Skip to content

Nodes

Conceptual phases implemented as simple async functions. Each lives under agent-sdk/src/nodes and returns partial state updates.

NodeFileResponsibility
resolvernodes/resolver.tsNormalize inbound state, seed counters, attach runtime defaults.
agentCorenodes/agentCore.tsBind tools (when supported), invoke the model, append the assistant response, normalize usage.
toolsnodes/tools.tsExecute proposed tool calls with global/per-turn limits, record history, emit tool events, handle handoffs and structured output finalize signals.
contextSummarizenodes/contextSummarize.tsWhen triggered, archive heavy tool outputs, generate summaries, and emit a synthetic context_summarize tool call/response pair.
toolLimitFinalizenodes/toolLimitFinalize.tsInject a system notice when the global tool-call cap is reached so the next turn must answer directly.

The smart agent orchestrates these nodes in a loop (no external graph runtime). Decision helpers in graph/decisions.ts determine when to run summarization before or after tool execution and when to finalize due to limits.

Each node is pure-ish: it only mutates through returned diffs, making them straightforward to unit test and reason about independently.

Released under the MIT License.