/** * Playground — Interactive REPL sandbox for Network-AI * * Provides an in-process REPL environment with pre-configured mock adapters, * a blackboard, budget, auth guardian, and orchestrator — ready to experiment * with immediately. * * Features: * - Pre-wired SwarmOrchestrator with mock CustomAdapter * - LockedBlackboard with in-memory backend * - AuthGuardian with default trust levels * - FederatedBudget with generous defaults * - REPL context exposes all key objects * - Helper functions: delegate(), bb(), budget(), agents() * * Usage: * import { startPlayground } from 'network-ai'; * await startPlayground(); * * CLI: * npx network-ai playground * * @module Playground * @version 1.0.0 */ import { EventEmitter } from 'events'; /** Configuration for the playground environment */ export interface PlaygroundConfig { /** Welcome banner (set to '' to disable) */ banner?: string; /** REPL prompt string (default: 'swarm> ') */ prompt?: string; /** Pre-register mock agent handlers (name → response) */ mockAgents?: Record string | Promise>; /** Budget ceiling (default: 100) */ budgetCeiling?: number; /** Whether to show tips on startup (default: true) */ showTips?: boolean; } /** Playground instance — provides access to all sandbox objects */ export interface PlaygroundInstance { /** The playground event emitter */ emitter: EventEmitter; /** Stop the playground */ stop: () => void; /** Whether the playground is running */ isRunning: boolean; } /** Simple mock agent registry for the playground */ export declare class MockAgentRegistry { private handlers; private callLog; /** Register a mock agent */ register(name: string, handler: (input: string) => string | Promise): void; /** List registered mock agents */ list(): string[]; /** Call a mock agent */ call(name: string, input: string): Promise; /** Get call history */ history(): ReadonlyArray<{ agentId: string; input: string; output: string; timestamp: number; }>; /** Clear call history */ clearHistory(): void; } /** * Start an interactive playground REPL with mock adapters. * * All key Network-AI objects are available in the REPL context. * Mock agents respond instantly with deterministic outputs. */ export declare function startPlayground(config?: PlaygroundConfig): PlaygroundInstance; //# sourceMappingURL=playground.d.ts.map