@ebowwa/crm 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.
Files changed (187) hide show
  1. package/README.md +174 -0
  2. package/dist/cli/commands/activities.d.ts +11 -0
  3. package/dist/cli/commands/activities.d.ts.map +1 -0
  4. package/dist/cli/commands/activities.js +427 -0
  5. package/dist/cli/commands/activities.js.map +1 -0
  6. package/dist/cli/commands/contacts.d.ts +11 -0
  7. package/dist/cli/commands/contacts.d.ts.map +1 -0
  8. package/dist/cli/commands/contacts.js +458 -0
  9. package/dist/cli/commands/contacts.js.map +1 -0
  10. package/dist/cli/commands/deals.d.ts +11 -0
  11. package/dist/cli/commands/deals.d.ts.map +1 -0
  12. package/dist/cli/commands/deals.js +498 -0
  13. package/dist/cli/commands/deals.js.map +1 -0
  14. package/dist/cli/commands/media.d.ts +11 -0
  15. package/dist/cli/commands/media.d.ts.map +1 -0
  16. package/dist/cli/commands/media.js +417 -0
  17. package/dist/cli/commands/media.js.map +1 -0
  18. package/dist/cli/commands/search.d.ts +11 -0
  19. package/dist/cli/commands/search.d.ts.map +1 -0
  20. package/dist/cli/commands/search.js +346 -0
  21. package/dist/cli/commands/search.js.map +1 -0
  22. package/dist/cli/index.d.ts +13 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +173 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/cli/repl.d.ts +15 -0
  27. package/dist/cli/repl.d.ts.map +1 -0
  28. package/dist/cli/repl.js +318 -0
  29. package/dist/cli/repl.js.map +1 -0
  30. package/dist/cli/utils/config.d.ts +91 -0
  31. package/dist/cli/utils/config.d.ts.map +1 -0
  32. package/dist/cli/utils/config.js +212 -0
  33. package/dist/cli/utils/config.js.map +1 -0
  34. package/dist/cli/utils/output.d.ts +136 -0
  35. package/dist/cli/utils/output.d.ts.map +1 -0
  36. package/dist/cli/utils/output.js +323 -0
  37. package/dist/cli/utils/output.js.map +1 -0
  38. package/dist/cli/utils/prompt.d.ts +81 -0
  39. package/dist/cli/utils/prompt.d.ts.map +1 -0
  40. package/dist/cli/utils/prompt.js +341 -0
  41. package/dist/cli/utils/prompt.js.map +1 -0
  42. package/dist/cli.d.ts +3 -0
  43. package/dist/cli.d.ts.map +1 -0
  44. package/dist/cli.js +8 -0
  45. package/dist/cli.js.map +1 -0
  46. package/dist/core/index.d.ts +6 -0
  47. package/dist/core/index.d.ts.map +1 -0
  48. package/dist/core/index.js +32 -0
  49. package/dist/core/index.js.map +1 -0
  50. package/dist/core/schemas.d.ts +3050 -0
  51. package/dist/core/schemas.d.ts.map +1 -0
  52. package/dist/core/schemas.js +667 -0
  53. package/dist/core/schemas.js.map +1 -0
  54. package/dist/core/types.d.ts +597 -0
  55. package/dist/core/types.d.ts.map +1 -0
  56. package/dist/core/types.js +8 -0
  57. package/dist/core/types.js.map +1 -0
  58. package/dist/index.d.ts +7 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +8 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/mcp/index.d.ts +14 -0
  63. package/dist/mcp/index.d.ts.map +1 -0
  64. package/dist/mcp/index.js +11 -0
  65. package/dist/mcp/index.js.map +1 -0
  66. package/dist/mcp/server.d.ts +13 -0
  67. package/dist/mcp/server.d.ts.map +1 -0
  68. package/dist/mcp/server.js +18 -0
  69. package/dist/mcp/server.js.map +1 -0
  70. package/dist/mcp/storage/client.d.ts +109 -0
  71. package/dist/mcp/storage/client.d.ts.map +1 -0
  72. package/dist/mcp/storage/client.js +355 -0
  73. package/dist/mcp/storage/client.js.map +1 -0
  74. package/dist/mcp/storage/index.d.ts +7 -0
  75. package/dist/mcp/storage/index.d.ts.map +1 -0
  76. package/dist/mcp/storage/index.js +6 -0
  77. package/dist/mcp/storage/index.js.map +1 -0
  78. package/dist/mcp/storage/types.d.ts +44 -0
  79. package/dist/mcp/storage/types.d.ts.map +1 -0
  80. package/dist/mcp/storage/types.js +35 -0
  81. package/dist/mcp/storage/types.js.map +1 -0
  82. package/dist/mcp/tools/definitions.d.ts +16 -0
  83. package/dist/mcp/tools/definitions.d.ts.map +1 -0
  84. package/dist/mcp/tools/definitions.js +914 -0
  85. package/dist/mcp/tools/definitions.js.map +1 -0
  86. package/dist/mcp/tools/handlers.d.ts +50 -0
  87. package/dist/mcp/tools/handlers.d.ts.map +1 -0
  88. package/dist/mcp/tools/handlers.js +760 -0
  89. package/dist/mcp/tools/handlers.js.map +1 -0
  90. package/dist/mcp/tools/index.d.ts +7 -0
  91. package/dist/mcp/tools/index.d.ts.map +1 -0
  92. package/dist/mcp/tools/index.js +6 -0
  93. package/dist/mcp/tools/index.js.map +1 -0
  94. package/dist/mcp/tools/types.d.ts +314 -0
  95. package/dist/mcp/tools/types.d.ts.map +1 -0
  96. package/dist/mcp/tools/types.js +5 -0
  97. package/dist/mcp/tools/types.js.map +1 -0
  98. package/dist/mcp/transports/stdio.d.ts +27 -0
  99. package/dist/mcp/transports/stdio.d.ts.map +1 -0
  100. package/dist/mcp/transports/stdio.js +237 -0
  101. package/dist/mcp/transports/stdio.js.map +1 -0
  102. package/dist/telemetry/index.d.ts +58 -0
  103. package/dist/telemetry/index.d.ts.map +1 -0
  104. package/dist/telemetry/index.js +109 -0
  105. package/dist/telemetry/index.js.map +1 -0
  106. package/dist/telemetry/logger.d.ts +116 -0
  107. package/dist/telemetry/logger.d.ts.map +1 -0
  108. package/dist/telemetry/logger.js +256 -0
  109. package/dist/telemetry/logger.js.map +1 -0
  110. package/dist/telemetry/metrics.d.ts +115 -0
  111. package/dist/telemetry/metrics.d.ts.map +1 -0
  112. package/dist/telemetry/metrics.js +292 -0
  113. package/dist/telemetry/metrics.js.map +1 -0
  114. package/dist/telemetry/tracer.d.ts +227 -0
  115. package/dist/telemetry/tracer.d.ts.map +1 -0
  116. package/dist/telemetry/tracer.js +355 -0
  117. package/dist/telemetry/tracer.js.map +1 -0
  118. package/dist/web/app.d.ts +2 -0
  119. package/dist/web/app.d.ts.map +1 -0
  120. package/dist/web/app.js +115 -0
  121. package/dist/web/app.js.map +1 -0
  122. package/dist/web/components/ContactList.d.ts +3 -0
  123. package/dist/web/components/ContactList.d.ts.map +1 -0
  124. package/dist/web/components/ContactList.js +262 -0
  125. package/dist/web/components/ContactList.js.map +1 -0
  126. package/dist/web/components/Dashboard.d.ts +3 -0
  127. package/dist/web/components/Dashboard.d.ts.map +1 -0
  128. package/dist/web/components/Dashboard.js +158 -0
  129. package/dist/web/components/Dashboard.js.map +1 -0
  130. package/dist/web/components/DealPipeline.d.ts +3 -0
  131. package/dist/web/components/DealPipeline.d.ts.map +1 -0
  132. package/dist/web/components/DealPipeline.js +306 -0
  133. package/dist/web/components/DealPipeline.js.map +1 -0
  134. package/dist/web/index.d.ts +2 -0
  135. package/dist/web/index.d.ts.map +1 -0
  136. package/dist/web/index.js +269 -0
  137. package/dist/web/index.js.map +1 -0
  138. package/dist/web/types.d.ts +75 -0
  139. package/dist/web/types.d.ts.map +1 -0
  140. package/dist/web/types.js +3 -0
  141. package/dist/web/types.js.map +1 -0
  142. package/native/index.d.ts +571 -0
  143. package/native/index.js +687 -0
  144. package/package.json +105 -0
  145. package/src/cli/commands/activities.ts +543 -0
  146. package/src/cli/commands/contacts.ts +563 -0
  147. package/src/cli/commands/deals.ts +637 -0
  148. package/src/cli/commands/media.ts +521 -0
  149. package/src/cli/commands/search.ts +426 -0
  150. package/src/cli/index.ts +203 -0
  151. package/src/cli/repl.ts +379 -0
  152. package/src/cli/utils/config.ts +299 -0
  153. package/src/cli/utils/output.ts +386 -0
  154. package/src/cli/utils/prompt.ts +444 -0
  155. package/src/cli.ts +11 -0
  156. package/src/core/index.ts +184 -0
  157. package/src/core/schemas.ts +770 -0
  158. package/src/core/types.ts +969 -0
  159. package/src/index.ts +8 -0
  160. package/src/mcp/index.ts +17 -0
  161. package/src/mcp/server.ts +26 -0
  162. package/src/mcp/storage/client.ts +408 -0
  163. package/src/mcp/storage/index.ts +7 -0
  164. package/src/mcp/storage/types.ts +72 -0
  165. package/src/mcp/tools/definitions.ts +961 -0
  166. package/src/mcp/tools/handlers.ts +805 -0
  167. package/src/mcp/tools/index.ts +7 -0
  168. package/src/mcp/tools/types.ts +390 -0
  169. package/src/mcp/transports/stdio.ts +225 -0
  170. package/src/telemetry/index.ts +131 -0
  171. package/src/telemetry/logger.ts +318 -0
  172. package/src/telemetry/metrics.ts +393 -0
  173. package/src/telemetry/tracer.ts +487 -0
  174. package/src/web/api/activities.ts +41 -0
  175. package/src/web/api/contacts.ts +114 -0
  176. package/src/web/api/deals.ts +108 -0
  177. package/src/web/api/media.ts +98 -0
  178. package/src/web/app.tsx +143 -0
  179. package/src/web/components/ActivityFeed.tsx +195 -0
  180. package/src/web/components/ContactList.tsx +340 -0
  181. package/src/web/components/Dashboard.tsx +214 -0
  182. package/src/web/components/DealPipeline.tsx +405 -0
  183. package/src/web/components/MediaGallery.tsx +334 -0
  184. package/src/web/index.html +14 -0
  185. package/src/web/index.ts +326 -0
  186. package/src/web/styles/main.css +180 -0
  187. package/src/web/types.ts +311 -0
@@ -0,0 +1,914 @@
1
+ /**
2
+ * MCP Tool definitions for CRM operations
3
+ * Defines the schema for each tool exposed via MCP
4
+ */
5
+ /** Tool definitions for all CRM MCP tools */
6
+ export const TOOL_DEFINITIONS = [
7
+ // ============================================================================
8
+ // Contact Tools
9
+ // ============================================================================
10
+ {
11
+ name: 'crm_create_contact',
12
+ description: 'Create a new contact in the CRM',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ name: {
17
+ type: 'string',
18
+ description: 'Full name of the contact',
19
+ },
20
+ firstName: {
21
+ type: 'string',
22
+ description: 'First name',
23
+ },
24
+ lastName: {
25
+ type: 'string',
26
+ description: 'Last name',
27
+ },
28
+ emails: {
29
+ type: 'array',
30
+ description: 'Email addresses',
31
+ items: {
32
+ type: 'object',
33
+ properties: {
34
+ email: { type: 'string' },
35
+ type: { type: 'string', enum: ['personal', 'work', 'other'] },
36
+ primary: { type: 'boolean' },
37
+ },
38
+ required: ['email'],
39
+ },
40
+ },
41
+ phones: {
42
+ type: 'array',
43
+ description: 'Phone numbers',
44
+ items: {
45
+ type: 'object',
46
+ properties: {
47
+ number: { type: 'string' },
48
+ type: { type: 'string', enum: ['mobile', 'home', 'work', 'other'] },
49
+ primary: { type: 'boolean' },
50
+ },
51
+ required: ['number'],
52
+ },
53
+ },
54
+ company: {
55
+ type: 'string',
56
+ description: 'Company name',
57
+ },
58
+ title: {
59
+ type: 'string',
60
+ description: 'Job title',
61
+ },
62
+ tags: {
63
+ type: 'array',
64
+ description: 'Tags for categorization',
65
+ items: { type: 'string' },
66
+ },
67
+ source: {
68
+ type: 'string',
69
+ enum: ['organic', 'referral', 'advertisement', 'social_media', 'email_campaign', 'website', 'event', 'cold_outreach', 'partner', 'other'],
70
+ },
71
+ status: {
72
+ type: 'string',
73
+ enum: ['lead', 'prospect', 'qualified', 'customer', 'churned', 'archived'],
74
+ default: 'lead',
75
+ },
76
+ customFields: {
77
+ type: 'array',
78
+ description: 'Custom fields',
79
+ items: {
80
+ type: 'object',
81
+ properties: {
82
+ key: { type: 'string' },
83
+ value: {},
84
+ type: { type: 'string', enum: ['string', 'number', 'boolean', 'date', 'select', 'multiselect'] },
85
+ },
86
+ },
87
+ },
88
+ },
89
+ required: ['name'],
90
+ },
91
+ },
92
+ {
93
+ name: 'crm_get_contact',
94
+ description: 'Get a contact by ID',
95
+ inputSchema: {
96
+ type: 'object',
97
+ properties: {
98
+ id: {
99
+ type: 'string',
100
+ description: 'Contact ID (UUID)',
101
+ },
102
+ },
103
+ required: ['id'],
104
+ },
105
+ },
106
+ {
107
+ name: 'crm_update_contact',
108
+ description: 'Update an existing contact',
109
+ inputSchema: {
110
+ type: 'object',
111
+ properties: {
112
+ id: {
113
+ type: 'string',
114
+ description: 'Contact ID to update',
115
+ },
116
+ name: { type: 'string', description: 'Full name' },
117
+ firstName: { type: 'string', description: 'First name' },
118
+ lastName: { type: 'string', description: 'Last name' },
119
+ emails: { type: 'array', description: 'Email addresses', items: { type: 'object' } },
120
+ phones: { type: 'array', description: 'Phone numbers', items: { type: 'object' } },
121
+ company: { type: 'string', description: 'Company name' },
122
+ title: { type: 'string', description: 'Job title' },
123
+ tags: { type: 'array', items: { type: 'string' } },
124
+ status: {
125
+ type: 'string',
126
+ enum: ['lead', 'prospect', 'qualified', 'customer', 'churned', 'archived'],
127
+ },
128
+ customFields: { type: 'array', items: { type: 'object' } },
129
+ },
130
+ required: ['id'],
131
+ },
132
+ },
133
+ {
134
+ name: 'crm_delete_contact',
135
+ description: 'Delete a contact by ID',
136
+ inputSchema: {
137
+ type: 'object',
138
+ properties: {
139
+ id: {
140
+ type: 'string',
141
+ description: 'Contact ID to delete',
142
+ },
143
+ },
144
+ required: ['id'],
145
+ },
146
+ },
147
+ {
148
+ name: 'crm_list_contacts',
149
+ description: 'List contacts with optional filtering and pagination',
150
+ inputSchema: {
151
+ type: 'object',
152
+ properties: {
153
+ search: {
154
+ type: 'string',
155
+ description: 'Search query for name, email, company',
156
+ },
157
+ status: {
158
+ type: 'array',
159
+ description: 'Filter by status',
160
+ items: { type: 'string', enum: ['lead', 'prospect', 'qualified', 'customer', 'churned', 'archived'] },
161
+ },
162
+ tags: {
163
+ type: 'array',
164
+ description: 'Filter by tags',
165
+ items: { type: 'string' },
166
+ },
167
+ source: {
168
+ type: 'array',
169
+ description: 'Filter by source',
170
+ items: { type: 'string' },
171
+ },
172
+ limit: {
173
+ type: 'number',
174
+ description: 'Maximum number of results (default: 20)',
175
+ },
176
+ offset: {
177
+ type: 'number',
178
+ description: 'Number of results to skip',
179
+ },
180
+ },
181
+ },
182
+ },
183
+ {
184
+ name: 'crm_search_contacts',
185
+ description: 'Search contacts by email address',
186
+ inputSchema: {
187
+ type: 'object',
188
+ properties: {
189
+ email: {
190
+ type: 'string',
191
+ description: 'Email address to search for',
192
+ },
193
+ },
194
+ required: ['email'],
195
+ },
196
+ },
197
+ // ============================================================================
198
+ // Deal Tools
199
+ // ============================================================================
200
+ {
201
+ name: 'crm_create_deal',
202
+ description: 'Create a new deal/opportunity',
203
+ inputSchema: {
204
+ type: 'object',
205
+ properties: {
206
+ title: {
207
+ type: 'string',
208
+ description: 'Deal title',
209
+ },
210
+ contactId: {
211
+ type: 'string',
212
+ description: 'Associated contact ID',
213
+ },
214
+ value: {
215
+ type: 'number',
216
+ description: 'Deal value',
217
+ },
218
+ currency: {
219
+ type: 'string',
220
+ enum: ['USD', 'EUR', 'GBP', 'CAD', 'AUD', 'JPY', 'CNY', 'INR', 'BRL', 'MXN'],
221
+ default: 'USD',
222
+ },
223
+ stage: {
224
+ type: 'string',
225
+ enum: ['prospecting', 'qualification', 'needs_analysis', 'proposal', 'negotiation', 'closed_won', 'closed_lost'],
226
+ default: 'prospecting',
227
+ },
228
+ probability: {
229
+ type: 'number',
230
+ description: 'Win probability (0-100)',
231
+ minimum: 0,
232
+ maximum: 100,
233
+ },
234
+ expectedClose: {
235
+ type: 'string',
236
+ description: 'Expected close date (ISO 8601)',
237
+ },
238
+ priority: {
239
+ type: 'string',
240
+ enum: ['low', 'medium', 'high', 'urgent'],
241
+ default: 'medium',
242
+ },
243
+ notes: {
244
+ type: 'string',
245
+ description: 'Deal notes',
246
+ },
247
+ tags: {
248
+ type: 'array',
249
+ items: { type: 'string' },
250
+ },
251
+ },
252
+ required: ['title', 'contactId', 'value', 'expectedClose'],
253
+ },
254
+ },
255
+ {
256
+ name: 'crm_get_deal',
257
+ description: 'Get a deal by ID',
258
+ inputSchema: {
259
+ type: 'object',
260
+ properties: {
261
+ id: {
262
+ type: 'string',
263
+ description: 'Deal ID (UUID)',
264
+ },
265
+ },
266
+ required: ['id'],
267
+ },
268
+ },
269
+ {
270
+ name: 'crm_update_deal',
271
+ description: 'Update an existing deal',
272
+ inputSchema: {
273
+ type: 'object',
274
+ properties: {
275
+ id: {
276
+ type: 'string',
277
+ description: 'Deal ID to update',
278
+ },
279
+ title: { type: 'string' },
280
+ value: { type: 'number' },
281
+ stage: {
282
+ type: 'string',
283
+ enum: ['prospecting', 'qualification', 'needs_analysis', 'proposal', 'negotiation', 'closed_won', 'closed_lost'],
284
+ },
285
+ probability: { type: 'number', minimum: 0, maximum: 100 },
286
+ expectedClose: { type: 'string' },
287
+ actualClose: { type: 'string' },
288
+ priority: { type: 'string', enum: ['low', 'medium', 'high', 'urgent'] },
289
+ notes: { type: 'string' },
290
+ tags: { type: 'array', items: { type: 'string' } },
291
+ },
292
+ required: ['id'],
293
+ },
294
+ },
295
+ {
296
+ name: 'crm_delete_deal',
297
+ description: 'Delete a deal by ID',
298
+ inputSchema: {
299
+ type: 'object',
300
+ properties: {
301
+ id: {
302
+ type: 'string',
303
+ description: 'Deal ID to delete',
304
+ },
305
+ },
306
+ required: ['id'],
307
+ },
308
+ },
309
+ {
310
+ name: 'crm_list_deals',
311
+ description: 'List deals with optional filtering',
312
+ inputSchema: {
313
+ type: 'object',
314
+ properties: {
315
+ contactId: {
316
+ type: 'string',
317
+ description: 'Filter by contact ID',
318
+ },
319
+ stage: {
320
+ type: 'array',
321
+ description: 'Filter by stage',
322
+ items: { type: 'string' },
323
+ },
324
+ priority: {
325
+ type: 'array',
326
+ items: { type: 'string', enum: ['low', 'medium', 'high', 'urgent'] },
327
+ },
328
+ minValue: {
329
+ type: 'number',
330
+ description: 'Minimum deal value',
331
+ },
332
+ maxValue: {
333
+ type: 'number',
334
+ description: 'Maximum deal value',
335
+ },
336
+ limit: { type: 'number' },
337
+ offset: { type: 'number' },
338
+ },
339
+ },
340
+ },
341
+ {
342
+ name: 'crm_get_deals_by_stage',
343
+ description: 'Get all deals in a specific pipeline stage',
344
+ inputSchema: {
345
+ type: 'object',
346
+ properties: {
347
+ stage: {
348
+ type: 'string',
349
+ enum: ['prospecting', 'qualification', 'needs_analysis', 'proposal', 'negotiation', 'closed_won', 'closed_lost'],
350
+ },
351
+ },
352
+ required: ['stage'],
353
+ },
354
+ },
355
+ // ============================================================================
356
+ // Activity Tools
357
+ // ============================================================================
358
+ {
359
+ name: 'crm_create_activity',
360
+ description: 'Log a new activity (call, email, meeting, task, etc.)',
361
+ inputSchema: {
362
+ type: 'object',
363
+ properties: {
364
+ contactId: {
365
+ type: 'string',
366
+ description: 'Associated contact ID',
367
+ },
368
+ dealId: {
369
+ type: 'string',
370
+ description: 'Associated deal ID',
371
+ },
372
+ type: {
373
+ type: 'string',
374
+ enum: ['call', 'email', 'meeting', 'task', 'note', 'sms', 'video_call', 'demo', 'proposal_sent', 'contract_sent', 'follow_up', 'social_media', 'event', 'other'],
375
+ },
376
+ title: {
377
+ type: 'string',
378
+ description: 'Activity title',
379
+ },
380
+ description: {
381
+ type: 'string',
382
+ description: 'Activity description',
383
+ },
384
+ timestamp: {
385
+ type: 'string',
386
+ description: 'Activity timestamp (ISO 8601)',
387
+ },
388
+ duration: {
389
+ type: 'number',
390
+ description: 'Duration in seconds',
391
+ },
392
+ metadata: {
393
+ type: 'object',
394
+ description: 'Activity-specific metadata',
395
+ },
396
+ tags: {
397
+ type: 'array',
398
+ items: { type: 'string' },
399
+ },
400
+ },
401
+ required: ['type', 'title'],
402
+ },
403
+ },
404
+ {
405
+ name: 'crm_get_activity',
406
+ description: 'Get an activity by ID',
407
+ inputSchema: {
408
+ type: 'object',
409
+ properties: {
410
+ id: {
411
+ type: 'string',
412
+ description: 'Activity ID',
413
+ },
414
+ },
415
+ required: ['id'],
416
+ },
417
+ },
418
+ {
419
+ name: 'crm_list_activities',
420
+ description: 'List activities with optional filtering',
421
+ inputSchema: {
422
+ type: 'object',
423
+ properties: {
424
+ contactId: {
425
+ type: 'string',
426
+ description: 'Filter by contact ID',
427
+ },
428
+ dealId: {
429
+ type: 'string',
430
+ description: 'Filter by deal ID',
431
+ },
432
+ type: {
433
+ type: 'array',
434
+ description: 'Filter by activity type',
435
+ items: { type: 'string' },
436
+ },
437
+ limit: { type: 'number' },
438
+ offset: { type: 'number' },
439
+ },
440
+ },
441
+ },
442
+ {
443
+ name: 'crm_delete_activity',
444
+ description: 'Delete an activity by ID',
445
+ inputSchema: {
446
+ type: 'object',
447
+ properties: {
448
+ id: {
449
+ type: 'string',
450
+ description: 'Activity ID to delete',
451
+ },
452
+ },
453
+ required: ['id'],
454
+ },
455
+ },
456
+ // ============================================================================
457
+ // Media Tools
458
+ // ============================================================================
459
+ {
460
+ name: 'crm_upload_media',
461
+ description: 'Register a media file (image, video, audio, document) attached to an entity',
462
+ inputSchema: {
463
+ type: 'object',
464
+ properties: {
465
+ entityType: {
466
+ type: 'string',
467
+ enum: ['contact', 'deal', 'activity', 'note', 'company'],
468
+ },
469
+ entityId: {
470
+ type: 'string',
471
+ description: 'ID of the entity this media belongs to',
472
+ },
473
+ type: {
474
+ type: 'string',
475
+ enum: ['image', 'video', 'audio', 'document', 'spreadsheet', 'presentation', 'pdf', 'archive', 'other'],
476
+ },
477
+ filename: {
478
+ type: 'string',
479
+ description: 'Original filename',
480
+ },
481
+ mimeType: {
482
+ type: 'string',
483
+ description: 'MIME type',
484
+ },
485
+ size: {
486
+ type: 'number',
487
+ description: 'File size in bytes',
488
+ },
489
+ url: {
490
+ type: 'string',
491
+ description: 'Storage URL or path',
492
+ },
493
+ thumbnailUrl: {
494
+ type: 'string',
495
+ description: 'Thumbnail URL (for images/videos)',
496
+ },
497
+ altText: {
498
+ type: 'string',
499
+ description: 'Alt text for accessibility',
500
+ },
501
+ caption: {
502
+ type: 'string',
503
+ description: 'Caption/description',
504
+ },
505
+ isPublic: {
506
+ type: 'boolean',
507
+ default: false,
508
+ },
509
+ },
510
+ required: ['entityType', 'entityId', 'type', 'filename', 'mimeType', 'size', 'url'],
511
+ },
512
+ },
513
+ {
514
+ name: 'crm_get_media',
515
+ description: 'Get media by ID',
516
+ inputSchema: {
517
+ type: 'object',
518
+ properties: {
519
+ id: {
520
+ type: 'string',
521
+ description: 'Media ID',
522
+ },
523
+ },
524
+ required: ['id'],
525
+ },
526
+ },
527
+ {
528
+ name: 'crm_list_media',
529
+ description: 'List media for an entity',
530
+ inputSchema: {
531
+ type: 'object',
532
+ properties: {
533
+ entityType: {
534
+ type: 'string',
535
+ enum: ['contact', 'deal', 'activity', 'note', 'company'],
536
+ },
537
+ entityId: {
538
+ type: 'string',
539
+ description: 'Entity ID to get media for',
540
+ },
541
+ type: {
542
+ type: 'string',
543
+ enum: ['image', 'video', 'audio', 'document', 'spreadsheet', 'presentation', 'pdf', 'archive', 'other'],
544
+ },
545
+ },
546
+ required: ['entityId'],
547
+ },
548
+ },
549
+ {
550
+ name: 'crm_delete_media',
551
+ description: 'Delete media by ID',
552
+ inputSchema: {
553
+ type: 'object',
554
+ properties: {
555
+ id: {
556
+ type: 'string',
557
+ description: 'Media ID to delete',
558
+ },
559
+ },
560
+ required: ['id'],
561
+ },
562
+ },
563
+ // ============================================================================
564
+ // Note Tools
565
+ // ============================================================================
566
+ {
567
+ name: 'crm_create_note',
568
+ description: 'Create a note attached to a contact or deal',
569
+ inputSchema: {
570
+ type: 'object',
571
+ properties: {
572
+ contactId: {
573
+ type: 'string',
574
+ description: 'Contact ID',
575
+ },
576
+ dealId: {
577
+ type: 'string',
578
+ description: 'Deal ID',
579
+ },
580
+ content: {
581
+ type: 'string',
582
+ description: 'Note content (supports markdown)',
583
+ },
584
+ format: {
585
+ type: 'string',
586
+ enum: ['plain', 'markdown', 'html'],
587
+ default: 'markdown',
588
+ },
589
+ title: {
590
+ type: 'string',
591
+ description: 'Note title',
592
+ },
593
+ visibility: {
594
+ type: 'string',
595
+ enum: ['private', 'team', 'public'],
596
+ default: 'team',
597
+ },
598
+ pinned: {
599
+ type: 'boolean',
600
+ default: false,
601
+ },
602
+ tags: {
603
+ type: 'array',
604
+ items: { type: 'string' },
605
+ },
606
+ },
607
+ required: ['content'],
608
+ },
609
+ },
610
+ {
611
+ name: 'crm_get_note',
612
+ description: 'Get a note by ID',
613
+ inputSchema: {
614
+ type: 'object',
615
+ properties: {
616
+ id: {
617
+ type: 'string',
618
+ description: 'Note ID',
619
+ },
620
+ },
621
+ required: ['id'],
622
+ },
623
+ },
624
+ {
625
+ name: 'crm_update_note',
626
+ description: 'Update an existing note',
627
+ inputSchema: {
628
+ type: 'object',
629
+ properties: {
630
+ id: {
631
+ type: 'string',
632
+ description: 'Note ID to update',
633
+ },
634
+ content: { type: 'string' },
635
+ title: { type: 'string' },
636
+ visibility: { type: 'string', enum: ['private', 'team', 'public'] },
637
+ pinned: { type: 'boolean' },
638
+ tags: { type: 'array', items: { type: 'string' } },
639
+ },
640
+ required: ['id'],
641
+ },
642
+ },
643
+ {
644
+ name: 'crm_delete_note',
645
+ description: 'Delete a note by ID',
646
+ inputSchema: {
647
+ type: 'object',
648
+ properties: {
649
+ id: {
650
+ type: 'string',
651
+ description: 'Note ID to delete',
652
+ },
653
+ },
654
+ required: ['id'],
655
+ },
656
+ },
657
+ {
658
+ name: 'crm_list_notes',
659
+ description: 'List notes for a contact or deal',
660
+ inputSchema: {
661
+ type: 'object',
662
+ properties: {
663
+ contactId: {
664
+ type: 'string',
665
+ description: 'Filter by contact ID',
666
+ },
667
+ dealId: {
668
+ type: 'string',
669
+ description: 'Filter by deal ID',
670
+ },
671
+ limit: { type: 'number' },
672
+ offset: { type: 'number' },
673
+ },
674
+ },
675
+ },
676
+ // ============================================================================
677
+ // Tag Tools
678
+ // ============================================================================
679
+ {
680
+ name: 'crm_create_tag',
681
+ description: 'Create a new tag for categorization',
682
+ inputSchema: {
683
+ type: 'object',
684
+ properties: {
685
+ name: {
686
+ type: 'string',
687
+ description: 'Tag name (slug-friendly)',
688
+ pattern: '^[a-z0-9-]+$',
689
+ },
690
+ label: {
691
+ type: 'string',
692
+ description: 'Display label',
693
+ },
694
+ color: {
695
+ type: 'string',
696
+ description: 'Color (hex or named)',
697
+ },
698
+ category: {
699
+ type: 'string',
700
+ enum: ['general', 'industry', 'source', 'status', 'priority', 'product', 'region', 'custom'],
701
+ default: 'general',
702
+ },
703
+ description: {
704
+ type: 'string',
705
+ description: 'Tag description',
706
+ },
707
+ icon: {
708
+ type: 'string',
709
+ description: 'Icon (emoji or icon name)',
710
+ },
711
+ parentId: {
712
+ type: 'string',
713
+ description: 'Parent tag ID (for hierarchical tags)',
714
+ },
715
+ },
716
+ required: ['name', 'label', 'color'],
717
+ },
718
+ },
719
+ {
720
+ name: 'crm_get_tag',
721
+ description: 'Get a tag by ID or name',
722
+ inputSchema: {
723
+ type: 'object',
724
+ properties: {
725
+ id: {
726
+ type: 'string',
727
+ description: 'Tag ID',
728
+ },
729
+ name: {
730
+ type: 'string',
731
+ description: 'Tag name',
732
+ },
733
+ },
734
+ },
735
+ },
736
+ {
737
+ name: 'crm_list_tags',
738
+ description: 'List all tags',
739
+ inputSchema: {
740
+ type: 'object',
741
+ properties: {
742
+ category: {
743
+ type: 'string',
744
+ enum: ['general', 'industry', 'source', 'status', 'priority', 'product', 'region', 'custom'],
745
+ },
746
+ },
747
+ },
748
+ },
749
+ {
750
+ name: 'crm_delete_tag',
751
+ description: 'Delete a tag by ID',
752
+ inputSchema: {
753
+ type: 'object',
754
+ properties: {
755
+ id: {
756
+ type: 'string',
757
+ description: 'Tag ID to delete',
758
+ },
759
+ },
760
+ required: ['id'],
761
+ },
762
+ },
763
+ // ============================================================================
764
+ // Company Tools
765
+ // ============================================================================
766
+ {
767
+ name: 'crm_create_company',
768
+ description: 'Create a company/organization',
769
+ inputSchema: {
770
+ type: 'object',
771
+ properties: {
772
+ name: {
773
+ type: 'string',
774
+ description: 'Company name',
775
+ },
776
+ website: {
777
+ type: 'string',
778
+ description: 'Website URL',
779
+ },
780
+ industry: {
781
+ type: 'string',
782
+ enum: ['technology', 'finance', 'healthcare', 'education', 'retail', 'manufacturing', 'consulting', 'marketing', 'legal', 'real_estate', 'construction', 'transportation', 'hospitality', 'energy', 'telecommunications', 'government', 'non_profit', 'other'],
783
+ },
784
+ size: {
785
+ type: 'string',
786
+ enum: ['sole_proprietor', 'startup', 'small', 'medium', 'large', 'enterprise'],
787
+ },
788
+ employeeCount: {
789
+ type: 'number',
790
+ description: 'Number of employees',
791
+ },
792
+ annualRevenue: {
793
+ type: 'number',
794
+ description: 'Annual revenue',
795
+ },
796
+ tags: {
797
+ type: 'array',
798
+ items: { type: 'string' },
799
+ },
800
+ },
801
+ required: ['name'],
802
+ },
803
+ },
804
+ {
805
+ name: 'crm_get_company',
806
+ description: 'Get a company by ID',
807
+ inputSchema: {
808
+ type: 'object',
809
+ properties: {
810
+ id: {
811
+ type: 'string',
812
+ description: 'Company ID',
813
+ },
814
+ },
815
+ required: ['id'],
816
+ },
817
+ },
818
+ {
819
+ name: 'crm_update_company',
820
+ description: 'Update a company',
821
+ inputSchema: {
822
+ type: 'object',
823
+ properties: {
824
+ id: {
825
+ type: 'string',
826
+ description: 'Company ID to update',
827
+ },
828
+ name: { type: 'string' },
829
+ website: { type: 'string' },
830
+ industry: { type: 'string' },
831
+ size: { type: 'string' },
832
+ employeeCount: { type: 'number' },
833
+ annualRevenue: { type: 'number' },
834
+ tags: { type: 'array', items: { type: 'string' } },
835
+ },
836
+ required: ['id'],
837
+ },
838
+ },
839
+ {
840
+ name: 'crm_delete_company',
841
+ description: 'Delete a company by ID',
842
+ inputSchema: {
843
+ type: 'object',
844
+ properties: {
845
+ id: {
846
+ type: 'string',
847
+ description: 'Company ID to delete',
848
+ },
849
+ },
850
+ required: ['id'],
851
+ },
852
+ },
853
+ {
854
+ name: 'crm_list_companies',
855
+ description: 'List companies with optional filtering',
856
+ inputSchema: {
857
+ type: 'object',
858
+ properties: {
859
+ search: {
860
+ type: 'string',
861
+ description: 'Search query for company name',
862
+ },
863
+ industry: {
864
+ type: 'string',
865
+ enum: ['technology', 'finance', 'healthcare', 'education', 'retail', 'manufacturing', 'consulting', 'marketing', 'legal', 'real_estate', 'construction', 'transportation', 'hospitality', 'energy', 'telecommunications', 'government', 'non_profit', 'other'],
866
+ },
867
+ size: {
868
+ type: 'array',
869
+ items: { type: 'string', enum: ['sole_proprietor', 'startup', 'small', 'medium', 'large', 'enterprise'] },
870
+ },
871
+ limit: { type: 'number' },
872
+ offset: { type: 'number' },
873
+ },
874
+ },
875
+ },
876
+ // ============================================================================
877
+ // Stats & Dashboard Tools
878
+ // ============================================================================
879
+ {
880
+ name: 'crm_get_stats',
881
+ description: 'Get CRM statistics (counts of all entity types)',
882
+ inputSchema: {
883
+ type: 'object',
884
+ properties: {},
885
+ },
886
+ },
887
+ {
888
+ name: 'crm_get_dashboard',
889
+ description: 'Get dashboard data with deals by stage and recent activities',
890
+ inputSchema: {
891
+ type: 'object',
892
+ properties: {
893
+ period: {
894
+ type: 'string',
895
+ enum: ['day', 'week', 'month', 'quarter', 'year'],
896
+ default: 'month',
897
+ },
898
+ },
899
+ },
900
+ },
901
+ ];
902
+ /**
903
+ * Get tool definition by name
904
+ */
905
+ export function getToolDefinition(name) {
906
+ return TOOL_DEFINITIONS.find((t) => t.name === name);
907
+ }
908
+ /**
909
+ * List all tool names
910
+ */
911
+ export function listToolNames() {
912
+ return TOOL_DEFINITIONS.map((t) => t.name);
913
+ }
914
+ //# sourceMappingURL=definitions.js.map