core

package
v0.136.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelTimerExpiredMsg

type CancelTimerExpiredMsg struct{}

CancelTimerExpiredMsg is sent by the tea.Tick command that starts when the user presses ESC once during stateWorking. If this message arrives before the user presses ESC a second time, the canceling state is reset to false.

type CtrlCResetMsg added in v0.57.0

type CtrlCResetMsg struct{}

CtrlCResetMsg is sent after a short delay when the user presses Ctrl+C to clear input. If the user doesn't press Ctrl+C again within the timeout, the ctrlCPressedOnce flag is reset so the next Ctrl+C will clear again.

type ImageAttachment

type ImageAttachment struct {
	// Data is the raw image bytes (PNG, JPEG, etc.).
	Data []byte
	// MediaType is the MIME type (e.g. "image/png", "image/jpeg").
	MediaType string
}

ImageAttachment holds a clipboard image that will be sent alongside the user's text prompt to the LLM. The data is raw image bytes; MediaType is a MIME type like "image/png".

type ShellCommandMsg

type ShellCommandMsg struct {
	// Command is the shell command to execute (prefix stripped).
	Command string
	// ExcludeFromContext is true for !! (output excluded from LLM context),
	// false for ! (output included in LLM context).
	ExcludeFromContext bool
}

ShellCommandMsg is sent by the InputComponent when the user submits a ! or !! prefixed command. The parent model intercepts this to execute the shell command directly instead of forwarding to the LLM.

Matching pi's behavior:

  • !cmd → run shell command, output INCLUDED in LLM context
  • !!cmd → run shell command, output EXCLUDED from LLM context

type ShellCommandResultMsg

type ShellCommandResultMsg struct {
	// Command is the original shell command that was executed.
	Command string
	// Output is the combined stdout/stderr output.
	Output string
	// ExitCode is the process exit code (0 = success).
	ExitCode int
	// Err is non-nil if the command failed to start or timed out.
	Err error
	// ExcludeFromContext mirrors the flag from ShellCommandMsg.
	ExcludeFromContext bool
	// ItemID names the scrollback block this result belongs to, so the parent
	// updates the block it already created rather than appending a second one.
	ItemID string
	// TimedOut reports that the command hit its timeout. Output collected
	// before the kill is still present.
	TimedOut bool
}

ShellCommandResultMsg carries the result of a shell command execution back to the parent model for display.

type ShellStreamChunkMsg added in v0.118.0

type ShellStreamChunkMsg struct {
	// ItemID names the scrollback block the chunk belongs to.
	ItemID string
	// Chunk is the raw bytes, exactly as the command wrote them. They may
	// contain escape sequences, and may split one across two chunks; the block
	// repairs both when it renders.
	Chunk string
	// Ch is the channel the reader drains. Update re-arms the reader with it,
	// and the runner closes it to end the stream.
	Ch chan string
}

ShellStreamChunkMsg carries one piece of a running shell command's output.

The parent model appends it to the pending block and re-arms the reader that produced it, which is what makes the block fill in as the command runs rather than appearing all at once when it exits.

type SubmitMsg

type SubmitMsg struct {
	// Text is the user's input text to send to the agent.
	Text string
	// Images holds clipboard image attachments to send alongside the text.
	// Empty when no images are attached.
	Images []ImageAttachment
}

SubmitMsg is sent by the InputComponent when the user submits a text prompt. The parent model receives this and calls app.Run(Text) to start agent processing.

type TreeCancelledMsg

type TreeCancelledMsg struct{}

TreeCancelledMsg is sent when the user cancels the tree selector (ESC).

type TreeNodeSelectedMsg

type TreeNodeSelectedMsg struct {
	// ID is the entry ID of the selected node.
	ID string
	// ParentID is the entry ID of the selected node's parent, empty for
	// root entries. Forking a user message branches from the parent so the
	// message itself can be edited and resubmitted.
	ParentID string
	// IsUser is true if the selected entry is a user message.
	IsUser bool
	// UserText is the user message text (only set when IsUser is true).
	UserText string
}

TreeNodeSelectedMsg is sent when the user selects a node in the tree selector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL