autonomous-agents 0.1.0 → 2.0.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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +9 -0
- package/README.md +260 -96
- package/dist/actions.d.ts +136 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +303 -0
- package/dist/actions.js.map +1 -0
- package/dist/agent.d.ts +49 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +452 -0
- package/dist/agent.js.map +1 -0
- package/dist/goals.d.ts +138 -0
- package/dist/goals.d.ts.map +1 -0
- package/dist/goals.js +342 -0
- package/dist/goals.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics.d.ts +245 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +436 -0
- package/dist/metrics.js.map +1 -0
- package/dist/role.d.ts +122 -0
- package/dist/role.d.ts.map +1 -0
- package/dist/role.js +393 -0
- package/dist/role.js.map +1 -0
- package/dist/team.d.ts +152 -0
- package/dist/team.d.ts.map +1 -0
- package/dist/team.js +347 -0
- package/dist/team.js.map +1 -0
- package/dist/types.d.ts +327 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +27 -36
- package/src/actions.ts +366 -0
- package/src/agent.ts +548 -0
- package/src/goals.ts +435 -0
- package/src/index.ts +135 -0
- package/src/metrics.ts +591 -0
- package/src/role.ts +422 -0
- package/src/team.ts +466 -0
- package/src/types.ts +356 -0
- package/test/actions.test.ts +522 -0
- package/test/agent.test.ts +490 -0
- package/test/goals.test.ts +570 -0
- package/test/metrics.test.ts +707 -0
- package/test/role.test.ts +423 -0
- package/test/team.test.ts +708 -0
- package/tsconfig.json +9 -0
package/dist/team.js
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team - Define and coordinate a team of agents and humans
|
|
3
|
+
*
|
|
4
|
+
* Teams enable collaboration and coordination between multiple agents
|
|
5
|
+
* and human workers working toward shared goals.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Create a team
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Team, Agent, Role } from 'autonomous-agents'
|
|
15
|
+
*
|
|
16
|
+
* const productTeam = Team({
|
|
17
|
+
* name: 'Product Development',
|
|
18
|
+
* description: 'Cross-functional team building product features',
|
|
19
|
+
* members: [
|
|
20
|
+
* {
|
|
21
|
+
* id: 'pm-1',
|
|
22
|
+
* name: 'Sarah',
|
|
23
|
+
* type: 'human',
|
|
24
|
+
* role: Roles.ProductManager,
|
|
25
|
+
* status: 'active',
|
|
26
|
+
* availability: 'available',
|
|
27
|
+
* },
|
|
28
|
+
* {
|
|
29
|
+
* id: 'dev-agent-1',
|
|
30
|
+
* name: 'DevAgent',
|
|
31
|
+
* type: 'agent',
|
|
32
|
+
* role: Roles.SoftwareEngineer,
|
|
33
|
+
* status: 'active',
|
|
34
|
+
* availability: 'available',
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* goals: [
|
|
38
|
+
* {
|
|
39
|
+
* id: 'q1-goal',
|
|
40
|
+
* description: 'Launch new feature X',
|
|
41
|
+
* target: '100%',
|
|
42
|
+
* deadline: new Date('2024-03-31'),
|
|
43
|
+
* priority: 'high',
|
|
44
|
+
* },
|
|
45
|
+
* ],
|
|
46
|
+
* channels: [
|
|
47
|
+
* { id: 'team-slack', type: 'slack', config: { channel: '#product-dev' } },
|
|
48
|
+
* ],
|
|
49
|
+
* })
|
|
50
|
+
*
|
|
51
|
+
* // Add a new member
|
|
52
|
+
* team.addMember({
|
|
53
|
+
* id: 'designer-1',
|
|
54
|
+
* name: 'Alex',
|
|
55
|
+
* type: 'human',
|
|
56
|
+
* role: Roles.Designer,
|
|
57
|
+
* })
|
|
58
|
+
*
|
|
59
|
+
* // Broadcast to team
|
|
60
|
+
* await team.broadcast('Starting sprint planning!')
|
|
61
|
+
*
|
|
62
|
+
* // Get available members
|
|
63
|
+
* const available = team.getAvailableMembers()
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export function Team(config) {
|
|
67
|
+
const team = {
|
|
68
|
+
id: generateTeamId(config.name),
|
|
69
|
+
name: config.name,
|
|
70
|
+
description: config.description,
|
|
71
|
+
members: config.members || [],
|
|
72
|
+
goals: config.goals,
|
|
73
|
+
context: config.context,
|
|
74
|
+
channels: config.channels,
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
...team,
|
|
78
|
+
addMember,
|
|
79
|
+
removeMember,
|
|
80
|
+
getMember,
|
|
81
|
+
getMembers,
|
|
82
|
+
getAvailableMembers,
|
|
83
|
+
getMembersByRole,
|
|
84
|
+
getMembersByType,
|
|
85
|
+
updateMember,
|
|
86
|
+
addGoal,
|
|
87
|
+
updateGoal,
|
|
88
|
+
removeGoal,
|
|
89
|
+
getGoals,
|
|
90
|
+
addChannel,
|
|
91
|
+
removeChannel,
|
|
92
|
+
broadcast,
|
|
93
|
+
sendTo,
|
|
94
|
+
updateContext,
|
|
95
|
+
getContext,
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Add a member to the team
|
|
99
|
+
*/
|
|
100
|
+
function addMember(member) {
|
|
101
|
+
const existing = team.members.find(m => m.id === member.id);
|
|
102
|
+
if (existing) {
|
|
103
|
+
throw new Error(`Member with id ${member.id} already exists`);
|
|
104
|
+
}
|
|
105
|
+
team.members.push(member);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Remove a member from the team
|
|
109
|
+
*/
|
|
110
|
+
function removeMember(memberId) {
|
|
111
|
+
const index = team.members.findIndex(m => m.id === memberId);
|
|
112
|
+
if (index === -1)
|
|
113
|
+
return false;
|
|
114
|
+
team.members.splice(index, 1);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get a specific member
|
|
119
|
+
*/
|
|
120
|
+
function getMember(memberId) {
|
|
121
|
+
return team.members.find(m => m.id === memberId);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get all members
|
|
125
|
+
*/
|
|
126
|
+
function getMembers() {
|
|
127
|
+
return [...team.members];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get available members
|
|
131
|
+
*/
|
|
132
|
+
function getAvailableMembers() {
|
|
133
|
+
return team.members.filter(m => m.status === 'active' && m.availability === 'available');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Get members by role
|
|
137
|
+
*/
|
|
138
|
+
function getMembersByRole(roleId) {
|
|
139
|
+
return team.members.filter(m => m.role.id === roleId);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get members by type
|
|
143
|
+
*/
|
|
144
|
+
function getMembersByType(type) {
|
|
145
|
+
return team.members.filter(m => m.type === type);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Update a member
|
|
149
|
+
*/
|
|
150
|
+
function updateMember(memberId, updates) {
|
|
151
|
+
const member = team.members.find(m => m.id === memberId);
|
|
152
|
+
if (!member) {
|
|
153
|
+
throw new Error(`Member with id ${memberId} not found`);
|
|
154
|
+
}
|
|
155
|
+
Object.assign(member, updates);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Add a goal
|
|
159
|
+
*/
|
|
160
|
+
function addGoal(goal) {
|
|
161
|
+
if (!team.goals) {
|
|
162
|
+
team.goals = [];
|
|
163
|
+
}
|
|
164
|
+
team.goals.push(goal);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Update a goal
|
|
168
|
+
*/
|
|
169
|
+
function updateGoal(goalId, updates) {
|
|
170
|
+
const goal = team.goals?.find(g => g.id === goalId);
|
|
171
|
+
if (!goal) {
|
|
172
|
+
throw new Error(`Goal with id ${goalId} not found`);
|
|
173
|
+
}
|
|
174
|
+
Object.assign(goal, updates);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Remove a goal
|
|
178
|
+
*/
|
|
179
|
+
function removeGoal(goalId) {
|
|
180
|
+
if (!team.goals)
|
|
181
|
+
return false;
|
|
182
|
+
const index = team.goals.findIndex(g => g.id === goalId);
|
|
183
|
+
if (index === -1)
|
|
184
|
+
return false;
|
|
185
|
+
team.goals.splice(index, 1);
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Get all goals
|
|
190
|
+
*/
|
|
191
|
+
function getGoals() {
|
|
192
|
+
return team.goals ? [...team.goals] : [];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Add a communication channel
|
|
196
|
+
*/
|
|
197
|
+
function addChannel(channel) {
|
|
198
|
+
if (!team.channels) {
|
|
199
|
+
team.channels = [];
|
|
200
|
+
}
|
|
201
|
+
team.channels.push(channel);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Remove a communication channel
|
|
205
|
+
*/
|
|
206
|
+
function removeChannel(channelId) {
|
|
207
|
+
if (!team.channels)
|
|
208
|
+
return false;
|
|
209
|
+
const index = team.channels.findIndex(c => c.id === channelId);
|
|
210
|
+
if (index === -1)
|
|
211
|
+
return false;
|
|
212
|
+
team.channels.splice(index, 1);
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Broadcast message to all team members
|
|
217
|
+
*/
|
|
218
|
+
async function broadcast(message, channelType) {
|
|
219
|
+
const channels = channelType
|
|
220
|
+
? team.channels?.filter(c => c.type === channelType)
|
|
221
|
+
: team.channels;
|
|
222
|
+
if (!channels || channels.length === 0) {
|
|
223
|
+
console.log(`[Team: ${team.name}] Broadcast: ${message}`);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
// In a real implementation, this would send via the specified channels
|
|
227
|
+
for (const channel of channels) {
|
|
228
|
+
console.log(`[Team: ${team.name}] [${channel.type}:${channel.id}] ${message}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Send message to specific team members
|
|
233
|
+
*/
|
|
234
|
+
async function sendTo(memberIds, message, channelType) {
|
|
235
|
+
const members = team.members.filter(m => memberIds.includes(m.id));
|
|
236
|
+
if (members.length === 0) {
|
|
237
|
+
throw new Error('No valid members found');
|
|
238
|
+
}
|
|
239
|
+
// In a real implementation, this would send via appropriate channels
|
|
240
|
+
for (const member of members) {
|
|
241
|
+
console.log(`[Team: ${team.name}] To ${member.name}: ${message}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Update team context
|
|
246
|
+
*/
|
|
247
|
+
function updateContext(key, value) {
|
|
248
|
+
if (!team.context) {
|
|
249
|
+
team.context = {};
|
|
250
|
+
}
|
|
251
|
+
team.context[key] = value;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get team context
|
|
255
|
+
*/
|
|
256
|
+
function getContext(key) {
|
|
257
|
+
if (!team.context)
|
|
258
|
+
return (key ? undefined : {});
|
|
259
|
+
if (key)
|
|
260
|
+
return team.context[key];
|
|
261
|
+
return { ...team.context };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Generate a team ID from name
|
|
266
|
+
*/
|
|
267
|
+
function generateTeamId(name) {
|
|
268
|
+
return `team-${name.toLowerCase().replace(/\s+/g, '-')}`;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Create a team member entry
|
|
272
|
+
*/
|
|
273
|
+
export function createTeamMember(config) {
|
|
274
|
+
return {
|
|
275
|
+
id: config.id,
|
|
276
|
+
name: config.name,
|
|
277
|
+
type: config.type,
|
|
278
|
+
role: config.role,
|
|
279
|
+
status: config.status || 'active',
|
|
280
|
+
availability: config.availability || 'available',
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Create a team member from an agent
|
|
285
|
+
*/
|
|
286
|
+
export function teamMemberFromAgent(agent) {
|
|
287
|
+
return {
|
|
288
|
+
id: agent.config.name,
|
|
289
|
+
name: agent.config.name,
|
|
290
|
+
type: 'agent',
|
|
291
|
+
role: agent.config.role,
|
|
292
|
+
status: agent.status === 'idle' || agent.status === 'completed' ? 'active' : 'active',
|
|
293
|
+
availability: agent.status === 'idle' ? 'available' : 'busy',
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Calculate team capacity based on available members
|
|
298
|
+
*/
|
|
299
|
+
export function calculateTeamCapacity(team) {
|
|
300
|
+
const members = team.getMembers();
|
|
301
|
+
const available = members.filter(m => m.availability === 'available').length;
|
|
302
|
+
const busy = members.filter(m => m.availability === 'busy').length;
|
|
303
|
+
const offline = members.filter(m => m.availability === 'offline').length;
|
|
304
|
+
return {
|
|
305
|
+
total: members.length,
|
|
306
|
+
available,
|
|
307
|
+
busy,
|
|
308
|
+
offline,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get team skills - aggregated from all members
|
|
313
|
+
*/
|
|
314
|
+
export function getTeamSkills(team) {
|
|
315
|
+
const skills = new Set();
|
|
316
|
+
team.getMembers().forEach(member => {
|
|
317
|
+
member.role.skills.forEach(skill => skills.add(skill));
|
|
318
|
+
});
|
|
319
|
+
return Array.from(skills);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Check if team has a specific skill
|
|
323
|
+
*/
|
|
324
|
+
export function teamHasSkill(team, skill) {
|
|
325
|
+
return team.getMembers().some(member => member.role.skills.some(s => s.toLowerCase() === skill.toLowerCase() ||
|
|
326
|
+
s.toLowerCase().includes(skill.toLowerCase())));
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Find best member for a task based on role skills
|
|
330
|
+
*/
|
|
331
|
+
export function findBestMemberForTask(team, requiredSkills) {
|
|
332
|
+
const availableMembers = team.getAvailableMembers();
|
|
333
|
+
if (availableMembers.length === 0)
|
|
334
|
+
return null;
|
|
335
|
+
// Score each member based on skill matches
|
|
336
|
+
const scored = availableMembers.map(member => {
|
|
337
|
+
const matchingSkills = requiredSkills.filter(skill => member.role.skills.some(s => s.toLowerCase().includes(skill.toLowerCase())));
|
|
338
|
+
return {
|
|
339
|
+
member,
|
|
340
|
+
score: matchingSkills.length,
|
|
341
|
+
};
|
|
342
|
+
});
|
|
343
|
+
// Sort by score descending
|
|
344
|
+
scored.sort((a, b) => b.score - a.score);
|
|
345
|
+
return scored.length > 0 && scored[0].score > 0 ? scored[0].member : null;
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=team.js.map
|
package/dist/team.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../src/team.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,UAAU,IAAI,CAAC,MAOpB;IACC,MAAM,IAAI,GAAa;QACrB,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;QAC7B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAA;IAED,OAAO;QACL,GAAG,IAAI;QACP,SAAS;QACT,YAAY;QACZ,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,YAAY;QACZ,OAAO;QACP,UAAU;QACV,UAAU;QACV,QAAQ;QACR,UAAU;QACV,aAAa;Q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CAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7E,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for autonomous-agents
|
|
3
|
+
*
|
|
4
|
+
* Primitives for building and orchestrating autonomous AI agents that operate
|
|
5
|
+
* within a company boundary using the digital-workers interface.
|
|
6
|
+
*/
|
|
7
|
+
import type { AIFunctionDefinition, AIGenerateOptions, SimpleSchema } from 'ai-functions';
|
|
8
|
+
export type { AIFunctionDefinition };
|
|
9
|
+
/**
|
|
10
|
+
* Agent execution mode determines how the agent processes tasks
|
|
11
|
+
*/
|
|
12
|
+
export type AgentMode = 'autonomous' | 'supervised' | 'manual';
|
|
13
|
+
/**
|
|
14
|
+
* Agent status during execution
|
|
15
|
+
*/
|
|
16
|
+
export type AgentStatus = 'idle' | 'thinking' | 'acting' | 'waiting' | 'completed' | 'error';
|
|
17
|
+
/**
|
|
18
|
+
* Priority levels for tasks and decisions
|
|
19
|
+
*/
|
|
20
|
+
export type Priority = 'low' | 'medium' | 'high' | 'urgent';
|
|
21
|
+
/**
|
|
22
|
+
* Decision approval status
|
|
23
|
+
*/
|
|
24
|
+
export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
|
|
25
|
+
/**
|
|
26
|
+
* Role definition for an agent or human worker
|
|
27
|
+
*/
|
|
28
|
+
export interface Role {
|
|
29
|
+
/** Unique role identifier */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Role name (e.g., "Product Manager", "Software Engineer") */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Role description and responsibilities */
|
|
34
|
+
description: string;
|
|
35
|
+
/** Skills and capabilities required for this role */
|
|
36
|
+
skills: string[];
|
|
37
|
+
/** Permissions and access levels */
|
|
38
|
+
permissions?: string[];
|
|
39
|
+
/** Tools available to this role */
|
|
40
|
+
tools?: AIFunctionDefinition[];
|
|
41
|
+
/** Expected outputs from this role */
|
|
42
|
+
outputs?: string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Team composition and coordination
|
|
46
|
+
*/
|
|
47
|
+
export interface Team {
|
|
48
|
+
/** Unique team identifier */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Team name */
|
|
51
|
+
name: string;
|
|
52
|
+
/** Team description and purpose */
|
|
53
|
+
description?: string;
|
|
54
|
+
/** Team members (agents and humans) */
|
|
55
|
+
members: TeamMember[];
|
|
56
|
+
/** Team goals */
|
|
57
|
+
goals?: Goal[];
|
|
58
|
+
/** Shared context for the team */
|
|
59
|
+
context?: Record<string, unknown>;
|
|
60
|
+
/** Communication channels */
|
|
61
|
+
channels?: CommunicationChannel[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Team member representation
|
|
65
|
+
*/
|
|
66
|
+
export interface TeamMember {
|
|
67
|
+
/** Member ID (agent or human) */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Member name */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Member role on the team */
|
|
72
|
+
role: Role;
|
|
73
|
+
/** Member type */
|
|
74
|
+
type: 'agent' | 'human';
|
|
75
|
+
/** Member status */
|
|
76
|
+
status?: 'active' | 'inactive' | 'away';
|
|
77
|
+
/** Member availability */
|
|
78
|
+
availability?: 'available' | 'busy' | 'offline';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Communication channel for team collaboration
|
|
82
|
+
*/
|
|
83
|
+
export interface CommunicationChannel {
|
|
84
|
+
/** Channel identifier */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Channel type */
|
|
87
|
+
type: 'slack' | 'email' | 'web' | 'sms' | 'custom';
|
|
88
|
+
/** Channel configuration */
|
|
89
|
+
config: Record<string, unknown>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Goal definition with measurable outcomes
|
|
93
|
+
*/
|
|
94
|
+
export interface Goal {
|
|
95
|
+
/** Unique goal identifier */
|
|
96
|
+
id: string;
|
|
97
|
+
/** Goal description */
|
|
98
|
+
description: string;
|
|
99
|
+
/** Target outcome or metric */
|
|
100
|
+
target: string | number;
|
|
101
|
+
/** Current progress */
|
|
102
|
+
progress?: string | number;
|
|
103
|
+
/** Goal deadline */
|
|
104
|
+
deadline?: Date;
|
|
105
|
+
/** Goal priority */
|
|
106
|
+
priority?: Priority;
|
|
107
|
+
/** Goal status */
|
|
108
|
+
status?: 'active' | 'completed' | 'blocked' | 'cancelled';
|
|
109
|
+
/** Sub-goals */
|
|
110
|
+
subgoals?: Goal[];
|
|
111
|
+
/** Success criteria */
|
|
112
|
+
successCriteria?: string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Agent configuration and behavior
|
|
116
|
+
*/
|
|
117
|
+
export interface AgentConfig {
|
|
118
|
+
/** Agent name */
|
|
119
|
+
name: string;
|
|
120
|
+
/** Agent description and purpose */
|
|
121
|
+
description?: string;
|
|
122
|
+
/** Agent role */
|
|
123
|
+
role: Role;
|
|
124
|
+
/** Agent execution mode */
|
|
125
|
+
mode?: AgentMode;
|
|
126
|
+
/** Agent goals */
|
|
127
|
+
goals?: Goal[];
|
|
128
|
+
/** Agent tools (functions) */
|
|
129
|
+
tools?: AIFunctionDefinition[];
|
|
130
|
+
/** Agent memory/context */
|
|
131
|
+
context?: Record<string, unknown>;
|
|
132
|
+
/** Model to use for agent reasoning */
|
|
133
|
+
model?: string;
|
|
134
|
+
/** System prompt for the agent */
|
|
135
|
+
system?: string;
|
|
136
|
+
/** Maximum iterations per task */
|
|
137
|
+
maxIterations?: number;
|
|
138
|
+
/** Temperature for AI generation */
|
|
139
|
+
temperature?: number;
|
|
140
|
+
/** Team the agent belongs to */
|
|
141
|
+
team?: Team;
|
|
142
|
+
/** Approval requirements */
|
|
143
|
+
requiresApproval?: boolean;
|
|
144
|
+
/** Human supervisor (for supervised mode) */
|
|
145
|
+
supervisor?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Agent instance with methods and state
|
|
149
|
+
*/
|
|
150
|
+
export interface Agent {
|
|
151
|
+
/** Agent configuration */
|
|
152
|
+
config: AgentConfig;
|
|
153
|
+
/** Agent current status */
|
|
154
|
+
status: AgentStatus;
|
|
155
|
+
/** Agent state/memory */
|
|
156
|
+
state: Record<string, unknown>;
|
|
157
|
+
/** Execute a task */
|
|
158
|
+
do: <TResult = unknown>(task: string, context?: unknown) => Promise<TResult>;
|
|
159
|
+
/** Ask a question */
|
|
160
|
+
ask: <TResult = unknown>(question: string, context?: unknown) => Promise<TResult>;
|
|
161
|
+
/** Make a decision */
|
|
162
|
+
decide: <T extends string>(options: T[], context?: string) => Promise<T>;
|
|
163
|
+
/** Request approval */
|
|
164
|
+
approve: <TResult = unknown>(request: ApprovalRequest) => Promise<ApprovalResult<TResult>>;
|
|
165
|
+
/** Generate content */
|
|
166
|
+
generate: (options: AIGenerateOptions) => Promise<unknown>;
|
|
167
|
+
/** Type checking/validation */
|
|
168
|
+
is: (value: unknown, type: string | SimpleSchema) => Promise<boolean>;
|
|
169
|
+
/** Send notification */
|
|
170
|
+
notify: (message: string, channel?: string) => Promise<void>;
|
|
171
|
+
/** Update agent state */
|
|
172
|
+
setState: (key: string, value: unknown) => void;
|
|
173
|
+
/** Get agent state */
|
|
174
|
+
getState: <T = unknown>(key: string) => T | undefined;
|
|
175
|
+
/** Get agent history */
|
|
176
|
+
getHistory: () => AgentHistoryEntry[];
|
|
177
|
+
/** Reset agent state */
|
|
178
|
+
reset: () => void;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Approval request structure
|
|
182
|
+
*/
|
|
183
|
+
export interface ApprovalRequest {
|
|
184
|
+
/** Request title/summary */
|
|
185
|
+
title: string;
|
|
186
|
+
/** Detailed description */
|
|
187
|
+
description: string;
|
|
188
|
+
/** Data to be approved */
|
|
189
|
+
data: unknown;
|
|
190
|
+
/** Priority level */
|
|
191
|
+
priority?: Priority;
|
|
192
|
+
/** Approver (user ID, email, or role) */
|
|
193
|
+
approver?: string;
|
|
194
|
+
/** Timeout in milliseconds */
|
|
195
|
+
timeout?: number;
|
|
196
|
+
/** Channel for approval request */
|
|
197
|
+
channel?: 'slack' | 'email' | 'web' | 'sms' | 'custom';
|
|
198
|
+
/** Expected response schema */
|
|
199
|
+
responseSchema?: SimpleSchema;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Approval result
|
|
203
|
+
*/
|
|
204
|
+
export interface ApprovalResult<T = unknown> {
|
|
205
|
+
/** Approval status */
|
|
206
|
+
status: ApprovalStatus;
|
|
207
|
+
/** Response data */
|
|
208
|
+
response?: T;
|
|
209
|
+
/** Who approved/rejected */
|
|
210
|
+
approver?: string;
|
|
211
|
+
/** When the decision was made */
|
|
212
|
+
timestamp?: Date;
|
|
213
|
+
/** Optional notes */
|
|
214
|
+
notes?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Agent history entry
|
|
218
|
+
*/
|
|
219
|
+
export interface AgentHistoryEntry {
|
|
220
|
+
/** Timestamp */
|
|
221
|
+
timestamp: Date;
|
|
222
|
+
/** Action type */
|
|
223
|
+
type: 'task' | 'question' | 'decision' | 'approval' | 'notification' | 'error';
|
|
224
|
+
/** Action description */
|
|
225
|
+
action: string;
|
|
226
|
+
/** Input data */
|
|
227
|
+
input?: unknown;
|
|
228
|
+
/** Output result */
|
|
229
|
+
output?: unknown;
|
|
230
|
+
/** Error if any */
|
|
231
|
+
error?: string;
|
|
232
|
+
/** Duration in milliseconds */
|
|
233
|
+
duration?: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Key Performance Indicator
|
|
237
|
+
*/
|
|
238
|
+
export interface KPI {
|
|
239
|
+
/** KPI identifier */
|
|
240
|
+
id: string;
|
|
241
|
+
/** KPI name */
|
|
242
|
+
name: string;
|
|
243
|
+
/** KPI description */
|
|
244
|
+
description?: string;
|
|
245
|
+
/** Current value */
|
|
246
|
+
value: number | string;
|
|
247
|
+
/** Target value */
|
|
248
|
+
target?: number | string;
|
|
249
|
+
/** Unit of measurement */
|
|
250
|
+
unit?: string;
|
|
251
|
+
/** Measurement frequency */
|
|
252
|
+
frequency?: 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
|
|
253
|
+
/** Trend direction */
|
|
254
|
+
trend?: 'up' | 'down' | 'stable';
|
|
255
|
+
/** Historical data */
|
|
256
|
+
history?: Array<{
|
|
257
|
+
timestamp: Date;
|
|
258
|
+
value: number | string;
|
|
259
|
+
}>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Objectives and Key Results
|
|
263
|
+
*/
|
|
264
|
+
export interface OKR {
|
|
265
|
+
/** OKR identifier */
|
|
266
|
+
id: string;
|
|
267
|
+
/** Objective statement */
|
|
268
|
+
objective: string;
|
|
269
|
+
/** Objective description */
|
|
270
|
+
description?: string;
|
|
271
|
+
/** Key results */
|
|
272
|
+
keyResults: KeyResult[];
|
|
273
|
+
/** Time period */
|
|
274
|
+
period?: string;
|
|
275
|
+
/** Owner (agent, team, or person) */
|
|
276
|
+
owner?: string;
|
|
277
|
+
/** Status */
|
|
278
|
+
status?: 'active' | 'completed' | 'at-risk' | 'cancelled';
|
|
279
|
+
/** Overall progress (0-100) */
|
|
280
|
+
progress?: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Key Result within an OKR
|
|
284
|
+
*/
|
|
285
|
+
export interface KeyResult {
|
|
286
|
+
/** Key result identifier */
|
|
287
|
+
id: string;
|
|
288
|
+
/** Key result description */
|
|
289
|
+
description: string;
|
|
290
|
+
/** Current value */
|
|
291
|
+
current: number | string;
|
|
292
|
+
/** Target value */
|
|
293
|
+
target: number | string;
|
|
294
|
+
/** Unit of measurement */
|
|
295
|
+
unit?: string;
|
|
296
|
+
/** Progress (0-100) */
|
|
297
|
+
progress?: number;
|
|
298
|
+
/** Status */
|
|
299
|
+
status?: 'on-track' | 'at-risk' | 'off-track' | 'completed';
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Goals configuration
|
|
303
|
+
*/
|
|
304
|
+
export interface GoalsConfig {
|
|
305
|
+
/** Goals list */
|
|
306
|
+
goals: Goal[];
|
|
307
|
+
/** Strategy or context */
|
|
308
|
+
strategy?: string;
|
|
309
|
+
/** Time horizon */
|
|
310
|
+
timeHorizon?: string;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Notification options
|
|
314
|
+
*/
|
|
315
|
+
export interface NotificationOptions {
|
|
316
|
+
/** Message to send */
|
|
317
|
+
message: string;
|
|
318
|
+
/** Notification channel */
|
|
319
|
+
channel?: 'slack' | 'email' | 'web' | 'sms' | 'custom';
|
|
320
|
+
/** Recipients */
|
|
321
|
+
recipients?: string[];
|
|
322
|
+
/** Priority */
|
|
323
|
+
priority?: Priority;
|
|
324
|
+
/** Additional data */
|
|
325
|
+
data?: Record<string, unknown>;
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=types.d.ts.map
|