Skip to content

coding ​

The returned string summarizes the work. Files and other effects are the deliverable. Use verifierAgent afterwards to check the result against the task, or std::agents/agency/coding to generate Agency source as text.

ts
import { codingAgent } from "std::agents/coding"

node main() {
  const result = codingAgent("Create a CSV report in report.csv")
  print(result)
}

When called as an LLM tool, codingAgent continues the caller's conversation. From code, wrap the call in thread { ... } to keep its messages out of the current thread. GitHub work goes through githubAgent, which it carries as a tool.

The model reports progress in a sentence beside each tool call, and nothing prints it by default. std::agents/lib/toolkits shows the callback that does.

Functions ​

buildTools ​

ts
buildTools(commandJudge: CommandJudge | null = null): any[]

Return the coding agent's built-in tools for inspection or extension.

Parameters:

NameTypeDefaultDescription
commandJudgeCommandJudge | nullnullA decision model that may refuse a bash command too complex to review, or null for none

Returns: any[]

(source)

codingAgent ​

ts
@guarded(cost: maxCost, time: maxTime)
codingAgent(
  task: string,
  context: string = "",
  maxCost: number = $50.00,
  maxTime: number = 30m,
  model: string = "",
  provider: string = "",
  extraTools: any[] = [],
  commandJudge: CommandJudge | null = null,
): Result<string>

Write, edit, and run code to complete a task on disk. Returns a short summary; the real output is filesystem side effects. It continues your conversation, so it already sees the work above.

Called from code, this runs on the caller's thread like any function: the tool results and the answer stay there, and the system prompt is removed when the agent finishes. Wrap the call in thread { ... } to keep them apart.

Parameters:

NameTypeDefaultDescription
taskstringWhat to accomplish
contextstring""Extra material folded into the prompt, or ""
maxCostnumber$50.00Cost budget in USD.
maxTimenumber30mTime budget in milliseconds.
modelstring""Model override, or "" for the ambient model
providerstring""Provider for the model override, ignored when model is empty.
extraToolsany[][]Extra tools to offer the LLM, appended to the built-in set
commandJudgeCommandJudge | nullnullA decision model that may refuse a bash command too complex to review, or null for none

Returns: Result<string>

Throws: std::guard

(source)