@toolcog/repl
Toolcog read-eval-print loop
Classes
Repl
Constructors
new Repl()
new Repl(
options?):Repl
Parameters
• options?: ReplOptions
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:105
Accessors
breakCommand
getbreakCommand():ReplCommand
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1024
coreImports
getcoreImports():ReplImports
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1190
exitCommand
getexitCommand():ReplCommand
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1033
helpCommand
gethelpCommand():ReplCommand
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1181
imports
getimports(): readonlyReplImports[]
Returns
readonly ReplImports[]
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:299
input
getinput():ReadableStream
Returns
ReadableStream
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:271
output
getoutput():WritableStream
Returns
WritableStream
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:275
outputCols
getoutputCols():undefined|number
Returns
undefined | number
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:285
outputRows
getoutputRows():undefined|number
Returns
undefined | number
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:279
preludeSource
getpreludeSource():string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:342
resetCommand
getresetCommand():ReplCommand
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1015
runtimeImports
getruntimeImports():ReplImports
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1254
style
getstyle():Style
Returns
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:295
styled
getstyled():boolean
Returns
boolean
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:291
version
getversion():string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:267
Methods
continuationPrompt()
continuationPrompt(
turn):string
Parameters
• turn: number
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:316
defineCommand()
defineCommand(
keyword,command):void
Parameters
• keyword: string
• command: undefined | ReplCommand
Returns
void
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:303
evalCode()
evalCode(
input):Promise<Record<string,unknown>>
Parameters
• input: string
Returns
Promise<Record<string, unknown>>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:780
evalLang()
evalLang(
input):Promise<unknown>
Parameters
• input: string
Returns
Promise<unknown>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:703
evalPrelude()
evalPrelude():
Promise<void>
Returns
Promise<void>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:368
formatBanner()
formatBanner():
string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:320
formatError()
formatError(
error):string
Parameters
• error: Error
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:580
formatHelpMessage()
formatHelpMessage():
string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1166
formatStack()
formatStack(
stack):string
Parameters
• stack: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:589
formatStackFrame()
formatStackFrame(
frame,cwd):undefined|string
Parameters
• frame: string
• cwd: string
Returns
undefined | string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:597
formatValue()
formatValue(
value):string
Parameters
• value: unknown
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:767
initialPrompt()
initialPrompt(
turn):string
Parameters
• turn: number
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:312
printBanner()
printBanner():
void
Returns
void
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:338
printBindings()
printBindings(
bindings):void
Parameters
• bindings: Record<string, unknown>
Returns
void
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:758
printDiagnostics()
printDiagnostics(
diagnostics):void
Parameters
• diagnostics: readonly Diagnostic[]
Returns
void
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:771
printError()
printError(
error):void
Parameters
• error: unknown
Returns
void
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:562
reset()
reset():
Promise<void>
Resets the REPL to its initial state.
Returns
Promise<void>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:999
run()
run():
Promise<void>
Returns
Promise<void>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:412
ReplCompilerError
Extends
Error
Constructors
new ReplCompilerError()
new ReplCompilerError(
message,diagnostics,options?):ReplCompilerError
Parameters
• message: string
• diagnostics: readonly Diagnostic[]
• options?: ErrorOptions
Returns
Overrides
Error.constructor
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1290
Properties
cause?
optionalcause:unknown
Inherited from
Error.cause
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:24
diagnostics
readonlydiagnostics: readonlyDiagnostic[]
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:1288
message
message:
string
Inherited from
Error.message
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077
name
name:
string
Inherited from
Error.name
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1076
stack?
optionalstack:string
Inherited from
Error.stack
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078
prepareStackTrace()?
staticoptionalprepareStackTrace: (err,stackTraces) =>any
Optional override for formatting stack traces
Parameters
• err: Error
• stackTraces: CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTrace
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:143
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Error.stackTraceLimit
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:145
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Error.captureStackTrace
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:136
ReplExitError
Extends
Error
Constructors
new ReplExitError()
new ReplExitError(
message?):ReplExitError
Parameters
• message?: string
Returns
Inherited from
Error.constructor
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1082
new ReplExitError()
new ReplExitError(
message?,options?):ReplExitError
Parameters
• message?: string
• options?: ErrorOptions
Returns
Inherited from
Error.constructor
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1082
Properties
cause?
optionalcause:unknown
Inherited from
Error.cause
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Error.message
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077
name
name:
string
Inherited from
Error.name
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1076
stack?
optionalstack:string
Inherited from
Error.stack
Defined in
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078
prepareStackTrace()?
staticoptionalprepareStackTrace: (err,stackTraces) =>any
Optional override for formatting stack traces
Parameters
• err: Error
• stackTraces: CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTrace
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:143
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Error.stackTraceLimit
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:145
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Error.captureStackTrace
Defined in
repos/toolcog/node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:136
Interfaces
MarkdownTheme
Properties
blockquote()
readonlyblockquote: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:19
bullet
readonlybullet:string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:10
checkbox()
readonlycheckbox: (checked) =>string
Parameters
• checked: boolean
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:21
code()
readonlycode: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:18
codespan()
readonlycodespan: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:26
del()
readonlydel: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:27
em()
readonlyem: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:25
h1()
readonlyh1: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:12
h2()
readonlyh2: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:13
h3()
readonlyh3: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:14
h4()
readonlyh4: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:15
h5()
readonlyh5: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:16
h6()
readonlyh6: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:17
hr()
readonlyhr: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:11
html()
readonlyhtml: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:22
image()
readonlyimage: (text,url,title?) =>string
Parameters
• text: string
• url: string
• title?: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:30
link()
readonlylink: (text,url,title?) =>string
Parameters
• text: string
• url: string
• title?: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:29
linkDef()
readonlylinkDef: (label,url) =>string
Parameters
• label: string
• url: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:31
paragraph()
readonlyparagraph: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:23
point()
readonlypoint: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:20
sectionBreak
readonlysectionBreak:string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:9
strong()
readonlystrong: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:24
text()
readonlytext: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:32
url()
readonlyurl: (text) =>string
Parameters
• text: string
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:28
ReplCommand
Properties
action()
readonlyaction: (argument,repl) =>void|Promise<void>
Parameters
• argument: undefined | string
• repl: Repl
Returns
void | Promise<void>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:36
description?
readonlyoptionaldescription:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:35
ReplImport
Properties
description?
readonlyoptionaldescription:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:24
name
readonlyname:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:22
type?
readonlyoptionaltype:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:23
ReplImports
Properties
description?
readonlyoptionaldescription:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:29
module
readonlymodule:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:28
typeImports
readonlytypeImports: readonlyReplImport[]
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:30
valueImports
readonlyvalueImports: readonlyReplImport[]
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:31
ReplOptions
Properties
commands?
optionalcommands:Record<string,ReplCommand>
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:51
compilerOptions?
optionalcompilerOptions:CompilerOptions
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:59
documentRegistry?
optionaldocumentRegistry:DocumentRegistry
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:61
historyFile?
optionalhistoryFile:string
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:53
historySize?
optionalhistorySize:number
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:54
imports?
optionalimports:ReplImports[]
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:49
input?
optionalinput:ReadableStream
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:43
languageVariant?
optionallanguageVariant:LanguageVariant
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:57
languageVersion?
optionallanguageVersion:ScriptTarget
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:56
output?
optionaloutput:WritableStream
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:44
styled?
optionalstyled:boolean
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:47
terminal?
optionalterminal:boolean
Defined in
repos/toolcog/packages/framework/repl/src/repl.ts:46
Variables
markdownTheme
constmarkdownTheme:MarkdownTheme
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:35
Functions
renderMarkdown()
renderMarkdown(
tokens,theme,width,depth,top):string
Parameters
• tokens: Token[] & object
• theme: MarkdownTheme = markdownTheme
• width: number = Infinity
• depth: number = 0
• top: boolean = true
Returns
string
Defined in
repos/toolcog/packages/framework/repl/src/markdown.ts:86
renderMarkdownInline()
renderMarkdownInline(
tokens,theme):string
Parameters
• tokens: Token[]
• theme: MarkdownTheme
Returns
string