Documentation Home/SDK Reference

SDK Functions & Full `moven.config.ts` Specs

Complete reference for `createMovenCircuitBreaker`, `MovenRunState`, `MovenReporter`, and all initialization parameters.

1. Full Configuration Options Reference

ParameterTypeDefaultDescription
agentIdstring"agent_run"Unique deterministic slug for tracing multi-agent sub-trees.
agentNamestring"default-agent"Human-readable agent identifier shown in cloud telemetry.
maxRepeatCallsnumber5Trips when identical SHA-256 argument hashes repeat N times within time window.
maxCostDollarnumber$2.00Dollar spending ceiling for a single agent execution run.
maxDepthnumber15Maximum recursion step depth before tripping depth ceiling.
maxNoProgressTurnsnumber3Trips when N consecutive turns produce identical output state hashes.
autoFallbackCheaperModelbooleantrueAutomatically switch model to cheaper tier on soft trip before terminating.
apiKeystringundefinedMoven hosted telemetry API Key (`moven_sk_live_...`).

2. Complete `moven.config.ts` Code Example

Below is a complete enterprise-grade moven.config.ts configuration example initializing circuit breaker rules, provider mappings, and hallucination alerts:

import { createMovenCircuitBreaker } from 'moven-sdk';

export const movenCircuitBreaker = createMovenCircuitBreaker({
  // Production Agent Identity
  agentId: 'agent_inventory_prod_01',
  agentName: 'inventory_production_agent',
  framework: 'LangGraph / LangChain',
  version: '1.2.0',
  tags: ['production', 'e-commerce'],

  // Rule 01: Intercept tool called 5x in 60s with identical arguments
  maxRepeatCalls: 5,
  repeatTimeWindowMs: 60000,

  // Rule 02: Strict Dollar Cost Ceiling ($2.00 max per agent run)
  maxCostDollar: 2.00,

  // Rule 03: Recursion & Depth Limit (Max 15 sub-agent steps)
  maxDepth: 15,

  // Rule 04: No-Progress State Hash Shield (3 consecutive identical turn outputs)
  maxNoProgressTurns: 3,

  // Rule 05: Cheaper Model Fallback & LLM Judge Arbitrator
  provider: 'openai',
  currentModel: 'gpt-4o',
  cheaperModel: 'gpt-4o-mini',
  autoFallbackCheaperModel: true,
  enableLlmJudgeArbitrator: true,

  // Callbacks
  onHallucination: ({ agentName, reason, toolName }) => {
    console.warn(`[Moven Alert] Agent '${agentName}' hallucination on tool '${toolName}': ${reason}`);
  },

  // Telemetry API Key
  apiKey: process.env.MOVEN_API_KEY,
});