DZapSDK) behind four interfaces: SDK, CLI, HTTP, and MCP.
The model decides what to call; runtime code decides what is allowed to execute.
Core runtime behavior
- Startup requires
DZAP_STARTUP_PASSWORD - Every ask call requires
metadata.accountInfo[] - Metadata is sanitized before prompt injection (
private_keyis excluded) - Session memory is in-process and keyed by generated
sessionId
Model and tool calling
- LLM adapter:
@ai-sdk/openaiwithgenerateText(...) - Default model:
gpt-4o-mini(DZAP_OPENAI_MODELoverride) - Tool choice: automatic
- Step cap:
stepCountIs(25) - Retries:
DZAP_MODEL_MAX_RETRIES(default2) - Timeout:
DZAP_MODEL_TIMEOUT_MS(default4500000)
Tool exposure pipeline
SDKTool, which:
- validates input with zod when schema is present
- executes tool code
- normalizes JSON-string payloads into structured objects
- returns duration + typed result/error details
Session logging
Each session captures:- metadata snapshot
- conversation timeline
- structured tool logs
- summary counters
getSessionHistory(sessionId) or GET /sessions/:sessionId/history.
Scheduler and persistence
- Storage: SQLite via
better-sqlite3 - Default DB:
schedules.db(DB_PATHoverride) - Statuses:
pending,running,done,error - Scheduler loop: runs periodically (60s default from server startup)
End-to-end flow
Related pages
Safety & Execution
Interactive gates and execution controls.
SDK-AI
API methods and direct tool execution examples.