MCPcopy Create free account

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

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

MethodEstimatedCostUSD
EstimatedCostUSD multiplies the cumulative usage by the current model's per-million-token rates. Returns -1 for an unknown model.
internal/provider/anthropic.go:55
MethodEstimatedCostUSD
()
internal/provider/openai.go:61
MethodExecute
(ctx context.Context, rawInput string)
delegate.go:40
MethodExecute
(ctx context.Context, input string)
internal/mcp/register.go:29
MethodExecute
(_ context.Context, in string)
internal/agent/agent_test.go:29
MethodExecute
(ctx context.Context, rawInput string)
internal/tool/remember.go:44
MethodExecute
(_ context.Context, rawInput string)
internal/tool/readfile.go:30
MethodExecute
(ctx context.Context, rawInput string)
internal/tool/recall.go:40
MethodExecute
(_ context.Context, rawInput string)
internal/tool/writefile.go:34
MethodExecute
(_ context.Context, _ string)
internal/tool/registry_test.go:23
MethodExecute
(ctx context.Context, rawInput string)
internal/tool/bash.go:30
MethodInit
()
internal/ui/program.go:207
MethodInit
()
internal/ui/input.go:53
MethodInit
()
internal/ui/input.go:146
MethodModel
()
internal/provider/mock.go:89
MethodModel
()
internal/provider/anthropic.go:37
MethodModel
()
internal/provider/openai.go:43
MethodPreamble
(ctx context.Context)
internal/memory/store.go:43
MethodPreamble
(_ context.Context)
internal/memory/store.go:58
FunctionPrintBanner
PrintBanner renders the startup banner. Falls back to a single-line wordmark when the terminal is narrower than the big banner needs.
internal/ui/banner.go:29
FunctionReadChatInput
ReadChatInput shows the bordered input box and blocks until the user submits or hits ctrl-d. Returns (text, ok). ok=false on exit.
internal/ui/input.go:119
MethodRecall
(_ context.Context, _ string, _ int)
internal/memory/store.go:57
MethodRegister
(s Subagent)
internal/subagent/registry.go:35
MethodRoundTrip
(req *http.Request)
internal/mcp/client.go:118
MethodRun
(ctx context.Context, task string)
internal/subagent/research.go:40
MethodSave
(_ context.Context, _ Entry)
internal/memory/store.go:56
MethodSend
Send returns the next canned response (or Err, or a default end_turn), recording the messages and tools it was called with for later assertion.
internal/provider/mock.go:61
MethodSend
(ctx context.Context, messages []api.Message, tools []api.ToolDef)
internal/provider/anthropic.go:86
MethodSend
(ctx context.Context, messages []api.Message, tools []api.ToolDef)
internal/provider/openai.go:75
MethodSend
Send appends a user message and runs the tool-use loop until the model stops requesting tools (or MaxTurns is reached). Returns the final assistant te
internal/agent/agent.go:63
MethodSentAt
SentAt returns a copy of the messages passed to the i-th Send call. Indexing is 0-based and matches the order of Responses. Returns nil when i is out
internal/provider/mock.go:114
MethodSetModel
(name string)
internal/provider/mock.go:98
MethodSetModel
(name string)
internal/provider/anthropic.go:38
MethodSetModel
(name string)
internal/provider/openai.go:49
FunctionStartSpinner
StartSpinner begins a braille spinner on stdout with the given label. No-op when stdout isn't a TTY (piped, redirected). Call Stop() to clear.
internal/ui/spinner.go:26
FunctionTestBuildWriteDiffIdenticalContentReturnsMarker
(t *testing.T)
internal/agent/diff_test.go:52
FunctionTestBuildWriteDiffMalformedInputReturnsEmpty
(t *testing.T)
internal/agent/diff_test.go:66
FunctionTestBuildWriteDiffNewFileShowsAdditions
(t *testing.T)
internal/agent/diff_test.go:10
FunctionTestBuildWriteDiffShowsChangedLines
(t *testing.T)
internal/agent/diff_test.go:31
FunctionTestDefinitionsAreSortedByName
Definitions must be sorted by name. Two reasons matter — chapter 09's "map iteration is random" warning, and prompt caching (chapter 17), which silent
internal/tool/registry_test.go:47
FunctionTestExecuteDispatchesToTool
(t *testing.T)
internal/tool/registry_test.go:109
FunctionTestExecutePropagatesIsErr
Tools that fail report it via the (result, isErr) channel rather than a Go error — the agent loop relies on this contract (chapter 02).
internal/tool/registry_test.go:124
FunctionTestExecuteUnknownReturnsErrorString
(t *testing.T)
internal/tool/registry_test.go:98
FunctionTestLatestSkipsPayloadlessEvents
Latest walks back from the newest event to find one with a non-empty payload, skipping payload-less events along the way.
internal/debug/debug_test.go:173
FunctionTestMessageHasToolResult
(t *testing.T)
internal/api/types_test.go:34
FunctionTestNoCompactionIsPassthrough
(t *testing.T)
internal/compact/strategy_test.go:86
FunctionTestPairReturnsFalseForUnpairedEvent
Unpaired events return (zero, false). The lookup must not match itself.
internal/debug/debug_test.go:132
FunctionTestPairWalksBothDirections
Pair walks both directions: a request emits → response correlates back. Calling Pair on either ID returns the other.
internal/debug/debug_test.go:106
FunctionTestRecordAssignsMonotonicIDs
(t *testing.T)
internal/debug/debug_test.go:27
FunctionTestRecordReturnsZeroWhenDisabled
All tests in this file share the package's global state (the ring, the nextID counter, the sink). They run sequentially (no t.Parallel()) and reset st
internal/debug/debug_test.go:14
FunctionTestRegisterAndGet
(t *testing.T)
internal/tool/registry_test.go:27
FunctionTestRenderTranscriptIncludesAllBlockKinds
(t *testing.T)
internal/api/types_test.go:80
FunctionTestRingDropsOldestPastCapacity
The ring drops the oldest event once it reaches capacity. We push more than the ring can hold and verify the front is gone, the back is intact, and Fi
internal/debug/debug_test.go:66
FunctionTestSafeSplitPointAtCleanBoundary
When the desired split already lands on a clean user text message, SafeSplitPoint returns it as-is.
internal/compact/strategy_test.go:36
FunctionTestSafeSplitPointEdges
Edge values bounce out without walking the slice.
internal/compact/strategy_test.go:76
FunctionTestSafeSplitPointGivesUpAtZero
If no clean boundary exists in the prefix, returns 0 — "do nothing" is safer than risking an orphaned tool_use.
internal/compact/strategy_test.go:65
FunctionTestSafeSplitPointWalksBackOverToolPair
When desired falls inside a tool_use/tool_result pair, the function walks back to the previous clean user-text boundary.
internal/compact/strategy_test.go:49
FunctionTestSendLoopsOnToolUse
TestSendLoopsOnToolUse covers the tool-use round-trip: the model asks for `echo`, the agent dispatches it, the agent loops back to the model with the
internal/agent/agent_test.go:68
FunctionTestSendPropagatesProviderError
TestSendPropagatesProviderError makes sure a provider failure bubbles out of Send instead of being swallowed. The error itself should be the exact sen
internal/agent/agent_test.go:142
FunctionTestSendReturnsTextOnEndTurn
TestSendReturnsTextOnEndTurn exercises the simplest path: the model replies with a text block and a non-tool stop reason, and Send returns that text t
internal/agent/agent_test.go:43
FunctionTestSendStopsAtMaxTurns
TestSendStopsAtMaxTurns confirms the safety clamp: a provider that keeps requesting tools indefinitely is bounded by Agent.MaxTurns. The loop terminat
internal/agent/agent_test.go:108
FunctionTestSessionFilesEmptyCloseIsNoop
Empty sessions shouldn't leak into the index — opening, doing nothing, and closing leaves the store untouched.
internal/memory/sessionfiles_test.go:65
FunctionTestSessionFilesPrunesMissingFiles
If the session file referenced in index.json was deleted manually, the loader should prune the dead reference on the next open.
internal/memory/sessionfiles_test.go:160
FunctionTestSessionFilesRecallMatchesTagsAndSummary
Recall is matched by tag OR summary substring.
internal/memory/sessionfiles_test.go:115
FunctionTestSessionFilesReopenLoadsHistory
After a session is closed, reopening the store should re-load the index and surface the previous session via Preamble and Recall.
internal/memory/sessionfiles_test.go:81
FunctionTestSessionFilesSaveAndCloseWritesSessionAndIndex
(t *testing.T)
internal/memory/sessionfiles_test.go:11
FunctionTestSinkReceivesEventsInOrder
The sink is called once per Record while enabled, in order, with the fully-constructed Event.
internal/debug/debug_test.go:146
FunctionTestSlidingWindowAboveThresholdDropsPrefix
Above the keep-window: drops a prefix, snapping to a safe boundary.
internal/compact/strategy_test.go:114
FunctionTestSlidingWindowBelowThresholdIsNoop
Below the keep-window: no-op.
internal/compact/strategy_test.go:101
FunctionTestSlidingWindowNeverSplitsToolPair
The whole point of SafeSplitPoint is that compaction never separates a tool_use from its tool_result. This is a regression test for that invariant on
internal/compact/strategy_test.go:136
FunctionTestSnapshotReturnsCopy
(t *testing.T)
internal/debug/debug_test.go:44
FunctionTestSubsetEmpty
Subset of nothing is a valid empty registry — used by subagents that shouldn't have any tools at all.
internal/tool/registry_test.go:89
FunctionTestSubsetKeepsOnlyNamedTools
(t *testing.T)
internal/tool/registry_test.go:65
FunctionTestUsageAddIsCommutative
(t *testing.T)
internal/api/types_test.go:19
FunctionTestUsageAddSumsAllFields
(t *testing.T)
internal/api/types_test.go:8
FunctionTestUsageAddWithZero
(t *testing.T)
internal/api/types_test.go:27
MethodTotalUsage
TotalUsage returns the cumulative tokens this provider has consumed since it was constructed. Subagents that share the provider contribute to the same
internal/provider/anthropic.go:47
MethodTotalUsage
()
internal/provider/openai.go:55
MethodUpdate
(msg tea.Msg)
internal/ui/input.go:55
MethodView
()
internal/ui/input.go:107
FunctionWithLogging
WithLogging is sugar for &LoggingStrategy{Inner: inner, FilePath: path}.
internal/compact/logging.go:21
FunctioncmdClear
(_ string)
commands.go:215
FunctioncmdCompact
(args string)
commands.go:264
FunctioncmdDebug
(args string)
commands.go:312
FunctioncmdExit
(_ string)
commands.go:414
FunctioncmdHelp
(_ string)
commands.go:115
FunctioncmdModel
(args string)
commands.go:152
FunctioncmdProvider
(args string)
commands.go:169
FunctioncmdSubagents
cmdSubagents lists registered subagent types and, separately, any that are currently running. The active list is empty when nothing is in flight.
commands.go:238
FunctioncmdTokens
(_ string)
commands.go:61
FunctioncmdTools
(_ string)
commands.go:220
FunctioncmdVerbose
(args string)
commands.go:293
Functioninit
()
commands.go:27
Functioninit
()
internal/tool/remember.go:19
Functioninit
()
internal/tool/readfile.go:14
Functioninit
()
internal/tool/recall.go:20
Functioninit
()
internal/tool/writefile.go:14
Functioninit
()
internal/tool/bash.go:14
Functionmain
()
main.go:94
Functionmain
()
cmd/sitegen/main.go:166
← previousnext →201–300 of 301, ranked by callers