@agent-relay/api-types 0.1.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.
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/agent.d.ts +259 -0
- package/dist/schemas/agent.d.ts.map +1 -0
- package/dist/schemas/agent.js +102 -0
- package/dist/schemas/agent.js.map +1 -0
- package/dist/schemas/api.d.ts +290 -0
- package/dist/schemas/api.d.ts.map +1 -0
- package/dist/schemas/api.js +162 -0
- package/dist/schemas/api.js.map +1 -0
- package/dist/schemas/decision.d.ts +230 -0
- package/dist/schemas/decision.d.ts.map +1 -0
- package/dist/schemas/decision.js +104 -0
- package/dist/schemas/decision.js.map +1 -0
- package/dist/schemas/fleet.d.ts +615 -0
- package/dist/schemas/fleet.d.ts.map +1 -0
- package/dist/schemas/fleet.js +71 -0
- package/dist/schemas/fleet.js.map +1 -0
- package/dist/schemas/history.d.ts +180 -0
- package/dist/schemas/history.d.ts.map +1 -0
- package/dist/schemas/history.js +72 -0
- package/dist/schemas/history.js.map +1 -0
- package/dist/schemas/index.d.ts +14 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +22 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/message.d.ts +456 -0
- package/dist/schemas/message.d.ts.map +1 -0
- package/dist/schemas/message.js +88 -0
- package/dist/schemas/message.js.map +1 -0
- package/dist/schemas/session.d.ts +60 -0
- package/dist/schemas/session.d.ts.map +1 -0
- package/dist/schemas/session.js +36 -0
- package/dist/schemas/session.js.map +1 -0
- package/dist/schemas/task.d.ts +111 -0
- package/dist/schemas/task.d.ts.map +1 -0
- package/dist/schemas/task.js +64 -0
- package/dist/schemas/task.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Request/Response Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for API request and response types.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Generic API response schema
|
|
9
|
+
*/
|
|
10
|
+
export declare const ApiResponseSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
|
|
11
|
+
success: z.ZodBoolean;
|
|
12
|
+
data: z.ZodOptional<T>;
|
|
13
|
+
error: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
15
|
+
success: z.ZodBoolean;
|
|
16
|
+
data: z.ZodOptional<T>;
|
|
17
|
+
error: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
19
|
+
success: z.ZodBoolean;
|
|
20
|
+
data: z.ZodOptional<T>;
|
|
21
|
+
error: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
23
|
+
/**
|
|
24
|
+
* Simple success/error response
|
|
25
|
+
*/
|
|
26
|
+
export declare const SimpleApiResponseSchema: z.ZodObject<{
|
|
27
|
+
success: z.ZodBoolean;
|
|
28
|
+
error: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
success: boolean;
|
|
31
|
+
error?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
success: boolean;
|
|
34
|
+
error?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type SimpleApiResponse = z.infer<typeof SimpleApiResponseSchema>;
|
|
37
|
+
/**
|
|
38
|
+
* Send message request schema
|
|
39
|
+
*/
|
|
40
|
+
export declare const SendMessageRequestSchema: z.ZodObject<{
|
|
41
|
+
to: z.ZodString;
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
44
|
+
/** Attachment IDs to include with the message */
|
|
45
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
message: string;
|
|
48
|
+
to: string;
|
|
49
|
+
thread?: string | undefined;
|
|
50
|
+
attachments?: string[] | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
message: string;
|
|
53
|
+
to: string;
|
|
54
|
+
thread?: string | undefined;
|
|
55
|
+
attachments?: string[] | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export type SendMessageRequest = z.infer<typeof SendMessageRequestSchema>;
|
|
58
|
+
/**
|
|
59
|
+
* Speak on trigger enum (for shadow agents)
|
|
60
|
+
*/
|
|
61
|
+
export declare const SpeakOnTriggerSchema: z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>;
|
|
62
|
+
export type SpeakOnTrigger = z.infer<typeof SpeakOnTriggerSchema>;
|
|
63
|
+
/**
|
|
64
|
+
* Shadow mode enum
|
|
65
|
+
*/
|
|
66
|
+
export declare const ShadowModeSchema: z.ZodEnum<["subagent", "process"]>;
|
|
67
|
+
export type ShadowMode = z.infer<typeof ShadowModeSchema>;
|
|
68
|
+
/**
|
|
69
|
+
* Spawn agent request schema
|
|
70
|
+
*/
|
|
71
|
+
export declare const SpawnAgentRequestSchema: z.ZodObject<{
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
cli: z.ZodOptional<z.ZodString>;
|
|
74
|
+
task: z.ZodOptional<z.ZodString>;
|
|
75
|
+
team: z.ZodOptional<z.ZodString>;
|
|
76
|
+
/** Shadow execution mode */
|
|
77
|
+
shadowMode: z.ZodOptional<z.ZodEnum<["subagent", "process"]>>;
|
|
78
|
+
/** Primary agent to shadow */
|
|
79
|
+
shadowOf: z.ZodOptional<z.ZodString>;
|
|
80
|
+
/** Shadow agent profile to use */
|
|
81
|
+
shadowAgent: z.ZodOptional<z.ZodString>;
|
|
82
|
+
/** When the shadow should be invoked */
|
|
83
|
+
shadowTriggers: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
84
|
+
/** When the shadow should speak */
|
|
85
|
+
shadowSpeakOn: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
name: string;
|
|
88
|
+
cli?: string | undefined;
|
|
89
|
+
team?: string | undefined;
|
|
90
|
+
task?: string | undefined;
|
|
91
|
+
shadowMode?: "subagent" | "process" | undefined;
|
|
92
|
+
shadowOf?: string | undefined;
|
|
93
|
+
shadowAgent?: string | undefined;
|
|
94
|
+
shadowTriggers?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
95
|
+
shadowSpeakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
name: string;
|
|
98
|
+
cli?: string | undefined;
|
|
99
|
+
team?: string | undefined;
|
|
100
|
+
task?: string | undefined;
|
|
101
|
+
shadowMode?: "subagent" | "process" | undefined;
|
|
102
|
+
shadowOf?: string | undefined;
|
|
103
|
+
shadowAgent?: string | undefined;
|
|
104
|
+
shadowTriggers?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
105
|
+
shadowSpeakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
export type SpawnAgentRequest = z.infer<typeof SpawnAgentRequestSchema>;
|
|
108
|
+
/**
|
|
109
|
+
* Spawn agent response schema
|
|
110
|
+
*/
|
|
111
|
+
export declare const SpawnAgentResponseSchema: z.ZodObject<{
|
|
112
|
+
success: z.ZodBoolean;
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
error: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
name: string;
|
|
117
|
+
success: boolean;
|
|
118
|
+
error?: string | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
name: string;
|
|
121
|
+
success: boolean;
|
|
122
|
+
error?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
export type SpawnAgentResponse = z.infer<typeof SpawnAgentResponseSchema>;
|
|
125
|
+
/**
|
|
126
|
+
* Create task request schema
|
|
127
|
+
*/
|
|
128
|
+
export declare const CreateTaskRequestSchema: z.ZodObject<{
|
|
129
|
+
agentName: z.ZodString;
|
|
130
|
+
title: z.ZodString;
|
|
131
|
+
description: z.ZodOptional<z.ZodString>;
|
|
132
|
+
priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
title: string;
|
|
135
|
+
agentName: string;
|
|
136
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
137
|
+
description?: string | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
title: string;
|
|
140
|
+
agentName: string;
|
|
141
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
142
|
+
description?: string | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
export type CreateTaskRequest = z.infer<typeof CreateTaskRequestSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* Create bead request schema
|
|
147
|
+
*/
|
|
148
|
+
export declare const CreateBeadRequestSchema: z.ZodObject<{
|
|
149
|
+
title: z.ZodString;
|
|
150
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
151
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
type: z.ZodOptional<z.ZodEnum<["task", "bug", "feature"]>>;
|
|
153
|
+
description: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
title: string;
|
|
156
|
+
type?: "task" | "bug" | "feature" | undefined;
|
|
157
|
+
description?: string | undefined;
|
|
158
|
+
priority?: number | undefined;
|
|
159
|
+
assignee?: string | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
title: string;
|
|
162
|
+
type?: "task" | "bug" | "feature" | undefined;
|
|
163
|
+
description?: string | undefined;
|
|
164
|
+
priority?: number | undefined;
|
|
165
|
+
assignee?: string | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
export type CreateBeadRequest = z.infer<typeof CreateBeadRequestSchema>;
|
|
168
|
+
/**
|
|
169
|
+
* Send relay message request schema
|
|
170
|
+
*/
|
|
171
|
+
export declare const SendRelayMessageRequestSchema: z.ZodObject<{
|
|
172
|
+
to: z.ZodString;
|
|
173
|
+
content: z.ZodString;
|
|
174
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
to: string;
|
|
177
|
+
content: string;
|
|
178
|
+
thread?: string | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
to: string;
|
|
181
|
+
content: string;
|
|
182
|
+
thread?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
export type SendRelayMessageRequest = z.infer<typeof SendRelayMessageRequestSchema>;
|
|
185
|
+
/**
|
|
186
|
+
* Activity event type enum
|
|
187
|
+
*/
|
|
188
|
+
export declare const ActivityEventTypeSchema: z.ZodEnum<["agent_spawned", "agent_released", "agent_online", "agent_offline", "user_joined", "user_left", "broadcast", "error"]>;
|
|
189
|
+
export type ActivityEventType = z.infer<typeof ActivityEventTypeSchema>;
|
|
190
|
+
/**
|
|
191
|
+
* Actor type enum
|
|
192
|
+
*/
|
|
193
|
+
export declare const ActorTypeSchema: z.ZodEnum<["user", "agent", "system"]>;
|
|
194
|
+
export type ActorType = z.infer<typeof ActorTypeSchema>;
|
|
195
|
+
/**
|
|
196
|
+
* Activity event schema
|
|
197
|
+
*/
|
|
198
|
+
export declare const ActivityEventSchema: z.ZodObject<{
|
|
199
|
+
id: z.ZodString;
|
|
200
|
+
type: z.ZodEnum<["agent_spawned", "agent_released", "agent_online", "agent_offline", "user_joined", "user_left", "broadcast", "error"]>;
|
|
201
|
+
timestamp: z.ZodString;
|
|
202
|
+
/** Actor who triggered the event */
|
|
203
|
+
actor: z.ZodString;
|
|
204
|
+
/** Optional avatar URL for the actor */
|
|
205
|
+
actorAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
206
|
+
/** Whether actor is a user or agent */
|
|
207
|
+
actorType: z.ZodEnum<["user", "agent", "system"]>;
|
|
208
|
+
/** Event title for display */
|
|
209
|
+
title: z.ZodString;
|
|
210
|
+
/** Optional detailed description */
|
|
211
|
+
description: z.ZodOptional<z.ZodString>;
|
|
212
|
+
/** Optional metadata */
|
|
213
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
type: "error" | "agent_spawned" | "agent_released" | "agent_online" | "agent_offline" | "user_joined" | "user_left" | "broadcast";
|
|
216
|
+
title: string;
|
|
217
|
+
id: string;
|
|
218
|
+
timestamp: string;
|
|
219
|
+
actor: string;
|
|
220
|
+
actorType: "agent" | "user" | "system";
|
|
221
|
+
description?: string | undefined;
|
|
222
|
+
actorAvatarUrl?: string | undefined;
|
|
223
|
+
metadata?: Record<string, unknown> | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
type: "error" | "agent_spawned" | "agent_released" | "agent_online" | "agent_offline" | "user_joined" | "user_left" | "broadcast";
|
|
226
|
+
title: string;
|
|
227
|
+
id: string;
|
|
228
|
+
timestamp: string;
|
|
229
|
+
actor: string;
|
|
230
|
+
actorType: "agent" | "user" | "system";
|
|
231
|
+
description?: string | undefined;
|
|
232
|
+
actorAvatarUrl?: string | undefined;
|
|
233
|
+
metadata?: Record<string, unknown> | undefined;
|
|
234
|
+
}>;
|
|
235
|
+
export type ActivityEvent = z.infer<typeof ActivityEventSchema>;
|
|
236
|
+
/**
|
|
237
|
+
* WebSocket message type enum
|
|
238
|
+
*/
|
|
239
|
+
export declare const WSMessageTypeSchema: z.ZodEnum<["data", "agents", "messages", "fleet", "error"]>;
|
|
240
|
+
export type WSMessageType = z.infer<typeof WSMessageTypeSchema>;
|
|
241
|
+
/**
|
|
242
|
+
* WebSocket message schema
|
|
243
|
+
*/
|
|
244
|
+
export declare const WSMessageSchema: z.ZodObject<{
|
|
245
|
+
type: z.ZodEnum<["data", "agents", "messages", "fleet", "error"]>;
|
|
246
|
+
payload: z.ZodUnknown;
|
|
247
|
+
}, "strip", z.ZodTypeAny, {
|
|
248
|
+
type: "data" | "messages" | "error" | "agents" | "fleet";
|
|
249
|
+
payload?: unknown;
|
|
250
|
+
}, {
|
|
251
|
+
type: "data" | "messages" | "error" | "agents" | "fleet";
|
|
252
|
+
payload?: unknown;
|
|
253
|
+
}>;
|
|
254
|
+
export type WSMessage = z.infer<typeof WSMessageSchema>;
|
|
255
|
+
/**
|
|
256
|
+
* Dashboard state schema
|
|
257
|
+
*/
|
|
258
|
+
export declare const DashboardStateSchema: z.ZodObject<{
|
|
259
|
+
agents: z.ZodArray<z.ZodLazy<z.ZodAny>, "many">;
|
|
260
|
+
messages: z.ZodArray<z.ZodLazy<z.ZodAny>, "many">;
|
|
261
|
+
currentChannel: z.ZodString;
|
|
262
|
+
currentThread: z.ZodNullable<z.ZodString>;
|
|
263
|
+
isConnected: z.ZodBoolean;
|
|
264
|
+
viewMode: z.ZodEnum<["local", "fleet"]>;
|
|
265
|
+
fleetData: z.ZodNullable<z.ZodLazy<z.ZodAny>>;
|
|
266
|
+
sessions: z.ZodArray<z.ZodLazy<z.ZodAny>, "many">;
|
|
267
|
+
summaries: z.ZodArray<z.ZodLazy<z.ZodAny>, "many">;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
messages: any[];
|
|
270
|
+
agents: any[];
|
|
271
|
+
currentChannel: string;
|
|
272
|
+
currentThread: string | null;
|
|
273
|
+
isConnected: boolean;
|
|
274
|
+
viewMode: "fleet" | "local";
|
|
275
|
+
sessions: any[];
|
|
276
|
+
summaries: any[];
|
|
277
|
+
fleetData?: any;
|
|
278
|
+
}, {
|
|
279
|
+
messages: any[];
|
|
280
|
+
agents: any[];
|
|
281
|
+
currentChannel: string;
|
|
282
|
+
currentThread: string | null;
|
|
283
|
+
isConnected: boolean;
|
|
284
|
+
viewMode: "fleet" | "local";
|
|
285
|
+
sessions: any[];
|
|
286
|
+
summaries: any[];
|
|
287
|
+
fleetData?: any;
|
|
288
|
+
}>;
|
|
289
|
+
export type DashboardState = z.infer<typeof DashboardStateSchema>;
|
|
290
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/schemas/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC;;;;;;;;;;;;iEAKnE,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;IAInC,iDAAiD;;;;;;;;;;;;EAEjD,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,oBAAoB,8FAM/B,C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wCAAsC,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;IAI9B,oCAAoC;;IAEpC,wCAAwC;;IAExC,uCAAuC;;IAEvC,8BAA8B;;IAE9B,oCAAoC;;IAEpC,wBAAwB;;;;;;;;;;;;;;;;;;;;;;EAExB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,mBAAmB,6DAA2D,CAAC;AAC5F,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Request/Response Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for API request and response types.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Generic API response schema
|
|
9
|
+
*/
|
|
10
|
+
export const ApiResponseSchema = (dataSchema) => z.object({
|
|
11
|
+
success: z.boolean(),
|
|
12
|
+
data: dataSchema.optional(),
|
|
13
|
+
error: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Simple success/error response
|
|
17
|
+
*/
|
|
18
|
+
export const SimpleApiResponseSchema = z.object({
|
|
19
|
+
success: z.boolean(),
|
|
20
|
+
error: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Send message request schema
|
|
24
|
+
*/
|
|
25
|
+
export const SendMessageRequestSchema = z.object({
|
|
26
|
+
to: z.string(),
|
|
27
|
+
message: z.string(),
|
|
28
|
+
thread: z.string().optional(),
|
|
29
|
+
/** Attachment IDs to include with the message */
|
|
30
|
+
attachments: z.array(z.string()).optional(),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Speak on trigger enum (for shadow agents)
|
|
34
|
+
*/
|
|
35
|
+
export const SpeakOnTriggerSchema = z.enum([
|
|
36
|
+
'SESSION_END',
|
|
37
|
+
'CODE_WRITTEN',
|
|
38
|
+
'REVIEW_REQUEST',
|
|
39
|
+
'EXPLICIT_ASK',
|
|
40
|
+
'ALL_MESSAGES',
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* Shadow mode enum
|
|
44
|
+
*/
|
|
45
|
+
export const ShadowModeSchema = z.enum(['subagent', 'process']);
|
|
46
|
+
/**
|
|
47
|
+
* Spawn agent request schema
|
|
48
|
+
*/
|
|
49
|
+
export const SpawnAgentRequestSchema = z.object({
|
|
50
|
+
name: z.string(),
|
|
51
|
+
cli: z.string().optional(),
|
|
52
|
+
task: z.string().optional(),
|
|
53
|
+
team: z.string().optional(),
|
|
54
|
+
/** Shadow execution mode */
|
|
55
|
+
shadowMode: ShadowModeSchema.optional(),
|
|
56
|
+
/** Primary agent to shadow */
|
|
57
|
+
shadowOf: z.string().optional(),
|
|
58
|
+
/** Shadow agent profile to use */
|
|
59
|
+
shadowAgent: z.string().optional(),
|
|
60
|
+
/** When the shadow should be invoked */
|
|
61
|
+
shadowTriggers: z.array(SpeakOnTriggerSchema).optional(),
|
|
62
|
+
/** When the shadow should speak */
|
|
63
|
+
shadowSpeakOn: z.array(SpeakOnTriggerSchema).optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Spawn agent response schema
|
|
67
|
+
*/
|
|
68
|
+
export const SpawnAgentResponseSchema = z.object({
|
|
69
|
+
success: z.boolean(),
|
|
70
|
+
name: z.string(),
|
|
71
|
+
error: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Create task request schema
|
|
75
|
+
*/
|
|
76
|
+
export const CreateTaskRequestSchema = z.object({
|
|
77
|
+
agentName: z.string(),
|
|
78
|
+
title: z.string(),
|
|
79
|
+
description: z.string().optional(),
|
|
80
|
+
priority: z.enum(['low', 'medium', 'high', 'critical']),
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Create bead request schema
|
|
84
|
+
*/
|
|
85
|
+
export const CreateBeadRequestSchema = z.object({
|
|
86
|
+
title: z.string(),
|
|
87
|
+
assignee: z.string().optional(),
|
|
88
|
+
priority: z.number().optional(),
|
|
89
|
+
type: z.enum(['task', 'bug', 'feature']).optional(),
|
|
90
|
+
description: z.string().optional(),
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Send relay message request schema
|
|
94
|
+
*/
|
|
95
|
+
export const SendRelayMessageRequestSchema = z.object({
|
|
96
|
+
to: z.string(),
|
|
97
|
+
content: z.string(),
|
|
98
|
+
thread: z.string().optional(),
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Activity event type enum
|
|
102
|
+
*/
|
|
103
|
+
export const ActivityEventTypeSchema = z.enum([
|
|
104
|
+
'agent_spawned',
|
|
105
|
+
'agent_released',
|
|
106
|
+
'agent_online',
|
|
107
|
+
'agent_offline',
|
|
108
|
+
'user_joined',
|
|
109
|
+
'user_left',
|
|
110
|
+
'broadcast',
|
|
111
|
+
'error',
|
|
112
|
+
]);
|
|
113
|
+
/**
|
|
114
|
+
* Actor type enum
|
|
115
|
+
*/
|
|
116
|
+
export const ActorTypeSchema = z.enum(['user', 'agent', 'system']);
|
|
117
|
+
/**
|
|
118
|
+
* Activity event schema
|
|
119
|
+
*/
|
|
120
|
+
export const ActivityEventSchema = z.object({
|
|
121
|
+
id: z.string(),
|
|
122
|
+
type: ActivityEventTypeSchema,
|
|
123
|
+
timestamp: z.string(),
|
|
124
|
+
/** Actor who triggered the event */
|
|
125
|
+
actor: z.string(),
|
|
126
|
+
/** Optional avatar URL for the actor */
|
|
127
|
+
actorAvatarUrl: z.string().optional(),
|
|
128
|
+
/** Whether actor is a user or agent */
|
|
129
|
+
actorType: ActorTypeSchema,
|
|
130
|
+
/** Event title for display */
|
|
131
|
+
title: z.string(),
|
|
132
|
+
/** Optional detailed description */
|
|
133
|
+
description: z.string().optional(),
|
|
134
|
+
/** Optional metadata */
|
|
135
|
+
metadata: z.record(z.unknown()).optional(),
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* WebSocket message type enum
|
|
139
|
+
*/
|
|
140
|
+
export const WSMessageTypeSchema = z.enum(['data', 'agents', 'messages', 'fleet', 'error']);
|
|
141
|
+
/**
|
|
142
|
+
* WebSocket message schema
|
|
143
|
+
*/
|
|
144
|
+
export const WSMessageSchema = z.object({
|
|
145
|
+
type: WSMessageTypeSchema,
|
|
146
|
+
payload: z.unknown(),
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* Dashboard state schema
|
|
150
|
+
*/
|
|
151
|
+
export const DashboardStateSchema = z.object({
|
|
152
|
+
agents: z.array(z.lazy(() => z.any())), // References AgentSchema
|
|
153
|
+
messages: z.array(z.lazy(() => z.any())), // References MessageSchema
|
|
154
|
+
currentChannel: z.string(),
|
|
155
|
+
currentThread: z.string().nullable(),
|
|
156
|
+
isConnected: z.boolean(),
|
|
157
|
+
viewMode: z.enum(['local', 'fleet']),
|
|
158
|
+
fleetData: z.lazy(() => z.any()).nullable(), // References FleetDataSchema
|
|
159
|
+
sessions: z.array(z.lazy(() => z.any())), // References SessionSchema
|
|
160
|
+
summaries: z.array(z.lazy(() => z.any())), // References AgentSummarySchema
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0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