Creates a new Terminal Brick.
The options for the Terminal Brick.
OptionalaiThe intelligence of the Brick instance. This is used to manage the AI capabilities of the Brick.
The key-value store of the Brick instance.
The event emitter of the Brick instance. This is used to emit events that occur in the Brick, such as the running of a program.
The unique identifier of the Brick instance.
The TerminalKit module.
The logger used by the Brick instance. This is used to log information about the operation of the Brick.
The name of the Brick instance.
OptionalstructureThe parent Structure of the Brick instance, if any.
The TerminalKit terminal instance.
Accumulates token usage/cost across every ask() call on this Brick.
Starts as a .child() of this.ai.usage when an Intelligence is
configured (so totals also roll up there), or standalone otherwise.
Rebound as a .child() of the parent Structure's usage when added
to one via Structure.add().
Returns the private map of programs.
Runs a prompt through this Brick's ai, offering its programs (via
Brick.tools) plus any tools attached via Brick.use.
Optionaloptions: AskOptionsRemoves a program from the private map of programs by its name.
The name of the program to remove.
Prompts the user for input in the terminal.
The options for the input field.
A promise that resolves to the user's input.
InputClosedError if stdin ends (EOF, a closed pipe) or the user presses Ctrl+C before a line is entered.
Toggles the keep alive flag of the Brick instance, which will prevent the Node process from exiting
A boolean indicating whether to turn the keep alive flag on or off.
Calls handler whenever the user presses Ctrl+C. TerminalKit puts the terminal in raw mode
while it reads input, so Ctrl+C is delivered as a key instead of raising SIGINT.
A function that removes the handler.
Prints some text to the terminal.
The text to print.
Prints a debug message to the terminal in cyan color.
The debug message to print.
Prints an error message to the terminal in red color.
The error message to print.
Prints an info message to the terminal in blue color.
The info message to print.
Prints a line of text to the terminal.
The text to print.
Prints a success message to the terminal in green color.
The success message to print.
Prints a warning message to the terminal in yellow color.
The warning message to print.
Adds a program to the private map of programs.
The program to add.
Stops grabbing the terminal's input, restoring normal Ctrl+C handling and letting the process exit.
Runs a program by its name with a given payload.
The name of the program to run.
The payload to pass to the program.
The result of the program.
Schedules a Task to run on a given schedule. This is a wrapper around the cron package.
The Task to schedule.
The scheduled task.
Returns a Task by its name.
Exposes every registered program as a ToolDefinition, each
execute calling this.run(program.name, input).
Every tool this Brick offers: its programs (via Brick.tools) plus anything attached via Brick.use.
Attaches external tool arrays (e.g. MCP-sourced tools) to this Brick,
included whenever ask() builds its tool list.
Class representing a Terminal Brick. It extends from the intellibrix!Brick class.
It uses the TerminalKit library to interact with the terminal.
Example