mcp-sunsama 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 (53) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +11 -0
  3. package/.claude/settings.local.json +29 -0
  4. package/.env.example +10 -0
  5. package/CHANGELOG.md +29 -0
  6. package/CLAUDE.md +137 -0
  7. package/LICENSE +21 -0
  8. package/README.md +143 -0
  9. package/TODO_PREPUBLISH.md +182 -0
  10. package/bun.lock +515 -0
  11. package/dist/auth/http.d.ts +20 -0
  12. package/dist/auth/http.d.ts.map +1 -0
  13. package/dist/auth/http.js +52 -0
  14. package/dist/auth/stdio.d.ts +13 -0
  15. package/dist/auth/stdio.d.ts.map +1 -0
  16. package/dist/auth/stdio.js +27 -0
  17. package/dist/auth/types.d.ts +9 -0
  18. package/dist/auth/types.d.ts.map +1 -0
  19. package/dist/auth/types.js +1 -0
  20. package/dist/config/transport.d.ts +32 -0
  21. package/dist/config/transport.d.ts.map +1 -0
  22. package/dist/config/transport.js +62 -0
  23. package/dist/main.d.ts +2 -0
  24. package/dist/main.d.ts.map +1 -0
  25. package/dist/main.js +473 -0
  26. package/dist/schemas.d.ts +522 -0
  27. package/dist/schemas.d.ts.map +1 -0
  28. package/dist/schemas.js +124 -0
  29. package/dist/utils/client-resolver.d.ts +10 -0
  30. package/dist/utils/client-resolver.d.ts.map +1 -0
  31. package/dist/utils/client-resolver.js +19 -0
  32. package/dist/utils/task-filters.d.ts +29 -0
  33. package/dist/utils/task-filters.d.ts.map +1 -0
  34. package/dist/utils/task-filters.js +42 -0
  35. package/dist/utils/task-trimmer.d.ts +47 -0
  36. package/dist/utils/task-trimmer.d.ts.map +1 -0
  37. package/dist/utils/task-trimmer.js +50 -0
  38. package/dist/utils/to-tsv.d.ts +8 -0
  39. package/dist/utils/to-tsv.d.ts.map +1 -0
  40. package/dist/utils/to-tsv.js +64 -0
  41. package/mcp-inspector.json +14 -0
  42. package/package.json +56 -0
  43. package/src/auth/http.ts +61 -0
  44. package/src/auth/stdio.ts +33 -0
  45. package/src/auth/types.ts +9 -0
  46. package/src/config/transport.ts +80 -0
  47. package/src/main.ts +542 -0
  48. package/src/schemas.ts +169 -0
  49. package/src/utils/client-resolver.ts +23 -0
  50. package/src/utils/task-filters.ts +49 -0
  51. package/src/utils/task-trimmer.ts +81 -0
  52. package/src/utils/to-tsv.ts +73 -0
  53. package/tsconfig.json +36 -0
@@ -0,0 +1,522 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Task Operation Schemas
4
+ */
5
+ export declare const completionFilterSchema: z.ZodEnum<["all", "incomplete", "completed"]>;
6
+ export declare const getTasksByDaySchema: z.ZodObject<{
7
+ day: z.ZodString;
8
+ timezone: z.ZodOptional<z.ZodString>;
9
+ completionFilter: z.ZodOptional<z.ZodEnum<["all", "incomplete", "completed"]>>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ day: string;
12
+ timezone?: string | undefined;
13
+ completionFilter?: "all" | "incomplete" | "completed" | undefined;
14
+ }, {
15
+ day: string;
16
+ timezone?: string | undefined;
17
+ completionFilter?: "all" | "incomplete" | "completed" | undefined;
18
+ }>;
19
+ export declare const getTasksBacklogSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
20
+ /**
21
+ * User Operation Schemas
22
+ */
23
+ export declare const getUserSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
24
+ /**
25
+ * Stream Operation Schemas
26
+ */
27
+ export declare const getStreamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
28
+ /**
29
+ * Task Mutation Operation Schemas
30
+ */
31
+ export declare const createTaskSchema: z.ZodObject<{
32
+ text: z.ZodString;
33
+ notes: z.ZodOptional<z.ZodString>;
34
+ streamIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ timeEstimate: z.ZodOptional<z.ZodNumber>;
36
+ dueDate: z.ZodOptional<z.ZodString>;
37
+ snoozeUntil: z.ZodOptional<z.ZodString>;
38
+ private: z.ZodOptional<z.ZodBoolean>;
39
+ taskId: z.ZodOptional<z.ZodString>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ text: string;
42
+ notes?: string | undefined;
43
+ streamIds?: string[] | undefined;
44
+ timeEstimate?: number | undefined;
45
+ dueDate?: string | undefined;
46
+ snoozeUntil?: string | undefined;
47
+ private?: boolean | undefined;
48
+ taskId?: string | undefined;
49
+ }, {
50
+ text: string;
51
+ notes?: string | undefined;
52
+ streamIds?: string[] | undefined;
53
+ timeEstimate?: number | undefined;
54
+ dueDate?: string | undefined;
55
+ snoozeUntil?: string | undefined;
56
+ private?: boolean | undefined;
57
+ taskId?: string | undefined;
58
+ }>;
59
+ export declare const updateTaskCompleteSchema: z.ZodObject<{
60
+ taskId: z.ZodString;
61
+ completeOn: z.ZodOptional<z.ZodString>;
62
+ limitResponsePayload: z.ZodOptional<z.ZodBoolean>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ taskId: string;
65
+ completeOn?: string | undefined;
66
+ limitResponsePayload?: boolean | undefined;
67
+ }, {
68
+ taskId: string;
69
+ completeOn?: string | undefined;
70
+ limitResponsePayload?: boolean | undefined;
71
+ }>;
72
+ export declare const deleteTaskSchema: z.ZodObject<{
73
+ taskId: z.ZodString;
74
+ limitResponsePayload: z.ZodOptional<z.ZodBoolean>;
75
+ wasTaskMerged: z.ZodOptional<z.ZodBoolean>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ taskId: string;
78
+ limitResponsePayload?: boolean | undefined;
79
+ wasTaskMerged?: boolean | undefined;
80
+ }, {
81
+ taskId: string;
82
+ limitResponsePayload?: boolean | undefined;
83
+ wasTaskMerged?: boolean | undefined;
84
+ }>;
85
+ /**
86
+ * Response Type Schemas (for validation and documentation)
87
+ */
88
+ export declare const userProfileSchema: z.ZodObject<{
89
+ _id: z.ZodString;
90
+ email: z.ZodString;
91
+ firstName: z.ZodString;
92
+ lastName: z.ZodString;
93
+ timezone: z.ZodString;
94
+ avatarUrl: z.ZodOptional<z.ZodString>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ email: string;
97
+ timezone: string;
98
+ _id: string;
99
+ firstName: string;
100
+ lastName: string;
101
+ avatarUrl?: string | undefined;
102
+ }, {
103
+ email: string;
104
+ timezone: string;
105
+ _id: string;
106
+ firstName: string;
107
+ lastName: string;
108
+ avatarUrl?: string | undefined;
109
+ }>;
110
+ export declare const groupSchema: z.ZodObject<{
111
+ groupId: z.ZodString;
112
+ name: z.ZodString;
113
+ role: z.ZodOptional<z.ZodString>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ groupId: string;
116
+ name: string;
117
+ role?: string | undefined;
118
+ }, {
119
+ groupId: string;
120
+ name: string;
121
+ role?: string | undefined;
122
+ }>;
123
+ export declare const userSchema: z.ZodObject<{
124
+ _id: z.ZodString;
125
+ email: z.ZodString;
126
+ profile: z.ZodObject<{
127
+ _id: z.ZodString;
128
+ email: z.ZodString;
129
+ firstName: z.ZodString;
130
+ lastName: z.ZodString;
131
+ timezone: z.ZodString;
132
+ avatarUrl: z.ZodOptional<z.ZodString>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ email: string;
135
+ timezone: string;
136
+ _id: string;
137
+ firstName: string;
138
+ lastName: string;
139
+ avatarUrl?: string | undefined;
140
+ }, {
141
+ email: string;
142
+ timezone: string;
143
+ _id: string;
144
+ firstName: string;
145
+ lastName: string;
146
+ avatarUrl?: string | undefined;
147
+ }>;
148
+ primaryGroup: z.ZodOptional<z.ZodObject<{
149
+ groupId: z.ZodString;
150
+ name: z.ZodString;
151
+ role: z.ZodOptional<z.ZodString>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ groupId: string;
154
+ name: string;
155
+ role?: string | undefined;
156
+ }, {
157
+ groupId: string;
158
+ name: string;
159
+ role?: string | undefined;
160
+ }>>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ email: string;
163
+ _id: string;
164
+ profile: {
165
+ email: string;
166
+ timezone: string;
167
+ _id: string;
168
+ firstName: string;
169
+ lastName: string;
170
+ avatarUrl?: string | undefined;
171
+ };
172
+ primaryGroup?: {
173
+ groupId: string;
174
+ name: string;
175
+ role?: string | undefined;
176
+ } | undefined;
177
+ }, {
178
+ email: string;
179
+ _id: string;
180
+ profile: {
181
+ email: string;
182
+ timezone: string;
183
+ _id: string;
184
+ firstName: string;
185
+ lastName: string;
186
+ avatarUrl?: string | undefined;
187
+ };
188
+ primaryGroup?: {
189
+ groupId: string;
190
+ name: string;
191
+ role?: string | undefined;
192
+ } | undefined;
193
+ }>;
194
+ export declare const taskSchema: z.ZodObject<{
195
+ _id: z.ZodString;
196
+ title: z.ZodString;
197
+ description: z.ZodOptional<z.ZodString>;
198
+ status: z.ZodString;
199
+ createdAt: z.ZodString;
200
+ updatedAt: z.ZodString;
201
+ scheduledDate: z.ZodOptional<z.ZodString>;
202
+ completedAt: z.ZodOptional<z.ZodString>;
203
+ streamId: z.ZodOptional<z.ZodString>;
204
+ userId: z.ZodString;
205
+ groupId: z.ZodString;
206
+ }, "strip", z.ZodTypeAny, {
207
+ status: string;
208
+ _id: string;
209
+ groupId: string;
210
+ title: string;
211
+ createdAt: string;
212
+ updatedAt: string;
213
+ userId: string;
214
+ description?: string | undefined;
215
+ scheduledDate?: string | undefined;
216
+ completedAt?: string | undefined;
217
+ streamId?: string | undefined;
218
+ }, {
219
+ status: string;
220
+ _id: string;
221
+ groupId: string;
222
+ title: string;
223
+ createdAt: string;
224
+ updatedAt: string;
225
+ userId: string;
226
+ description?: string | undefined;
227
+ scheduledDate?: string | undefined;
228
+ completedAt?: string | undefined;
229
+ streamId?: string | undefined;
230
+ }>;
231
+ export declare const streamSchema: z.ZodObject<{
232
+ _id: z.ZodString;
233
+ name: z.ZodString;
234
+ color: z.ZodOptional<z.ZodString>;
235
+ groupId: z.ZodString;
236
+ isActive: z.ZodBoolean;
237
+ createdAt: z.ZodString;
238
+ updatedAt: z.ZodString;
239
+ }, "strip", z.ZodTypeAny, {
240
+ _id: string;
241
+ groupId: string;
242
+ name: string;
243
+ createdAt: string;
244
+ updatedAt: string;
245
+ isActive: boolean;
246
+ color?: string | undefined;
247
+ }, {
248
+ _id: string;
249
+ groupId: string;
250
+ name: string;
251
+ createdAt: string;
252
+ updatedAt: string;
253
+ isActive: boolean;
254
+ color?: string | undefined;
255
+ }>;
256
+ /**
257
+ * API Response Schemas
258
+ */
259
+ export declare const userResponseSchema: z.ZodObject<{
260
+ user: z.ZodObject<{
261
+ _id: z.ZodString;
262
+ email: z.ZodString;
263
+ profile: z.ZodObject<{
264
+ _id: z.ZodString;
265
+ email: z.ZodString;
266
+ firstName: z.ZodString;
267
+ lastName: z.ZodString;
268
+ timezone: z.ZodString;
269
+ avatarUrl: z.ZodOptional<z.ZodString>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ email: string;
272
+ timezone: string;
273
+ _id: string;
274
+ firstName: string;
275
+ lastName: string;
276
+ avatarUrl?: string | undefined;
277
+ }, {
278
+ email: string;
279
+ timezone: string;
280
+ _id: string;
281
+ firstName: string;
282
+ lastName: string;
283
+ avatarUrl?: string | undefined;
284
+ }>;
285
+ primaryGroup: z.ZodOptional<z.ZodObject<{
286
+ groupId: z.ZodString;
287
+ name: z.ZodString;
288
+ role: z.ZodOptional<z.ZodString>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ groupId: string;
291
+ name: string;
292
+ role?: string | undefined;
293
+ }, {
294
+ groupId: string;
295
+ name: string;
296
+ role?: string | undefined;
297
+ }>>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ email: string;
300
+ _id: string;
301
+ profile: {
302
+ email: string;
303
+ timezone: string;
304
+ _id: string;
305
+ firstName: string;
306
+ lastName: string;
307
+ avatarUrl?: string | undefined;
308
+ };
309
+ primaryGroup?: {
310
+ groupId: string;
311
+ name: string;
312
+ role?: string | undefined;
313
+ } | undefined;
314
+ }, {
315
+ email: string;
316
+ _id: string;
317
+ profile: {
318
+ email: string;
319
+ timezone: string;
320
+ _id: string;
321
+ firstName: string;
322
+ lastName: string;
323
+ avatarUrl?: string | undefined;
324
+ };
325
+ primaryGroup?: {
326
+ groupId: string;
327
+ name: string;
328
+ role?: string | undefined;
329
+ } | undefined;
330
+ }>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ user: {
333
+ email: string;
334
+ _id: string;
335
+ profile: {
336
+ email: string;
337
+ timezone: string;
338
+ _id: string;
339
+ firstName: string;
340
+ lastName: string;
341
+ avatarUrl?: string | undefined;
342
+ };
343
+ primaryGroup?: {
344
+ groupId: string;
345
+ name: string;
346
+ role?: string | undefined;
347
+ } | undefined;
348
+ };
349
+ }, {
350
+ user: {
351
+ email: string;
352
+ _id: string;
353
+ profile: {
354
+ email: string;
355
+ timezone: string;
356
+ _id: string;
357
+ firstName: string;
358
+ lastName: string;
359
+ avatarUrl?: string | undefined;
360
+ };
361
+ primaryGroup?: {
362
+ groupId: string;
363
+ name: string;
364
+ role?: string | undefined;
365
+ } | undefined;
366
+ };
367
+ }>;
368
+ export declare const tasksResponseSchema: z.ZodObject<{
369
+ tasks: z.ZodArray<z.ZodObject<{
370
+ _id: z.ZodString;
371
+ title: z.ZodString;
372
+ description: z.ZodOptional<z.ZodString>;
373
+ status: z.ZodString;
374
+ createdAt: z.ZodString;
375
+ updatedAt: z.ZodString;
376
+ scheduledDate: z.ZodOptional<z.ZodString>;
377
+ completedAt: z.ZodOptional<z.ZodString>;
378
+ streamId: z.ZodOptional<z.ZodString>;
379
+ userId: z.ZodString;
380
+ groupId: z.ZodString;
381
+ }, "strip", z.ZodTypeAny, {
382
+ status: string;
383
+ _id: string;
384
+ groupId: string;
385
+ title: string;
386
+ createdAt: string;
387
+ updatedAt: string;
388
+ userId: string;
389
+ description?: string | undefined;
390
+ scheduledDate?: string | undefined;
391
+ completedAt?: string | undefined;
392
+ streamId?: string | undefined;
393
+ }, {
394
+ status: string;
395
+ _id: string;
396
+ groupId: string;
397
+ title: string;
398
+ createdAt: string;
399
+ updatedAt: string;
400
+ userId: string;
401
+ description?: string | undefined;
402
+ scheduledDate?: string | undefined;
403
+ completedAt?: string | undefined;
404
+ streamId?: string | undefined;
405
+ }>, "many">;
406
+ count: z.ZodNumber;
407
+ }, "strip", z.ZodTypeAny, {
408
+ tasks: {
409
+ status: string;
410
+ _id: string;
411
+ groupId: string;
412
+ title: string;
413
+ createdAt: string;
414
+ updatedAt: string;
415
+ userId: string;
416
+ description?: string | undefined;
417
+ scheduledDate?: string | undefined;
418
+ completedAt?: string | undefined;
419
+ streamId?: string | undefined;
420
+ }[];
421
+ count: number;
422
+ }, {
423
+ tasks: {
424
+ status: string;
425
+ _id: string;
426
+ groupId: string;
427
+ title: string;
428
+ createdAt: string;
429
+ updatedAt: string;
430
+ userId: string;
431
+ description?: string | undefined;
432
+ scheduledDate?: string | undefined;
433
+ completedAt?: string | undefined;
434
+ streamId?: string | undefined;
435
+ }[];
436
+ count: number;
437
+ }>;
438
+ export declare const streamsResponseSchema: z.ZodObject<{
439
+ streams: z.ZodArray<z.ZodObject<{
440
+ _id: z.ZodString;
441
+ name: z.ZodString;
442
+ color: z.ZodOptional<z.ZodString>;
443
+ groupId: z.ZodString;
444
+ isActive: z.ZodBoolean;
445
+ createdAt: z.ZodString;
446
+ updatedAt: z.ZodString;
447
+ }, "strip", z.ZodTypeAny, {
448
+ _id: string;
449
+ groupId: string;
450
+ name: string;
451
+ createdAt: string;
452
+ updatedAt: string;
453
+ isActive: boolean;
454
+ color?: string | undefined;
455
+ }, {
456
+ _id: string;
457
+ groupId: string;
458
+ name: string;
459
+ createdAt: string;
460
+ updatedAt: string;
461
+ isActive: boolean;
462
+ color?: string | undefined;
463
+ }>, "many">;
464
+ count: z.ZodNumber;
465
+ }, "strip", z.ZodTypeAny, {
466
+ count: number;
467
+ streams: {
468
+ _id: string;
469
+ groupId: string;
470
+ name: string;
471
+ createdAt: string;
472
+ updatedAt: string;
473
+ isActive: boolean;
474
+ color?: string | undefined;
475
+ }[];
476
+ }, {
477
+ count: number;
478
+ streams: {
479
+ _id: string;
480
+ groupId: string;
481
+ name: string;
482
+ createdAt: string;
483
+ updatedAt: string;
484
+ isActive: boolean;
485
+ color?: string | undefined;
486
+ }[];
487
+ }>;
488
+ /**
489
+ * Error Response Schema
490
+ */
491
+ export declare const errorResponseSchema: z.ZodObject<{
492
+ error: z.ZodString;
493
+ message: z.ZodString;
494
+ code: z.ZodOptional<z.ZodString>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ message: string;
497
+ error: string;
498
+ code?: string | undefined;
499
+ }, {
500
+ message: string;
501
+ error: string;
502
+ code?: string | undefined;
503
+ }>;
504
+ /**
505
+ * Type Exports (for use in tools)
506
+ */
507
+ export type CompletionFilter = z.infer<typeof completionFilterSchema>;
508
+ export type GetTasksByDayInput = z.infer<typeof getTasksByDaySchema>;
509
+ export type GetTasksBacklogInput = z.infer<typeof getTasksBacklogSchema>;
510
+ export type GetUserInput = z.infer<typeof getUserSchema>;
511
+ export type GetStreamsInput = z.infer<typeof getStreamsSchema>;
512
+ export type CreateTaskInput = z.infer<typeof createTaskSchema>;
513
+ export type UpdateTaskCompleteInput = z.infer<typeof updateTaskCompleteSchema>;
514
+ export type DeleteTaskInput = z.infer<typeof deleteTaskSchema>;
515
+ export type User = z.infer<typeof userSchema>;
516
+ export type Task = z.infer<typeof taskSchema>;
517
+ export type Stream = z.infer<typeof streamSchema>;
518
+ export type UserResponse = z.infer<typeof userResponseSchema>;
519
+ export type TasksResponse = z.infer<typeof tasksResponseSchema>;
520
+ export type StreamsResponse = z.infer<typeof streamsResponseSchema>;
521
+ export type ErrorResponse = z.infer<typeof errorResponseSchema>;
522
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,+CAA6C,CAAC;AAGjF,eAAO,MAAM,mB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0 +1,124 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Task Operation Schemas
4
+ */
5
+ // Completion filter schema
6
+ export const completionFilterSchema = z.enum(["all", "incomplete", "completed"]);
7
+ // Get tasks by day parameters
8
+ export const getTasksByDaySchema = z.object({
9
+ day: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Day must be in YYYY-MM-DD format"),
10
+ timezone: z.string().optional().describe("Timezone string (e.g., 'America/New_York'). If not provided, uses user's default timezone"),
11
+ completionFilter: completionFilterSchema.optional().describe("Filter tasks by completion status. 'all' returns all tasks, 'incomplete' returns only incomplete tasks, 'completed' returns only completed tasks. Defaults to 'all'"),
12
+ });
13
+ // Get tasks backlog parameters (no parameters needed)
14
+ export const getTasksBacklogSchema = z.object({});
15
+ /**
16
+ * User Operation Schemas
17
+ */
18
+ // Get user parameters (no parameters needed)
19
+ export const getUserSchema = z.object({});
20
+ /**
21
+ * Stream Operation Schemas
22
+ */
23
+ // Get streams parameters (no parameters needed, uses cached group ID)
24
+ export const getStreamsSchema = z.object({});
25
+ /**
26
+ * Task Mutation Operation Schemas
27
+ */
28
+ // Create task parameters
29
+ export const createTaskSchema = z.object({
30
+ text: z.string().min(1, "Task text is required").describe("Task title/description"),
31
+ notes: z.string().optional().describe("Additional task notes"),
32
+ streamIds: z.array(z.string()).optional().describe("Array of stream IDs to associate with the task"),
33
+ timeEstimate: z.number().int().positive().optional().describe("Time estimate in minutes"),
34
+ dueDate: z.string().optional().describe("Due date string (ISO format)"),
35
+ snoozeUntil: z.string().optional().describe("Snooze until date string (ISO format)"),
36
+ private: z.boolean().optional().describe("Whether the task is private"),
37
+ taskId: z.string().optional().describe("Custom task ID (auto-generated if not provided)"),
38
+ });
39
+ // Update task complete parameters
40
+ export const updateTaskCompleteSchema = z.object({
41
+ taskId: z.string().min(1, "Task ID is required").describe("The ID of the task to mark as complete"),
42
+ completeOn: z.string().optional().describe("Completion timestamp (ISO format). Defaults to current time"),
43
+ limitResponsePayload: z.boolean().optional().describe("Whether to limit the response payload size"),
44
+ });
45
+ // Delete task parameters
46
+ export const deleteTaskSchema = z.object({
47
+ taskId: z.string().min(1, "Task ID is required").describe("The ID of the task to delete"),
48
+ limitResponsePayload: z.boolean().optional().describe("Whether to limit response size"),
49
+ wasTaskMerged: z.boolean().optional().describe("Whether the task was merged before deletion"),
50
+ });
51
+ /**
52
+ * Response Type Schemas (for validation and documentation)
53
+ */
54
+ // Basic user profile schema
55
+ export const userProfileSchema = z.object({
56
+ _id: z.string(),
57
+ email: z.string().email(),
58
+ firstName: z.string(),
59
+ lastName: z.string(),
60
+ timezone: z.string(),
61
+ avatarUrl: z.string().url().optional(),
62
+ });
63
+ // Group schema
64
+ export const groupSchema = z.object({
65
+ groupId: z.string(),
66
+ name: z.string(),
67
+ role: z.string().optional(),
68
+ });
69
+ // User schema with primary group
70
+ export const userSchema = z.object({
71
+ _id: z.string(),
72
+ email: z.string().email(),
73
+ profile: userProfileSchema,
74
+ primaryGroup: groupSchema.optional(),
75
+ });
76
+ // Task schema (simplified - based on common task properties)
77
+ export const taskSchema = z.object({
78
+ _id: z.string(),
79
+ title: z.string(),
80
+ description: z.string().optional(),
81
+ status: z.string(),
82
+ createdAt: z.string(),
83
+ updatedAt: z.string(),
84
+ scheduledDate: z.string().optional(),
85
+ completedAt: z.string().optional(),
86
+ streamId: z.string().optional(),
87
+ userId: z.string(),
88
+ groupId: z.string(),
89
+ });
90
+ // Stream schema
91
+ export const streamSchema = z.object({
92
+ _id: z.string(),
93
+ name: z.string(),
94
+ color: z.string().optional(),
95
+ groupId: z.string(),
96
+ isActive: z.boolean(),
97
+ createdAt: z.string(),
98
+ updatedAt: z.string(),
99
+ });
100
+ /**
101
+ * API Response Schemas
102
+ */
103
+ // User response
104
+ export const userResponseSchema = z.object({
105
+ user: userSchema,
106
+ });
107
+ // Tasks response
108
+ export const tasksResponseSchema = z.object({
109
+ tasks: z.array(taskSchema),
110
+ count: z.number(),
111
+ });
112
+ // Streams response
113
+ export const streamsResponseSchema = z.object({
114
+ streams: z.array(streamSchema),
115
+ count: z.number(),
116
+ });
117
+ /**
118
+ * Error Response Schema
119
+ */
120
+ export const errorResponseSchema = z.object({
121
+ error: z.string(),
122
+ message: z.string(),
123
+ code: z.string().optional(),
124
+ });
@@ -0,0 +1,10 @@
1
+ import { SunsamaClient } from "sunsama-api";
2
+ import type { SessionData } from "../auth/types.js";
3
+ /**
4
+ * Gets the appropriate SunsamaClient instance based on transport type
5
+ * @param session - Session data for HTTP transport (null for stdio)
6
+ * @returns Authenticated SunsamaClient instance
7
+ * @throws {Error} If session is not available for HTTP transport or global client not initialized for stdio
8
+ */
9
+ export declare function getSunsamaClient(session: SessionData | null): SunsamaClient;
10
+ //# sourceMappingURL=client-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/client-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,aAAa,CAW3E"}
@@ -0,0 +1,19 @@
1
+ import { SunsamaClient } from "sunsama-api";
2
+ import { getGlobalSunsamaClient } from "../auth/stdio.js";
3
+ import { getTransportConfig } from "../config/transport.js";
4
+ /**
5
+ * Gets the appropriate SunsamaClient instance based on transport type
6
+ * @param session - Session data for HTTP transport (null for stdio)
7
+ * @returns Authenticated SunsamaClient instance
8
+ * @throws {Error} If session is not available for HTTP transport or global client not initialized for stdio
9
+ */
10
+ export function getSunsamaClient(session) {
11
+ const transportConfig = getTransportConfig();
12
+ if (transportConfig.transportType === "httpStream") {
13
+ if (!session?.sunsamaClient) {
14
+ throw new Error("Session not available. Authentication may have failed.");
15
+ }
16
+ return session.sunsamaClient;
17
+ }
18
+ return getGlobalSunsamaClient();
19
+ }