Skip to content

buildAgUiCapabilities

buildAgUiCapabilities(config, agent?): AgentCapabilities

Defined in: packages/agent/src/modules/agUiCapabilities.ts:304

Build the capability declaration for a running AG-UI server.

agent is the server’s own initialised agent — the one a run without client-declared tools is served from — and is optional only so a caller mid-boot gets a declaration rather than a throw.

Nothing in here throws. A client asking what a server can do and getting a 500 learns less than one getting a declaration with a field missing, so every read that could fail degrades to an omission.

Why humanInTheLoop is absent, and why state is false

Section titled “Why humanInTheLoop is absent, and why state is false”

These look inconsistent and are not, and the difference is the schema’s absent-means-undeclared rule doing real work.

state is a closed measurement: this server emits no STATE_SNAPSHOT and no STATE_DELTA, AG_UI_EMITTED_EVENT_TYPES says so, and a spec holds that set to the run path’s emissions. false is the answer, and it tells a client something absence would not — that the question was asked.

humanInTheLoop is open: this module wires no tool-approval callback ([[EXT-54]] measured that), so a gated tool on this surface reaches a defined outcome only by not being gated. Neither true nor false is honest about a pathway that is unfinished rather than declined, and of the ten categories it is the one a client would act on most consequentially — approvals: true written to make the block look complete would promise a human review that nothing performs.

So do not “complete” this object by adding the missing category. EXT-54 fills it in when the callback is wired, and the declaration is honest in the meantime precisely because it is silent.

GthConfig

GthAbstractAgent

AgentCapabilities