@lov3kaizen/agentsea-crews 1.0.1 → 1.1.1

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.
@@ -0,0 +1,190 @@
1
+ import { EventEmitter } from 'eventemitter3';
2
+ import { C as CrewStatusDetails, a as Crew, b as CrewEvent, c as CrewMetrics, T as TimelineEntry, d as TaskConfig } from './Crew-BnvVjN7A.mjs';
3
+
4
+ interface AgentStatus {
5
+ name: string;
6
+ role: string;
7
+ status: 'idle' | 'busy' | 'error';
8
+ currentTask?: string;
9
+ tasksCompleted: number;
10
+ tasksFailed: number;
11
+ tokensUsed: number;
12
+ lastActivity?: Date;
13
+ }
14
+ interface DashboardUpdate {
15
+ type: 'status_change' | 'agent_update' | 'task_update' | 'metrics_update' | 'event';
16
+ timestamp: Date;
17
+ data: unknown;
18
+ }
19
+ interface DashboardConfig {
20
+ updateInterval?: number;
21
+ trackEvents?: boolean;
22
+ maxEvents?: number;
23
+ }
24
+ declare class CrewDashboard extends EventEmitter<{
25
+ update: (update: DashboardUpdate) => void;
26
+ statusChange: (status: CrewStatusDetails) => void;
27
+ agentUpdate: (agent: AgentStatus) => void;
28
+ error: (error: Error) => void;
29
+ }> {
30
+ private readonly crew;
31
+ private readonly config;
32
+ private readonly events;
33
+ private updateTimer?;
34
+ private lastStatus?;
35
+ private subscribed;
36
+ constructor(crew: Crew, config?: DashboardConfig);
37
+ start(): void;
38
+ stop(): void;
39
+ subscribe(callback: (update: DashboardUpdate) => void): () => void;
40
+ recordEvent(event: CrewEvent): void;
41
+ getCrewStatus(): CrewStatusDetails;
42
+ getAgentStatuses(): Map<string, AgentStatus>;
43
+ getMetrics(): CrewMetrics;
44
+ getTimeline(): TimelineEntry[];
45
+ getEvents(filter?: {
46
+ type?: string;
47
+ agent?: string;
48
+ since?: Date;
49
+ limit?: number;
50
+ }): CrewEvent[];
51
+ getProgress(): {
52
+ percentage: number;
53
+ completedTasks: number;
54
+ totalTasks: number;
55
+ currentTask?: string;
56
+ elapsedTime: number;
57
+ estimatedRemaining?: number;
58
+ };
59
+ getTaskBreakdown(): {
60
+ pending: number;
61
+ inProgress: number;
62
+ completed: number;
63
+ failed: number;
64
+ total: number;
65
+ };
66
+ getAgentBreakdown(): {
67
+ total: number;
68
+ busy: number;
69
+ idle: number;
70
+ performance: Array<{
71
+ name: string;
72
+ completed: number;
73
+ failed: number;
74
+ successRate: number;
75
+ }>;
76
+ };
77
+ private emitUpdate;
78
+ getSnapshot(): DashboardSnapshot;
79
+ }
80
+ interface DashboardSnapshot {
81
+ timestamp: Date;
82
+ status: CrewStatusDetails;
83
+ metrics: CrewMetrics;
84
+ agents: Record<string, AgentStatus>;
85
+ progress: ReturnType<CrewDashboard['getProgress']>;
86
+ taskBreakdown: ReturnType<CrewDashboard['getTaskBreakdown']>;
87
+ agentBreakdown: ReturnType<CrewDashboard['getAgentBreakdown']>;
88
+ recentEvents: CrewEvent[];
89
+ }
90
+ declare function createDashboard(crew: Crew, config?: DashboardConfig): CrewDashboard;
91
+
92
+ type BreakpointType = 'task:assigned' | 'task:started' | 'task:completed' | 'task:failed' | 'agent:thinking' | 'delegation:decision' | 'custom';
93
+ interface Breakpoint {
94
+ id: string;
95
+ type: BreakpointType;
96
+ condition?: (event: CrewEvent, context: DebugContext) => boolean;
97
+ enabled: boolean;
98
+ hitCount: number;
99
+ }
100
+ interface DebugContext {
101
+ currentEvent?: CrewEvent;
102
+ agents: Map<string, AgentInspection>;
103
+ tasks: TaskConfig[];
104
+ variables: Map<string, unknown>;
105
+ callStack: string[];
106
+ }
107
+ interface AgentInspection {
108
+ name: string;
109
+ role: string;
110
+ status: 'idle' | 'busy' | 'paused';
111
+ currentTask?: string;
112
+ lastThought?: string;
113
+ lastToolCall?: {
114
+ tool: string;
115
+ input: unknown;
116
+ output?: unknown;
117
+ };
118
+ memory: Map<string, unknown>;
119
+ }
120
+ interface StepResult {
121
+ event: CrewEvent;
122
+ breakpointHit?: Breakpoint;
123
+ agentStates: Map<string, AgentInspection>;
124
+ continueExecution: boolean;
125
+ }
126
+ interface DebugModeConfig {
127
+ pauseOnError?: boolean;
128
+ verbose?: boolean;
129
+ maxCallStackDepth?: number;
130
+ }
131
+ declare class DebugMode extends EventEmitter<{
132
+ breakpointHit: (breakpoint: Breakpoint, event: CrewEvent) => void;
133
+ step: (result: StepResult) => void;
134
+ error: (error: Error) => void;
135
+ paused: () => void;
136
+ resumed: () => void;
137
+ }> {
138
+ private readonly crew;
139
+ private readonly config;
140
+ private readonly breakpoints;
141
+ private readonly eventQueue;
142
+ private readonly callStack;
143
+ private context;
144
+ private enabled;
145
+ private paused;
146
+ private stepMode;
147
+ private breakpointCounter;
148
+ private resolveStep?;
149
+ constructor(crew: Crew, config?: DebugModeConfig);
150
+ enable(): void;
151
+ disable(): void;
152
+ isEnabled(): boolean;
153
+ setBreakpoint(type: BreakpointType, condition?: (event: CrewEvent, context: DebugContext) => boolean): string;
154
+ removeBreakpoint(id: string): boolean;
155
+ enableBreakpoint(id: string): boolean;
156
+ disableBreakpoint(id: string): boolean;
157
+ getBreakpoints(): Breakpoint[];
158
+ clearBreakpoints(): void;
159
+ step(): Promise<StepResult>;
160
+ continue(): Promise<void>;
161
+ pause(): void;
162
+ resume(): void;
163
+ isPaused(): boolean;
164
+ inspect(agentName: string): AgentInspection | undefined;
165
+ inspectAll(): Map<string, AgentInspection>;
166
+ getContext(): DebugContext;
167
+ getCallStack(): string[];
168
+ evaluate(expression: string): unknown;
169
+ watch(expression: string): {
170
+ expression: string;
171
+ value: unknown;
172
+ };
173
+ handleEvent(event: CrewEvent): void;
174
+ private createContext;
175
+ private updateContext;
176
+ private checkBreakpoints;
177
+ private getAgentStates;
178
+ private createAgentInspection;
179
+ getSummary(): {
180
+ enabled: boolean;
181
+ paused: boolean;
182
+ stepMode: boolean;
183
+ breakpointCount: number;
184
+ queuedEvents: number;
185
+ callStackDepth: number;
186
+ };
187
+ }
188
+ declare function createDebugMode(crew: Crew, config?: DebugModeConfig): DebugMode;
189
+
190
+ export { type AgentInspection as A, type Breakpoint as B, CrewDashboard as C, DebugMode as D, type StepResult as S, type AgentStatus as a, type BreakpointType as b, type DashboardConfig as c, type DashboardSnapshot as d, type DashboardUpdate as e, type DebugContext as f, type DebugModeConfig as g, createDashboard as h, createDebugMode as i };
@@ -0,0 +1,190 @@
1
+ import { EventEmitter } from 'eventemitter3';
2
+ import { C as CrewStatusDetails, a as Crew, b as CrewEvent, c as CrewMetrics, T as TimelineEntry, d as TaskConfig } from './Crew-BnvVjN7A.js';
3
+
4
+ interface AgentStatus {
5
+ name: string;
6
+ role: string;
7
+ status: 'idle' | 'busy' | 'error';
8
+ currentTask?: string;
9
+ tasksCompleted: number;
10
+ tasksFailed: number;
11
+ tokensUsed: number;
12
+ lastActivity?: Date;
13
+ }
14
+ interface DashboardUpdate {
15
+ type: 'status_change' | 'agent_update' | 'task_update' | 'metrics_update' | 'event';
16
+ timestamp: Date;
17
+ data: unknown;
18
+ }
19
+ interface DashboardConfig {
20
+ updateInterval?: number;
21
+ trackEvents?: boolean;
22
+ maxEvents?: number;
23
+ }
24
+ declare class CrewDashboard extends EventEmitter<{
25
+ update: (update: DashboardUpdate) => void;
26
+ statusChange: (status: CrewStatusDetails) => void;
27
+ agentUpdate: (agent: AgentStatus) => void;
28
+ error: (error: Error) => void;
29
+ }> {
30
+ private readonly crew;
31
+ private readonly config;
32
+ private readonly events;
33
+ private updateTimer?;
34
+ private lastStatus?;
35
+ private subscribed;
36
+ constructor(crew: Crew, config?: DashboardConfig);
37
+ start(): void;
38
+ stop(): void;
39
+ subscribe(callback: (update: DashboardUpdate) => void): () => void;
40
+ recordEvent(event: CrewEvent): void;
41
+ getCrewStatus(): CrewStatusDetails;
42
+ getAgentStatuses(): Map<string, AgentStatus>;
43
+ getMetrics(): CrewMetrics;
44
+ getTimeline(): TimelineEntry[];
45
+ getEvents(filter?: {
46
+ type?: string;
47
+ agent?: string;
48
+ since?: Date;
49
+ limit?: number;
50
+ }): CrewEvent[];
51
+ getProgress(): {
52
+ percentage: number;
53
+ completedTasks: number;
54
+ totalTasks: number;
55
+ currentTask?: string;
56
+ elapsedTime: number;
57
+ estimatedRemaining?: number;
58
+ };
59
+ getTaskBreakdown(): {
60
+ pending: number;
61
+ inProgress: number;
62
+ completed: number;
63
+ failed: number;
64
+ total: number;
65
+ };
66
+ getAgentBreakdown(): {
67
+ total: number;
68
+ busy: number;
69
+ idle: number;
70
+ performance: Array<{
71
+ name: string;
72
+ completed: number;
73
+ failed: number;
74
+ successRate: number;
75
+ }>;
76
+ };
77
+ private emitUpdate;
78
+ getSnapshot(): DashboardSnapshot;
79
+ }
80
+ interface DashboardSnapshot {
81
+ timestamp: Date;
82
+ status: CrewStatusDetails;
83
+ metrics: CrewMetrics;
84
+ agents: Record<string, AgentStatus>;
85
+ progress: ReturnType<CrewDashboard['getProgress']>;
86
+ taskBreakdown: ReturnType<CrewDashboard['getTaskBreakdown']>;
87
+ agentBreakdown: ReturnType<CrewDashboard['getAgentBreakdown']>;
88
+ recentEvents: CrewEvent[];
89
+ }
90
+ declare function createDashboard(crew: Crew, config?: DashboardConfig): CrewDashboard;
91
+
92
+ type BreakpointType = 'task:assigned' | 'task:started' | 'task:completed' | 'task:failed' | 'agent:thinking' | 'delegation:decision' | 'custom';
93
+ interface Breakpoint {
94
+ id: string;
95
+ type: BreakpointType;
96
+ condition?: (event: CrewEvent, context: DebugContext) => boolean;
97
+ enabled: boolean;
98
+ hitCount: number;
99
+ }
100
+ interface DebugContext {
101
+ currentEvent?: CrewEvent;
102
+ agents: Map<string, AgentInspection>;
103
+ tasks: TaskConfig[];
104
+ variables: Map<string, unknown>;
105
+ callStack: string[];
106
+ }
107
+ interface AgentInspection {
108
+ name: string;
109
+ role: string;
110
+ status: 'idle' | 'busy' | 'paused';
111
+ currentTask?: string;
112
+ lastThought?: string;
113
+ lastToolCall?: {
114
+ tool: string;
115
+ input: unknown;
116
+ output?: unknown;
117
+ };
118
+ memory: Map<string, unknown>;
119
+ }
120
+ interface StepResult {
121
+ event: CrewEvent;
122
+ breakpointHit?: Breakpoint;
123
+ agentStates: Map<string, AgentInspection>;
124
+ continueExecution: boolean;
125
+ }
126
+ interface DebugModeConfig {
127
+ pauseOnError?: boolean;
128
+ verbose?: boolean;
129
+ maxCallStackDepth?: number;
130
+ }
131
+ declare class DebugMode extends EventEmitter<{
132
+ breakpointHit: (breakpoint: Breakpoint, event: CrewEvent) => void;
133
+ step: (result: StepResult) => void;
134
+ error: (error: Error) => void;
135
+ paused: () => void;
136
+ resumed: () => void;
137
+ }> {
138
+ private readonly crew;
139
+ private readonly config;
140
+ private readonly breakpoints;
141
+ private readonly eventQueue;
142
+ private readonly callStack;
143
+ private context;
144
+ private enabled;
145
+ private paused;
146
+ private stepMode;
147
+ private breakpointCounter;
148
+ private resolveStep?;
149
+ constructor(crew: Crew, config?: DebugModeConfig);
150
+ enable(): void;
151
+ disable(): void;
152
+ isEnabled(): boolean;
153
+ setBreakpoint(type: BreakpointType, condition?: (event: CrewEvent, context: DebugContext) => boolean): string;
154
+ removeBreakpoint(id: string): boolean;
155
+ enableBreakpoint(id: string): boolean;
156
+ disableBreakpoint(id: string): boolean;
157
+ getBreakpoints(): Breakpoint[];
158
+ clearBreakpoints(): void;
159
+ step(): Promise<StepResult>;
160
+ continue(): Promise<void>;
161
+ pause(): void;
162
+ resume(): void;
163
+ isPaused(): boolean;
164
+ inspect(agentName: string): AgentInspection | undefined;
165
+ inspectAll(): Map<string, AgentInspection>;
166
+ getContext(): DebugContext;
167
+ getCallStack(): string[];
168
+ evaluate(expression: string): unknown;
169
+ watch(expression: string): {
170
+ expression: string;
171
+ value: unknown;
172
+ };
173
+ handleEvent(event: CrewEvent): void;
174
+ private createContext;
175
+ private updateContext;
176
+ private checkBreakpoints;
177
+ private getAgentStates;
178
+ private createAgentInspection;
179
+ getSummary(): {
180
+ enabled: boolean;
181
+ paused: boolean;
182
+ stepMode: boolean;
183
+ breakpointCount: number;
184
+ queuedEvents: number;
185
+ callStackDepth: number;
186
+ };
187
+ }
188
+ declare function createDebugMode(crew: Crew, config?: DebugModeConfig): DebugMode;
189
+
190
+ export { type AgentInspection as A, type Breakpoint as B, CrewDashboard as C, DebugMode as D, type StepResult as S, type AgentStatus as a, type BreakpointType as b, type DashboardConfig as c, type DashboardSnapshot as d, type DashboardUpdate as e, type DebugContext as f, type DebugModeConfig as g, createDashboard as h, createDebugMode as i };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCrew
3
- } from "./chunk-QMK3HWFX.mjs";
3
+ } from "./chunk-J5KQSOGT.mjs";
4
4
 
5
5
  // src/templates/ResearchCrew.ts
6
6
  var researcherRole = {