Skip to content

review ​

agencyReviewAgent reports parse errors and, when parsing succeeds, typecheck errors and warnings. Supplying task adds an LLM review with access to the bundled documentation and web sources.

The source is not executed. Use agencyVerifierAgent to run it. A failed LLM review contributes no findings, while static findings remain.

Functions ​

reportFeedback ​

ts
reportFeedback(report: TypeCheckReport): Feedback[]

Convert a typecheck report into findings: one error item per error, one advisory item per warning.

Parameters:

NameTypeDefault
reportTypeCheckReport

Returns: Feedback[]

(source)

buildTools ​

ts
buildTools(): any[]

Return the Agency reviewer's documentation and web lookup tools.

Returns: any[]

(source)

agencyReviewAgent ​

ts
agencyReviewAgent(
  source: string,
  task: string = "",
  context: string = "",
  maxCost: number = $10.00,
  maxTime: number = 10m,
  model: string = "",
  provider: string = "",
  session: string = "",
  extraTools: any[] = [],
  dir: string = "",
  strict: boolean = false,
): Result<Feedback[]>

Check Agency source for parse and type errors, and review it against a task when given. A failed LLM review contributes no findings.

Parameters:

NameTypeDefaultDescription
sourcestring
taskstring""What the code should do, or "" for static checks only.
contextstring""
maxCostnumber$10.00Cost budget in USD for the task review.
maxTimenumber10mTime budget in milliseconds for the task review.
modelstring""Model override, or "" for the ambient model.
providerstring""Provider for the model override, ignored when model is empty.
sessionstring""Name a conversation to reuse across calls, or "" for an isolated thread.
extraToolsany[][]Tools added to the LLM review.
dirstring""Base directory for the source's relative imports.
strictbooleanfalseTrue uses the name checks applied during sandboxed compilation.

Returns: Result<Feedback[]>

Throws: std::guard

Needs: fileRead

(source)