ai-agent-inspector 1.0.0__py3-none-any.whl → 1.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,6 +43,11 @@ from .core.interfaces import Exporter, Sampler
43
43
  from .core.trace import (
44
44
  Trace,
45
45
  TraceContext,
46
+ agent_communication,
47
+ agent_handoff,
48
+ agent_join,
49
+ agent_leave,
50
+ agent_spawn,
46
51
  error,
47
52
  final,
48
53
  get_trace,
@@ -51,6 +56,8 @@ from .core.trace import (
51
56
  memory_write,
52
57
  run,
53
58
  set_trace,
59
+ task_assign,
60
+ task_complete,
54
61
  tool,
55
62
  )
56
63
 
@@ -71,6 +78,11 @@ except ImportError:
71
78
 
72
79
  # Event types
73
80
  from .core.events import (
81
+ AgentCommunicationEvent,
82
+ AgentHandoffEvent,
83
+ AgentJoinEvent,
84
+ AgentLeaveEvent,
85
+ AgentSpawnEvent,
74
86
  BaseEvent,
75
87
  ErrorEvent,
76
88
  EventStatus,
@@ -81,6 +93,8 @@ from .core.events import (
81
93
  MemoryWriteEvent,
82
94
  RunEndEvent,
83
95
  RunStartEvent,
96
+ TaskAssignmentEvent,
97
+ TaskCompletionEvent,
84
98
  ToolCallEvent,
85
99
  )
86
100
 
@@ -100,6 +114,14 @@ __all__ = [
100
114
  "final",
101
115
  "get_trace",
102
116
  "set_trace",
117
+ # Multi-agent tracing
118
+ "agent_spawn",
119
+ "agent_join",
120
+ "agent_leave",
121
+ "agent_communication",
122
+ "agent_handoff",
123
+ "task_assign",
124
+ "task_complete",
103
125
  # Configuration
104
126
  "TraceConfig",
105
127
  "Profile",
@@ -121,6 +143,14 @@ __all__ = [
121
143
  "MemoryWriteEvent",
122
144
  "ErrorEvent",
123
145
  "FinalAnswerEvent",
146
+ # Multi-agent event types
147
+ "AgentSpawnEvent",
148
+ "AgentJoinEvent",
149
+ "AgentLeaveEvent",
150
+ "AgentCommunicationEvent",
151
+ "AgentHandoffEvent",
152
+ "TaskAssignmentEvent",
153
+ "TaskCompletionEvent",
124
154
  # Adapters (optional)
125
155
  "enable_langchain",
126
156
  # API server (optional)
agent_inspector/cli.py CHANGED
@@ -113,18 +113,30 @@ def cmd_prune(args):
113
113
  # Override with CLI arguments
114
114
  if args.retention_days is not None:
115
115
  config.retention_days = args.retention_days
116
+ if getattr(args, "retention_max_bytes", None) is not None:
117
+ config.retention_max_bytes = args.retention_max_bytes
116
118
 
117
119
  # Initialize database
118
120
  db = Database(config)
119
121
  db.initialize()
120
122
 
121
- # Prune old runs
123
+ # Prune by age first
122
124
  deleted_count = db.prune_old_runs(retention_days=config.retention_days)
125
+ size_deleted = 0
126
+
127
+ # Then prune by size if configured
128
+ max_bytes = config.retention_max_bytes
129
+ if max_bytes is not None and max_bytes > 0:
130
+ size_deleted = db.prune_by_size(max_bytes)
131
+ deleted_count += size_deleted
132
+ if size_deleted > 0:
133
+ print(f"✅ Pruned {size_deleted} runs by size (max_bytes={max_bytes})")
123
134
 
124
135
  if deleted_count > 0:
125
- print(f"✅ Pruned {deleted_count} old runs")
136
+ if size_deleted == 0: # only age-based pruning had effect
137
+ print(f"✅ Pruned {deleted_count} old runs")
126
138
 
127
- # Optionally vacuum to reclaim space
139
+ # Optionally vacuum to reclaim space (prune_by_size already vacuums)
128
140
  if args.vacuum:
129
141
  print("💾 Running VACUUM to reclaim disk space...")
130
142
  if db.vacuum():
@@ -408,6 +420,13 @@ Examples:
408
420
  type=int,
409
421
  help="Retention period in days (default: from config)",
410
422
  )
423
+ prune_parser.add_argument(
424
+ "--retention-max-bytes",
425
+ type=int,
426
+ default=None,
427
+ metavar="BYTES",
428
+ help="Prune oldest runs until DB size is at or below BYTES (optional; from config if set)",
429
+ )
411
430
  prune_parser.add_argument(
412
431
  "--vacuum",
413
432
  action="store_true",