@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 CHANGED
@@ -1,242 +1,334 @@
1
- /**
2
- * \@spencerbeggs/claude-coordinator-core
3
- *
4
- * Core schemas and types for the Claude Coordinator system.
5
- * Provides Zod schemas for validation and TypeScript types for
6
- * communication between Claude Code instances.
7
- *
8
- * @packageDocumentation
9
- */
10
-
11
- import { z } from 'zod';
12
-
13
- export declare type Agent = z.infer<typeof AgentSchema>;
14
-
15
- export declare type AgentRole = z.infer<typeof AgentRoleSchema>;
16
-
17
- /**
18
- * Role of an agent in the coordination session
19
- */
20
- export declare const AgentRoleSchema: z.ZodEnum<{
21
- source: "source";
22
- target: "target";
23
- }>;
24
-
25
- /**
26
- * Schema for a connected agent in the coordination session
27
- */
28
- export declare const AgentSchema: z.ZodObject<{
29
- id: z.ZodString;
30
- role: z.ZodEnum<{
31
- source: "source";
32
- target: "target";
33
- }>;
34
- name: z.ZodString;
35
- repoPath: z.ZodString;
36
- connectedAt: z.ZodCoercedDate<unknown>;
37
- }, z.core.$strip>;
38
-
39
- export declare type AnswerEvent = z.infer<typeof AnswerEventSchema>;
40
-
41
- /**
42
- * Event emitted when a question is answered
43
- */
44
- export declare const AnswerEventSchema: z.ZodObject<{
45
- type: z.ZodLiteral<"answer">;
46
- question: z.ZodObject<{
47
- id: z.ZodString;
48
- question: z.ZodString;
49
- from: z.ZodString;
50
- to: z.ZodOptional<z.ZodString>;
51
- answer: z.ZodOptional<z.ZodString>;
52
- answeredBy: z.ZodOptional<z.ZodString>;
53
- status: z.ZodEnum<{
54
- answered: "answered";
55
- pending: "pending";
56
- }>;
57
- createdAt: z.ZodCoercedDate<unknown>;
58
- answeredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
59
- }, z.core.$strip>;
60
- }, z.core.$strip>;
61
-
62
- export declare type AnswerInput = z.infer<typeof AnswerInputSchema>;
63
-
64
- /**
65
- * Input schema for answering a question
66
- */
67
- export declare const AnswerInputSchema: z.ZodObject<{
68
- questionId: z.ZodString;
69
- answer: z.ZodString;
70
- }, z.core.$strip>;
71
-
72
- export declare type AskInput = z.infer<typeof AskInputSchema>;
73
-
74
- /**
75
- * Input schema for asking a question
76
- */
77
- export declare const AskInputSchema: z.ZodObject<{
78
- question: z.ZodString;
79
- to: z.ZodOptional<z.ZodString>;
80
- }, z.core.$strip>;
81
-
82
- export declare type ContextEntry = z.infer<typeof ContextEntrySchema>;
83
-
84
- /**
85
- * Schema for a shared context entry
86
- */
87
- export declare const ContextEntrySchema: z.ZodObject<{
88
- id: z.ZodString;
89
- key: z.ZodString;
90
- value: z.ZodString;
91
- tags: z.ZodArray<z.ZodString>;
92
- createdBy: z.ZodString;
93
- createdAt: z.ZodCoercedDate<unknown>;
94
- updatedAt: z.ZodCoercedDate<unknown>;
95
- }, z.core.$strip>;
96
-
97
- export declare type Decision = z.infer<typeof DecisionSchema>;
98
-
99
- /**
100
- * Schema for a logged decision
101
- */
102
- export declare const DecisionSchema: z.ZodObject<{
103
- id: z.ZodString;
104
- decision: z.ZodString;
105
- rationale: z.ZodOptional<z.ZodString>;
106
- by: z.ZodString;
107
- createdAt: z.ZodCoercedDate<unknown>;
108
- }, z.core.$strip>;
109
-
110
- export declare const DEFAULT_HOST: string;
111
-
112
- export declare const DEFAULT_PORT: number;
113
-
114
- export declare const DEFAULT_URL: string;
115
-
116
- export declare type GetContextInput = z.infer<typeof GetContextInputSchema>;
117
-
118
- /**
119
- * Input schema for retrieving a context entry by key
120
- */
121
- export declare const GetContextInputSchema: z.ZodObject<{
122
- key: z.ZodString;
123
- }, z.core.$strip>;
124
-
125
- export declare type JoinInput = z.infer<typeof JoinInputSchema>;
126
-
127
- /**
128
- * Input schema for joining a coordination session
129
- */
130
- export declare const JoinInputSchema: z.ZodObject<{
131
- name: z.ZodString;
132
- role: z.ZodEnum<{
133
- source: "source";
134
- target: "target";
135
- }>;
136
- repoPath: z.ZodString;
137
- }, z.core.$strip>;
138
-
139
- export declare type JoinResult = z.infer<typeof JoinResultSchema>;
140
-
141
- /**
142
- * Result of joining a coordination session
143
- */
144
- export declare const JoinResultSchema: z.ZodObject<{
145
- agent: z.ZodObject<{
146
- id: z.ZodString;
147
- role: z.ZodEnum<{
148
- source: "source";
149
- target: "target";
150
- }>;
151
- name: z.ZodString;
152
- repoPath: z.ZodString;
153
- connectedAt: z.ZodCoercedDate<unknown>;
154
- }, z.core.$strip>;
155
- sessionId: z.ZodString;
156
- }, z.core.$strip>;
157
-
158
- export declare type ListContextInput = z.infer<typeof ListContextInputSchema>;
159
-
160
- /**
161
- * Input schema for listing context entries with optional filters
162
- */
163
- export declare const ListContextInputSchema: z.ZodObject<{
164
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
- createdBy: z.ZodOptional<z.ZodString>;
166
- }, z.core.$strip>;
167
-
168
- export declare type LogDecisionInput = z.infer<typeof LogDecisionInputSchema>;
169
-
170
- /**
171
- * Input schema for logging a decision
172
- */
173
- export declare const LogDecisionInputSchema: z.ZodObject<{
174
- decision: z.ZodString;
175
- rationale: z.ZodOptional<z.ZodString>;
176
- }, z.core.$strip>;
177
-
178
- export declare type Question = z.infer<typeof QuestionSchema>;
179
-
180
- export declare type QuestionEvent = z.infer<typeof QuestionEventSchema>;
181
-
182
- /**
183
- * Event emitted when a question is asked
184
- */
185
- export declare const QuestionEventSchema: z.ZodObject<{
186
- type: z.ZodLiteral<"question">;
187
- question: z.ZodObject<{
188
- id: z.ZodString;
189
- question: z.ZodString;
190
- from: z.ZodString;
191
- to: z.ZodOptional<z.ZodString>;
192
- answer: z.ZodOptional<z.ZodString>;
193
- answeredBy: z.ZodOptional<z.ZodString>;
194
- status: z.ZodEnum<{
195
- answered: "answered";
196
- pending: "pending";
197
- }>;
198
- createdAt: z.ZodCoercedDate<unknown>;
199
- answeredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
200
- }, z.core.$strip>;
201
- }, z.core.$strip>;
202
-
203
- /**
204
- * Schema for a question between agents
205
- */
206
- export 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
- export declare type QuestionStatus = z.infer<typeof QuestionStatusSchema>;
222
-
223
- /**
224
- * Status of a question
225
- */
226
- export declare const QuestionStatusSchema: z.ZodEnum<{
227
- answered: "answered";
228
- pending: "pending";
229
- }>;
230
-
231
- export declare type ShareContextInput = z.infer<typeof ShareContextInputSchema>;
232
-
233
- /**
234
- * Input schema for sharing a context entry
235
- */
236
- export declare const ShareContextInputSchema: z.ZodObject<{
237
- key: z.ZodString;
238
- value: z.ZodString;
239
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
240
- }, z.core.$strip>;
241
-
242
- export { }
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 { z } from "zod";
2
- const AgentRoleSchema = z["enum"]([
3
- "source",
4
- "target"
5
- ]).describe("The role of the agent: 'source' provides knowledge, 'target' receives knowledge");
6
- const AgentSchema = z.object({
7
- id: z.string().uuid().describe("Unique identifier for the agent"),
8
- role: AgentRoleSchema,
9
- name: z.string().min(1).describe("Human-readable name for the agent"),
10
- repoPath: z.string().min(1).describe("Path to the repository this agent is working in"),
11
- connectedAt: z.coerce.date().describe("Timestamp when the agent connected")
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
- export { AgentRoleSchema, AgentSchema, AnswerEventSchema, AnswerInputSchema, AskInputSchema, ContextEntrySchema, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_URL, DecisionSchema, GetContextInputSchema, JoinInputSchema, JoinResultSchema, ListContextInputSchema, LogDecisionInputSchema, QuestionEventSchema, QuestionSchema, QuestionStatusSchema, ShareContextInputSchema };
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.0",
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.3.5"
34
+ "zod": "^4.5.4"
32
35
  },
33
36
  "engines": {
34
- "node": ">=20.0.0"
35
- },
36
- "files": [
37
- "LICENSE",
38
- "README.md",
39
- "index.d.ts",
40
- "index.js",
41
- "package.json"
42
- ]
43
- }
37
+ "node": ">=24.11.0"
38
+ }
39
+ }
@@ -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
+ }