@levelcode/sdk 0.1.0 → 0.2.0

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.
Files changed (70) hide show
  1. package/README.md +104 -0
  2. package/dist/agents/constants.d.ts +1 -0
  3. package/dist/agents/team/apprentice.d.ts +3 -0
  4. package/dist/agents/team/coordinator.d.ts +3 -0
  5. package/dist/agents/team/cto.d.ts +3 -0
  6. package/dist/agents/team/designer.d.ts +3 -0
  7. package/dist/agents/team/director.d.ts +3 -0
  8. package/dist/agents/team/distinguished-engineer.d.ts +3 -0
  9. package/dist/agents/team/fellow.d.ts +3 -0
  10. package/dist/agents/team/index.d.ts +27 -0
  11. package/dist/agents/team/intern.d.ts +3 -0
  12. package/dist/agents/team/junior-engineer.d.ts +3 -0
  13. package/dist/agents/team/manager.d.ts +3 -0
  14. package/dist/agents/team/mid-level-engineer.d.ts +3 -0
  15. package/dist/agents/team/principal-engineer.d.ts +3 -0
  16. package/dist/agents/team/product-lead.d.ts +3 -0
  17. package/dist/agents/team/researcher.d.ts +3 -0
  18. package/dist/agents/team/role-hierarchy.d.ts +24 -0
  19. package/dist/agents/team/scientist.d.ts +3 -0
  20. package/dist/agents/team/senior-engineer.d.ts +3 -0
  21. package/dist/agents/team/senior-staff-engineer.d.ts +3 -0
  22. package/dist/agents/team/staff-engineer.d.ts +3 -0
  23. package/dist/agents/team/sub-manager.d.ts +3 -0
  24. package/dist/agents/team/tester.d.ts +3 -0
  25. package/dist/agents/team/vp-engineering.d.ts +3 -0
  26. package/dist/agents/types/agent-definition.d.ts +296 -0
  27. package/dist/agents/types/secret-agent-definition.d.ts +19 -0
  28. package/dist/agents/types/tools.d.ts +308 -0
  29. package/dist/agents/types/util-types.d.ts +134 -0
  30. package/dist/common/src/constants/analytics-events.d.ts +5 -1
  31. package/dist/common/src/constants/model-config.d.ts +1 -1
  32. package/dist/common/src/tools/list.d.ts +18 -6
  33. package/dist/common/src/tools/params/tool/run-file-change-hooks.d.ts +2 -2
  34. package/dist/common/src/tools/params/tool/run-terminal-command.d.ts +3 -3
  35. package/dist/common/src/tools/params/tool/send-message.d.ts +2 -2
  36. package/dist/common/src/tools/params/tool/task-create.d.ts +6 -0
  37. package/dist/common/src/tools/params/tool/task-update.d.ts +6 -0
  38. package/dist/common/src/types/print-mode.d.ts +2 -2
  39. package/dist/common/src/types/team-config-schemas.d.ts +213 -0
  40. package/dist/common/src/types/team-config.d.ts +4 -1
  41. package/dist/common/src/types/team-hook-events.d.ts +36 -0
  42. package/dist/common/src/utils/dev-phases.d.ts +23 -0
  43. package/dist/common/src/utils/file-lock.d.ts +13 -0
  44. package/dist/common/src/utils/team-analytics.d.ts +16 -0
  45. package/dist/common/src/utils/team-discovery.d.ts +47 -0
  46. package/dist/common/src/utils/team-fs.d.ts +9 -6
  47. package/dist/common/src/utils/team-hook-emitter.d.ts +40 -0
  48. package/dist/common/src/utils/team-presets.d.ts +35 -0
  49. package/dist/index.cjs +5339 -1554
  50. package/dist/index.cjs.map +62 -24
  51. package/dist/index.mjs +6027 -2242
  52. package/dist/index.mjs.map +62 -24
  53. package/dist/packages/agent-runtime/src/inbox-poller.d.ts +81 -0
  54. package/dist/packages/agent-runtime/src/message-formatter.d.ts +12 -0
  55. package/dist/packages/agent-runtime/src/system-prompt/team-context-prompt.d.ts +9 -0
  56. package/dist/packages/agent-runtime/src/system-prompt/team-prompt.d.ts +9 -0
  57. package/dist/packages/agent-runtime/src/team-context.d.ts +14 -0
  58. package/dist/packages/agent-runtime/src/templates/agent-registry.d.ts +1 -1
  59. package/dist/packages/agent-runtime/src/tools/handlers/list.d.ts +20 -1
  60. package/dist/packages/agent-runtime/src/tools/handlers/tool/send-message.d.ts +5 -0
  61. package/dist/packages/agent-runtime/src/tools/handlers/tool/spawn-agent-utils.d.ts +31 -1
  62. package/dist/packages/agent-runtime/src/tools/handlers/tool/spawn-agents.d.ts +2 -0
  63. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-completed.d.ts +9 -1
  64. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-update.d.ts +5 -0
  65. package/dist/packages/agent-runtime/src/tools/handlers/tool/team-create.d.ts +5 -0
  66. package/dist/packages/agent-runtime/src/tools/handlers/tool/team-delete.d.ts +5 -0
  67. package/dist/sdk/src/__tests__/team-api.test.d.ts +1 -0
  68. package/dist/sdk/src/client.d.ts +38 -0
  69. package/dist/sdk/src/team.d.ts +49 -0
  70. package/package.json +1 -1
@@ -0,0 +1,213 @@
1
+ import { z } from 'zod';
2
+ export declare const teamRoleSchema: z.ZodEnum<{
3
+ researcher: "researcher";
4
+ reviewer: "reviewer";
5
+ coordinator: "coordinator";
6
+ cto: "cto";
7
+ "vp-engineering": "vp-engineering";
8
+ director: "director";
9
+ fellow: "fellow";
10
+ "distinguished-engineer": "distinguished-engineer";
11
+ "principal-engineer": "principal-engineer";
12
+ "senior-staff-engineer": "senior-staff-engineer";
13
+ "staff-engineer": "staff-engineer";
14
+ manager: "manager";
15
+ "sub-manager": "sub-manager";
16
+ "senior-engineer": "senior-engineer";
17
+ "super-senior": "super-senior";
18
+ "mid-level-engineer": "mid-level-engineer";
19
+ "junior-engineer": "junior-engineer";
20
+ scientist: "scientist";
21
+ designer: "designer";
22
+ "product-lead": "product-lead";
23
+ tester: "tester";
24
+ intern: "intern";
25
+ apprentice: "apprentice";
26
+ }>;
27
+ export declare const devPhaseSchema: z.ZodEnum<{
28
+ planning: "planning";
29
+ "pre-alpha": "pre-alpha";
30
+ alpha: "alpha";
31
+ beta: "beta";
32
+ production: "production";
33
+ mature: "mature";
34
+ }>;
35
+ export declare const teamMemberSchema: z.ZodObject<{
36
+ agentId: z.ZodString;
37
+ name: z.ZodString;
38
+ role: z.ZodEnum<{
39
+ researcher: "researcher";
40
+ reviewer: "reviewer";
41
+ coordinator: "coordinator";
42
+ cto: "cto";
43
+ "vp-engineering": "vp-engineering";
44
+ director: "director";
45
+ fellow: "fellow";
46
+ "distinguished-engineer": "distinguished-engineer";
47
+ "principal-engineer": "principal-engineer";
48
+ "senior-staff-engineer": "senior-staff-engineer";
49
+ "staff-engineer": "staff-engineer";
50
+ manager: "manager";
51
+ "sub-manager": "sub-manager";
52
+ "senior-engineer": "senior-engineer";
53
+ "super-senior": "super-senior";
54
+ "mid-level-engineer": "mid-level-engineer";
55
+ "junior-engineer": "junior-engineer";
56
+ scientist: "scientist";
57
+ designer: "designer";
58
+ "product-lead": "product-lead";
59
+ tester: "tester";
60
+ intern: "intern";
61
+ apprentice: "apprentice";
62
+ }>;
63
+ agentType: z.ZodString;
64
+ model: z.ZodString;
65
+ joinedAt: z.ZodNumber;
66
+ status: z.ZodEnum<{
67
+ active: "active";
68
+ idle: "idle";
69
+ completed: "completed";
70
+ failed: "failed";
71
+ }>;
72
+ currentTaskId: z.ZodOptional<z.ZodString>;
73
+ cwd: z.ZodString;
74
+ }, z.core.$strip>;
75
+ export declare const teamConfigSchema: z.ZodObject<{
76
+ name: z.ZodString;
77
+ description: z.ZodString;
78
+ createdAt: z.ZodNumber;
79
+ leadAgentId: z.ZodString;
80
+ phase: z.ZodEnum<{
81
+ planning: "planning";
82
+ "pre-alpha": "pre-alpha";
83
+ alpha: "alpha";
84
+ beta: "beta";
85
+ production: "production";
86
+ mature: "mature";
87
+ }>;
88
+ members: z.ZodArray<z.ZodObject<{
89
+ agentId: z.ZodString;
90
+ name: z.ZodString;
91
+ role: z.ZodEnum<{
92
+ researcher: "researcher";
93
+ reviewer: "reviewer";
94
+ coordinator: "coordinator";
95
+ cto: "cto";
96
+ "vp-engineering": "vp-engineering";
97
+ director: "director";
98
+ fellow: "fellow";
99
+ "distinguished-engineer": "distinguished-engineer";
100
+ "principal-engineer": "principal-engineer";
101
+ "senior-staff-engineer": "senior-staff-engineer";
102
+ "staff-engineer": "staff-engineer";
103
+ manager: "manager";
104
+ "sub-manager": "sub-manager";
105
+ "senior-engineer": "senior-engineer";
106
+ "super-senior": "super-senior";
107
+ "mid-level-engineer": "mid-level-engineer";
108
+ "junior-engineer": "junior-engineer";
109
+ scientist: "scientist";
110
+ designer: "designer";
111
+ "product-lead": "product-lead";
112
+ tester: "tester";
113
+ intern: "intern";
114
+ apprentice: "apprentice";
115
+ }>;
116
+ agentType: z.ZodString;
117
+ model: z.ZodString;
118
+ joinedAt: z.ZodNumber;
119
+ status: z.ZodEnum<{
120
+ active: "active";
121
+ idle: "idle";
122
+ completed: "completed";
123
+ failed: "failed";
124
+ }>;
125
+ currentTaskId: z.ZodOptional<z.ZodString>;
126
+ cwd: z.ZodString;
127
+ }, z.core.$strip>>;
128
+ settings: z.ZodObject<{
129
+ maxMembers: z.ZodNumber;
130
+ autoAssign: z.ZodBoolean;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>;
133
+ export declare const teamTaskSchema: z.ZodObject<{
134
+ id: z.ZodString;
135
+ subject: z.ZodString;
136
+ description: z.ZodString;
137
+ status: z.ZodEnum<{
138
+ blocked: "blocked";
139
+ completed: "completed";
140
+ pending: "pending";
141
+ in_progress: "in_progress";
142
+ }>;
143
+ owner: z.ZodOptional<z.ZodString>;
144
+ blockedBy: z.ZodArray<z.ZodString>;
145
+ blocks: z.ZodArray<z.ZodString>;
146
+ phase: z.ZodEnum<{
147
+ planning: "planning";
148
+ "pre-alpha": "pre-alpha";
149
+ alpha: "alpha";
150
+ beta: "beta";
151
+ production: "production";
152
+ mature: "mature";
153
+ }>;
154
+ activeForm: z.ZodOptional<z.ZodString>;
155
+ createdAt: z.ZodNumber;
156
+ updatedAt: z.ZodNumber;
157
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
158
+ }, z.core.$strip>;
159
+ export declare const teamProtocolMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ type: z.ZodLiteral<"idle_notification">;
161
+ from: z.ZodString;
162
+ timestamp: z.ZodString;
163
+ summary: z.ZodOptional<z.ZodString>;
164
+ completedTaskId: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ type: z.ZodLiteral<"task_completed">;
167
+ from: z.ZodString;
168
+ taskId: z.ZodString;
169
+ taskSubject: z.ZodString;
170
+ timestamp: z.ZodString;
171
+ }, z.core.$strip>, z.ZodObject<{
172
+ type: z.ZodLiteral<"shutdown_request">;
173
+ requestId: z.ZodString;
174
+ from: z.ZodString;
175
+ reason: z.ZodOptional<z.ZodString>;
176
+ timestamp: z.ZodString;
177
+ }, z.core.$strip>, z.ZodObject<{
178
+ type: z.ZodLiteral<"shutdown_approved">;
179
+ requestId: z.ZodString;
180
+ from: z.ZodString;
181
+ timestamp: z.ZodString;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ type: z.ZodLiteral<"shutdown_rejected">;
184
+ requestId: z.ZodString;
185
+ from: z.ZodString;
186
+ reason: z.ZodString;
187
+ timestamp: z.ZodString;
188
+ }, z.core.$strip>, z.ZodObject<{
189
+ type: z.ZodLiteral<"plan_approval_request">;
190
+ requestId: z.ZodString;
191
+ from: z.ZodString;
192
+ planContent: z.ZodString;
193
+ timestamp: z.ZodString;
194
+ }, z.core.$strip>, z.ZodObject<{
195
+ type: z.ZodLiteral<"plan_approval_response">;
196
+ requestId: z.ZodString;
197
+ approved: z.ZodBoolean;
198
+ feedback: z.ZodOptional<z.ZodString>;
199
+ timestamp: z.ZodString;
200
+ }, z.core.$strip>, z.ZodObject<{
201
+ type: z.ZodLiteral<"message">;
202
+ from: z.ZodString;
203
+ to: z.ZodString;
204
+ text: z.ZodString;
205
+ summary: z.ZodOptional<z.ZodString>;
206
+ timestamp: z.ZodString;
207
+ }, z.core.$strip>, z.ZodObject<{
208
+ type: z.ZodLiteral<"broadcast">;
209
+ from: z.ZodString;
210
+ text: z.ZodString;
211
+ summary: z.ZodOptional<z.ZodString>;
212
+ timestamp: z.ZodString;
213
+ }, z.core.$strip>], "type">;
@@ -1,5 +1,6 @@
1
1
  export type TeamRole = 'coordinator' | 'cto' | 'vp-engineering' | 'director' | 'fellow' | 'distinguished-engineer' | 'principal-engineer' | 'senior-staff-engineer' | 'staff-engineer' | 'manager' | 'sub-manager' | 'senior-engineer' | 'super-senior' | 'mid-level-engineer' | 'junior-engineer' | 'researcher' | 'scientist' | 'designer' | 'product-lead' | 'tester' | 'reviewer' | 'intern' | 'apprentice';
2
2
  export type DevPhase = 'planning' | 'pre-alpha' | 'alpha' | 'beta' | 'production' | 'mature';
3
+ export type AgentStatus = 'active' | 'idle' | 'working' | 'blocked' | 'completed' | 'failed';
3
4
  export interface TeamMember {
4
5
  agentId: string;
5
6
  name: string;
@@ -7,7 +8,7 @@ export interface TeamMember {
7
8
  agentType: string;
8
9
  model: string;
9
10
  joinedAt: number;
10
- status: 'active' | 'idle' | 'completed' | 'failed';
11
+ status: AgentStatus;
11
12
  currentTaskId?: string;
12
13
  cwd: string;
13
14
  }
@@ -23,11 +24,13 @@ export interface TeamConfig {
23
24
  autoAssign: boolean;
24
25
  };
25
26
  }
27
+ export type TaskPriority = 'critical' | 'high' | 'medium' | 'low';
26
28
  export interface TeamTask {
27
29
  id: string;
28
30
  subject: string;
29
31
  description: string;
30
32
  status: 'pending' | 'in_progress' | 'completed' | 'blocked';
33
+ priority: TaskPriority;
31
34
  owner?: string;
32
35
  blockedBy: string[];
33
36
  blocks: string[];
@@ -0,0 +1,36 @@
1
+ import type { DevPhase } from './team-config';
2
+ /**
3
+ * Hook event fired when an agent goes idle (no active tasks).
4
+ */
5
+ export type TeammateIdleHookEvent = {
6
+ type: 'teammate_idle';
7
+ agentName: string;
8
+ teamName: string;
9
+ lastTaskId?: string;
10
+ timestamp: number;
11
+ };
12
+ /**
13
+ * Hook event fired when a task is marked as completed.
14
+ */
15
+ export type TaskCompletedHookEvent = {
16
+ type: 'task_completed';
17
+ taskId: string;
18
+ taskSubject: string;
19
+ owner: string;
20
+ teamName: string;
21
+ timestamp: number;
22
+ };
23
+ /**
24
+ * Hook event fired when the team's dev phase changes.
25
+ */
26
+ export type PhaseTransitionHookEvent = {
27
+ type: 'phase_transition';
28
+ teamName: string;
29
+ fromPhase: DevPhase;
30
+ toPhase: DevPhase;
31
+ timestamp: number;
32
+ };
33
+ /**
34
+ * Union of all team hook event types.
35
+ */
36
+ export type TeamHookEvent = TeammateIdleHookEvent | TaskCompletedHookEvent | PhaseTransitionHookEvent;
@@ -0,0 +1,23 @@
1
+ import type { ToolName } from '../tools/constants.js';
2
+ import type { DevPhase, TeamConfig } from '../types/team-config.js';
3
+ export declare const PHASE_ORDER: readonly DevPhase[];
4
+ export declare function getPhaseOrder(phase: DevPhase): number;
5
+ export declare function canTransition(currentPhase: DevPhase, targetPhase: DevPhase): boolean;
6
+ export declare function transitionPhase(teamConfig: TeamConfig, targetPhase: DevPhase): TeamConfig;
7
+ export declare function getPhaseDescription(phase: DevPhase): string;
8
+ /**
9
+ * Team tool names that are subject to phase gating.
10
+ * Non-team tools (read_files, str_replace, etc.) are not gated by dev phase.
11
+ */
12
+ export declare const TEAM_TOOL_NAMES: readonly ToolName[];
13
+ export declare function getPhaseTools(phase: DevPhase): ToolName[];
14
+ /**
15
+ * Checks whether a specific tool is allowed in the given dev phase.
16
+ * Only team tools are gated by phase. Non-team tools always return true.
17
+ */
18
+ export declare function isToolAllowedInPhase(toolName: string, phase: DevPhase): boolean;
19
+ /**
20
+ * Returns the minimum phase required to use a given team tool.
21
+ * Returns null for non-team tools (they are always allowed).
22
+ */
23
+ export declare function getMinimumPhaseForTool(toolName: string): DevPhase | null;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Acquire an exclusive lock on a file path using a .lock sidecar file.
3
+ * Returns a release function that must be called when done.
4
+ *
5
+ * The lock file contains a timestamp. If the lock is older than `staleMs`,
6
+ * it is considered abandoned and will be forcibly acquired.
7
+ */
8
+ export declare function acquireLock(filePath: string, timeout?: number): Promise<() => void>;
9
+ /**
10
+ * Execute a function while holding an exclusive file lock.
11
+ * The lock is automatically released when the function completes or throws.
12
+ */
13
+ export declare function withLock<T>(filePath: string, fn: () => T | Promise<T>): Promise<T>;
@@ -0,0 +1,16 @@
1
+ import type { TrackEventFn } from '../types/contracts/analytics';
2
+ import type { Logger } from '../types/contracts/logger';
3
+ import type { DevPhase } from '../types/team-config';
4
+ type TrackingContext = {
5
+ trackEvent: TrackEventFn;
6
+ userId: string;
7
+ logger: Logger;
8
+ };
9
+ export declare function trackTeamCreated(ctx: TrackingContext, teamName: string, memberCount: number): void;
10
+ export declare function trackTeamDeleted(ctx: TrackingContext, teamName: string): void;
11
+ export declare function trackTeammateIdle(ctx: TrackingContext, teamName: string, agentName: string, role: string): void;
12
+ export declare function trackTaskCompleted(ctx: TrackingContext, teamName: string, taskId: string, taskSubject: string, owner: string): void;
13
+ export declare function trackPhaseTransition(ctx: TrackingContext, teamName: string, fromPhase: DevPhase, toPhase: DevPhase): void;
14
+ export declare function trackMessageSent(ctx: TrackingContext, teamName: string, type: 'dm' | 'broadcast' | 'shutdown'): void;
15
+ export declare function trackAgentSpawned(ctx: TrackingContext, teamName: string, role: string, agentName: string): void;
16
+ export {};
@@ -0,0 +1,47 @@
1
+ import type { TeamConfig, DevPhase, TeamRole } from '../types/team-config';
2
+ export interface TeamAndAgent {
3
+ teamName: string;
4
+ agentName: string;
5
+ config: TeamConfig;
6
+ }
7
+ export interface AgentTeamContext {
8
+ teamName: string;
9
+ agentName: string;
10
+ role: TeamRole;
11
+ isLeader: boolean;
12
+ phase: DevPhase;
13
+ }
14
+ export interface TeamSummary {
15
+ name: string;
16
+ phase: DevPhase;
17
+ memberCount: number;
18
+ }
19
+ /**
20
+ * Finds the team that an agent belongs to, returning the team name and config.
21
+ * Matches against both the raw agentId and a "lead-" prefixed variant.
22
+ */
23
+ export declare function findCurrentTeam(agentId: string): {
24
+ teamName: string;
25
+ config: TeamConfig;
26
+ } | null;
27
+ /**
28
+ * Finds the team and the matched agent name for a given agent identifier.
29
+ * This is the richer variant that also returns which member name was matched.
30
+ */
31
+ export declare function findCurrentTeamAndAgent(agentId: string): TeamAndAgent | null;
32
+ /**
33
+ * Direct lookup of a team by name.
34
+ */
35
+ export declare function findTeamByName(name: string): TeamConfig | null;
36
+ /**
37
+ * Lists all teams with summary information.
38
+ */
39
+ export declare function listAllTeams(): TeamSummary[];
40
+ /**
41
+ * Returns full context for an agent's team membership including role and leadership status.
42
+ */
43
+ export declare function getAgentTeamContext(agentId: string): AgentTeamContext | null;
44
+ /**
45
+ * Checks whether an agent is a member of a specific team.
46
+ */
47
+ export declare function isAgentInTeam(agentId: string, teamName: string): boolean;
@@ -1,17 +1,20 @@
1
1
  import type { TeamConfig, TeamMember, TeamTask } from '../types/team-config';
2
2
  import type { TeamProtocolMessage } from '../types/team-protocol';
3
+ export declare function validateTeamName(teamName: string): void;
4
+ export declare function validateAgentName(agentName: string): void;
5
+ export declare function validateTaskId(taskId: string): void;
3
6
  export declare function getTeamsDir(): string;
4
7
  export declare function getTasksDir(teamName: string): string;
5
8
  export declare function createTeam(config: TeamConfig): void;
6
9
  export declare function loadTeamConfig(teamName: string): TeamConfig | null;
7
- export declare function saveTeamConfig(teamName: string, config: TeamConfig): void;
10
+ export declare function saveTeamConfig(teamName: string, config: TeamConfig): Promise<void>;
8
11
  export declare function deleteTeam(teamName: string): void;
9
- export declare function addTeamMember(teamName: string, member: TeamMember): void;
10
- export declare function removeTeamMember(teamName: string, agentId: string): void;
11
- export declare function createTask(teamName: string, task: TeamTask): void;
12
- export declare function updateTask(teamName: string, taskId: string, updates: Partial<TeamTask>): void;
12
+ export declare function addTeamMember(teamName: string, member: TeamMember): Promise<void>;
13
+ export declare function removeTeamMember(teamName: string, agentId: string): Promise<void>;
14
+ export declare function createTask(teamName: string, task: TeamTask): Promise<void>;
15
+ export declare function updateTask(teamName: string, taskId: string, updates: Partial<TeamTask>): Promise<void>;
13
16
  export declare function listTasks(teamName: string): TeamTask[];
14
17
  export declare function getTask(teamName: string, taskId: string): TeamTask | null;
15
- export declare function sendMessage(teamName: string, to: string, message: TeamProtocolMessage): void;
18
+ export declare function sendMessage(teamName: string, to: string, message: TeamProtocolMessage): Promise<void>;
16
19
  export declare function readInbox(teamName: string, agentName: string): TeamProtocolMessage[];
17
20
  export declare function clearInbox(teamName: string, agentName: string): void;
@@ -0,0 +1,40 @@
1
+ import type { TrackEventFn } from '../types/contracts/analytics';
2
+ import type { Logger } from '../types/contracts/logger';
3
+ import type { TeamHookEvent } from '../types/team-hook-events';
4
+ import type { DevPhase } from '../types/team-config';
5
+ /**
6
+ * Subscribe to all team hook events.
7
+ * Returns an unsubscribe function.
8
+ */
9
+ export declare function onTeamHookEvent(listener: (event: TeamHookEvent) => void): () => void;
10
+ /**
11
+ * Dispatch a team hook event to all registered listeners.
12
+ * Exported for use in contexts (e.g. CLI) where the full emit helpers
13
+ * cannot be used because a server-side TrackEventFn is not available.
14
+ */
15
+ export declare function dispatchTeamHookEvent(event: TeamHookEvent): void;
16
+ export declare function emitTeammateIdle(params: {
17
+ agentName: string;
18
+ teamName: string;
19
+ lastTaskId?: string;
20
+ trackEvent: TrackEventFn;
21
+ userId: string;
22
+ logger: Logger;
23
+ }): void;
24
+ export declare function emitTaskCompleted(params: {
25
+ taskId: string;
26
+ taskSubject: string;
27
+ owner: string;
28
+ teamName: string;
29
+ trackEvent: TrackEventFn;
30
+ userId: string;
31
+ logger: Logger;
32
+ }): void;
33
+ export declare function emitPhaseTransition(params: {
34
+ teamName: string;
35
+ fromPhase: DevPhase;
36
+ toPhase: DevPhase;
37
+ trackEvent: TrackEventFn;
38
+ userId: string;
39
+ logger: Logger;
40
+ }): void;
@@ -0,0 +1,35 @@
1
+ import type { TeamRole, DevPhase } from '../types/team-config';
2
+ /**
3
+ * A preset member definition. Contains the role and descriptive name
4
+ * but not runtime fields (agentId, joinedAt, status, cwd) which are
5
+ * assigned at spawn time.
6
+ */
7
+ export interface PresetMember {
8
+ name: string;
9
+ role: TeamRole;
10
+ agentType: string;
11
+ model: string;
12
+ }
13
+ /**
14
+ * A preset configuration that can be used to bootstrap a team.
15
+ * Contains the member list and default settings but no runtime state.
16
+ */
17
+ export interface PresetConfig {
18
+ presetName: string;
19
+ description: string;
20
+ defaultPhase: DevPhase;
21
+ members: PresetMember[];
22
+ settings: {
23
+ maxMembers: number;
24
+ autoAssign: boolean;
25
+ };
26
+ }
27
+ /**
28
+ * Returns a preset team configuration by name, or null if not found.
29
+ * Preset names are case-insensitive.
30
+ */
31
+ export declare function getTeamPreset(name: string): PresetConfig | null;
32
+ /**
33
+ * Returns the list of all available preset names.
34
+ */
35
+ export declare function listPresets(): string[];