Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/betta-tech/byo-coding-agent
/ functions
Functions
301 in github.com/betta-tech/byo-coding-agent
⨍
Functions
301
◇
Types & classes
75
↓ 56 callers
Function
Dimmed
Dimmed wraps s with the dim ANSI escape and reset.
internal/ui/styles.go:16
↓ 23 callers
Function
textMsg
Test helpers that build common message shapes — text turn, tool-use turn, tool-result turn. Keeps the test cases readable.
internal/compact/strategy_test.go:13
↓ 21 callers
Method
Register
(t Tool)
internal/tool/registry.go:27
↓ 19 callers
Function
SetEnabled
SetEnabled flips recording on or off. The UI calls this from the /debug slash command. Disabling does not clear the ring — old events stick around unt
internal/debug/debug.go:68
↓ 15 callers
Function
Cyan
Cyan wraps s with the bold-cyan ANSI escape and reset.
internal/ui/styles.go:19
↓ 14 callers
Method
Send
(ctx context.Context, messages []api.Message, tools []api.ToolDef)
internal/provider/provider.go:13
↓ 13 callers
Method
refreshDebugContent
refreshDebugContent re-renders the debug ring into the debug viewport. Two modes: - debugList: one line per event; the currently selected event (if an
internal/ui/program.go:586
↓ 12 callers
Function
Enabled
Enabled reports whether recording is currently on.
internal/debug/debug.go:59
↓ 12 callers
Function
NewRegistry
()
internal/tool/registry.go:23
↓ 12 callers
Function
RenderTranscript
RenderTranscript serializes messages to a human-readable transcript. Used by summarization prompts and compaction logs.
internal/api/types.go:100
↓ 11 callers
Function
NewSessionFiles
NewSessionFiles opens (or creates) the memory directory at root and loads the index. Missing sessions referenced in the index get pruned silently — dr
internal/memory/sessionfiles.go:45
↓ 11 callers
Function
Snapshot
Snapshot returns a copy of the current ring, oldest first.
internal/debug/debug.go:221
↓ 10 callers
Function
Record
Record appends a payload-less event and returns its ID (0 if disabled).
internal/debug/debug.go:83
↓ 9 callers
Function
Clear
Clear empties the ring. Called from /debug clear.
internal/debug/debug.go:230
↓ 9 callers
Method
Name
()
internal/subagent/registry.go:21
↓ 8 callers
Method
Add
Add returns the per-field sum. Provider accumulators use this to fold a per-call Usage into the running total.
internal/api/types.go:89
↓ 7 callers
Method
Close
Close flushes the current session draft to a markdown file and adds a record to index.json. An empty draft (no Save calls) is a no-op — empty sessions
internal/memory/sessionfiles.go:196
↓ 7 callers
Method
Get
Get returns a previously-registered tool, used by Subset to compose curated tool registries for subagents.
internal/tool/registry.go:33
↓ 7 callers
Function
Recordp
Recordp appends an event with an attached payload (full request JSON, tool output, before/after transcript) and returns its ID. Payload is truncated t
internal/debug/debug.go:96
↓ 7 callers
Function
SafeSplitPoint
SafeSplitPoint walks backward from `desired` to find an index where the conversation is in a "clean" state — no tool_use without its tool_result on ei
internal/compact/strategy.go:23
↓ 7 callers
Method
Save
Save appends an entry to the in-progress session draft. Nothing reaches disk until Close — drafts are cheap, and per-Save file writes during a busy se
internal/memory/sessionfiles.go:100
↓ 7 callers
Method
layout
layout recomputes viewport widths/heights from the current window size. In any modal state (debug detail OR approval-with-diff) the debug viewport is
internal/ui/program.go:520
↓ 7 callers
Method
setConversationContent
setConversationContent pushes the current scrollback buffer into the viewport, wrapping it to the viewport's width first so long lines (file output, J
internal/ui/program.go:892
↓ 6 callers
Method
Calls
Calls returns how many times Send has been invoked.
internal/provider/mock.go:105
↓ 6 callers
Method
Recall
Recall walks the index and returns up to `limit` session records whose summary or tags match the query. Match is a case-insensitive substring scan, or
internal/memory/sessionfiles.go:114
↓ 5 callers
Method
Close
Close shuts down the session. For stdio transports this terminates the subprocess; for HTTP it tears down the persistent connection. Safe to call mult
internal/mcp/client.go:85
↓ 5 callers
Method
Definitions
Definitions returns all registered tool schemas, sorted by name so the output is deterministic (important for prompt caching when you turn it on).
internal/tool/registry.go:53
↓ 5 callers
Function
FindByID
FindByID returns the event with the given monotonic ID, if it's still in the ring. Used by /debug show to look up a specific event.
internal/debug/debug.go:185
↓ 5 callers
Method
Model
()
internal/provider/provider.go:14
↓ 5 callers
Function
Pair
Pair returns the event linked to id, in either direction. If the given event has a CorrelatedID, that's the request it's paired with. Otherwise Pair w
internal/debug/debug.go:151
↓ 5 callers
Method
Run
(ctx context.Context, task string)
internal/subagent/registry.go:23
↓ 5 callers
Method
View
()
internal/ui/program.go:942
↓ 5 callers
Function
buildWriteDiff
buildWriteDiff returns a unified-diff string describing what a write_file tool call would change on disk, suitable for display in the approval modal.
internal/agent/diff.go:20
↓ 5 callers
Function
record
record is the shared implementation. The sink (if any) is called outside the lock to avoid re-entrancy from sinks that take their own lock. Returns th
internal/debug/debug.go:117
↓ 4 callers
Method
Compact
(ctx context.Context, messages []api.Message)
internal/compact/strategy.go:15
↓ 4 callers
Method
Definition
()
internal/tool/registry.go:15
↓ 4 callers
Method
HasToolResult
HasToolResult reports whether the message contains any tool_result blocks. Used by compaction to find safe split points (a clean conversation boundary
internal/api/types.go:48
↓ 4 callers
Function
Recordpc
Recordpc is Recordp with a correlation back to a previously-recorded event. The new event's CorrelatedID is set to startID; Pair() can then walk the l
internal/debug/debug.go:103
↓ 4 callers
Method
Update
(msg tea.Msg)
internal/ui/program.go:251
↓ 4 callers
Function
formatThousands
formatThousands inserts thousands separators into a non-negative int.
commands.go:84
↓ 4 callers
Function
formatThousands
formatThousands inserts thousands separators into a non-negative int. Mirrors the helper in commands.go; lives here too to avoid a UI → main dependenc
internal/ui/program.go:1191
↓ 4 callers
Function
newTestAgent
newTestAgent wires an Agent against the mock provider with the smallest useful surface area: an empty system prompt, an empty tool registry, no-op com
internal/agent/agent_test.go:34
↓ 4 callers
Function
writeTemplate
(t *template.Template, name, out string, data any)
cmd/sitegen/main.go:376
↓ 3 callers
Function
BannerText
BannerText returns the banner as a string for callers that want to pre-populate a scrollback buffer (the TUI program) rather than print.
internal/ui/banner.go:33
↓ 3 callers
Method
Compact
(_ context.Context, messages []api.Message)
internal/compact/slidingwindow.go:16
↓ 3 callers
Method
Execute
Execute dispatches a tool call by name. Unknown tools return an error result rather than panicking — the model can read it and recover.
internal/tool/registry.go:68
↓ 3 callers
Function
HighlightPayload
HighlightPayload returns content with ANSI 256-color syntax highlighting applied if it looks like a recognized language (JSON or a unified diff), othe
internal/ui/highlight.go:20
↓ 3 callers
Function
New
(p provider.Provider, system string, tools *tool.Registry)
internal/agent/agent.go:38
↓ 3 callers
Function
ProviderKind
ProviderKind returns the short name of a provider value. Used by /model and /provider to display the active backend.
main.go:321
↓ 3 callers
Function
Recordfc
Recordfc is Recordf with a correlation back to a previously-recorded event. Used for the error-path response that pairs with an in-flight request.
internal/debug/debug.go:110
↓ 3 callers
Function
SetSink
SetSink registers a callback fired on each Record. The TUI uses it to nudge a re-render of the debug panel. Pass nil to unregister.
internal/debug/debug.go:76
↓ 3 callers
Method
Subset
Subset returns a new Registry containing only the named tools from r. Used to build curated tool sets for subagents (e.g. give a research subagent onl
internal/tool/registry.go:41
↓ 3 callers
Function
TermWidth
TermWidth returns stdout's terminal width, or 0 when stdout isn't a TTY.
internal/ui/banner.go:147
↓ 3 callers
Method
modalSize
modalSize returns the outer width/height of the detail modal — capped so it doesn't get unreadably wide on big monitors, and clamped so small terminal
internal/ui/program.go:560
↓ 3 callers
Function
newProviderByName
newProviderByName constructs a provider by short name. An empty model string falls back to that provider's default. Unknown names error.
main.go:287
↓ 3 callers
Function
rewriteLinksFrom
rewriteLinksFrom rewrites the relative markdown links in body so they work on the generated site: - `(NN-name.md)` becomes `(NN-name.html)` (sibling
cmd/sitegen/main.go:706
↓ 3 callers
Function
splitChapter
splitChapter pulls the first H1 out of the raw markdown, returns the chapter number (best-effort), the human title, and the body without the H1 (becau
cmd/sitegen/main.go:680
↓ 3 callers
Function
toolResultMsg
(id, result string)
internal/compact/strategy_test.go:26
↓ 2 callers
Function
Active
Active returns a snapshot of currently running subagents (name -> count). Used by the /subagents command and any UI affordance that wants to show what
internal/subagent/registry.go:84
↓ 2 callers
Method
All
()
internal/subagent/registry.go:41
↓ 2 callers
Method
Description
()
internal/subagent/registry.go:22
↓ 2 callers
Method
EstimatedCostUSD
()
commands.go:58
↓ 2 callers
Method
Execute
(ctx context.Context, input string)
internal/tool/registry.go:16
↓ 2 callers
Function
Latest
Latest returns the most recent event that has a non-empty payload, or (zero, false) if the ring is empty or no event has a payload yet. Used by /debug
internal/debug/debug.go:199
↓ 2 callers
Method
Messages
Messages returns the agent's conversation slice. Callers (e.g. /compact) may read it, but should not mutate it directly — use SetMessages instead.
internal/agent/agent.go:50
↓ 2 callers
Method
Name
()
internal/subagent/research.go:29
↓ 2 callers
Function
NewMockProvider
NewMockProvider constructs a MockProvider preloaded with the given canned responses. Equivalent to &MockProvider{Responses: responses} but reads bette
internal/provider/mock.go:55
↓ 2 callers
Method
Preamble
Preamble returns the last preambleSessionCount session summaries as a compact block ready to concatenate to the system prompt. Bounded size so a year
internal/memory/sessionfiles.go:162
↓ 2 callers
Method
TotalUsage
()
commands.go:57
↓ 2 callers
Function
apiKeyEnv
(provider string)
commands.go:204
↓ 2 callers
Method
compactorName
compactorName returns a short label for whichever compaction strategy is active. Used in debug-log entries so it's obvious what ran.
internal/agent/agent.go:189
↓ 2 callers
Function
connect
(ctx context.Context, name string, transport sdk.Transport)
internal/mcp/client.go:47
↓ 2 callers
Function
firstParagraph
firstParagraph returns the first non-empty paragraph of body as plain text, dropping a leading "Goal:" / "Objetivo:" label if present. Used as the gui
cmd/sitegen/main.go:616
↓ 2 callers
Function
historyPath
── history persistence ───────────────────────────────────────────────────
internal/ui/input.go:178
↓ 2 callers
Function
loadChapters
loadChapters reads every *.md in dir (skipping README.md, which is a table of contents the generator builds itself) and returns rendered chapters in f
cmd/sitegen/main.go:408
↓ 2 callers
Function
loadExercises
loadExercises reads every *.md in dir (skipping README.md) and returns rendered exercises sorted by slug. Returns nil with no error if the directory i
cmd/sitegen/main.go:514
↓ 2 callers
Function
loadGuides
loadGuides reads every *.md in dir (skipping README.md, which is just an index in the markdown source) and returns rendered guides sorted by filename.
cmd/sitegen/main.go:441
↓ 2 callers
Function
marshalRequestPayload
marshalRequestPayload renders the about-to-be-sent request as pretty JSON for the /debug show panel. We include the resolved tool list (names + descri
internal/provider/payloads.go:15
↓ 2 callers
Function
marshalResponsePayload
marshalResponsePayload renders the full response shape for /debug show. Includes elapsed wall time so the user can tell at a glance which calls were e
internal/provider/payloads.go:41
↓ 2 callers
Method
moveSelection
moveSelection walks the snapshot to find the current selection, then shifts it by delta (clamped). The snapshot is small (≤500) so a linear scan is fi
internal/ui/program.go:755
↓ 2 callers
Function
notifyDebugUI
notifyDebugUI sends a DebugToggleMsg into the running program so it recomputes layout. Called from /debug after flipping state.
main.go:76
↓ 2 callers
Function
registerSubagents
registerSubagents wires up every subagent the harness exposes.
main.go:422
↓ 2 callers
Function
renderInline
renderInline applies a minimal inline-markdown pass: HTML-escapes the text, then turns `...` backtick runs into <code>...</code>. Good enough for one-
cmd/sitegen/main.go:504
↓ 2 callers
Function
renderLanguage
renderLanguage writes one full set of pages (landing + chapters + how-tos + exercises) for a given language under out/<subdir>. Pass subdir="" for the
cmd/sitegen/main.go:240
↓ 2 callers
Method
replaceBanner
replaceBanner regenerates the banner with the current shine column and splices it into place inside m.output. Anything written after the banner (the u
internal/ui/program.go:868
↓ 2 callers
Function
shineTickCmd
shineTickCmd schedules the next shine animation frame.
internal/ui/program.go:228
↓ 2 callers
Function
toolUseMsg
(id, name string)
internal/compact/strategy_test.go:17
↓ 2 callers
Function
truncate
(s string, n int)
internal/agent/agent.go:196
↓ 2 callers
Function
truncatePayload
(p string)
internal/debug/debug.go:213
↓ 1 callers
Function
AnimatedBanner
AnimatedBanner returns the banner with a "shine" highlight peaked at column shineCol. Pass shineCol == -1 (or any out-of-range value) to get the stati
internal/ui/banner.go:60
↓ 1 callers
Function
Begin
Begin marks a subagent run as started. Returns a function to be deferred that decrements the count on completion.
internal/subagent/registry.go:67
↓ 1 callers
Method
CallTool
CallTool dispatches a tool invocation to the remote server. The result's content blocks (the SDK supports text, image, audio, etc.) are concatenated t
internal/mcp/client.go:71
↓ 1 callers
Method
ClearMessages
ClearMessages wipes the conversation history.
internal/agent/agent.go:57
↓ 1 callers
Method
LastSent
LastSent is shorthand for the most recent SentAt.
internal/provider/mock.go:124
↓ 1 callers
Method
ListTools
ListTools returns every tool the server exposes. Called once at startup per server, results cached in our local registry.
internal/mcp/client.go:59
↓ 1 callers
Function
LoadConfig
LoadConfig reads a JSON config file. Missing file returns (nil, nil) — MCP is opt-in; absence is not an error.
internal/mcp/register.go:65
↓ 1 callers
Function
NewAnthropicProvider
(model anthropic.Model, maxTokens int64, system string)
internal/provider/anthropic.go:28
↓ 1 callers
Function
NewHTTPClient
NewHTTPClient connects to a remote MCP server over the Streamable HTTP transport. Headers (auth tokens, API keys) are injected via a RoundTripper so t
internal/mcp/client.go:33
↓ 1 callers
Function
NewOpenAIProvider
NewOpenAIProvider constructs the provider. The SDK reads OPENAI_API_KEY from the environment by default; pass option.WithAPIKey if you need to overrid
internal/provider/openai.go:34
↓ 1 callers
Function
NewProgram
NewProgram builds the Bubble Tea program. Wire the returned program to a Confirm callback and a stdout-pipe forwarder before calling Run. Pass nil for
internal/ui/program.go:194
next →
1–100 of 301, ranked by callers