MCPcopy Create free account

hub / github.com/betta-tech/byo-coding-agent / functions

Functions301 in github.com/betta-tech/byo-coding-agent

↓ 56 callersFunctionDimmed
Dimmed wraps s with the dim ANSI escape and reset.
internal/ui/styles.go:16
↓ 23 callersFunctiontextMsg
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 callersMethodRegister
(t Tool)
internal/tool/registry.go:27
↓ 19 callersFunctionSetEnabled
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 callersFunctionCyan
Cyan wraps s with the bold-cyan ANSI escape and reset.
internal/ui/styles.go:19
↓ 14 callersMethodSend
(ctx context.Context, messages []api.Message, tools []api.ToolDef)
internal/provider/provider.go:13
↓ 13 callersMethodrefreshDebugContent
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 callersFunctionEnabled
Enabled reports whether recording is currently on.
internal/debug/debug.go:59
↓ 12 callersFunctionNewRegistry
()
internal/tool/registry.go:23
↓ 12 callersFunctionRenderTranscript
RenderTranscript serializes messages to a human-readable transcript. Used by summarization prompts and compaction logs.
internal/api/types.go:100
↓ 11 callersFunctionNewSessionFiles
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 callersFunctionSnapshot
Snapshot returns a copy of the current ring, oldest first.
internal/debug/debug.go:221
↓ 10 callersFunctionRecord
Record appends a payload-less event and returns its ID (0 if disabled).
internal/debug/debug.go:83
↓ 9 callersFunctionClear
Clear empties the ring. Called from /debug clear.
internal/debug/debug.go:230
↓ 9 callersMethodName
()
internal/subagent/registry.go:21
↓ 8 callersMethodAdd
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 callersMethodClose
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 callersMethodGet
Get returns a previously-registered tool, used by Subset to compose curated tool registries for subagents.
internal/tool/registry.go:33
↓ 7 callersFunctionRecordp
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 callersFunctionSafeSplitPoint
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 callersMethodSave
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 callersMethodlayout
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 callersMethodsetConversationContent
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 callersMethodCalls
Calls returns how many times Send has been invoked.
internal/provider/mock.go:105
↓ 6 callersMethodRecall
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 callersMethodClose
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 callersMethodDefinitions
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 callersFunctionFindByID
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 callersMethodModel
()
internal/provider/provider.go:14
↓ 5 callersFunctionPair
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 callersMethodRun
(ctx context.Context, task string)
internal/subagent/registry.go:23
↓ 5 callersMethodView
()
internal/ui/program.go:942
↓ 5 callersFunctionbuildWriteDiff
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 callersFunctionrecord
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 callersMethodCompact
(ctx context.Context, messages []api.Message)
internal/compact/strategy.go:15
↓ 4 callersMethodDefinition
()
internal/tool/registry.go:15
↓ 4 callersMethodHasToolResult
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 callersFunctionRecordpc
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 callersMethodUpdate
(msg tea.Msg)
internal/ui/program.go:251
↓ 4 callersFunctionformatThousands
formatThousands inserts thousands separators into a non-negative int.
commands.go:84
↓ 4 callersFunctionformatThousands
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 callersFunctionnewTestAgent
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 callersFunctionwriteTemplate
(t *template.Template, name, out string, data any)
cmd/sitegen/main.go:376
↓ 3 callersFunctionBannerText
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 callersMethodCompact
(_ context.Context, messages []api.Message)
internal/compact/slidingwindow.go:16
↓ 3 callersMethodExecute
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 callersFunctionHighlightPayload
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 callersFunctionNew
(p provider.Provider, system string, tools *tool.Registry)
internal/agent/agent.go:38
↓ 3 callersFunctionProviderKind
ProviderKind returns the short name of a provider value. Used by /model and /provider to display the active backend.
main.go:321
↓ 3 callersFunctionRecordfc
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 callersFunctionSetSink
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 callersMethodSubset
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 callersFunctionTermWidth
TermWidth returns stdout's terminal width, or 0 when stdout isn't a TTY.
internal/ui/banner.go:147
↓ 3 callersMethodmodalSize
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 callersFunctionnewProviderByName
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 callersFunctionrewriteLinksFrom
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 callersFunctionsplitChapter
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 callersFunctiontoolResultMsg
(id, result string)
internal/compact/strategy_test.go:26
↓ 2 callersFunctionActive
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 callersMethodAll
()
internal/subagent/registry.go:41
↓ 2 callersMethodDescription
()
internal/subagent/registry.go:22
↓ 2 callersMethodEstimatedCostUSD
()
commands.go:58
↓ 2 callersMethodExecute
(ctx context.Context, input string)
internal/tool/registry.go:16
↓ 2 callersFunctionLatest
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 callersMethodMessages
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 callersMethodName
()
internal/subagent/research.go:29
↓ 2 callersFunctionNewMockProvider
NewMockProvider constructs a MockProvider preloaded with the given canned responses. Equivalent to &MockProvider{Responses: responses} but reads bette
internal/provider/mock.go:55
↓ 2 callersMethodPreamble
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 callersMethodTotalUsage
()
commands.go:57
↓ 2 callersFunctionapiKeyEnv
(provider string)
commands.go:204
↓ 2 callersMethodcompactorName
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 callersFunctionconnect
(ctx context.Context, name string, transport sdk.Transport)
internal/mcp/client.go:47
↓ 2 callersFunctionfirstParagraph
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 callersFunctionhistoryPath
── history persistence ───────────────────────────────────────────────────
internal/ui/input.go:178
↓ 2 callersFunctionloadChapters
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 callersFunctionloadExercises
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 callersFunctionloadGuides
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 callersFunctionmarshalRequestPayload
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 callersFunctionmarshalResponsePayload
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 callersMethodmoveSelection
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 callersFunctionnotifyDebugUI
notifyDebugUI sends a DebugToggleMsg into the running program so it recomputes layout. Called from /debug after flipping state.
main.go:76
↓ 2 callersFunctionregisterSubagents
registerSubagents wires up every subagent the harness exposes.
main.go:422
↓ 2 callersFunctionrenderInline
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 callersFunctionrenderLanguage
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 callersMethodreplaceBanner
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 callersFunctionshineTickCmd
shineTickCmd schedules the next shine animation frame.
internal/ui/program.go:228
↓ 2 callersFunctiontoolUseMsg
(id, name string)
internal/compact/strategy_test.go:17
↓ 2 callersFunctiontruncate
(s string, n int)
internal/agent/agent.go:196
↓ 2 callersFunctiontruncatePayload
(p string)
internal/debug/debug.go:213
↓ 1 callersFunctionAnimatedBanner
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 callersFunctionBegin
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 callersMethodCallTool
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 callersMethodClearMessages
ClearMessages wipes the conversation history.
internal/agent/agent.go:57
↓ 1 callersMethodLastSent
LastSent is shorthand for the most recent SentAt.
internal/provider/mock.go:124
↓ 1 callersMethodListTools
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 callersFunctionLoadConfig
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 callersFunctionNewAnthropicProvider
(model anthropic.Model, maxTokens int64, system string)
internal/provider/anthropic.go:28
↓ 1 callersFunctionNewHTTPClient
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 callersFunctionNewOpenAIProvider
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 callersFunctionNewProgram
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