@compilr-dev/sdk 0.1.28 → 0.2.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.
- package/dist/agent.js +16 -4
- package/dist/config.d.ts +12 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +27 -1
- package/dist/team/activity.d.ts +21 -0
- package/dist/team/activity.js +34 -0
- package/dist/team/agent-selection.d.ts +53 -0
- package/dist/team/agent-selection.js +88 -0
- package/dist/team/artifacts.d.ts +175 -0
- package/dist/team/artifacts.js +279 -0
- package/dist/team/collision-utils.d.ts +16 -0
- package/dist/team/collision-utils.js +28 -0
- package/dist/team/context-resolver.d.ts +97 -0
- package/dist/team/context-resolver.js +322 -0
- package/dist/team/custom-agents.d.ts +68 -0
- package/dist/team/custom-agents.js +150 -0
- package/dist/team/delegation-tracker.d.ts +147 -0
- package/dist/team/delegation-tracker.js +215 -0
- package/dist/team/index.d.ts +34 -0
- package/dist/team/index.js +30 -0
- package/dist/team/interfaces.d.ts +36 -0
- package/dist/team/interfaces.js +7 -0
- package/dist/team/mention-parser.d.ts +64 -0
- package/dist/team/mention-parser.js +138 -0
- package/dist/team/shared-context.d.ts +293 -0
- package/dist/team/shared-context.js +673 -0
- package/dist/team/skill-requirements.d.ts +66 -0
- package/dist/team/skill-requirements.js +178 -0
- package/dist/team/task-assignment.d.ts +69 -0
- package/dist/team/task-assignment.js +123 -0
- package/dist/team/task-suggestion.d.ts +31 -0
- package/dist/team/task-suggestion.js +84 -0
- package/dist/team/team-agent.d.ts +201 -0
- package/dist/team/team-agent.js +492 -0
- package/dist/team/team.d.ts +297 -0
- package/dist/team/team.js +615 -0
- package/dist/team/tool-config.d.ts +110 -0
- package/dist/team/tool-config.js +739 -0
- package/dist/team/types.d.ts +211 -0
- package/dist/team/types.js +638 -0
- package/package.json +1 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Agent Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the multi-agent team system.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentConfig, AgentState } from '@compilr-dev/agents';
|
|
7
|
+
import type { ModelTier } from '../models/index.js';
|
|
8
|
+
export type ToolProfile = 'full' | 'read-only' | 'developer' | 'security' | 'docs' | 'devops' | 'qa' | 'architect' | 'planner' | 'analyst' | 'custom';
|
|
9
|
+
/**
|
|
10
|
+
* Information about a background agent session.
|
|
11
|
+
* Used by /bg overlay to display status.
|
|
12
|
+
*/
|
|
13
|
+
export interface BackgroundSessionInfo {
|
|
14
|
+
/** Agent ID */
|
|
15
|
+
agentId: string;
|
|
16
|
+
/** Agent display name */
|
|
17
|
+
displayName: string;
|
|
18
|
+
/** Agent mascot */
|
|
19
|
+
mascot: string;
|
|
20
|
+
/** Current action being performed */
|
|
21
|
+
currentAction: string | null;
|
|
22
|
+
/** Whether the agent is blocked waiting for user input */
|
|
23
|
+
isBlocked: boolean;
|
|
24
|
+
/** Number of pending requests from this agent */
|
|
25
|
+
pendingCount: number;
|
|
26
|
+
/** Number of messages queued for this agent */
|
|
27
|
+
queuedCount: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Mascot expressions for visual differentiation of agents
|
|
31
|
+
*/
|
|
32
|
+
export type MascotExpression = '[•_•]' | '[◈_◈]' | '[▣_▣]' | '[◉_◉]' | '[▲_▲]' | '[◆_◆]' | '[○_○]' | '[◇_◇]' | '[□_□]';
|
|
33
|
+
/**
|
|
34
|
+
* Predefined agent roles with default configurations
|
|
35
|
+
*/
|
|
36
|
+
export type AgentRole = 'default' | 'pm' | 'arch' | 'qa' | 'dev' | 'ops' | 'docs' | 'ba' | 'custom';
|
|
37
|
+
/**
|
|
38
|
+
* List of predefined role IDs (for validation against custom agent IDs)
|
|
39
|
+
*/
|
|
40
|
+
export declare const PREDEFINED_ROLE_IDS: readonly ["default", "pm", "arch", "qa", "dev", "ops", "docs", "ba"];
|
|
41
|
+
/**
|
|
42
|
+
* Role metadata for predefined roles
|
|
43
|
+
*/
|
|
44
|
+
export interface RoleMetadata {
|
|
45
|
+
displayName: string;
|
|
46
|
+
mascot: MascotExpression;
|
|
47
|
+
description: string;
|
|
48
|
+
defaultSystemPromptAddition?: string;
|
|
49
|
+
/** Use minimal system prompt - skip all modules, just use role prompt (for testing) */
|
|
50
|
+
useMinimalSystemPrompt?: boolean;
|
|
51
|
+
/** Skip all tool registration - agent has no tools (for testing role identity) */
|
|
52
|
+
noTools?: boolean;
|
|
53
|
+
/** Default tool profile for this role */
|
|
54
|
+
defaultToolProfile?: ToolProfile;
|
|
55
|
+
/** Default model tier for this role */
|
|
56
|
+
defaultModelTier?: ModelTier;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Role expertise keywords for team awareness
|
|
60
|
+
* Used in the team roster to help agents understand each other's strengths
|
|
61
|
+
*/
|
|
62
|
+
export declare const ROLE_EXPERTISE: Record<AgentRole, string[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Predefined role configurations
|
|
65
|
+
*/
|
|
66
|
+
export declare const ROLE_METADATA: Record<AgentRole, RoleMetadata>;
|
|
67
|
+
/**
|
|
68
|
+
* Configuration for creating a team agent
|
|
69
|
+
*/
|
|
70
|
+
export interface TeamAgentConfig {
|
|
71
|
+
/**
|
|
72
|
+
* Unique identifier for the agent (e.g., 'pm', 'arch', 'qa')
|
|
73
|
+
* Used for $name switching
|
|
74
|
+
*/
|
|
75
|
+
id: string;
|
|
76
|
+
/**
|
|
77
|
+
* Display name shown in UI (e.g., 'Technical PM')
|
|
78
|
+
*/
|
|
79
|
+
displayName: string;
|
|
80
|
+
/**
|
|
81
|
+
* Mascot expression for visual differentiation
|
|
82
|
+
*/
|
|
83
|
+
mascot: MascotExpression;
|
|
84
|
+
/**
|
|
85
|
+
* Role type (for presets)
|
|
86
|
+
*/
|
|
87
|
+
role: AgentRole;
|
|
88
|
+
/**
|
|
89
|
+
* Optional description of the agent's purpose
|
|
90
|
+
*/
|
|
91
|
+
description?: string;
|
|
92
|
+
/**
|
|
93
|
+
* System prompt addition specific to this agent
|
|
94
|
+
* Appended to the base system prompt
|
|
95
|
+
*/
|
|
96
|
+
systemPromptAddition?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Use minimal system prompt - skip all modules, just use role prompt
|
|
99
|
+
*/
|
|
100
|
+
useMinimalSystemPrompt?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Skip all tool registration - agent has no tools
|
|
103
|
+
*/
|
|
104
|
+
noTools?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Tool filter - which tools this agent can use
|
|
107
|
+
* If not specified, inherits all tools from the team
|
|
108
|
+
*/
|
|
109
|
+
toolFilter?: string[];
|
|
110
|
+
/**
|
|
111
|
+
* Tool profile name (for display purposes)
|
|
112
|
+
* Shows which profile was selected when creating the agent
|
|
113
|
+
*/
|
|
114
|
+
toolProfile?: ToolProfile;
|
|
115
|
+
/**
|
|
116
|
+
* Enabled skills for this agent
|
|
117
|
+
* Empty array means all skills, non-empty means filtered
|
|
118
|
+
*/
|
|
119
|
+
enabledSkills?: string[];
|
|
120
|
+
/**
|
|
121
|
+
* Model tier for this agent (fast/balanced/powerful)
|
|
122
|
+
* Determines which model is used based on provider
|
|
123
|
+
* If not specified, uses role default or 'balanced'
|
|
124
|
+
*/
|
|
125
|
+
modelTier?: ModelTier;
|
|
126
|
+
/**
|
|
127
|
+
* Auto-approve handoffs from this agent without showing the approval overlay.
|
|
128
|
+
* Default: false (user must approve each handoff)
|
|
129
|
+
*/
|
|
130
|
+
autoApproveHandoff?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Base agent configuration (provider, model, etc.)
|
|
133
|
+
* If not specified, inherits from team defaults
|
|
134
|
+
*/
|
|
135
|
+
agentConfig?: Partial<AgentConfig>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Serialized team agent state for persistence
|
|
139
|
+
*/
|
|
140
|
+
export interface SerializedTeamAgent {
|
|
141
|
+
id: string;
|
|
142
|
+
displayName: string;
|
|
143
|
+
mascot: MascotExpression;
|
|
144
|
+
role: AgentRole;
|
|
145
|
+
description?: string;
|
|
146
|
+
systemPromptAddition?: string;
|
|
147
|
+
useMinimalSystemPrompt?: boolean;
|
|
148
|
+
noTools?: boolean;
|
|
149
|
+
toolFilter?: string[];
|
|
150
|
+
toolProfile?: ToolProfile;
|
|
151
|
+
enabledSkills?: string[];
|
|
152
|
+
modelTier?: ModelTier;
|
|
153
|
+
autoApproveHandoff?: boolean;
|
|
154
|
+
agentState?: AgentState;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Team metadata for persistence
|
|
158
|
+
*/
|
|
159
|
+
export interface TeamMetadata {
|
|
160
|
+
/**
|
|
161
|
+
* Team name
|
|
162
|
+
*/
|
|
163
|
+
name: string;
|
|
164
|
+
/**
|
|
165
|
+
* Currently active agent ID
|
|
166
|
+
*/
|
|
167
|
+
activeAgentId: string;
|
|
168
|
+
/**
|
|
169
|
+
* Coordinator agent ID (optional)
|
|
170
|
+
* If set, all messages go through coordinator first
|
|
171
|
+
*/
|
|
172
|
+
coordinatorId?: string;
|
|
173
|
+
/**
|
|
174
|
+
* List of agent IDs in the team
|
|
175
|
+
*/
|
|
176
|
+
agentIds: string[];
|
|
177
|
+
/**
|
|
178
|
+
* Creation timestamp
|
|
179
|
+
*/
|
|
180
|
+
createdAt: string;
|
|
181
|
+
/**
|
|
182
|
+
* Last updated timestamp
|
|
183
|
+
*/
|
|
184
|
+
updatedAt: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Full serialized team state for persistence
|
|
188
|
+
*/
|
|
189
|
+
export interface SerializedTeam {
|
|
190
|
+
metadata: TeamMetadata;
|
|
191
|
+
agents: SerializedTeamAgent[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Event types for team operations
|
|
195
|
+
*/
|
|
196
|
+
export type TeamEventType = 'agent:added' | 'agent:removed' | 'agent:switched' | 'agent:switch_warning' | 'agent:collision' | 'agent:message' | 'team:checkpoint' | 'team:restored' | 'team:reset';
|
|
197
|
+
/**
|
|
198
|
+
* Team event payload
|
|
199
|
+
*/
|
|
200
|
+
export interface TeamEvent {
|
|
201
|
+
type: TeamEventType;
|
|
202
|
+
agentId?: string;
|
|
203
|
+
previousAgentId?: string;
|
|
204
|
+
/** Original ID before collision resolution (for agent:collision events) */
|
|
205
|
+
originalId?: string;
|
|
206
|
+
message?: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Team event handler
|
|
210
|
+
*/
|
|
211
|
+
export type TeamEventHandler = (event: TeamEvent) => void;
|