Skip to content

Overview ​

This guide describes @chamberu/core as it is built today. Every sample on these pages type-checks against the current source.

The concepts ​

ConceptIn coreWhat it is
AgentdefineAgent()A model, instructions, triggers, a tool factory, a budget, approvals and state
Triggercron(), http(), manual()How a run can start. Normalized into a TriggerEnvelope at intake
RunRunOne execution of an agent for one envelope, with a status, usage and output
StepStepAn llm, tool or wait record, appended as the run progresses
CheckpointCheckpointThe message history after a step; a resumed run continues from the latest one
ToolAI SDK tool(), defineEffectTool()What the model can call. Effect tools apply at most once per effect key
StateAgentStatePer-agent key-value data and typed collections that outlive runs
NotifierNotifierDelivers approval requests and other messages to the owner
StoreStoreRuns, steps, checkpoints, keys, locks, effects and state. Pluggable

The App and Workspace concepts (an app with HTTP, scheduler and UI, and sandboxed workspaces for coding) belong to planned packages.

The engine in one picture ​

             dispatch(envelope)
                    |
        idempotency key seen? ----yes----> existing run id
                    | no
                    v
               [ queued ] <--------------------------------+
                    | slot free, key free, claim taken     |
                    v                                      |
               [ running ] --- step --> checkpoint         |
                    |                                      |
   +----------------+-----------------+-----------------+  |
   |                |                 |                 |  |
completed         failed          cancelled        waiting -- resume / timeout
                                                    interrupted -- recover

See Run Lifecycle for every transition.

Reading order ​

  1. Agents and Triggers & the Envelope
  2. Run Lifecycle and Execution & Checkpoints
  3. Budgets, Tools, Effect Tools, Approvals, State
  4. Concurrency, Cancel, Drain & Recovery, Notifiers, Errors