@spencerbeggs/claude-coordinator-core 0.1.0 → 0.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.
- package/index.d.ts +334 -242
- package/index.js +24 -85
- package/package.json +10 -14
- package/schemas/agent.js +43 -0
- package/schemas/context.js +45 -0
- package/schemas/decision.js +27 -0
- package/schemas/question.js +64 -0
- package/tsdoc-metadata.json +11 -0
package/index.d.ts
CHANGED
|
@@ -1,242 +1,334 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Schema for a shared context entry
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, z.core.$strip>;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schemas/agent.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Role of an agent in the coordination session
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
declare const AgentRoleSchema: z.ZodEnum<{
|
|
9
|
+
source: "source";
|
|
10
|
+
target: "target";
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Role of an agent in the coordination session
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
type AgentRole = z.infer<typeof AgentRoleSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Schema for a connected agent in the coordination session
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
declare const AgentSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
role: z.ZodEnum<{
|
|
26
|
+
source: "source";
|
|
27
|
+
target: "target";
|
|
28
|
+
}>;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
repoPath: z.ZodString;
|
|
31
|
+
connectedAt: z.ZodCoercedDate<unknown>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/**
|
|
34
|
+
* A connected agent in the coordination session
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
type Agent = z.infer<typeof AgentSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* Input schema for joining a coordination session
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
declare const JoinInputSchema: z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
role: z.ZodEnum<{
|
|
47
|
+
source: "source";
|
|
48
|
+
target: "target";
|
|
49
|
+
}>;
|
|
50
|
+
repoPath: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
/**
|
|
53
|
+
* Input for joining a coordination session
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
type JoinInput = z.infer<typeof JoinInputSchema>;
|
|
58
|
+
/**
|
|
59
|
+
* Result of joining a coordination session
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
declare const JoinResultSchema: z.ZodObject<{
|
|
64
|
+
agent: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
role: z.ZodEnum<{
|
|
67
|
+
source: "source";
|
|
68
|
+
target: "target";
|
|
69
|
+
}>;
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
repoPath: z.ZodString;
|
|
72
|
+
connectedAt: z.ZodCoercedDate<unknown>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
sessionId: z.ZodString;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
/**
|
|
77
|
+
* Result of joining a coordination session
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
type JoinResult = z.infer<typeof JoinResultSchema>;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/schemas/context.d.ts
|
|
84
|
+
/**
|
|
85
|
+
* Schema for a shared context entry
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
declare const ContextEntrySchema: z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
key: z.ZodString;
|
|
92
|
+
value: z.ZodString;
|
|
93
|
+
tags: z.ZodArray<z.ZodString>;
|
|
94
|
+
createdBy: z.ZodString;
|
|
95
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
96
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
/**
|
|
99
|
+
* A shared context entry
|
|
100
|
+
*
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
type ContextEntry = z.infer<typeof ContextEntrySchema>;
|
|
104
|
+
/**
|
|
105
|
+
* Input schema for sharing a context entry
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
declare const ShareContextInputSchema: z.ZodObject<{
|
|
110
|
+
key: z.ZodString;
|
|
111
|
+
value: z.ZodString;
|
|
112
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
/**
|
|
115
|
+
* Input for sharing a context entry
|
|
116
|
+
*
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
type ShareContextInput = z.infer<typeof ShareContextInputSchema>;
|
|
120
|
+
/**
|
|
121
|
+
* Input schema for retrieving a context entry by key
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
declare const GetContextInputSchema: z.ZodObject<{
|
|
126
|
+
key: z.ZodString;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
/**
|
|
129
|
+
* Input for retrieving a context entry by key
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
type GetContextInput = z.infer<typeof GetContextInputSchema>;
|
|
134
|
+
/**
|
|
135
|
+
* Input schema for listing context entries with optional filters
|
|
136
|
+
*
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
declare const ListContextInputSchema: z.ZodObject<{
|
|
140
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
/**
|
|
144
|
+
* Input for listing context entries with optional filters
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
type ListContextInput = z.infer<typeof ListContextInputSchema>;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/schemas/decision.d.ts
|
|
151
|
+
/**
|
|
152
|
+
* Schema for a logged decision
|
|
153
|
+
*
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
declare const DecisionSchema: z.ZodObject<{
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
decision: z.ZodString;
|
|
159
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
160
|
+
by: z.ZodString;
|
|
161
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
/**
|
|
164
|
+
* A logged decision
|
|
165
|
+
*
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
168
|
+
type Decision = z.infer<typeof DecisionSchema>;
|
|
169
|
+
/**
|
|
170
|
+
* Input schema for logging a decision
|
|
171
|
+
*
|
|
172
|
+
* @public
|
|
173
|
+
*/
|
|
174
|
+
declare const LogDecisionInputSchema: z.ZodObject<{
|
|
175
|
+
decision: z.ZodString;
|
|
176
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
/**
|
|
179
|
+
* Input for logging a decision
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
183
|
+
type LogDecisionInput = z.infer<typeof LogDecisionInputSchema>;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/schemas/question.d.ts
|
|
186
|
+
/**
|
|
187
|
+
* Status of a question
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
declare const QuestionStatusSchema: z.ZodEnum<{
|
|
192
|
+
answered: "answered";
|
|
193
|
+
pending: "pending";
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Status of a question
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
type QuestionStatus = z.infer<typeof QuestionStatusSchema>;
|
|
201
|
+
/**
|
|
202
|
+
* Schema for a question between agents
|
|
203
|
+
*
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
declare const QuestionSchema: z.ZodObject<{
|
|
207
|
+
id: z.ZodString;
|
|
208
|
+
question: z.ZodString;
|
|
209
|
+
from: z.ZodString;
|
|
210
|
+
to: z.ZodOptional<z.ZodString>;
|
|
211
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
212
|
+
answeredBy: z.ZodOptional<z.ZodString>;
|
|
213
|
+
status: z.ZodEnum<{
|
|
214
|
+
answered: "answered";
|
|
215
|
+
pending: "pending";
|
|
216
|
+
}>;
|
|
217
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
218
|
+
answeredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
/**
|
|
221
|
+
* A question between agents
|
|
222
|
+
*
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
type Question = z.infer<typeof QuestionSchema>;
|
|
226
|
+
/**
|
|
227
|
+
* Input schema for asking a question
|
|
228
|
+
*
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
declare const AskInputSchema: z.ZodObject<{
|
|
232
|
+
question: z.ZodString;
|
|
233
|
+
to: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
/**
|
|
236
|
+
* Input for asking a question
|
|
237
|
+
*
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
type AskInput = z.infer<typeof AskInputSchema>;
|
|
241
|
+
/**
|
|
242
|
+
* Input schema for answering a question
|
|
243
|
+
*
|
|
244
|
+
* @public
|
|
245
|
+
*/
|
|
246
|
+
declare const AnswerInputSchema: z.ZodObject<{
|
|
247
|
+
questionId: z.ZodString;
|
|
248
|
+
answer: z.ZodString;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
/**
|
|
251
|
+
* Input for answering a question
|
|
252
|
+
*
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
type AnswerInput = z.infer<typeof AnswerInputSchema>;
|
|
256
|
+
/**
|
|
257
|
+
* Event emitted when a question is asked
|
|
258
|
+
*
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
declare const QuestionEventSchema: z.ZodObject<{
|
|
262
|
+
type: z.ZodLiteral<"question">;
|
|
263
|
+
question: z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
question: z.ZodString;
|
|
266
|
+
from: z.ZodString;
|
|
267
|
+
to: z.ZodOptional<z.ZodString>;
|
|
268
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
269
|
+
answeredBy: z.ZodOptional<z.ZodString>;
|
|
270
|
+
status: z.ZodEnum<{
|
|
271
|
+
answered: "answered";
|
|
272
|
+
pending: "pending";
|
|
273
|
+
}>;
|
|
274
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
275
|
+
answeredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
/**
|
|
279
|
+
* Event emitted when a question is asked
|
|
280
|
+
*
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
type QuestionEvent = z.infer<typeof QuestionEventSchema>;
|
|
284
|
+
/**
|
|
285
|
+
* Event emitted when a question is answered
|
|
286
|
+
*
|
|
287
|
+
* @public
|
|
288
|
+
*/
|
|
289
|
+
declare const AnswerEventSchema: z.ZodObject<{
|
|
290
|
+
type: z.ZodLiteral<"answer">;
|
|
291
|
+
question: z.ZodObject<{
|
|
292
|
+
id: z.ZodString;
|
|
293
|
+
question: z.ZodString;
|
|
294
|
+
from: z.ZodString;
|
|
295
|
+
to: z.ZodOptional<z.ZodString>;
|
|
296
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
297
|
+
answeredBy: z.ZodOptional<z.ZodString>;
|
|
298
|
+
status: z.ZodEnum<{
|
|
299
|
+
answered: "answered";
|
|
300
|
+
pending: "pending";
|
|
301
|
+
}>;
|
|
302
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
303
|
+
answeredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
}, z.core.$strip>;
|
|
306
|
+
/**
|
|
307
|
+
* Event emitted when a question is answered
|
|
308
|
+
*
|
|
309
|
+
* @public
|
|
310
|
+
*/
|
|
311
|
+
type AnswerEvent = z.infer<typeof AnswerEventSchema>;
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/index.d.ts
|
|
314
|
+
/**
|
|
315
|
+
* Default port for the coordinator WebSocket server
|
|
316
|
+
*
|
|
317
|
+
* @public
|
|
318
|
+
*/
|
|
319
|
+
declare const DEFAULT_PORT: number;
|
|
320
|
+
/**
|
|
321
|
+
* Default host for the coordinator WebSocket server
|
|
322
|
+
*
|
|
323
|
+
* @public
|
|
324
|
+
*/
|
|
325
|
+
declare const DEFAULT_HOST: string;
|
|
326
|
+
/**
|
|
327
|
+
* Default WebSocket URL for the coordinator server
|
|
328
|
+
*
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
331
|
+
declare const DEFAULT_URL: string;
|
|
332
|
+
//#endregion
|
|
333
|
+
export { type Agent, type AgentRole, AgentRoleSchema, AgentSchema, type AnswerEvent, AnswerEventSchema, type AnswerInput, AnswerInputSchema, type AskInput, AskInputSchema, type ContextEntry, ContextEntrySchema, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_URL, type Decision, DecisionSchema, type GetContextInput, GetContextInputSchema, type JoinInput, JoinInputSchema, type JoinResult, JoinResultSchema, type ListContextInput, ListContextInputSchema, type LogDecisionInput, LogDecisionInputSchema, type Question, type QuestionEvent, QuestionEventSchema, QuestionSchema, type QuestionStatus, QuestionStatusSchema, type ShareContextInput, ShareContextInputSchema };
|
|
334
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,88 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}).describe("A connected agent in the coordination session");
|
|
13
|
-
const JoinInputSchema = z.object({
|
|
14
|
-
name: z.string().min(1).describe("Human-readable name for the agent"),
|
|
15
|
-
role: AgentRoleSchema,
|
|
16
|
-
repoPath: z.string().min(1).describe("Path to the repository this agent is working in")
|
|
17
|
-
}).describe("Input for joining a coordination session");
|
|
18
|
-
const JoinResultSchema = z.object({
|
|
19
|
-
agent: AgentSchema,
|
|
20
|
-
sessionId: z.string().uuid().describe("Unique identifier for the session")
|
|
21
|
-
}).describe("Result of joining a coordination session");
|
|
22
|
-
const ContextEntrySchema = z.object({
|
|
23
|
-
id: z.string().uuid().describe("Unique identifier for this context entry"),
|
|
24
|
-
key: z.string().min(1).describe("Key to identify this context entry"),
|
|
25
|
-
value: z.string().describe("The context value/content"),
|
|
26
|
-
tags: z.array(z.string()).describe("Tags for categorizing context"),
|
|
27
|
-
createdBy: z.string().uuid().describe("ID of the agent that created this entry"),
|
|
28
|
-
createdAt: z.coerce.date().describe("Timestamp when the entry was created"),
|
|
29
|
-
updatedAt: z.coerce.date().describe("Timestamp when the entry was last updated")
|
|
30
|
-
}).describe("A shared context entry");
|
|
31
|
-
const ShareContextInputSchema = z.object({
|
|
32
|
-
key: z.string().min(1).describe("Key to identify this context entry"),
|
|
33
|
-
value: z.string().describe("The context value/content to share"),
|
|
34
|
-
tags: z.array(z.string()).optional().describe("Optional tags for categorizing context")
|
|
35
|
-
}).describe("Input for sharing a context entry");
|
|
36
|
-
const GetContextInputSchema = z.object({
|
|
37
|
-
key: z.string().min(1).describe("Key of the context entry to retrieve")
|
|
38
|
-
}).describe("Input for retrieving a context entry by key");
|
|
39
|
-
const ListContextInputSchema = z.object({
|
|
40
|
-
tags: z.array(z.string()).optional().describe("Filter by tags (entries must have all specified tags)"),
|
|
41
|
-
createdBy: z.string().uuid().optional().describe("Filter by creator agent ID")
|
|
42
|
-
}).describe("Input for listing context entries with optional filters");
|
|
43
|
-
const DecisionSchema = z.object({
|
|
44
|
-
id: z.string().uuid().describe("Unique identifier for this decision"),
|
|
45
|
-
decision: z.string().min(1).describe("The decision that was made"),
|
|
46
|
-
rationale: z.string().optional().describe("Explanation for why this decision was made"),
|
|
47
|
-
by: z.string().uuid().describe("ID of the agent that made this decision"),
|
|
48
|
-
createdAt: z.coerce.date().describe("Timestamp when the decision was logged")
|
|
49
|
-
}).describe("A logged decision");
|
|
50
|
-
const LogDecisionInputSchema = z.object({
|
|
51
|
-
decision: z.string().min(1).describe("The decision that was made"),
|
|
52
|
-
rationale: z.string().optional().describe("Explanation for why this decision was made")
|
|
53
|
-
}).describe("Input for logging a decision");
|
|
54
|
-
const QuestionStatusSchema = z["enum"]([
|
|
55
|
-
"pending",
|
|
56
|
-
"answered"
|
|
57
|
-
]).describe("Status of the question");
|
|
58
|
-
const QuestionSchema = z.object({
|
|
59
|
-
id: z.string().uuid().describe("Unique identifier for this question"),
|
|
60
|
-
question: z.string().min(1).describe("The question being asked"),
|
|
61
|
-
from: z.string().uuid().describe("ID of the agent asking the question"),
|
|
62
|
-
to: z.string().uuid().optional().describe("ID of a specific agent to answer (optional)"),
|
|
63
|
-
answer: z.string().optional().describe("The answer to the question"),
|
|
64
|
-
answeredBy: z.string().uuid().optional().describe("ID of the agent that answered"),
|
|
65
|
-
status: QuestionStatusSchema,
|
|
66
|
-
createdAt: z.coerce.date().describe("Timestamp when the question was asked"),
|
|
67
|
-
answeredAt: z.coerce.date().optional().describe("Timestamp when the question was answered")
|
|
68
|
-
}).describe("A question between agents");
|
|
69
|
-
const AskInputSchema = z.object({
|
|
70
|
-
question: z.string().min(1).describe("The question to ask"),
|
|
71
|
-
to: z.string().uuid().optional().describe("ID of a specific agent to answer (optional)")
|
|
72
|
-
}).describe("Input for asking a question");
|
|
73
|
-
const AnswerInputSchema = z.object({
|
|
74
|
-
questionId: z.string().uuid().describe("ID of the question to answer"),
|
|
75
|
-
answer: z.string().min(1).describe("The answer to the question")
|
|
76
|
-
}).describe("Input for answering a question");
|
|
77
|
-
const QuestionEventSchema = z.object({
|
|
78
|
-
type: z.literal("question"),
|
|
79
|
-
question: QuestionSchema
|
|
80
|
-
}).describe("Event emitted when a question is asked");
|
|
81
|
-
const AnswerEventSchema = z.object({
|
|
82
|
-
type: z.literal("answer"),
|
|
83
|
-
question: QuestionSchema
|
|
84
|
-
}).describe("Event emitted when a question is answered");
|
|
1
|
+
import { AgentRoleSchema, AgentSchema, JoinInputSchema, JoinResultSchema } from "./schemas/agent.js";
|
|
2
|
+
import { ContextEntrySchema, GetContextInputSchema, ListContextInputSchema, ShareContextInputSchema } from "./schemas/context.js";
|
|
3
|
+
import { DecisionSchema, LogDecisionInputSchema } from "./schemas/decision.js";
|
|
4
|
+
import { AnswerEventSchema, AnswerInputSchema, AskInputSchema, QuestionEventSchema, QuestionSchema, QuestionStatusSchema } from "./schemas/question.js";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
/**
|
|
8
|
+
* Default port for the coordinator WebSocket server
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
85
12
|
const DEFAULT_PORT = 3030;
|
|
13
|
+
/**
|
|
14
|
+
* Default host for the coordinator WebSocket server
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
86
18
|
const DEFAULT_HOST = "localhost";
|
|
19
|
+
/**
|
|
20
|
+
* Default WebSocket URL for the coordinator server
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
87
24
|
const DEFAULT_URL = `ws://${DEFAULT_HOST}:${DEFAULT_PORT}`;
|
|
88
|
-
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AgentRoleSchema, AgentSchema, AnswerEventSchema, AnswerInputSchema, AskInputSchema, ContextEntrySchema, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_URL, DecisionSchema, GetContextInputSchema, JoinInputSchema, JoinResultSchema, ListContextInputSchema, LogDecisionInputSchema, QuestionEventSchema, QuestionSchema, QuestionStatusSchema, ShareContextInputSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spencerbeggs/claude-coordinator-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core schemas and types for Claude Coordinator",
|
|
6
6
|
"keywords": [
|
|
@@ -20,24 +20,20 @@
|
|
|
20
20
|
"email": "spencer@beggs.codes",
|
|
21
21
|
"url": "https://spencerbeg.gs"
|
|
22
22
|
},
|
|
23
|
+
"sideEffects": false,
|
|
23
24
|
"type": "module",
|
|
24
25
|
"exports": {
|
|
25
26
|
".": {
|
|
26
27
|
"types": "./index.d.ts",
|
|
27
|
-
"import": "./index.js"
|
|
28
|
-
|
|
28
|
+
"import": "./index.js",
|
|
29
|
+
"default": "./index.js"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"zod": "^4.
|
|
34
|
+
"zod": "^4.5.4"
|
|
32
35
|
},
|
|
33
36
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
"LICENSE",
|
|
38
|
-
"README.md",
|
|
39
|
-
"index.d.ts",
|
|
40
|
-
"index.js",
|
|
41
|
-
"package.json"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
37
|
+
"node": ">=24.11.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/schemas/agent.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas/agent.ts
|
|
4
|
+
/**
|
|
5
|
+
* Role of an agent in the coordination session
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const AgentRoleSchema = z.enum(["source", "target"]).describe("The role of the agent: 'source' provides knowledge, 'target' receives knowledge");
|
|
10
|
+
/**
|
|
11
|
+
* Schema for a connected agent in the coordination session
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
const AgentSchema = z.object({
|
|
16
|
+
id: z.string().uuid().describe("Unique identifier for the agent"),
|
|
17
|
+
role: AgentRoleSchema,
|
|
18
|
+
name: z.string().min(1).describe("Human-readable name for the agent"),
|
|
19
|
+
repoPath: z.string().min(1).describe("Path to the repository this agent is working in"),
|
|
20
|
+
connectedAt: z.coerce.date().describe("Timestamp when the agent connected")
|
|
21
|
+
}).describe("A connected agent in the coordination session");
|
|
22
|
+
/**
|
|
23
|
+
* Input schema for joining a coordination session
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
const JoinInputSchema = z.object({
|
|
28
|
+
name: z.string().min(1).describe("Human-readable name for the agent"),
|
|
29
|
+
role: AgentRoleSchema,
|
|
30
|
+
repoPath: z.string().min(1).describe("Path to the repository this agent is working in")
|
|
31
|
+
}).describe("Input for joining a coordination session");
|
|
32
|
+
/**
|
|
33
|
+
* Result of joining a coordination session
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
const JoinResultSchema = z.object({
|
|
38
|
+
agent: AgentSchema,
|
|
39
|
+
sessionId: z.string().uuid().describe("Unique identifier for the session")
|
|
40
|
+
}).describe("Result of joining a coordination session");
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AgentRoleSchema, AgentSchema, JoinInputSchema, JoinResultSchema };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas/context.ts
|
|
4
|
+
/**
|
|
5
|
+
* Schema for a shared context entry
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const ContextEntrySchema = z.object({
|
|
10
|
+
id: z.string().uuid().describe("Unique identifier for this context entry"),
|
|
11
|
+
key: z.string().min(1).describe("Key to identify this context entry"),
|
|
12
|
+
value: z.string().describe("The context value/content"),
|
|
13
|
+
tags: z.array(z.string()).describe("Tags for categorizing context"),
|
|
14
|
+
createdBy: z.string().uuid().describe("ID of the agent that created this entry"),
|
|
15
|
+
createdAt: z.coerce.date().describe("Timestamp when the entry was created"),
|
|
16
|
+
updatedAt: z.coerce.date().describe("Timestamp when the entry was last updated")
|
|
17
|
+
}).describe("A shared context entry");
|
|
18
|
+
/**
|
|
19
|
+
* Input schema for sharing a context entry
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
const ShareContextInputSchema = z.object({
|
|
24
|
+
key: z.string().min(1).describe("Key to identify this context entry"),
|
|
25
|
+
value: z.string().describe("The context value/content to share"),
|
|
26
|
+
tags: z.array(z.string()).optional().describe("Optional tags for categorizing context")
|
|
27
|
+
}).describe("Input for sharing a context entry");
|
|
28
|
+
/**
|
|
29
|
+
* Input schema for retrieving a context entry by key
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
const GetContextInputSchema = z.object({ key: z.string().min(1).describe("Key of the context entry to retrieve") }).describe("Input for retrieving a context entry by key");
|
|
34
|
+
/**
|
|
35
|
+
* Input schema for listing context entries with optional filters
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
const ListContextInputSchema = z.object({
|
|
40
|
+
tags: z.array(z.string()).optional().describe("Filter by tags (entries must have all specified tags)"),
|
|
41
|
+
createdBy: z.string().uuid().optional().describe("Filter by creator agent ID")
|
|
42
|
+
}).describe("Input for listing context entries with optional filters");
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ContextEntrySchema, GetContextInputSchema, ListContextInputSchema, ShareContextInputSchema };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas/decision.ts
|
|
4
|
+
/**
|
|
5
|
+
* Schema for a logged decision
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const DecisionSchema = z.object({
|
|
10
|
+
id: z.string().uuid().describe("Unique identifier for this decision"),
|
|
11
|
+
decision: z.string().min(1).describe("The decision that was made"),
|
|
12
|
+
rationale: z.string().optional().describe("Explanation for why this decision was made"),
|
|
13
|
+
by: z.string().uuid().describe("ID of the agent that made this decision"),
|
|
14
|
+
createdAt: z.coerce.date().describe("Timestamp when the decision was logged")
|
|
15
|
+
}).describe("A logged decision");
|
|
16
|
+
/**
|
|
17
|
+
* Input schema for logging a decision
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
const LogDecisionInputSchema = z.object({
|
|
22
|
+
decision: z.string().min(1).describe("The decision that was made"),
|
|
23
|
+
rationale: z.string().optional().describe("Explanation for why this decision was made")
|
|
24
|
+
}).describe("Input for logging a decision");
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { DecisionSchema, LogDecisionInputSchema };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas/question.ts
|
|
4
|
+
/**
|
|
5
|
+
* Status of a question
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const QuestionStatusSchema = z.enum(["pending", "answered"]).describe("Status of the question");
|
|
10
|
+
/**
|
|
11
|
+
* Schema for a question between agents
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
const QuestionSchema = z.object({
|
|
16
|
+
id: z.string().uuid().describe("Unique identifier for this question"),
|
|
17
|
+
question: z.string().min(1).describe("The question being asked"),
|
|
18
|
+
from: z.string().uuid().describe("ID of the agent asking the question"),
|
|
19
|
+
to: z.string().uuid().optional().describe("ID of a specific agent to answer (optional)"),
|
|
20
|
+
answer: z.string().optional().describe("The answer to the question"),
|
|
21
|
+
answeredBy: z.string().uuid().optional().describe("ID of the agent that answered"),
|
|
22
|
+
status: QuestionStatusSchema,
|
|
23
|
+
createdAt: z.coerce.date().describe("Timestamp when the question was asked"),
|
|
24
|
+
answeredAt: z.coerce.date().optional().describe("Timestamp when the question was answered")
|
|
25
|
+
}).describe("A question between agents");
|
|
26
|
+
/**
|
|
27
|
+
* Input schema for asking a question
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
const AskInputSchema = z.object({
|
|
32
|
+
question: z.string().min(1).describe("The question to ask"),
|
|
33
|
+
to: z.string().uuid().optional().describe("ID of a specific agent to answer (optional)")
|
|
34
|
+
}).describe("Input for asking a question");
|
|
35
|
+
/**
|
|
36
|
+
* Input schema for answering a question
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
const AnswerInputSchema = z.object({
|
|
41
|
+
questionId: z.string().uuid().describe("ID of the question to answer"),
|
|
42
|
+
answer: z.string().min(1).describe("The answer to the question")
|
|
43
|
+
}).describe("Input for answering a question");
|
|
44
|
+
/**
|
|
45
|
+
* Event emitted when a question is asked
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
const QuestionEventSchema = z.object({
|
|
50
|
+
type: z.literal("question"),
|
|
51
|
+
question: QuestionSchema
|
|
52
|
+
}).describe("Event emitted when a question is asked");
|
|
53
|
+
/**
|
|
54
|
+
* Event emitted when a question is answered
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
const AnswerEventSchema = z.object({
|
|
59
|
+
type: z.literal("answer"),
|
|
60
|
+
question: QuestionSchema
|
|
61
|
+
}).describe("Event emitted when a question is answered");
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { AnswerEventSchema, AnswerInputSchema, AskInputSchema, QuestionEventSchema, QuestionSchema, QuestionStatusSchema };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.59.0"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|