1"""NexusAgent - Production-grade Agent Framework SDK

2

3__version__ = "1.16.1"

4

5 v1.16.1: Core integration — CircuitBreaker, ToolOutputValidator, Metrics wired into ToolAgent + GraphExecutor.

6 v1.16.0: 30 infrastructure tools (connection_pool, circuit_breaker, jwt, scheduler, etc.) consolidated release.

7 v1.12.1: Async Parallel Primitives (fan-out/fan-in, parallel_gather, parallel_map, structured concurrency).

8 v1.12.0: Letta-style Virtual Memory Pager (page-out/page-in + swap store + smart recall).

9 v1.11.0: Background Task Manager + Agent Supervision Tree + Full Checkpoint Integration + Auto-Context Paging.

10 v1.10.0: All-in — Deploy (Docker/K8s) + Eval (SWE-bench/GAIA) + Multimodal (Vision/Audio) + Prompt Hub (versioned) + Cost Tracker (pricing).

11 v1.9.9: GuardPipeline (PII/Injection/Toxicity safety with strict/permissive modes).

12 v1.9.5: CodeSandbox (safe code gen + test case validation) + Human-in-the-Loop breakpoints.

13 v1.9.4: TaskDecomposer + ResultFusion + EvalFeedbackLoop (P0 three-bottleneck fix).

14 v1.9.3: CompositeScorer V2 (BLEU smoothing + LLM-as-Judge), 50+ benchmark cases, 80% pass rate.

15 v1.9.2: Swarm MESH 5x parallel acceleration, CompositeScorer (ROUGE-L+BLEU+contains+exact), 14 built-in benchmarks, AutoPilot self-healing.

16 v1.7.1: System layer + Desktop client: visual approval engine (Agent applies → user clicks allow/deny), native desktop shell (pywebview wrapper), tiered file/shell/browser ops。

17 v1.0.0: Production release — ToolUsingAgent CLI, Mock fallback mode,

18 weather demo (`agentos demo`), unified LLM Provider abstraction,

19 streaming/retry/checkpoint/resume, PyPI + TestPyPI dual publish.

20

21 v1.3.38: +Tool-Using Agent streaming/retry/checkpoint/resume（run_stream/重试逻辑/断点恢复），

22+MockLLMProvider 集成测试支持。11+10 条 Agent 测试全过。

23 v1.3.37: +Tool-Using Agent (agentos.agent) — 基于 LLM Function Calling 的自主 Agent 循环：

24 ToolExecutor 工具注册/执行、多步推理闭环、同步/异步运行、成本追踪、端到端天气 Agent 示例。

25 v1.3.36: +LLM Provider Module (agentos.llm) — unified abstraction with OpenAI/DeepSeek/Anthropic

26 providers, Function Calling / Tool Use, streaming, cost estimation. 零 SDK 依赖 AnthropicProvider

27(pure httpx).

28 v1.3.15: +SubAgent Parent-Child Communication (SharedState, ChildContext/ChildHandle, heartbeat,

29 lifecycle management: pause/resume/cancel/timeout, heartbeat monitoring).

30 v1.3.14: +OpenTelemetry Integration (otel_bridge: OtelConfig/OtelTracer/OtelMeter/OtelMiddleware).

31 v1.3.13: +A2A Protocol v2 (Task Store with InMemory/SQLite backends, Streaming SSE task lifecycle

32 notifications, enhanced A2AClient with retry/auth/connection pooling, A2AServer with FastAPI

33 route builder + streaming + auth + pluggable persistence).

34 v1.3.12: +Prompt Optimizer (DSPy-inspired iterative refinement, bootstrapping, multi-strategy),

35+Few-Shot Selector (similarity/diversity/label-balanced strategies),

36+SSE Streaming (ASGI SSE with heartbeats, backpressure, typed events).

37 v1.3.11: +Guardrails (Input/Output safety engine with PII/Injection/Keyword/Toxicity rules, PolicyEnforcer),

38+HITL (Human-in-the-Loop approval workflows with RiskLevel auto-decision, caching, preset policies).

39 v1.3.10: +Conversation Manager (multi-turn dialog, sliding window, branching, summarization).

40 v1.3.9: +Schema Enforcer (Pydantic output validation/auto-repair).

41 v1.3.8: +Quality (docstrings, bare-except/type-ignore fixes).

42

43 v1.4.0: +End-to-end examples (multi_agent_research.py, file_ops_agent.py),

44+Professional README with feature comparison table,

45+CLI demo upgraded with self-check mode, +Agent marketplace listing.

46"""

47

48__version__ = "1.16.0"

49

50# v1.15.0: Tool Output Validation Layer (structured result validation + error classification + auto-repair suggestions).

51# v1.14.9: Memory Persistence Checkpoint Delivery - all 6 memory subsystems get_state()/restore_state() + ServerDaemon lifecycle integration + DaemonConfig + /api/daemon/memory endpoint.

52# v1.14.8: P0 regression fix (imports, version, dependencies).

53

54# Core - DI system

55 from agentos.core.di import (

56 Agent,

57 RunContext,

58 Depends,

59 inject_tool,

60 requires_context,

61)

62

63# Core - Handoff protocol

64 from agentos.core.handoff import (

65 Handoff,

66 HandoffResult,

67 transfer_to,

68 can_handle,

69 execute_with_handoff,

70 HandoffAwareAgent,

71)

72

73# Core - CodeAgent

74 from agentos.core.code_agent import (

75 CodeAgent,

76 CodeResult,

77 CodeStep,

78)

79

80# Protocols - Structured output validation

81 from agentos.protocols.output import (

82 StructuredOutput,

83 validate_output,

84 OutputValidator,

85)

86

87# Protocols - Agent Card

88 from agentos.protocols.agent_card import (

89 AgentCard,

90 AgentCardRegistry,

91 AgentCardDiscovery,

92 discover_local,

93 create_card,

94)

95

96# Protocols - A2A

97 from agentos.protocols.a2a import (

98 A2ATask,

99 A2AMessage,

100 A2AArtifact,

101 A2AHandoff,

102 A2ASession,

103 A2AClient,

104 A2AServer,

105 TextPart,

106 FilePart,

107 DataPart,

108 TaskState,

109 new_task,

110 new_handoff,

111)

112

113# Memory pyramid

114 from agentos.memory.pyramid import (

115 MemoryPyramid,

116 MemoryLayer,

117 MemoryType,

118 MemoryItem,

119)

120

121# Evolution engine

122 from agentos.evolution.engine import (

123 EvolutionEngine,

124 EvolutionProposal,

125 EvolutionStatus,

126)

127

128# Fusion toolkit

129 from agentos.tools.fusion import (

130 FusionToolkit,

131 FusionResult,

132 ToolSpec,

133)

134

135# Tool risk rating (v1.1.4)

136 from agentos.tools.risk import (

137 ToolRiskLevel,

138 ToolRiskRating,

139 get_risk_preset,

140 infer_risk_level,

141)

142

143# Swarm coordinator

144 from agentos.swarm.coordinator import (

145 SwarmCoordinator,

146 SmartSwarmCoordinator,

147 SwarmTopology,

148 SwarmMessage,

149 ExecutionMode,

150 SwarmResult,

151)

152

153# Communication layer

154 from agentos.comm.layer import (

155 CommunicationLayer,

156 Blackboard,

157 EventBus,

158 Mailbox,

159)

160

161# Orchestration

162 from agentos.orchestration.graph import (

163 GraphOrchestrator,

164 GraphNode,

165 GraphEdge,

166)

167

168# Concurrency (v1.1.3)

169 from agentos.concurrency.batch import (

170 AsyncBatchExecutor,

171 TaskStatus as BatchTaskStatus,

172 TaskSpec,

173 TaskResult as BatchTaskResult,

174 BatchConfig,

175 BatchResult,

176 BatchStrategy,

177)

178

179# Cost tracking (v1.1.4)

180 from agentos.cost.tracker import (

181 RunCostSession,

182 CostTracker,

183 ModelPricing,

184 UsageRecord,

185 PRICING,

186)

187

188# Models - Resilience (v1.1.5)

189 from agentos.models.resilience import (

190 CancellationSource,

191 CancelledError,

192 RetryConfig,

193 CircuitBreaker,

194 CircuitBreakerConfig,

195 ResilienceConfig,

196 ResilientCall,

197 retry_with_backoff,

198 with_timeout,

199 with_fallback,

200)

201

202# Models - Router (v1.2.7 minimal)

203 from agentos.models.router import ModelRouter

204

205# Security - Sandbox (v1.2.1)

206 from agentos.security.sandbox_executor import (

207 SandboxExecutor,

208 SandboxMode,

209 SandboxResult,

210 ProcessSandbox,

211 DockerSandbox,

212)

213

214# Core - Middleware Pipeline (v1.2.7)

215 from agentos.core.middleware import (

216 MiddlewarePhase,

217 MiddlewareContext,

218 MiddlewareDecision,

219 AgentMiddleware,

220 MiddlewarePipeline,

221)

222

223# Queue - Task Queue & Rate Limiter (v1.2.7)

224 from agentos.queue import (

225 TaskQueue,

226 TaskState as QueueTaskState,

227 TaskPriority,

228 RateLimiter,

229 RateLimitStrategy,

230 RateLimitConfig,

231)

232

233# Cache - LLM Response Cache (v1.2.7)

234 from agentos.cache import (

235 LLMCache,

236 CacheEntry,

237 BaseEmbedder,

238 OpenAIEmbedder,

239 LocalEmbedder,

240 CohereEmbedder,

241 ResponseCache,

242 CacheKeyStrategy,

243)

244

245# Plugins - Plugin System (v1.2.7)

246 from agentos.plugins import (

247 PluginRegistry,

248 RegisteredPlugin,

249 PluginStatus,

250 PluginDiscovery,

251 DiscoveredPlugin,

252 PluginLoader,

253 LifecycleManager,

254)

255

256# Observability (v1.2.7)

257 from agentos.observability import (

258 MetricsCollector,

259 Tracer,

260 NoopTracer,

261 CostAnalytics,

262 BudgetAlert,

263)

264

265# Workflows (v1.2.7)

266 from agentos.workflows import (

267 WorkflowEngine,

268 WorkflowTemplate,

269)

270

271# MCP Protocol (v1.2.7)

272 from agentos.protocols.mcp import (

273 MCPClient,

274 MCPServerConfig,

275 MCPToolSchema,

276)

277

278# Config System (v1.2.7)

279 from agentos.config import (

280 AgentOSConfig,

281 AgentOSPreset,

282 ValidationResult,

283)

284

285# Evaluation Framework (v1.3.18)

286 from agentos.evaluation import (

287 GoldenDataset,

288 GoldenCase,

289 Evaluator,

290 EvalConfig,

291 EvalReport,

292 ScoreDetail,

293 Scorer,

294 load_dataset,

295 save_dataset,

296 quick_eval,

297)

298 from agentos.evaluation.regression import (

299 RegressionRunner,

300 RegressionReport,

301 RegressionCheck,

302 StatisticalRunner,

303 StatResult,

304 to_junit_xml,

305 to_json,

306 save_report,

307)

308 from agentos.evaluation.scorers import (

309 CompositeScorer,

310 ScoringStrategy,

311 ScoreResult,

312 rouge_l,

313 bleu,

314 semantic_similarity,

315 exact_match,

316 contains_match,

317 STRATEGY_CODE_GEN,

318 STRATEGY_QA,

319 STRATEGY_SUMMARY,

320 STRATEGY_TRANSLATION,

321)

322

323# Security - Auditor (v1.2.7)

324 from agentos.security.auditor import (

325 SecurityAuditor,

326 AuditFinding,

327 AuditReport,

328)

329

330# Tools - Orchestrator (v1.2.7)

331 from agentos.tools.orchestrator import (

332 ToolOrchestrator,

333 DAGBuilder,

334 DAGSpec,

335)

336

337# Memory - Retriever + Conversation (v1.2.7)

338 from agentos.memory import (

339 SemanticMemoryRetriever,

340 ConversationMemory,

341)

342

343# Prompts (v1.2.7)

344 from agentos.prompts import (

345 PromptTemplate,

346 PromptRegistry,

347)

348

349# Multimodal (v1.2.7)

350 from agentos.multimodal import (

351 MultimodalManager,

352 Modality,

353)

354

355# Vector Store (v1.2.7)

356 from agentos.vectorstore import (

357 BaseVectorStore,

358 FAISSVectorStore,

359 ChromaVectorStore,

360)

361

362# Errors (v1.2.8)

363 from agentos.errors import (

364 ErrorCategory,

365 ErrorContext,

366 ErrorFormatter,

367 HumanError,

368)

369

370# Deployment (v1.2.8)

371 from agentos.deployment import (

372 DockerConfig,

373 ComposeService,

374 ComposeConfig,

375)

376

377# Monitoring (v1.2.8)

378 from agentos.monitoring import (

379 Alert,

380 AlertEvaluator,

381 AlertRule,

382 AlertSeverity,

383 AlertState,

384 MonitoringConfig,

385 WebhookConfig,

386 WebhookDispatcher,

387)

388

389# Experiments (v1.2.8)

390 from agentos.experiments import (

391 ExperimentRunner,

392 ExperimentConfig,

393 ExperimentReport,

394 PromptVariant,

395 TrialResult,

396 Evaluator as ExperimentEvaluator,

397)

398

399# Feedback (v1.2.8)

400 from agentos.feedback import (

401 FeedbackCollector,

402 FeedbackRecord,

403 FeedbackType,

404 PreferenceLearner,

405)

406

407# Memory extensions (v1.2.8)

408 from agentos.memory import (

409 MemorySummarizer,

410 ImportanceScorer,

411 MemoryChunk,

412 LongTermMemory,

413 MemoryStore,

414 WorkingMemory,

415 WorkingMemoryItem,

416 VectorMemory,

417)

418

419# Orchestration extensions (v1.2.8)

420 from agentos.orchestration import (

421 A2ARouter,

422 RouterAgentCard,

423 RouterTask,

424 TaskResult,

425 TaskStatus,

426 AgentGraph,

427 GraphRecipe,

428 GraphNodeState,

429 GraphResult,

430)

431

432# Models - Routing Strategy (v1.2.8)

433 from agentos.models.routing_strategy import (

434 RoutingStrategy,

435 Complexity,

436 Budget,

437)

438

439# Swarm Patterns (v1.2.8)

440 from agentos.swarm import (

441 SwarmPatterns,

442 Topology,

443 CollaborationConfig,

444 CollaborationResult,

445)

446

447# Code Sandbox (v1.9.5)

448 from agentos.swarm.code_sandbox import (

449 CodeSandbox,

450 SandboxResult as CodeSandboxResult,

451 TestCase as CodeTestCase,

452 CodeFeedbackExtractor,

453)

454

455# Human-in-the-Loop (v1.9.5)

456 from agentos.swarm.human_loop import (

457 HITLManager,

458 HITLConfig,

459 Breakpoint,

460 BreakpointType,

461 HumanDecision,

462)

463

464# Core extensions (v1.2.9)

465 from agentos.core import (

466 AgentContext,

467 ContextManager,

468 CoreMessage,

469 CoreToolCall,

470 CoreToolResult,

471 AgentStateMachine,

472 AgentState,

473 StateTransition,

474 TransitionError,

475 StateTimeoutError,

476 StreamChunk,

477 StreamEmitter,

478 StreamEvent,

479 ResponseCollector,

480 Session,

481 SessionStore,

482 AsyncAgentLoop,

483 AsyncLoopConfig,

484 AsyncInvocationResult,

485 AsyncContextManager,

486)

487

488# Logging (v1.2.9)

489 from agentos.log import (

490 JSONFormatter,

491 TraceContext,

492)

493

494# Health (v1.2.9)

495 from agentos.health import (

496 HealthChecker,

497 HealthStatus,

498 HealthCheck,

499 CheckResult,

500)

501

502# Security extensions (v1.9.9)

503 from agentos.security import (

504 GuardPipeline,

505 InputGuard,

506 OutputGuard,

507 PIIDetector,

508 ContentSafetyFilter,

509 GuardChainResult,

510 GuardResult,

511 GuardAction,

512 Severity,

513 create_strict_guard,

514 create_permissive_guard,

515 SandboxManager,

516 Sandbox,

517 SafetyReport,

518 RiskLevel,

519 LLMSafetyAnalyzer,

520)

521

522# Storage (v1.2.9)

523 from agentos.storage import (

524 CheckpointStore,

525 SqliteStore,

526)

527

528# Plugin Manager (v1.2.9)

529 from agentos.plugin_manager import (

530 PluginManager,

531 PluginInfo,

532)

533

534# Cost - Token Counter (v1.2.9)

535 from agentos.cost import (

536 TokenCounter,

537 TokenCount,

538 CostEstimate,

539 ModelFamily,

540)

541

542# Protocols - Contracts (v1.2.9)

543 from agentos.protocols import (

544 AgentContract,

545 AgentCapability,

546 CapabilityDomain,

547 QoSLevel,

548 CapabilityMatcher,

549 ContractRegistry,

550 MatchScore,

551)

552

553# Memory - Compressor (v1.2.9)

554 from agentos.memory import (

555 ContextCompressor,

556)

557

558# Tools extensions (v1.2.9)

559 from agentos.tools import (

560 BaseTool,

561 PermissionLevel,

562 BaseToolCall,

563 BaseToolResult,

564 ToolRegistry,

565 ToolSchema,

566 FCToolCall,

567 FCToolResult,

568 FCToolRegistry,

569 OpenAPIToolGenerator,

570 GeneratedTool,

571)

572

573# SubAgent Manager (v1.2.9) + Parent-Child Communication (v1.3.15)

574 from agentos.subagent import (

575 SubAgentManager,

576 SubAgentMode,

577 SubAgentSpec,

578 SubAgentResult,

579 ChildStatus,

580 ChildHeartbeat,

581 ChildInfo,

582 SharedState,

583 ChildContext,

584 ChildHandle,

585)

586

587# Agent Marketplace (v1.3.0)

588 from agentos.agents.market import (

589 AgentMarket,

590 AgentSkill,

591 AgentCategory,

592)

593

594# Tool-Using Agent (v1.3.38)

595 from agentos.agent import (

596 ToolAgent,

597 ToolExecutor,

598 AgentConfig,

599 AgentStep,

600 AgentResult,

601 MockLLMProvider,

602)

603

604# API Middleware (v1.3.0)

605 from agentos.api.middleware import (

606 CORSConfig,

607 CORSMiddleware,

608 AuthConfig,

609 RequestContext,

610 RequestIDMiddleware,

611)

612

613# API Streaming (v1.3.0)

614 from agentos.api.streaming import (

615 StreamEvent,

616 StreamSession,

617 StreamingAgent,

618)

619

620# API Versioning (v1.3.0)

621 from agentos.api.versioning import (

622 APIVersion,

623 VersionStrategy,

624 VersionConfig,

625 VersionNegotiator,

626)

627

628# Benchmark Runner (v1.3.0)

629 from agentos.benchmarks.runner import (

630 BenchmarkRunner,

631 BenchmarkScenario,

632 BenchmarkConfig,

633 BenchmarkReport,

634)

635

636# Testing Fixtures (v1.3.0)

637 from agentos.testing.fixtures import (

638 MockLLMClient,

639 MockLLMResponse,

640 mock_openai_client,

641 mock_model_response,

642 sample_config,

643)

644

645# MCP Server (v1.3.0)

646 from agentos.server.mcp_server import (

647 MCPServer,

648 MCPServerConfig,

649 MCPTool,

650 MCPResource,

651 MCPPrompt,

652)

653

654# Concrete Tools (v1.3.0)

655 from agentos.tools.code_agent import (

656 CodeAgentTool,

657 ShellTool,

658)

659 from agentos.tools.file_tools import (

660 ReadFileTool,

661 WriteFileTool,

662 ListDirectoryTool,

663)

664 from agentos.tools.web_tools import (

665 WebFetchTool,

666)

667

668# CLI Serve (v1.3.0)

669 from agentos.cli.serve import (

670 ServeConfig,

671 start_api_server,

672)

673

674# Model Route Types (v1.3.1)

675 from agentos.models.router import (

676 ModelResponse,

677 ModelSpec,

678 AllModelsFailed,

679)

680

681# Gemini Backend (v1.3.1)

682 from agentos.models.backends.gemini import (

683 GeminiClient,

684 GeminiConfig,

685 GeminiSafetySetting,

686)

687

688# Agent Loop (v1.3.2)

689 from agentos.core.loop import (

690 AgentLoop,

691 LoopConfig,

692 LoopState,

693 AgentResult,

694 MaxIterationsExceeded,

695 HumanInterruptNeeded,

696)

697

698# API Server (v1.3.2)

699 from agentos.api.server import (

700 AgentAPI,

701 RunRequest,

702 RunResponse,

703)

704

705# CLI Main (v1.0.0)

706 from agentos.cli.main import main as cli_main

707

708# CLI Init (v1.4.1)

709 from agentos.cli.init import (

710 init_cli,

711 scaffold,

712 load_config,

713 config_status_text,

714)

715

716# Docs Generator (v1.3.2)

717 from agentos.docs.generator import (

718 DocConfig,

719 generate_api_docs,

720 generate_quickstart,

721)

722

723# Swarm Coordinator extensions (v1.3.2)

724 from agentos.swarm.coordinator import (

725 AgentRole,

726 MessageBus,

727)

728

729# Model Config (v1.3.2)

730 from agentos.models.router import (

731 ModelConfig,

732 RECOMMENDED_CONFIG,

733)

734

735# OpenAI Backend (v1.3.5)

736 from agentos.models.backends.openai import (

737 OpenAIClient,

738 OpenAIConfig,

739)

740

741# Anthropic Claude Backend (v1.3.5)

742 from agentos.models.backends.anthropic import (

743 ClaudeClient,

744 ClaudeConfig,

745)

746

747# Ollama Backend (v1.3.5)

748 from agentos.models.backends.ollama import (

749 OllamaClient,

750 OllamaConfig,

751)

752

753# RAG Pipeline (v1.3.5)

754 from agentos.rag import (

755 RAGPipeline,

756 TextChunker,

757 ChunkConfig,

758 EmbeddingConfig,

759)

760

761# MCP Package (v1.3.6)

762 from agentos.mcp import (

763 MCPClient as MCPFullClient,

764 MCPServerConfig as MCPConfig,

765 MCPToolInfo,

766 MCPResourceInfo,

767 MCPPromptInfo,

768 MCPError,

769 connect_mcp_servers,

770 # MCP Server (v1.5.2)

771 MCPServer,

772 MCPToolDef,

773 MCPResource,

774 MCPPromptDef,

775 create_default_server,

776 start_mcp_server,

777)

778 from agentos.mcp.adapter import (

779 MCPToolAdapter,

780 MCPToolRegistry,

781)

782# Built-in MCP Servers (v1.7.8)

783 from agentos.mcp.builtin_servers import (

784 FilesystemServer,

785 WebFetchServer,

786 MemoryServer,

787 BuiltinMCPRegistry,

788 create_default_registry,

789)

790

791__all__ = [

792 # Version

793 "__version__",

794 # Core DI

795 "Agent",

796 "RunContext",

797 "Depends",

798 "inject_tool",

799 "requires_context",

800 # Handoff

801 "Handoff",

802 "HandoffResult",

803 "transfer_to",

804 "can_handle",

805 "execute_with_handoff",

806 "HandoffAwareAgent",

807 # CodeAgent

808 "CodeAgent",

809 "CodeResult",

810 "CodeStep",

811 # Tool-Using Agent (v1.3.38)

812 "ToolAgent",

813 "ToolExecutor",

814 "AgentConfig",

815 "AgentStep",

816 "AgentResult",

817 "MockLLMProvider",

818 # Structured output

819 "StructuredOutput",

820 "validate_output",

821 "OutputValidator",

822 # Agent Card

823 "AgentCard",

824 "AgentCardRegistry",

825 "AgentCardDiscovery",

826 "discover_local",

827 "create_card",

828 # A2A

829 "A2ATask",

830 "A2AMessage",

831 "A2AArtifact",

832 "A2AHandoff",

833 "A2ASession",

834 "A2AClient",

835 "A2AServer",

836 "TextPart",

837 "FilePart",

838 "DataPart",

839 "TaskState",

840 "new_task",

841 "new_handoff",

842 # Memory

843 "MemoryPyramid",

844 "MemoryLayer",

845 "MemoryType",

846 "MemoryItem",

847 # Evolution

848 "EvolutionEngine",

849 "EvolutionProposal",

850 "EvolutionStatus",

851 # Fusion

852 "FusionToolkit",

853 "FusionResult",

854 "ToolSpec",

855 # Risk

856 "ToolRiskLevel",

857 "ToolRiskRating",

858 "get_risk_preset",

859 "infer_risk_level",

860 # Swarm

861 "SwarmCoordinator",

862 "SmartSwarmCoordinator",

863 "SwarmTopology",

864 "SwarmMessage",

865 "ExecutionMode",

866 "SwarmResult",

867 # Communication

868 "CommunicationLayer",

869 "Blackboard",

870 "EventBus",

871 "Mailbox",

872 # Orchestration

873 "GraphOrchestrator",

874 "GraphNode",

875 "GraphEdge",

876 # Concurrency

877 "AsyncBatchExecutor",

878 "BatchTaskStatus",

879 "TaskSpec",

880 "BatchTaskResult",

881 "BatchConfig",

882 "BatchResult",

883 "BatchStrategy",

884 # Cost

885 "RunCostSession",

886 "CostTracker",

887 "ModelPricing",

888 "UsageRecord",

889 "PRICING",

890 # Resilience

891 "CancellationSource",

892 "CancelledError",

893 "RetryConfig",

894 "CircuitBreaker",

895 "CircuitBreakerConfig",

896 "ResilienceConfig",

897 "ResilientCall",

898 "retry_with_backoff",

899 "with_timeout",

900 "with_fallback",

901 # Router

902 "ModelRouter",

903 # Sandbox

904 "SandboxExecutor",

905 "SandboxMode",

906 "SandboxResult",

907 "ProcessSandbox",

908 "DockerSandbox",

909 # Middleware (v1.2.7)

910 "MiddlewarePhase",

911 "MiddlewareContext",

912 "MiddlewareDecision",

913 "AgentMiddleware",

914 "MiddlewarePipeline",

915 # Queue (v1.2.7)

916 "TaskQueue",

917 "QueueTaskState",

918 "TaskPriority",

919 "RateLimiter",

920 "RateLimitStrategy",

921 "RateLimitConfig",

922 # Cache (v1.2.7)

923 "LLMCache",

924 "CacheEntry",

925 "BaseEmbedder",

926 "OpenAIEmbedder",

927 "LocalEmbedder",

928 "CohereEmbedder",

929 "ResponseCache",

930 "CacheKeyStrategy",

931 # Plugins (v1.2.7)

932 "PluginRegistry",

933 "RegisteredPlugin",

934 "PluginStatus",

935 "PluginDiscovery",

936 "DiscoveredPlugin",

937 "PluginLoader",

938 "LifecycleManager",

939 # Observability (v1.2.7)

940 "MetricsCollector",

941 "Tracer",

942 "NoopTracer",

943 "CostAnalytics",

944 "BudgetAlert",

945 # Workflows (v1.2.7)

946 "WorkflowEngine",

947 "WorkflowTemplate",

948 # MCP Protocol (v1.2.7)

949 "MCPClient",

950 "MCPServerConfig",

951 "MCPToolSchema",

952 # Config (v1.2.7)

953 "AgentOSConfig",

954 "AgentOSPreset",

955 "ValidationResult",

956 # Evaluation (v1.2.7)

957 "Evaluator",

958 "CompositeScorer",

959 "BenchmarkCase",

960 "EvalResult",

961 # Audit (v1.2.7)

962 "SecurityAuditor",

963 "AuditFinding",

964 "AuditReport",

965 # Orchestrator (v1.2.7)

966 "ToolOrchestrator",

967 "DAGBuilder",

968 "DAGSpec",

969 # Memory (v1.2.7)

970 "SemanticMemoryRetriever",

971 "ConversationMemory",

972 # Prompts (v1.2.7)

973 "PromptTemplate",

974 "PromptRegistry",

975 # Multimodal (v1.2.7)

976 "MultimodalManager",

977 "Modality",

978 # Vector Store (v1.2.7)

979 "BaseVectorStore",

980 "FAISSVectorStore",

981 "ChromaVectorStore",

982 # Errors (v1.2.8)

983 "ErrorCategory",

984 "ErrorContext",

985 "ErrorFormatter",

986 "HumanError",

987 # Deployment (v1.2.8)

988 "DockerConfig",

989 "ComposeService",

990 "ComposeConfig",

991 # Monitoring (v1.2.8)

992 "Alert",

993 "AlertEvaluator",

994 "AlertRule",

995 "AlertSeverity",

996 "AlertState",

997 "MonitoringConfig",

998 "WebhookConfig",

999 "WebhookDispatcher",

1000 # Experiments (v1.2.8)

1001 "ExperimentRunner",

1002 "ExperimentConfig",

1003 "ExperimentReport",

1004 "PromptVariant",

1005 "TrialResult",

1006 "ExperimentEvaluator",

1007 # Feedback (v1.2.8)

1008 "FeedbackCollector",

1009 "FeedbackRecord",

1010 "FeedbackType",

1011 "PreferenceLearner",

1012 # Memory extensions (v1.2.8)

1013 "MemorySummarizer",

1014 "ImportanceScorer",

1015 "MemoryChunk",

1016 "LongTermMemory",

1017 "MemoryStore",

1018 "WorkingMemory",

1019 "WorkingMemoryItem",

1020 "VectorMemory",

1021 # Orchestration extensions (v1.2.8)

1022 "A2ARouter",

1023 "RouterAgentCard",

1024 "RouterTask",

1025 "TaskResult",

1026 "TaskStatus",

1027 "AgentGraph",

1028 "GraphRecipe",

1029 "GraphNodeState",

1030 "GraphResult",

1031 # Models - Routing (v1.2.8)

1032 "RoutingStrategy",

1033 "Complexity",

1034 "Budget",

1035 # Swarm Patterns (v1.2.8)

1036 "SwarmPatterns",

1037 "Topology",

1038 "CollaborationConfig",

1039 "CollaborationResult",

1040 # Code Sandbox (v1.9.5)

1041 "CodeSandbox",

1042 "CodeSandboxResult",

1043 "CodeTestCase",

1044 "CodeFeedbackExtractor",

1045 # Human-in-the-Loop (v1.9.5)

1046 "HITLManager",

1047 "HITLConfig",

1048 "Breakpoint",

1049 "BreakpointType",

1050 "HumanDecision",

1051 # Core extensions (v1.2.9)

1052 "AgentContext",

1053 "ContextManager",

1054 "CoreMessage",

1055 "CoreToolCall",

1056 "CoreToolResult",

1057 "AgentStateMachine",

1058 "AgentState",

1059 "StateTransition",

1060 "TransitionError",

1061 "StateTimeoutError",

1062 "StreamChunk",

1063 "StreamEmitter",

1064 "StreamEvent",

1065 "ResponseCollector",

1066 "Session",

1067 "SessionStore",

1068 "AsyncAgentLoop",

1069 "AsyncLoopConfig",

1070 "AsyncInvocationResult",

1071 "AsyncContextManager",

1072 # Logging (v1.2.9)

1073 "JSONFormatter",

1074 "TraceContext",

1075 # Health (v1.2.9)

1076 "HealthChecker",

1077 "HealthStatus",

1078 "HealthCheck",

1079 "CheckResult",

1080 # Security extensions (v1.9.9)

1081 "GuardPipeline",

1082 "InputGuard",

1083 "OutputGuard",

1084 "PIIDetector",

1085 "ContentSafetyFilter",

1086 "GuardChainResult",

1087 "GuardResult",

1088 "GuardAction",

1089 "Severity",

1090 "create_strict_guard",

1091 "create_permissive_guard",

1092 "SandboxManager",

1093 "Sandbox",

1094 "SafetyReport",

1095 "RiskLevel",

1096 "LLMSafetyAnalyzer",

1097 # Storage (v1.2.9)

1098 "CheckpointStore",

1099 "SqliteStore",

1100 # Plugin Manager (v1.2.9)

1101 "PluginManager",

1102 "PluginInfo",

1103 # Cost - Token Counter (v1.2.9)

1104 "TokenCounter",

1105 "TokenCount",

1106 "CostEstimate",

1107 "ModelFamily",

1108 # Protocols - Contracts (v1.2.9)

1109 "AgentContract",

1110 "AgentCapability",

1111 "CapabilityDomain",

1112 "QoSLevel",

1113 "CapabilityMatcher",

1114 "ContractRegistry",

1115 "MatchScore",

1116 # Memory - Compressor (v1.2.9)

1117 "ContextCompressor",

1118 # Tools extensions (v1.2.9)

1119 "BaseTool",

1120 "PermissionLevel",

1121 "BaseToolCall",

1122 "BaseToolResult",

1123 "ToolRegistry",

1124 "ToolSchema",

1125 "FCToolCall",

1126 "FCToolResult",

1127 "FCToolRegistry",

1128 "OpenAPIToolGenerator",

1129 "GeneratedTool",

1130 # SubAgent Manager (v1.2.9) + Parent-Child (v1.3.15)

1131 "SubAgentManager",

1132 "SubAgentMode",

1133 "SubAgentSpec",

1134 "SubAgentResult",

1135 "ChildStatus",

1136 "ChildHeartbeat",

1137 "ChildInfo",

1138 "SharedState",

1139 "ChildContext",

1140 "ChildHandle",

1141 # Agent Marketplace (v1.3.0)

1142 "AgentMarket",

1143 "AgentSkill",

1144 "AgentCategory",

1145 # API Middleware (v1.3.0)

1146 "CORSConfig",

1147 "CORSMiddleware",

1148 "AuthConfig",

1149 "RequestContext",

1150 "RequestIDMiddleware",

1151 # API Streaming (v1.3.0)

1152 "StreamEvent",

1153 "StreamSession",

1154 "StreamingAgent",

1155 # API Versioning (v1.3.0)

1156 "APIVersion",

1157 "VersionStrategy",

1158 "VersionConfig",

1159 "VersionNegotiator",

1160 # Benchmark Runner (v1.3.0)

1161 "BenchmarkRunner",

1162 "BenchmarkScenario",

1163 "BenchmarkConfig",

1164 "BenchmarkReport",

1165 # Testing Fixtures (v1.3.0)

1166 "MockLLMClient",

1167 "MockLLMResponse",

1168 "mock_openai_client",

1169 "mock_model_response",

1170 "sample_config",

1171 # MCP Server (v1.3.0)

1172 "MCPServer",

1173 "MCPServerConfig",

1174 "MCPTool",

1175 "MCPResource",

1176 "MCPPrompt",

1177 # Concrete Tools (v1.3.0)

1178 "CodeAgentTool",

1179 "ShellTool",

1180 "ReadFileTool",

1181 "WriteFileTool",

1182 "ListDirectoryTool",

1183 "WebFetchTool",

1184 # CLI Serve (v1.3.0)

1185 "ServeConfig",

1186 "start_api_server",

1187 # Model Route Types (v1.3.1)

1188 "ModelResponse",

1189 "ModelSpec",

1190 "AllModelsFailed",

1191 # Gemini Backend (v1.3.1)

1192 "GeminiClient",

1193 "GeminiConfig",

1194 "GeminiSafetySetting",

1195 # Agent Loop (v1.3.2)

1196 "AgentLoop",

1197 "LoopConfig",

1198 "LoopState",

1199 "AgentResult",

1200 "MaxIterationsExceeded",

1201 "HumanInterruptNeeded",

1202 # API Server (v1.3.2)

1203 "AgentAPI",

1204 "RunRequest",

1205 "RunResponse",

1206 # CLI Main (v1.0.0)

1207 "cli_main",

1208 # CLI Init (v1.3.2)

1209 "scaffold",

1210 # Docs Generator (v1.3.2)

1211 "DocConfig",

1212 "generate_api_docs",

1213 "generate_quickstart",

1214 # Swarm Coordinator extensions (v1.3.2)

1215 "AgentRole",

1216 "MessageBus",

1217 # Model Config (v1.3.2)

1218 "ModelConfig",

1219 "RECOMMENDED_CONFIG",

1220 # OpenAI Backend (v1.3.5)

1221 "OpenAIClient",

1222 "OpenAIConfig",

1223 # Anthropic Claude Backend (v1.3.5)

1224 "ClaudeClient",

1225 "ClaudeConfig",

1226 # Ollama Backend (v1.3.5)

1227 "OllamaClient",

1228 "OllamaConfig",

1229 # RAG Pipeline (v1.3.5)

1230 "RAGPipeline",

1231 "TextChunker",

1232 "ChunkConfig",

1233 "EmbeddingConfig",

1234 # MCP Package (v1.3.6)

1235 "MCPFullClient",

1236 "MCPConfig",

1237 "MCPToolInfo",

1238 "MCPResourceInfo",

1239 "MCPPromptInfo",

1240 "MCPError",

1241 "connect_mcp_servers",

1242 # MCP Server (v1.5.2)

1243 "MCPServer",

1244 "MCPToolDef",

1245 "MCPResource",

1246 "MCPPromptDef",

1247 "create_default_server",

1248 "start_mcp_server",

1249 "MCPToolAdapter",

1250 "MCPToolRegistry",

1251 # Built-in MCP Servers

1252 "FilesystemServer",

1253 "WebFetchServer",

1254 "MemoryServer",

1255 "BuiltinMCPRegistry",

1256 "create_default_registry",

1257 # Schema Enforcer (v1.3.9)

1258 "SchemaEnforcer",

1259 "EnforcerConfig",

1260 "EnforcerResult",

1261 "EnforcerStats",

1262 "FixStrategy",

1263 # Conversation Manager (v1.3.10)

1264 "ConversationManager",

1265 "ConversationConfig",

1266 "ConversationStats",

1267 "ConversationSnapshot",

1268 "Message",

1269 "MessageRole",

1270 "TrimStrategy",

1271 # Prompt Optimizer (v1.3.12)

1272 "PromptOptimizer",

1273 "OptimizerConfig",

1274 "OptimizationStrategy",

1275 "OptimizationResult",

1276 "PromptCandidate",

1277 # Few-Shot Selector (v1.3.12)

1278 "FewShotSelector",

1279 "Example",

1280 "SelectionStrategy",

1281 "build_examples",

1282 # SSE Streaming (v1.3.12)

1283 "SSEEvent",

1284 "SSEEventType",

1285 "SSEStream",

1286 "SSEResponse",

1287 # A2A Store (v1.3.13)

1288 "A2ATaskStore",

1289 "InMemoryTaskStore",

1290 "SqliteTaskStore",

1291 # A2A Streaming (v1.3.13)

1292 "A2AStreamEvent",

1293 "TaskProgress",

1294 "A2AStreamSession",

1295 "A2AStreamManager",

1296 # LLM Provider Module (v1.3.36)

1297 "LLMProvider",

1298 "OpenAIProvider",

1299 "DeepSeekProvider",

1300 "AnthropicProvider",

1301 "CompletionResult",

1302 "CompletionChoice",

1303 "CompletionUsage",

1304 "TokenUsage",

1305 "LLMMessage",

1306 "LLMMessageRole",

1307 "LLMStreamChunk",

1308 "LLMTool",

1309 "LLMToolCall",

1310 "LLMToolFunction",

1311 "LLMToolParameter",

1312 "create_llm_provider",

1313 # Enterprise (v1.5.5)

1314 "APIKeyManager", "APIKey", "KeyScope", "KeyCreateRequest", "KeyCreateResult",

1315 "TenantManager", "Tenant", "TenantConfig", "TenantUsage", "TenantTier", "TenantStatus", "TIER_QUOTAS",

1316 "User", "Role", "Permission", "ROLE_PERMISSIONS", "RBACEngine",

1317 "EnterpriseSession", "EnterpriseSessionStore",

1318 "JWTManager", "SSOProvider", "OIDCConfig", "SAMLConfig", "SSOUser",

1319 "AuditLogger", "AuditEvent", "AuditCategory", "AuditSeverity", "RetentionPolicy",

1320 # System Layer (v1.6.0) — P0: OS-level operations

1321 "SystemPermissionManager", "SystemPermission", "PermissionTier", "PermissionDenied",

1322 "SAFE_PERMISSIONS", "DEV_PERMISSIONS", "FULL_PERMISSIONS",

1323 "FileOperator", "FileOpResult", "FileListing",

1324 "ShellExecutor", "ShellResult", "ShellSandbox", "ShellPolicy",

1325 "READONLY_POLICY", "STANDARD_POLICY", "FULL_POLICY",

1326 "CDPBrowser", "BrowserSession", "BrowserAction", "BrowserResult",

1327 # Desktop Client (v1.7.0) — P1: One-click desktop

1328 "DesktopServer", "DesktopConfig", "launch_desktop",

1329 # v1.10.0: Evaluation (SWE-bench + GAIA)

1330 "EvalMetric", "EvalSuite", "EvalCase", "EvalSample", "EvalResult", "EvalReport",

1331 "Scorer", "ExactMatchScorer", "F1Scorer", "ROUGELScorer", "get_scorer",

1332 "SWEBenchLoader", "GAIALoader",

1333 "EvalRunner", "EvalRegistry", "evaluate_quick",

1334 # v1.10.0: Prompt Hub

1335 "PromptType", "PromptTag", "PromptVersion", "PromptHub",

1336 "BUILTIN_PROMPTS", "create_default_hub",

1337 # v1.11.0: Background Task Manager

1338 "BackgroundTaskManager", "BackgroundTask", "BackgroundTaskStatus", "BackgroundTaskConfig",

1339 "TaskProgress", "ProgressPhase",

1340 # v1.11.0: Agent Supervision Tree

1341 "AgentSupervisor", "SupervisedAgent", "SupervisorConfig",

1342 "AgentQuota", "SupervisionEvent", "SupervisionEventType",

1343 # v1.12.0: Virtual Memory Pager

1344 "MemoryPager", "SwapStore", "MemoryPage", "PagerStats",

1345 "create_paging_callback", "recall_relevant_memories",

1346 # v1.12.1: Async Parallel Primitives

1347 "ParallelExecutor", "FanOutExecutor", "FanOutConfig",

1348 "TaskThrottler", "ParallelTaskResult", "ParallelTaskStatus", "ParallelGatherResult",

1349 "parallel_gather", "parallel_map", "create_parallel_agent_gather",

1350]

1351

1352# Enterprise (v1.5.5)

1353 from agentos.enterprise import (

1354 APIKeyManager, APIKey, KeyScope, KeyCreateRequest, KeyCreateResult,

1355 TenantManager, Tenant, TenantConfig, TenantUsage, TenantTier, TenantStatus, TIER_QUOTAS,

1356 User, Role, Permission, ROLE_PERMISSIONS, RBACEngine,

1357 Session as EnterpriseSession, SessionStore as EnterpriseSessionStore,

1358 JWTManager, SSOProvider, OIDCConfig, SAMLConfig, SSOUser,

1359 AuditLogger, AuditEvent, AuditCategory, AuditSeverity, RetentionPolicy,

1360)

1361

1362# System Layer (v1.6.0) — P0: OS-level operations with tiered permissions

1363 from agentos.system.permissions import (

1364 SystemPermissionManager, SystemPermission, PermissionTier, PermissionDenied,

1365 SAFE_PERMISSIONS, DEV_PERMISSIONS, FULL_PERMISSIONS,

1366)

1367 from agentos.system.file_ops import (

1368 FileOperator, FileOpResult, FileListing,

1369)

1370 from agentos.system.shell_exec import (

1371 ShellExecutor, ShellResult, ShellSandbox, ShellPolicy,

1372 READONLY_POLICY, STANDARD_POLICY, FULL_POLICY,

1373)

1374 from agentos.system.browser import (

1375 CDPBrowser, BrowserSession, BrowserAction, BrowserResult,

1376)

1377

1378# Desktop Client (v1.7.0) — P1: One-click web desktop (AutoClaw-inspired)

1379 from agentos.desktop.server import (

1380 DesktopServer, DesktopConfig,

1381)

1382 from agentos.desktop.server import launch_desktop

1383

1384# ── v1.10.0: Evaluation Framework (SWE-bench + GAIA) ──

1385 from agentos.eval.benchmark import (

1386 EvalMetric, EvalSuite, EvalCase, EvalSample, EvalResult, EvalReport,

1387 Scorer, ExactMatchScorer, F1Scorer, ROUGELScorer, get_scorer,

1388 SWEBenchLoader, GAIALoader,

1389 EvalRunner, EvalRegistry, evaluate_quick,

1390)

1391

1392# ── v1.10.0: Prompt Hub (versioned templates) ──

1393 from agentos.prompt.hub import (

1394 PromptType, PromptTag, PromptVersion, PromptHub,

1395 BUILTIN_PROMPTS, create_default_hub,

1396)

1397

1398# ── v1.12.0: Virtual Memory Pager ──

1399 from agentos.memory.pager import (

1400 MemoryPager, SwapStore, MemoryPage, PagerStats,

1401 create_paging_callback, recall_relevant_memories,

1402)

1403

1404# ── v1.11.0: Background Task Manager ──

1405 from agentos.background.task_manager import (

1406 BackgroundTaskManager, BackgroundTask, BackgroundTaskStatus, BackgroundTaskConfig,

1407 TaskProgress, ProgressPhase,

1408)

1409

1410# ── v1.11.0: Agent Supervision Tree ──

1411 from agentos.background.supervisor import (

1412 AgentSupervisor, SupervisedAgent, SupervisorConfig,

1413 AgentQuota, SupervisionEvent, SupervisionEventType,

1414)

1415

1416# Schema Enforcer (v1.3.9)

1417 from agentos.validation.schema_enforcer import (

1418 SchemaEnforcer,

1419 EnforcerConfig,

1420 EnforcerResult,

1421 EnforcerStats,

1422 FixStrategy,

1423)

1424

1425# Conversation Manager (v1.3.10)

1426 from agentos.conversation.conversation import (

1427 ConversationManager,

1428 ConversationConfig,

1429 ConversationStats,

1430 ConversationSnapshot,

1431 Message,

1432 MessageRole,

1433 TrimStrategy,

1434)

1435

1436# Guardrails (v1.3.11)

1437 from agentos.guardrails.engine import (

1438 GuardrailEngine,

1439 GuardrailResult,

1440 GuardrailAction,

1441 GuardrailRule,

1442 GuardrailCategory,

1443 InputGuardrail,

1444 OutputGuardrail,

1445)

1446 from agentos.guardrails.rules import (

1447 PIIRule,

1448 KeywordBlockRule,

1449 LengthLimitRule,

1450 RegexRule,

1451 ToxicityRule,

1452 CodeInjectionRule,

1453 build_default_rules,

1454)

1455 from agentos.guardrails.policy import (

1456 GuardrailPolicy,

1457 PolicyEnforcer,

1458 PolicyViolation,

1459)

1460

1461# HITL (v1.3.11)

1462 from agentos.hitl.approver import (

1463 HumanInTheLoop,

1464 ApprovalRequest,

1465 ApprovalDecision,

1466 ApprovalStatus,

1467 RiskLevel,

1468 ApprovalPolicy,

1469 ApprovalCallback,

1470)

1471 from agentos.hitl.presets import (

1472 default_approval_policy,

1473 permissive_approval_policy,

1474 strict_approval_policy,

1475)

1476

1477# Prompt Optimizer (v1.3.12)

1478 from agentos.prompts.optimizer import (

1479 PromptOptimizer,

1480 OptimizerConfig,

1481 OptimizationStrategy,

1482 OptimizationResult,

1483 PromptCandidate,

1484)

1485

1486# Few-Shot Selector (v1.3.12)

1487 from agentos.prompts.few_shot import (

1488 FewShotSelector,

1489 Example,

1490 SelectionStrategy,

1491 build_examples,

1492)

1493

1494# SSE Streaming (v1.3.12)

1495 from agentos.api.sse import (

1496 SSEEvent,

1497 SSEEventType,

1498 SSEStream,

1499 SSEResponse,

1500)

1501

1502# A2A Store (v1.3.13)

1503 from agentos.protocols.a2a_store import (

1504 A2ATaskStore,

1505 InMemoryTaskStore,

1506 SqliteTaskStore,

1507)

1508

1509# A2A Streaming (v1.3.13)

1510 from agentos.protocols.a2a_streaming import (

1511 A2AStreamEvent,

1512 TaskProgress,

1513 A2AStreamSession,

1514 A2AStreamManager,

1515)

1516

1517# LLM Provider Module (v1.3.36)

1518 from agentos.llm import (

1519 LLMProvider,

1520 OpenAIProvider,

1521 DeepSeekProvider,

1522 AnthropicProvider,

1523 CompletionResult,

1524 CompletionChoice,

1525 CompletionUsage,

1526 TokenUsage,

1527 Message as LLMMessage,

1528 MessageRole as LLMMessageRole,

1529 StreamChunk as LLMStreamChunk,

1530 Tool as LLMTool,

1531 ToolCall as LLMToolCall,

1532 ToolFunction as LLMToolFunction,

1533 ToolParameter as LLMToolParameter,

1534 create_provider as create_llm_provider,

1535)