API Reference
Flat reference table for all 16 runtime exports from @ai-employee-sdk/core.
All exports from @ai-employee-sdk/core. For type definitions, see Types Reference.
| Export | Signature | Description | Docs |
|---|
membrane | (config: MembraneConfig<TOOLS>) => MembraneResult<TOOLS> | Creates a 4-tier permission system for tools | Membrane |
resolveTier | (toolName: string, config: MembraneConfig) => Tier | Resolves a tool name to its tier | Membrane |
explainTier | (toolName: string, config: MembraneConfig) => TierResolution | Resolves tier with explanation (source, pattern index) | Membrane |
composePrepareStep | (...fns: (PrepareStepFn | undefined | null)[]) => PrepareStepFn | Composes multiple prepareStep functions with deterministic merge rules | Memory |
createMemoryPrepareStep | (store: MemoryStore, config?: MemoryPrepareStepConfig) => PrepareStepFn | Creates a prepareStep that injects memories at step 0 | Memory |
createCostTracker | (config: CostTrackerConfig) => CostTrackerResult | Stateful per-model cost tracker with budget enforcement | Cost Tracking |
budgetExceeded | (config: BudgetConfig) => StopCondition | Stateless stop condition for token/USD budgets | Cost Tracking |
tokenVelocityExceeded | (config: VelocityConfig) => StopCondition | Stop condition for runaway token velocity | Cost Tracking |
extractPendingApprovals | (result: any) => PendingApproval[] | Extracts tool calls awaiting approval from generateText result | Interrupts |
createInterruptHandle | (result: any, pendingApprovals: PendingApproval[]) => InterruptHandle | Creates a serializable JSON handle for interrupted state | Interrupts |
resolveInterrupt | (handle: InterruptHandle, decisions: InterruptDecision[]) => { messages, previousUsage } | Pure function. Applies human decisions to produce resumption messages | Interrupts |
createHeartbeat | (agent, config: HeartbeatConfig) => HeartbeatResult | Always-on tick function with concurrency guard and circuit breaker | Agent |
createAuditLogger | (config: AuditLoggerConfig) => AuditLoggerResult | Creates callbacks for tool call and step observability | Audit |
| Export | Description | Docs |
|---|
EmployeeAgent | Agent implementation composing membrane + memory + prepareStep + stop conditions. Delegates to ToolLoopAgent. | Agent |
InMemoryStore | Zero-dependency MemoryStore implementation with lazy TTL. For tests and development. | Memory |
| Export | Type | Description |
|---|
DEFAULT_MODEL_PRICING | Record<string, ModelPricing> | Built-in pricing for OpenAI, Anthropic, and Google models (March 2025) |
// Runtime exports
import {
membrane,
resolveTier,
explainTier,
composePrepareStep,
createMemoryPrepareStep,
createCostTracker,
DEFAULT_MODEL_PRICING,
budgetExceeded,
tokenVelocityExceeded,
extractPendingApprovals,
createInterruptHandle,
resolveInterrupt,
createHeartbeat,
createAuditLogger,
EmployeeAgent,
InMemoryStore,
} from '@ai-employee-sdk/core';
// Type-only exports
import type {
Tier,
TierPattern,
TierResolution,
MemoryStore,
MembraneConfig,
MembraneResult,
AuditEntry,
HeartbeatConfig,
HeartbeatResult,
CheckWorkFn,
MemoryPrepareStepConfig,
ModelPricing,
BudgetConfig,
VelocityConfig,
AuditLoggerConfig,
AuditLoggerResult,
EmployeeAgentConfig,
CostTrackerConfig,
CostSnapshot,
CostTrackerResult,
PendingApproval,
InterruptDecision,
InterruptHandle,
} from '@ai-employee-sdk/core';