Smithy
src/smithyis the L5 Product agent-builder (IndusForge) — a meta-tool that helps a user design and generate new agents that run on the runtime. Imported asindusagi/smithy, or as thesmithynamespace fromindusagi.
Smithy is a leaf product surface. Its layers turn a partial spec into a validated,
runnable agent description: a flag reader, a persona/blueprint generator, an
externalised knowledge pack, session-level tool accounting, a render seam, and the
Forge build session that conducts them all and instantiates the finished blueprint
into a real agent.
Table of Contents
Public exports
src/smithy/index.ts re-exports the layer barrels (export * over config,
persona, knowledge, runtime, ui) plus the Forge build session.
| Export | Kind | Source | Purpose |
|---|---|---|---|
Forge, createForge |
class / fn | forge.ts |
The build session that wires the layers into one agent-builder |
FlagReader, readFlags, FlagError, FLAG_TABLE |
from config |
config/flag-reader.ts |
Reads Smithy's own CLI into a SmithyConfig |
defineAgent, toAgentConfig |
from persona |
persona/define-agent.ts |
Merge a spec over a profile into a blueprint, then bridge to a runtime config |
PROFILES, PROFILE_NAMES, getProfile, isProfileName |
from persona |
persona/profiles.ts |
The starter profile table |
agentBlueprintSchema, validateBlueprint, serializeBlueprint, deserializeBlueprint, BlueprintError |
from persona |
persona/blueprint.ts |
The AgentBlueprint shape and (de)serialization |
loadKnowledge, KnowledgeError |
from knowledge |
knowledge/loader.ts |
Load the guide pack into a KnowledgePack |
ToolLedger |
from runtime |
runtime/tool-ledger.ts |
Append-only account of tool executions during a build |
TranscriptModel, ConsoleForgeView, formatTranscript |
from ui |
ui/transcript.ts |
The render seam + minimal text ForgeView |
Types include ForgeOptions, InterviewKey, InterviewAnswers; SmithyConfig,
SmithyFlagName; AgentBlueprint, ToolCollectionName, AgentProfile,
ProfileName, AgentSpec; KnowledgePack, KnowledgeManifest, Guide;
ToolEvent, LedgerEntry, ToolTally, LedgerSummary; and the RenderTranscript
/ ForgeView family.
Sub-directories
| Directory | Holds |
|---|---|
config/ |
flag-reader.ts — the FlagReader state machine and FLAG_TABLE |
persona/ |
blueprint.ts, profiles.ts, define-agent.ts — the blueprint shape, profiles, and generator |
knowledge/ |
loader.ts, manifest.json, guides/ — the externalised guide pack |
runtime/ |
tool-ledger.ts — the ToolLedger |
ui/ |
transcript.ts — the TranscriptModel and ForgeView seam |
forge.ts |
The Forge build session |
The Forge build session
The Forge is the conductor that wires the layers into a single drivable build
session. It runs in two modes:
Forge.buildInteractive— a short scripted interview. It asks the user, through the injectedForgeViewseam, for the agent's name, purpose, tool needs, and model preference; folds the answers into a blueprint viadefineAgent; records each step on aToolLedger; and keeps the dialogue as a transcript aTranscriptModelcan project.Forge.buildFromConfig— the non-interactive path. It takes aSmithyConfig(a profile plus pre-suppliedanswers) and produces the same kind of blueprint with no I/O at all.
Forge.instantiate turns a finished blueprint into a runnable Agent via
toAgentConfig and createAgent:
import { createForge } from "indusagi/smithy";
const forge = createForge(/* ForgeOptions */);
const blueprint = forge.buildFromConfig(config); // synchronous; returns AgentBlueprint
const agent = forge.instantiate(blueprint); // a runtime Agent
The view (and its lone ask) is injected, never constructed here, so tests script
the whole interview with canned answers; with neither given, the Forge falls back to
a ConsoleForgeView over stdio.
Layers
- config — the
FlagReaderstate machine reads Smithy's CLI into aSmithyConfig. - persona —
defineAgentmerges anAgentSpecover aPROFILESentry into a validatedAgentBlueprint;toAgentConfigbridges that into a runtimeAgentConfig. - knowledge —
loadKnowledgeloads amanifest.jsonplus markdownguides/into aKnowledgePackfor Smithy to consult while authoring. - runtime — the
ToolLedgeraccounts for tool executions during a build. - ui — the
TranscriptModelvisitor sanitizes and projects a transcript; the minimal textForgeViewis the seam the builder loop talks to.
Relationship to neighbors
Smithy generates agents that run on the Runtime:
toAgentConfig produces an AgentConfig and Forge.instantiate calls createAgent.
The generated agent's tools are a Capabilities
collection (ToolCollectionName). Smithy sits at the top of the stack — it builds
agents rather than running model conversations itself.
Back to the Architecture overview.
