@mirra-messenger/sdk 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +132 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +186 -4
- package/dist/client.js.map +1 -1
- package/dist/generated/adapters.d.ts +2355 -0
- package/dist/generated/adapters.d.ts.map +1 -0
- package/dist/generated/adapters.js +2669 -0
- package/dist/generated/adapters.js.map +1 -0
- package/dist/generated/index.d.ts +8 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +12 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/types.d.ts +193 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/README.md +0 -470
|
@@ -0,0 +1,2669 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-Generated SDK Adapter Methods
|
|
4
|
+
*
|
|
5
|
+
* DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
+
* Generated from adapter operation schemas
|
|
7
|
+
* Run: npm run generate:llm-api
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.generatedAdapters = void 0;
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Adapter Factory Functions
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Flows Adapter
|
|
16
|
+
* Category: internal
|
|
17
|
+
*/
|
|
18
|
+
function createFlowsAdapter(sdk) {
|
|
19
|
+
return {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new time-based flow with cron schedule
|
|
22
|
+
* @param args.title - Flow title
|
|
23
|
+
* @param args.description - Detailed description of what the flow does
|
|
24
|
+
* @param args.schedule - Cron expression for scheduling (e.g., "0 9 * * *" for daily at 9am)
|
|
25
|
+
* @param args.scriptId - ID of the script to execute when triggered
|
|
26
|
+
* @param args.scriptInput - Optional static input data for the script (optional)
|
|
27
|
+
*/
|
|
28
|
+
createTimeFlow: async (args) => {
|
|
29
|
+
return sdk.resources.call({
|
|
30
|
+
resourceId: 'flows',
|
|
31
|
+
method: 'createTimeFlow',
|
|
32
|
+
params: args || {}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Create an event-based flow with pre-filtering conditions.
|
|
37
|
+
|
|
38
|
+
EFFICIENCY RULE: Always filter in eventFilter, not the script.
|
|
39
|
+
- eventFilter conditions: FREE (evaluated in-memory before script runs)
|
|
40
|
+
- Script filtering: EXPENSIVE (invokes Lambda for every event)
|
|
41
|
+
|
|
42
|
+
BAD: Trigger on "telegram.message" with no filter → script checks sender
|
|
43
|
+
GOOD: Trigger on "telegram.message" with eventFilter for sender
|
|
44
|
+
|
|
45
|
+
TRIGGER STRUCTURE:
|
|
46
|
+
{
|
|
47
|
+
type: "event",
|
|
48
|
+
config: {
|
|
49
|
+
eventFilter: {
|
|
50
|
+
operator: "and" | "or",
|
|
51
|
+
conditions: [
|
|
52
|
+
{ operator: "equals", field: "eventType", value: "call.ended" },
|
|
53
|
+
{ operator: "contains", field: "content.text", value: "urgent" }
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
VALID OPERATORS: equals, notEquals, contains, startsWith, endsWith, greaterThan, lessThan, exists, notExists, matchesRegex, and, or, not
|
|
60
|
+
|
|
61
|
+
COMMON EVENT TYPES: call.started, call.ended, call.action, telegram.message, gmail.email_received
|
|
62
|
+
* @param args.title - Flow title
|
|
63
|
+
* @param args.description - Detailed description of what the flow does
|
|
64
|
+
* @param args.trigger - Event filter conditions that determine WHEN the script runs. Add ALL filtering logic here to minimize Lambda invocations. Must have type:"event" and config.eventFilter with operator and conditions array.
|
|
65
|
+
* @param args.scriptId - ID of the script to execute when triggered
|
|
66
|
+
* @param args.scriptInput - Optional static input data for the script (optional)
|
|
67
|
+
*/
|
|
68
|
+
createEventFlow: async (args) => {
|
|
69
|
+
return sdk.resources.call({
|
|
70
|
+
resourceId: 'flows',
|
|
71
|
+
method: 'createEventFlow',
|
|
72
|
+
params: args || {}
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* List all flows for the user
|
|
77
|
+
* @param args.status - Filter by status: active, paused, completed, failed (optional)
|
|
78
|
+
*/
|
|
79
|
+
listFlows: async (args) => {
|
|
80
|
+
return sdk.resources.call({
|
|
81
|
+
resourceId: 'flows',
|
|
82
|
+
method: 'listFlows',
|
|
83
|
+
params: args || {}
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* Get a specific flow by ID
|
|
88
|
+
* @param args.id - Flow ID
|
|
89
|
+
*/
|
|
90
|
+
getFlow: async (args) => {
|
|
91
|
+
return sdk.resources.call({
|
|
92
|
+
resourceId: 'flows',
|
|
93
|
+
method: 'getFlow',
|
|
94
|
+
params: args || {}
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Update an existing flow
|
|
99
|
+
* @param args.id - Flow ID to update
|
|
100
|
+
* @param args.title - New title (optional)
|
|
101
|
+
* @param args.description - New description (optional)
|
|
102
|
+
* @param args.trigger - New trigger configuration (optional)
|
|
103
|
+
* @param args.scriptId - New script ID (optional)
|
|
104
|
+
* @param args.scriptInput - New script input data (optional)
|
|
105
|
+
* @param args.status - New status: active, paused, completed, failed (optional)
|
|
106
|
+
*/
|
|
107
|
+
updateFlow: async (args) => {
|
|
108
|
+
return sdk.resources.call({
|
|
109
|
+
resourceId: 'flows',
|
|
110
|
+
method: 'updateFlow',
|
|
111
|
+
params: args || {}
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Delete a flow
|
|
116
|
+
* @param args.id - Flow ID to delete
|
|
117
|
+
*/
|
|
118
|
+
deleteFlow: async (args) => {
|
|
119
|
+
return sdk.resources.call({
|
|
120
|
+
resourceId: 'flows',
|
|
121
|
+
method: 'deleteFlow',
|
|
122
|
+
params: args || {}
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* Pause an active flow
|
|
127
|
+
* @param args.id - Flow ID to pause
|
|
128
|
+
*/
|
|
129
|
+
pauseFlow: async (args) => {
|
|
130
|
+
return sdk.resources.call({
|
|
131
|
+
resourceId: 'flows',
|
|
132
|
+
method: 'pauseFlow',
|
|
133
|
+
params: args || {}
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Resume a paused flow
|
|
138
|
+
* @param args.id - Flow ID to resume
|
|
139
|
+
*/
|
|
140
|
+
resumeFlow: async (args) => {
|
|
141
|
+
return sdk.resources.call({
|
|
142
|
+
resourceId: 'flows',
|
|
143
|
+
method: 'resumeFlow',
|
|
144
|
+
params: args || {}
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Search flows with filters
|
|
149
|
+
* @param args.status - Filter by status (or array of statuses) (optional)
|
|
150
|
+
* @param args.triggerType - Filter by trigger type: time or event (optional)
|
|
151
|
+
* @param args.limit - Maximum number of results (default: 100) (optional)
|
|
152
|
+
* @param args.offset - Pagination offset (default: 0) (optional)
|
|
153
|
+
*/
|
|
154
|
+
searchFlows: async (args) => {
|
|
155
|
+
return sdk.resources.call({
|
|
156
|
+
resourceId: 'flows',
|
|
157
|
+
method: 'searchFlows',
|
|
158
|
+
params: args || {}
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Record execution result for a flow
|
|
163
|
+
* @param args.id - Flow ID
|
|
164
|
+
* @param args.success - Whether execution succeeded
|
|
165
|
+
* @param args.result - Execution result data (optional)
|
|
166
|
+
* @param args.error - Error message if execution failed (optional)
|
|
167
|
+
*/
|
|
168
|
+
recordExecution: async (args) => {
|
|
169
|
+
return sdk.resources.call({
|
|
170
|
+
resourceId: 'flows',
|
|
171
|
+
method: 'recordExecution',
|
|
172
|
+
params: args || {}
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* List all available event types that can trigger automations
|
|
177
|
+
* @param args.includeTemplates - Include condition templates for each event type (optional)
|
|
178
|
+
*/
|
|
179
|
+
listEventTypes: async (args) => {
|
|
180
|
+
return sdk.resources.call({
|
|
181
|
+
resourceId: 'flows',
|
|
182
|
+
method: 'listEventTypes',
|
|
183
|
+
params: args || {}
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* Test a flow by generating an event that matches the trigger conditions.
|
|
188
|
+
|
|
189
|
+
MODES:
|
|
190
|
+
- dryRun=true (DEFAULT): Validates trigger matching only. Safe, no side effects, no token consumption.
|
|
191
|
+
- dryRun=false: Executes the real script. WARNING: This causes real side effects (sends messages, makes API calls, consumes tokens).
|
|
192
|
+
|
|
193
|
+
Use dryRun=true first to verify trigger conditions work, then dryRun=false only when ready to test full execution.
|
|
194
|
+
|
|
195
|
+
WORKFLOW:
|
|
196
|
+
1. Generates a test event from the flow's trigger conditions
|
|
197
|
+
2. Validates the event matches the trigger (always)
|
|
198
|
+
3. If dryRun=false, executes the script with the test event
|
|
199
|
+
|
|
200
|
+
RESULT:
|
|
201
|
+
Returns detailed information about trigger matching, including which conditions passed/failed, and optionally full execution results.
|
|
202
|
+
* @param args.flowId - ID of the flow to test
|
|
203
|
+
* @param args.dryRun - If true (default), only validate trigger matching without executing script. If false, execute the script (causes side effects). (optional)
|
|
204
|
+
* @param args.eventOverrides - Custom field values to merge into the generated test event (e.g., {"content.text": "custom message"}) (optional)
|
|
205
|
+
*/
|
|
206
|
+
testFlow: async (args) => {
|
|
207
|
+
return sdk.resources.call({
|
|
208
|
+
resourceId: 'flows',
|
|
209
|
+
method: 'testFlow',
|
|
210
|
+
params: args || {}
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* Check if a custom event would match a flow trigger without any execution. Useful for debugging trigger conditions or testing with real event data.
|
|
215
|
+
* @param args.flowId - ID of the flow
|
|
216
|
+
* @param args.event - Event object to test against the trigger (must match IntegrationEvent structure)
|
|
217
|
+
*/
|
|
218
|
+
validateTrigger: async (args) => {
|
|
219
|
+
return sdk.resources.call({
|
|
220
|
+
resourceId: 'flows',
|
|
221
|
+
method: 'validateTrigger',
|
|
222
|
+
params: args || {}
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* Get all active flows that are triggered by a specific event type. Used by frontend to show flow selection for targeted execution (e.g., call.action flows).
|
|
227
|
+
* @param args.eventType - Event type to filter by (e.g., "call.action", "call.ended", "telegram.message")
|
|
228
|
+
*/
|
|
229
|
+
getFlowsByEventType: async (args) => {
|
|
230
|
+
return sdk.resources.call({
|
|
231
|
+
resourceId: 'flows',
|
|
232
|
+
method: 'getFlowsByEventType',
|
|
233
|
+
params: args || {}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* User Adapter
|
|
240
|
+
* Category: internal
|
|
241
|
+
*/
|
|
242
|
+
function createUserAdapter(sdk) {
|
|
243
|
+
return {
|
|
244
|
+
/**
|
|
245
|
+
* Get user profile information including username, email, timezone, phone, and usage stats
|
|
246
|
+
*/
|
|
247
|
+
getProfile: async (args) => {
|
|
248
|
+
return sdk.resources.call({
|
|
249
|
+
resourceId: 'user',
|
|
250
|
+
method: 'getProfile',
|
|
251
|
+
params: args || {}
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Update user profile fields (username, email, timezone, phone)
|
|
256
|
+
* @param args.username - New username (3-30 characters, alphanumeric with underscores/hyphens) (optional)
|
|
257
|
+
* @param args.email - New email address (optional)
|
|
258
|
+
* @param args.timezone - IANA timezone identifier (e.g., America/Los_Angeles) (optional)
|
|
259
|
+
* @param args.phoneNumber - Phone number (7-15 digits with optional formatting) (optional)
|
|
260
|
+
*/
|
|
261
|
+
updateProfile: async (args) => {
|
|
262
|
+
return sdk.resources.call({
|
|
263
|
+
resourceId: 'user',
|
|
264
|
+
method: 'updateProfile',
|
|
265
|
+
params: args || {}
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* Update user preferences (notification settings, etc)
|
|
270
|
+
* @param args.timezone - Preferred timezone for scheduling (optional)
|
|
271
|
+
* @param args.socials - Social media links (twitter, discord) (optional)
|
|
272
|
+
*/
|
|
273
|
+
updatePreferences: async (args) => {
|
|
274
|
+
return sdk.resources.call({
|
|
275
|
+
resourceId: 'user',
|
|
276
|
+
method: 'updatePreferences',
|
|
277
|
+
params: args || {}
|
|
278
|
+
});
|
|
279
|
+
},
|
|
280
|
+
/**
|
|
281
|
+
* Get token usage statistics, quota, and billing information
|
|
282
|
+
*/
|
|
283
|
+
getUsageStats: async (args) => {
|
|
284
|
+
return sdk.resources.call({
|
|
285
|
+
resourceId: 'user',
|
|
286
|
+
method: 'getUsageStats',
|
|
287
|
+
params: args || {}
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
/**
|
|
291
|
+
* Get active sessions/devices (based on push token registrations)
|
|
292
|
+
*/
|
|
293
|
+
getSessions: async (args) => {
|
|
294
|
+
return sdk.resources.call({
|
|
295
|
+
resourceId: 'user',
|
|
296
|
+
method: 'getSessions',
|
|
297
|
+
params: args || {}
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
/**
|
|
301
|
+
* Soft delete user account (set inactive flag) - CAUTION: This marks the account for deletion
|
|
302
|
+
* @param args.confirm - Must be true to confirm account deactivation
|
|
303
|
+
*/
|
|
304
|
+
deactivateAccount: async (args) => {
|
|
305
|
+
return sdk.resources.call({
|
|
306
|
+
resourceId: 'user',
|
|
307
|
+
method: 'deactivateAccount',
|
|
308
|
+
params: args || {}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Contacts Adapter
|
|
315
|
+
* Category: internal
|
|
316
|
+
*/
|
|
317
|
+
function createContactsAdapter(sdk) {
|
|
318
|
+
return {
|
|
319
|
+
/**
|
|
320
|
+
* Get a list of all accepted contacts for the user with their profile information
|
|
321
|
+
* @param args.limit - Maximum number of contacts to return (default: 100) (optional)
|
|
322
|
+
* @param args.offset - Number of contacts to skip for pagination (default: 0) (optional)
|
|
323
|
+
*/
|
|
324
|
+
listContacts: async (args) => {
|
|
325
|
+
return sdk.resources.call({
|
|
326
|
+
resourceId: 'contacts',
|
|
327
|
+
method: 'listContacts',
|
|
328
|
+
params: args || {}
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
/**
|
|
332
|
+
* Get detailed information about a specific contact by their ID or username
|
|
333
|
+
* @param args.contactId - The contact user ID (MongoDB ObjectId) (optional)
|
|
334
|
+
* @param args.username - The contact username (optional)
|
|
335
|
+
*/
|
|
336
|
+
getContact: async (args) => {
|
|
337
|
+
return sdk.resources.call({
|
|
338
|
+
resourceId: 'contacts',
|
|
339
|
+
method: 'getContact',
|
|
340
|
+
params: args || {}
|
|
341
|
+
});
|
|
342
|
+
},
|
|
343
|
+
/**
|
|
344
|
+
* Send a contact request to another user by their username
|
|
345
|
+
* @param args.username - Username of the user to add as a contact
|
|
346
|
+
*/
|
|
347
|
+
addContact: async (args) => {
|
|
348
|
+
return sdk.resources.call({
|
|
349
|
+
resourceId: 'contacts',
|
|
350
|
+
method: 'addContact',
|
|
351
|
+
params: args || {}
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
/**
|
|
355
|
+
* Remove a user from your contacts list (unfriend)
|
|
356
|
+
* @param args.contactId - The contact user ID to remove (optional)
|
|
357
|
+
* @param args.username - The contact username to remove (optional)
|
|
358
|
+
*/
|
|
359
|
+
removeContact: async (args) => {
|
|
360
|
+
return sdk.resources.call({
|
|
361
|
+
resourceId: 'contacts',
|
|
362
|
+
method: 'removeContact',
|
|
363
|
+
params: args || {}
|
|
364
|
+
});
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
* Search your contacts by username, email, phone, or wallet address
|
|
368
|
+
* @param args.query - Search query - can be username, email, phone, or wallet address
|
|
369
|
+
* @param args.searchType - Type of search to perform: all, username, email, phone, or wallet (default: all) (optional)
|
|
370
|
+
* @param args.limit - Maximum number of results (default: 20) (optional)
|
|
371
|
+
*/
|
|
372
|
+
searchContacts: async (args) => {
|
|
373
|
+
return sdk.resources.call({
|
|
374
|
+
resourceId: 'contacts',
|
|
375
|
+
method: 'searchContacts',
|
|
376
|
+
params: args || {}
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
/**
|
|
380
|
+
* Block a user (prevents them from contacting you)
|
|
381
|
+
* @param args.contactId - The user ID to block (optional)
|
|
382
|
+
* @param args.username - The username to block (optional)
|
|
383
|
+
*/
|
|
384
|
+
blockContact: async (args) => {
|
|
385
|
+
return sdk.resources.call({
|
|
386
|
+
resourceId: 'contacts',
|
|
387
|
+
method: 'blockContact',
|
|
388
|
+
params: args || {}
|
|
389
|
+
});
|
|
390
|
+
},
|
|
391
|
+
/**
|
|
392
|
+
* Unblock a previously blocked user
|
|
393
|
+
* @param args.contactId - The user ID to unblock (optional)
|
|
394
|
+
* @param args.username - The username to unblock (optional)
|
|
395
|
+
*/
|
|
396
|
+
unblockContact: async (args) => {
|
|
397
|
+
return sdk.resources.call({
|
|
398
|
+
resourceId: 'contacts',
|
|
399
|
+
method: 'unblockContact',
|
|
400
|
+
params: args || {}
|
|
401
|
+
});
|
|
402
|
+
},
|
|
403
|
+
/**
|
|
404
|
+
* Get a list of all users you have blocked
|
|
405
|
+
* @param args.limit - Maximum number of results (default: 100) (optional)
|
|
406
|
+
* @param args.offset - Number of items to skip for pagination (default: 0) (optional)
|
|
407
|
+
*/
|
|
408
|
+
getBlockedContacts: async (args) => {
|
|
409
|
+
return sdk.resources.call({
|
|
410
|
+
resourceId: 'contacts',
|
|
411
|
+
method: 'getBlockedContacts',
|
|
412
|
+
params: args || {}
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
/**
|
|
416
|
+
* Get pending contact requests (sent by you or received from others)
|
|
417
|
+
* @param args.type - Type of requests to retrieve: all, sent, or received (default: all) (optional)
|
|
418
|
+
* @param args.status - Filter by request status: pending, accepted, or rejected (default: pending) (optional)
|
|
419
|
+
*/
|
|
420
|
+
getContactRequests: async (args) => {
|
|
421
|
+
return sdk.resources.call({
|
|
422
|
+
resourceId: 'contacts',
|
|
423
|
+
method: 'getContactRequests',
|
|
424
|
+
params: args || {}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Memory Adapter
|
|
431
|
+
* Category: internal
|
|
432
|
+
*/
|
|
433
|
+
function createMemoryAdapter(sdk) {
|
|
434
|
+
return {
|
|
435
|
+
/**
|
|
436
|
+
* Create a new memory entity in the knowledge graph. Use the type field to specify what kind of memory (task, note, idea, shopping_item, etc.)
|
|
437
|
+
* @param args.type - Memory subtype: "task" (reminders/todos), "note" (general notes), "idea" (concepts/ideas), "shopping_item" (shopping list), "topic" (general knowledge), "document" (documents), "contact" (people), or "event" (calendar items)
|
|
438
|
+
* @param args.content - Main content/description of the memory
|
|
439
|
+
* @param args.metadata - Additional metadata (e.g., priority, deadline, tags, etc.) (optional)
|
|
440
|
+
*/
|
|
441
|
+
create: async (args) => {
|
|
442
|
+
return sdk.resources.call({
|
|
443
|
+
resourceId: 'memory',
|
|
444
|
+
method: 'create',
|
|
445
|
+
params: args || {}
|
|
446
|
+
});
|
|
447
|
+
},
|
|
448
|
+
/**
|
|
449
|
+
* Semantic search across memory entities with advanced filtering
|
|
450
|
+
* @param args.query - Search query text for semantic matching
|
|
451
|
+
* @param args.types - Filter by entity types (e.g., ["TASK", "NOTE", "IDEA"]) (optional)
|
|
452
|
+
* @param args.startTime - Filter entities created after this timestamp (Unix milliseconds) (optional)
|
|
453
|
+
* @param args.endTime - Filter entities created before this timestamp (Unix milliseconds) (optional)
|
|
454
|
+
* @param args.propertyFilters - Filter by entity properties: { status: ["completed"], tags: ["urgent"], priority: ["high"], roles: ["task"], contexts: ["work"] } (optional)
|
|
455
|
+
* @param args.limit - Maximum number of results (default: 50, max: 100) (optional)
|
|
456
|
+
*/
|
|
457
|
+
search: async (args) => {
|
|
458
|
+
return sdk.resources.call({
|
|
459
|
+
resourceId: 'memory',
|
|
460
|
+
method: 'search',
|
|
461
|
+
params: args || {}
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
/**
|
|
465
|
+
* Query memory entities with filters. Returns lightweight summaries with normalized fields: id, type, name, description, status, priority, createdAt, updatedAt
|
|
466
|
+
* @param args.type - Semantic type filter (e.g., "task", "note", "idea", "reminder", "contact", "document"). Matches against meta_item_type, subType, or semantic_roles (optional)
|
|
467
|
+
* @param args.filters - Additional filters (not yet implemented) (optional)
|
|
468
|
+
* @param args.limit - Maximum results (default: 50, max: 100). Use smaller limits to get complete results without truncation (optional)
|
|
469
|
+
* @param args.offset - Pagination offset for fetching more results (default: 0) (optional)
|
|
470
|
+
*/
|
|
471
|
+
query: async (args) => {
|
|
472
|
+
return sdk.resources.call({
|
|
473
|
+
resourceId: 'memory',
|
|
474
|
+
method: 'query',
|
|
475
|
+
params: args || {}
|
|
476
|
+
});
|
|
477
|
+
},
|
|
478
|
+
/**
|
|
479
|
+
* Find a single entity matching criteria
|
|
480
|
+
* @param args.filters - Filter criteria (e.g., { id: "..." })
|
|
481
|
+
*/
|
|
482
|
+
findOne: async (args) => {
|
|
483
|
+
return sdk.resources.call({
|
|
484
|
+
resourceId: 'memory',
|
|
485
|
+
method: 'findOne',
|
|
486
|
+
params: args || {}
|
|
487
|
+
});
|
|
488
|
+
},
|
|
489
|
+
/**
|
|
490
|
+
* Update an existing memory entity
|
|
491
|
+
* @param args.id - Entity ID to update
|
|
492
|
+
* @param args.type - Entity type (optional)
|
|
493
|
+
* @param args.content - Updated content (optional)
|
|
494
|
+
* @param args.metadata - Updated metadata (optional)
|
|
495
|
+
*/
|
|
496
|
+
update: async (args) => {
|
|
497
|
+
return sdk.resources.call({
|
|
498
|
+
resourceId: 'memory',
|
|
499
|
+
method: 'update',
|
|
500
|
+
params: args || {}
|
|
501
|
+
});
|
|
502
|
+
},
|
|
503
|
+
/**
|
|
504
|
+
* Delete a memory entity
|
|
505
|
+
* @param args.id - Entity ID to delete
|
|
506
|
+
*/
|
|
507
|
+
delete: async (args) => {
|
|
508
|
+
return sdk.resources.call({
|
|
509
|
+
resourceId: 'memory',
|
|
510
|
+
method: 'delete',
|
|
511
|
+
params: args || {}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* AI Services Adapter
|
|
518
|
+
* Category: internal
|
|
519
|
+
*/
|
|
520
|
+
function createAiAdapter(sdk) {
|
|
521
|
+
return {
|
|
522
|
+
/**
|
|
523
|
+
* Have a conversation with an AI assistant. Supports multi-turn conversations with system prompts, user messages, and assistant responses.
|
|
524
|
+
|
|
525
|
+
PROVIDER: Uses Anthropic (Claude) as the AI provider.
|
|
526
|
+
|
|
527
|
+
BEST PRACTICES:
|
|
528
|
+
- Use system messages to set AI behavior and constraints
|
|
529
|
+
- Keep conversations focused - avoid unnecessary context
|
|
530
|
+
|
|
531
|
+
MESSAGE STRUCTURE:
|
|
532
|
+
Each message has:
|
|
533
|
+
- role: "system" | "user" | "assistant"
|
|
534
|
+
- content: string (the message text)
|
|
535
|
+
|
|
536
|
+
TYPICAL PATTERNS:
|
|
537
|
+
1. Simple query: [{ role: "user", content: "question" }]
|
|
538
|
+
2. With system prompt: [{ role: "system", content: "instructions" }, { role: "user", content: "question" }]
|
|
539
|
+
3. Multi-turn: [system, user, assistant, user, assistant, ...]
|
|
540
|
+
* @param args.messages - Array of message objects with role ("system" | "user" | "assistant") and content (string). System messages set AI behavior, user messages are queries, assistant messages are previous AI responses.
|
|
541
|
+
* @param args.model - Specific model to use. Default: "claude-3-haiku-20240307". Use Anthropic Claude model names. (optional)
|
|
542
|
+
* @param args.temperature - Creativity level 0.0-1.0. Lower=factual/consistent, Higher=creative/varied. Default: 0.7 (optional)
|
|
543
|
+
* @param args.maxTokens - Maximum tokens in response. Default: 1000. Increase for longer responses (costs more tokens). (optional)
|
|
544
|
+
*/
|
|
545
|
+
chat: async (args) => {
|
|
546
|
+
return sdk.resources.call({
|
|
547
|
+
resourceId: 'ai',
|
|
548
|
+
method: 'chat',
|
|
549
|
+
params: args || {}
|
|
550
|
+
});
|
|
551
|
+
},
|
|
552
|
+
/**
|
|
553
|
+
* Use AI to make a decision from a list of options. The AI analyzes your prompt, considers the context, and selects the most appropriate option with reasoning.
|
|
554
|
+
|
|
555
|
+
USE CASES:
|
|
556
|
+
- Route messages to correct handlers
|
|
557
|
+
- Classify user intents
|
|
558
|
+
- Select appropriate tools or actions
|
|
559
|
+
- Prioritize tasks
|
|
560
|
+
- Choose templates or responses
|
|
561
|
+
- Determine sentiment or category
|
|
562
|
+
|
|
563
|
+
HOW IT WORKS:
|
|
564
|
+
1. Provide a prompt (the decision context)
|
|
565
|
+
2. List available options (each with id and label)
|
|
566
|
+
3. Optionally add extra context
|
|
567
|
+
4. AI returns selected option ID and reasoning
|
|
568
|
+
|
|
569
|
+
BEST PRACTICES:
|
|
570
|
+
- Make option labels clear and descriptive
|
|
571
|
+
- Use unique IDs for options
|
|
572
|
+
- Add context when decision needs background info
|
|
573
|
+
- Keep prompt focused on the decision criteria
|
|
574
|
+
- Use metadata field for additional option data
|
|
575
|
+
* @param args.prompt - The decision prompt - what needs to be decided and why
|
|
576
|
+
* @param args.options - Array of options to choose from. Each option must have: id (unique identifier), label (descriptive name), and optional metadata (additional data)
|
|
577
|
+
* @param args.context - Additional context to help the AI make a better decision (optional)
|
|
578
|
+
* @param args.model - Specific model to use. Defaults to system default. (optional)
|
|
579
|
+
*/
|
|
580
|
+
decide: async (args) => {
|
|
581
|
+
return sdk.resources.call({
|
|
582
|
+
resourceId: 'ai',
|
|
583
|
+
method: 'decide',
|
|
584
|
+
params: args || {}
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Documents Adapter
|
|
591
|
+
* Category: storage
|
|
592
|
+
*/
|
|
593
|
+
function createDocumentAdapter(sdk) {
|
|
594
|
+
return {
|
|
595
|
+
/**
|
|
596
|
+
* Upload and process a document (PDF, DOCX, TXT, MD)
|
|
597
|
+
* @param args.file - Base64 encoded file content
|
|
598
|
+
* @param args.filename - Original filename with extension
|
|
599
|
+
* @param args.mimeType - MIME type (application/pdf, text/plain, etc.)
|
|
600
|
+
* @param args.graphId - Target graph ID (defaults to user's personal graph) (optional)
|
|
601
|
+
* @param args.title - Custom document title (optional)
|
|
602
|
+
* @param args.productTags - Array of product tags for categorization (optional)
|
|
603
|
+
*/
|
|
604
|
+
upload: async (args) => {
|
|
605
|
+
return sdk.resources.call({
|
|
606
|
+
resourceId: 'document',
|
|
607
|
+
method: 'upload',
|
|
608
|
+
params: args || {}
|
|
609
|
+
});
|
|
610
|
+
},
|
|
611
|
+
/**
|
|
612
|
+
* Get document metadata and content
|
|
613
|
+
* @param args.documentId - Document ID to retrieve
|
|
614
|
+
*/
|
|
615
|
+
get: async (args) => {
|
|
616
|
+
return sdk.resources.call({
|
|
617
|
+
resourceId: 'document',
|
|
618
|
+
method: 'get',
|
|
619
|
+
params: args || {}
|
|
620
|
+
});
|
|
621
|
+
},
|
|
622
|
+
/**
|
|
623
|
+
* Get document processing status
|
|
624
|
+
* @param args.documentId - Document ID to check
|
|
625
|
+
*/
|
|
626
|
+
getStatus: async (args) => {
|
|
627
|
+
return sdk.resources.call({
|
|
628
|
+
resourceId: 'document',
|
|
629
|
+
method: 'getStatus',
|
|
630
|
+
params: args || {}
|
|
631
|
+
});
|
|
632
|
+
},
|
|
633
|
+
/**
|
|
634
|
+
* Get all chunks for a document
|
|
635
|
+
* @param args.documentId - Document ID
|
|
636
|
+
*/
|
|
637
|
+
getChunks: async (args) => {
|
|
638
|
+
return sdk.resources.call({
|
|
639
|
+
resourceId: 'document',
|
|
640
|
+
method: 'getChunks',
|
|
641
|
+
params: args || {}
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
/**
|
|
645
|
+
* Delete a document and all its chunks
|
|
646
|
+
* @param args.documentId - Document ID to delete
|
|
647
|
+
*/
|
|
648
|
+
delete: async (args) => {
|
|
649
|
+
return sdk.resources.call({
|
|
650
|
+
resourceId: 'document',
|
|
651
|
+
method: 'delete',
|
|
652
|
+
params: args || {}
|
|
653
|
+
});
|
|
654
|
+
},
|
|
655
|
+
/**
|
|
656
|
+
* Share a document to another graph (group or user-contact)
|
|
657
|
+
* @param args.documentId - Document ID to share
|
|
658
|
+
* @param args.targetGraphId - Target graph ID to share to
|
|
659
|
+
* @param args.shareReason - Optional reason for sharing (optional)
|
|
660
|
+
*/
|
|
661
|
+
share: async (args) => {
|
|
662
|
+
return sdk.resources.call({
|
|
663
|
+
resourceId: 'document',
|
|
664
|
+
method: 'share',
|
|
665
|
+
params: args || {}
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
/**
|
|
669
|
+
* Remove document access from a graph
|
|
670
|
+
* @param args.documentId - Document ID
|
|
671
|
+
* @param args.graphId - Graph ID to remove access from
|
|
672
|
+
*/
|
|
673
|
+
unshare: async (args) => {
|
|
674
|
+
return sdk.resources.call({
|
|
675
|
+
resourceId: 'document',
|
|
676
|
+
method: 'unshare',
|
|
677
|
+
params: args || {}
|
|
678
|
+
});
|
|
679
|
+
},
|
|
680
|
+
/**
|
|
681
|
+
* List all graphs a document is shared in
|
|
682
|
+
* @param args.documentId - Document ID
|
|
683
|
+
*/
|
|
684
|
+
listGraphs: async (args) => {
|
|
685
|
+
return sdk.resources.call({
|
|
686
|
+
resourceId: 'document',
|
|
687
|
+
method: 'listGraphs',
|
|
688
|
+
params: args || {}
|
|
689
|
+
});
|
|
690
|
+
},
|
|
691
|
+
/**
|
|
692
|
+
* Semantic search across document chunks
|
|
693
|
+
* @param args.query - Search query
|
|
694
|
+
* @param args.graphId - Graph ID to search in (defaults to user's graph) (optional)
|
|
695
|
+
* @param args.limit - Maximum results (default: 10) (optional)
|
|
696
|
+
* @param args.threshold - Similarity threshold 0-1 (default: 0.7) (optional)
|
|
697
|
+
*/
|
|
698
|
+
search: async (args) => {
|
|
699
|
+
return sdk.resources.call({
|
|
700
|
+
resourceId: 'document',
|
|
701
|
+
method: 'search',
|
|
702
|
+
params: args || {}
|
|
703
|
+
});
|
|
704
|
+
},
|
|
705
|
+
/**
|
|
706
|
+
* List documents in a graph
|
|
707
|
+
* @param args.graphId - Graph ID to list documents from (defaults to user's graph) (optional)
|
|
708
|
+
* @param args.limit - Maximum results (default: 50) (optional)
|
|
709
|
+
* @param args.offset - Pagination offset (default: 0) (optional)
|
|
710
|
+
*/
|
|
711
|
+
list: async (args) => {
|
|
712
|
+
return sdk.resources.call({
|
|
713
|
+
resourceId: 'document',
|
|
714
|
+
method: 'list',
|
|
715
|
+
params: args || {}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Feed Items Adapter
|
|
722
|
+
* Category: internal
|
|
723
|
+
*/
|
|
724
|
+
function createFeedItemsAdapter(sdk) {
|
|
725
|
+
return {
|
|
726
|
+
/**
|
|
727
|
+
* Create a feed item with flexible content blocks. Use this to show action results, notifications, or updates to users.
|
|
728
|
+
* @param args.title - Main title of the feed item (shown prominently)
|
|
729
|
+
* @param args.subtitle - Optional subtitle (shown below title in muted color) (optional)
|
|
730
|
+
* @param args.blocks - Array of content blocks to display (text, key_value, list, timestamp, user_mention, divider, image, progress)
|
|
731
|
+
* @param args.itemType - Type: informative (FYI), actionable (needs response), or error
|
|
732
|
+
* @param args.actions - Optional action buttons for the feed item (optional)
|
|
733
|
+
* @param args.avatar - Optional avatar to show (user profile, icon, or custom image) (optional)
|
|
734
|
+
* @param args.metadata - Additional metadata (searchable, not displayed) (optional)
|
|
735
|
+
*/
|
|
736
|
+
createFeedItem: async (args) => {
|
|
737
|
+
return sdk.resources.call({
|
|
738
|
+
resourceId: 'feed-items',
|
|
739
|
+
method: 'create_feed_item',
|
|
740
|
+
params: args || {}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Telegram Adapter
|
|
747
|
+
* Category: social
|
|
748
|
+
*/
|
|
749
|
+
function createTelegramAdapter(sdk) {
|
|
750
|
+
return {
|
|
751
|
+
/**
|
|
752
|
+
* Send a text message to a Telegram chat or user. Supports both chat IDs and usernames.
|
|
753
|
+
* @param args.chatId - Chat ID (numeric) or username (e.g., @username) to send the message to. Chat IDs can be obtained from getChats operation.
|
|
754
|
+
* @param args.text - The text content of the message to send
|
|
755
|
+
*/
|
|
756
|
+
sendMessage: async (args) => {
|
|
757
|
+
return sdk.resources.call({
|
|
758
|
+
resourceId: 'telegram',
|
|
759
|
+
method: 'sendMessage',
|
|
760
|
+
params: args || {}
|
|
761
|
+
});
|
|
762
|
+
},
|
|
763
|
+
/**
|
|
764
|
+
* Retrieve Telegram chats with pagination support. Use limit and offset to paginate through large chat lists. Results are cached for 10 minutes.
|
|
765
|
+
* @param args.limit - Maximum number of chats to return (default: 50, max: 100). Use pagination for large chat lists to avoid token limits. (optional)
|
|
766
|
+
* @param args.offset - Number of chats to skip for pagination (default: 0). Combine with limit to fetch subsequent pages. (optional)
|
|
767
|
+
* @param args.forceRefresh - If true, bypasses the cache and fetches fresh chat data from Telegram. Default: false (optional)
|
|
768
|
+
*/
|
|
769
|
+
getChats: async (args) => {
|
|
770
|
+
return sdk.resources.call({
|
|
771
|
+
resourceId: 'telegram',
|
|
772
|
+
method: 'getChats',
|
|
773
|
+
params: args || {}
|
|
774
|
+
});
|
|
775
|
+
},
|
|
776
|
+
/**
|
|
777
|
+
* Find a Telegram chat by name or username. Searches through user's chats and returns the first match.
|
|
778
|
+
* @param args.name - Chat name, username (with or without @), or partial match to search for
|
|
779
|
+
*/
|
|
780
|
+
findChatByName: async (args) => {
|
|
781
|
+
return sdk.resources.call({
|
|
782
|
+
resourceId: 'telegram',
|
|
783
|
+
method: 'findChatByName',
|
|
784
|
+
params: args || {}
|
|
785
|
+
});
|
|
786
|
+
},
|
|
787
|
+
/**
|
|
788
|
+
* Search for messages across Telegram chats by content, date range, sender, or specific chats.
|
|
789
|
+
* @param args.chatIds - Array of chat IDs to search within. If not provided, searches globally. (optional)
|
|
790
|
+
* @param args.query - Text query to search for in messages (optional)
|
|
791
|
+
* @param args.fromDate - ISO date string for start of date range (optional)
|
|
792
|
+
* @param args.toDate - ISO date string for end of date range (optional)
|
|
793
|
+
* @param args.limit - Maximum number of messages to return (default: 100, max: 100) (optional)
|
|
794
|
+
* @param args.senderId - Filter messages by sender ID (optional)
|
|
795
|
+
*/
|
|
796
|
+
searchMessages: async (args) => {
|
|
797
|
+
return sdk.resources.call({
|
|
798
|
+
resourceId: 'telegram',
|
|
799
|
+
method: 'searchMessages',
|
|
800
|
+
params: args || {}
|
|
801
|
+
});
|
|
802
|
+
},
|
|
803
|
+
/**
|
|
804
|
+
* Get recent private chat contacts from Telegram, ordered by most recent activity. Uses the cached chat list filtered for 1:1 conversations.
|
|
805
|
+
* @param args.limit - Maximum number of contacts to return (default: 100, max: 100) (optional)
|
|
806
|
+
*/
|
|
807
|
+
getRecentContacts: async (args) => {
|
|
808
|
+
return sdk.resources.call({
|
|
809
|
+
resourceId: 'telegram',
|
|
810
|
+
method: 'getRecentContacts',
|
|
811
|
+
params: args || {}
|
|
812
|
+
});
|
|
813
|
+
},
|
|
814
|
+
/**
|
|
815
|
+
* Get message history from a specific Telegram chat with pagination and date filtering.
|
|
816
|
+
* @param args.chatId - Chat ID to retrieve messages from
|
|
817
|
+
* @param args.limit - Maximum number of messages to return (default: 50, max: 100) (optional)
|
|
818
|
+
* @param args.offsetId - Message ID to use as pagination offset (optional)
|
|
819
|
+
* @param args.minDate - ISO date string for minimum message date (optional)
|
|
820
|
+
* @param args.maxDate - ISO date string for maximum message date (optional)
|
|
821
|
+
*/
|
|
822
|
+
getChatMessages: async (args) => {
|
|
823
|
+
return sdk.resources.call({
|
|
824
|
+
resourceId: 'telegram',
|
|
825
|
+
method: 'getChatMessages',
|
|
826
|
+
params: args || {}
|
|
827
|
+
});
|
|
828
|
+
},
|
|
829
|
+
/**
|
|
830
|
+
* Get summary of unread messages across Telegram chats, including mentions and last message info.
|
|
831
|
+
* @param args.chatIds - Array of chat IDs to filter by. If not provided, checks all chats. (optional)
|
|
832
|
+
* @param args.priorityOnly - If true, only return chats with unread messages (optional)
|
|
833
|
+
* @param args.groupBy - Group results by "chat" or "sender" (optional)
|
|
834
|
+
*/
|
|
835
|
+
getUnreadSummary: async (args) => {
|
|
836
|
+
return sdk.resources.call({
|
|
837
|
+
resourceId: 'telegram',
|
|
838
|
+
method: 'getUnreadSummary',
|
|
839
|
+
params: args || {}
|
|
840
|
+
});
|
|
841
|
+
},
|
|
842
|
+
/**
|
|
843
|
+
* Mark messages as read in a Telegram chat up to a specific message ID.
|
|
844
|
+
* @param args.chatId - Chat ID to mark messages as read in
|
|
845
|
+
* @param args.maxMessageId - Maximum message ID to mark as read. If not provided, marks all messages as read. (optional)
|
|
846
|
+
*/
|
|
847
|
+
markAsRead: async (args) => {
|
|
848
|
+
return sdk.resources.call({
|
|
849
|
+
resourceId: 'telegram',
|
|
850
|
+
method: 'markAsRead',
|
|
851
|
+
params: args || {}
|
|
852
|
+
});
|
|
853
|
+
},
|
|
854
|
+
/**
|
|
855
|
+
* Get messages where the user is mentioned in Telegram chats.
|
|
856
|
+
* @param args.chatIds - Array of chat IDs to filter mentions by (optional)
|
|
857
|
+
* @param args.sinceDate - ISO date string - only return mentions since this date (optional)
|
|
858
|
+
* @param args.onlyUnread - If true, only return unread mentions (optional)
|
|
859
|
+
*/
|
|
860
|
+
getMentions: async (args) => {
|
|
861
|
+
return sdk.resources.call({
|
|
862
|
+
resourceId: 'telegram',
|
|
863
|
+
method: 'getMentions',
|
|
864
|
+
params: args || {}
|
|
865
|
+
});
|
|
866
|
+
},
|
|
867
|
+
/**
|
|
868
|
+
* Perform a global search across all Telegram chats for messages matching a query.
|
|
869
|
+
* @param args.query - Search query text
|
|
870
|
+
* @param args.filter - Filter results by chat type: "groups", "private", or "channels" (optional)
|
|
871
|
+
* @param args.limit - Maximum number of results to return (default: 100, max: 100) (optional)
|
|
872
|
+
*/
|
|
873
|
+
globalSearch: async (args) => {
|
|
874
|
+
return sdk.resources.call({
|
|
875
|
+
resourceId: 'telegram',
|
|
876
|
+
method: 'globalSearch',
|
|
877
|
+
params: args || {}
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Gmail Adapter
|
|
884
|
+
* Category: communication
|
|
885
|
+
*/
|
|
886
|
+
function createGoogleGmailAdapter(sdk) {
|
|
887
|
+
return {
|
|
888
|
+
/**
|
|
889
|
+
* Send an email via Gmail
|
|
890
|
+
* @param args.to - Valid email address
|
|
891
|
+
* @param args.subject - Email subject line
|
|
892
|
+
* @param args.body - Email body content
|
|
893
|
+
* @param args.cc - CC recipients (comma-separated email addresses) (optional)
|
|
894
|
+
* @param args.bcc - BCC recipients (comma-separated email addresses) (optional)
|
|
895
|
+
* @param args.isHtml - Whether body is HTML format (optional)
|
|
896
|
+
*/
|
|
897
|
+
sendEmail: async (args) => {
|
|
898
|
+
return sdk.resources.call({
|
|
899
|
+
resourceId: 'google-gmail',
|
|
900
|
+
method: 'sendEmail',
|
|
901
|
+
params: args || {}
|
|
902
|
+
});
|
|
903
|
+
},
|
|
904
|
+
/**
|
|
905
|
+
* Search emails with Gmail query syntax
|
|
906
|
+
* @param args.query - Gmail search query (e.g., "from:user@example.com is:unread")
|
|
907
|
+
* @param args.maxResults - Maximum number of results to return (default: 50, max: 100) (optional)
|
|
908
|
+
*/
|
|
909
|
+
searchEmails: async (args) => {
|
|
910
|
+
return sdk.resources.call({
|
|
911
|
+
resourceId: 'google-gmail',
|
|
912
|
+
method: 'searchEmails',
|
|
913
|
+
params: args || {}
|
|
914
|
+
});
|
|
915
|
+
},
|
|
916
|
+
/**
|
|
917
|
+
* List recent emails from inbox
|
|
918
|
+
* @param args.maxResults - Maximum number of results to return (default: 50, max: 100) (optional)
|
|
919
|
+
*/
|
|
920
|
+
listEmails: async (args) => {
|
|
921
|
+
return sdk.resources.call({
|
|
922
|
+
resourceId: 'google-gmail',
|
|
923
|
+
method: 'listEmails',
|
|
924
|
+
params: args || {}
|
|
925
|
+
});
|
|
926
|
+
},
|
|
927
|
+
/**
|
|
928
|
+
* Get details of a specific email by ID
|
|
929
|
+
* @param args.messageId - Gmail message ID
|
|
930
|
+
*/
|
|
931
|
+
getEmail: async (args) => {
|
|
932
|
+
return sdk.resources.call({
|
|
933
|
+
resourceId: 'google-gmail',
|
|
934
|
+
method: 'getEmail',
|
|
935
|
+
params: args || {}
|
|
936
|
+
});
|
|
937
|
+
},
|
|
938
|
+
/**
|
|
939
|
+
* Create a draft email in Gmail
|
|
940
|
+
* @param args.to - Valid email address
|
|
941
|
+
* @param args.subject - Email subject line
|
|
942
|
+
* @param args.body - Email body content
|
|
943
|
+
* @param args.cc - CC recipients (comma-separated email addresses) (optional)
|
|
944
|
+
* @param args.bcc - BCC recipients (comma-separated email addresses) (optional)
|
|
945
|
+
* @param args.isHtml - Whether body is HTML format (optional)
|
|
946
|
+
*/
|
|
947
|
+
createDraft: async (args) => {
|
|
948
|
+
return sdk.resources.call({
|
|
949
|
+
resourceId: 'google-gmail',
|
|
950
|
+
method: 'createDraft',
|
|
951
|
+
params: args || {}
|
|
952
|
+
});
|
|
953
|
+
},
|
|
954
|
+
/**
|
|
955
|
+
* Update an existing draft email
|
|
956
|
+
* @param args.draftId - Gmail draft ID to update
|
|
957
|
+
* @param args.to - Updated recipient email address(es) (optional)
|
|
958
|
+
* @param args.subject - Updated email subject line (optional)
|
|
959
|
+
* @param args.body - Updated email body content (optional)
|
|
960
|
+
* @param args.cc - Updated CC recipients (optional)
|
|
961
|
+
* @param args.bcc - Updated BCC recipients (optional)
|
|
962
|
+
* @param args.isHtml - Whether body is HTML format (optional)
|
|
963
|
+
*/
|
|
964
|
+
updateDraft: async (args) => {
|
|
965
|
+
return sdk.resources.call({
|
|
966
|
+
resourceId: 'google-gmail',
|
|
967
|
+
method: 'updateDraft',
|
|
968
|
+
params: args || {}
|
|
969
|
+
});
|
|
970
|
+
},
|
|
971
|
+
/**
|
|
972
|
+
* Delete a draft email
|
|
973
|
+
* @param args.draftId - Gmail draft ID to delete
|
|
974
|
+
*/
|
|
975
|
+
deleteDraft: async (args) => {
|
|
976
|
+
return sdk.resources.call({
|
|
977
|
+
resourceId: 'google-gmail',
|
|
978
|
+
method: 'deleteDraft',
|
|
979
|
+
params: args || {}
|
|
980
|
+
});
|
|
981
|
+
},
|
|
982
|
+
/**
|
|
983
|
+
* List all draft emails
|
|
984
|
+
* @param args.maxResults - Maximum number of drafts to return (default: 10) (optional)
|
|
985
|
+
*/
|
|
986
|
+
listDrafts: async (args) => {
|
|
987
|
+
return sdk.resources.call({
|
|
988
|
+
resourceId: 'google-gmail',
|
|
989
|
+
method: 'listDrafts',
|
|
990
|
+
params: args || {}
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
/**
|
|
994
|
+
* Delete an email
|
|
995
|
+
* @param args.messageId - Gmail message ID to delete
|
|
996
|
+
*/
|
|
997
|
+
deleteEmail: async (args) => {
|
|
998
|
+
return sdk.resources.call({
|
|
999
|
+
resourceId: 'google-gmail',
|
|
1000
|
+
method: 'deleteEmail',
|
|
1001
|
+
params: args || {}
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Google Calendar Adapter
|
|
1008
|
+
* Category: productivity
|
|
1009
|
+
*/
|
|
1010
|
+
function createGoogleCalendarAdapter(sdk) {
|
|
1011
|
+
return {
|
|
1012
|
+
/**
|
|
1013
|
+
* Create a new calendar event
|
|
1014
|
+
* @param args.summary - Event title/summary
|
|
1015
|
+
* @param args.start - Start time object with dateTime and optional timeZone
|
|
1016
|
+
* @param args.end - End time object with dateTime and optional timeZone
|
|
1017
|
+
* @param args.description - Event description (optional)
|
|
1018
|
+
* @param args.location - Event location (optional)
|
|
1019
|
+
* @param args.attendees - Array of attendee email addresses (optional)
|
|
1020
|
+
*/
|
|
1021
|
+
createEvent: async (args) => {
|
|
1022
|
+
return sdk.resources.call({
|
|
1023
|
+
resourceId: 'google-calendar',
|
|
1024
|
+
method: 'createEvent',
|
|
1025
|
+
params: args || {}
|
|
1026
|
+
});
|
|
1027
|
+
},
|
|
1028
|
+
/**
|
|
1029
|
+
* List calendar events
|
|
1030
|
+
* @param args.timeMin - Start time for events to list (ISO 8601) (optional)
|
|
1031
|
+
* @param args.timeMax - End time for events to list (ISO 8601) (optional)
|
|
1032
|
+
* @param args.maxResults - Maximum number of events to return (default: 50, max: 100) (optional)
|
|
1033
|
+
* @param args.query - Search query to filter events (optional)
|
|
1034
|
+
*/
|
|
1035
|
+
listEvents: async (args) => {
|
|
1036
|
+
return sdk.resources.call({
|
|
1037
|
+
resourceId: 'google-calendar',
|
|
1038
|
+
method: 'listEvents',
|
|
1039
|
+
params: args || {}
|
|
1040
|
+
});
|
|
1041
|
+
},
|
|
1042
|
+
/**
|
|
1043
|
+
* Get calendar events (alias for listEvents)
|
|
1044
|
+
* @param args.timeMin - Start time for events to list (ISO 8601) (optional)
|
|
1045
|
+
* @param args.timeMax - End time for events to list (ISO 8601) (optional)
|
|
1046
|
+
* @param args.maxResults - Maximum number of events to return (default: 50, max: 100) (optional)
|
|
1047
|
+
* @param args.query - Search query to filter events (optional)
|
|
1048
|
+
*/
|
|
1049
|
+
getEvents: async (args) => {
|
|
1050
|
+
return sdk.resources.call({
|
|
1051
|
+
resourceId: 'google-calendar',
|
|
1052
|
+
method: 'getEvents',
|
|
1053
|
+
params: args || {}
|
|
1054
|
+
});
|
|
1055
|
+
},
|
|
1056
|
+
/**
|
|
1057
|
+
* Get a specific calendar event by ID
|
|
1058
|
+
* @param args.eventId - Calendar event ID
|
|
1059
|
+
*/
|
|
1060
|
+
getEvent: async (args) => {
|
|
1061
|
+
return sdk.resources.call({
|
|
1062
|
+
resourceId: 'google-calendar',
|
|
1063
|
+
method: 'getEvent',
|
|
1064
|
+
params: args || {}
|
|
1065
|
+
});
|
|
1066
|
+
},
|
|
1067
|
+
/**
|
|
1068
|
+
* Update an existing calendar event
|
|
1069
|
+
* @param args.eventId - Calendar event ID to update
|
|
1070
|
+
* @param args.summary - Updated event title/summary (optional)
|
|
1071
|
+
* @param args.description - Updated event description (optional)
|
|
1072
|
+
* @param args.location - Updated event location (optional)
|
|
1073
|
+
* @param args.start - Updated start time object with dateTime and optional timeZone (optional)
|
|
1074
|
+
* @param args.end - Updated end time object with dateTime and optional timeZone (optional)
|
|
1075
|
+
*/
|
|
1076
|
+
updateEvent: async (args) => {
|
|
1077
|
+
return sdk.resources.call({
|
|
1078
|
+
resourceId: 'google-calendar',
|
|
1079
|
+
method: 'updateEvent',
|
|
1080
|
+
params: args || {}
|
|
1081
|
+
});
|
|
1082
|
+
},
|
|
1083
|
+
/**
|
|
1084
|
+
* Delete a calendar event
|
|
1085
|
+
* @param args.eventId - Calendar event ID to delete
|
|
1086
|
+
*/
|
|
1087
|
+
deleteEvent: async (args) => {
|
|
1088
|
+
return sdk.resources.call({
|
|
1089
|
+
resourceId: 'google-calendar',
|
|
1090
|
+
method: 'deleteEvent',
|
|
1091
|
+
params: args || {}
|
|
1092
|
+
});
|
|
1093
|
+
},
|
|
1094
|
+
/**
|
|
1095
|
+
* Search calendar events by text query
|
|
1096
|
+
* @param args.query - Search query to filter events
|
|
1097
|
+
* @param args.timeMin - Start time for events to search (ISO 8601) (optional)
|
|
1098
|
+
* @param args.timeMax - End time for events to search (ISO 8601) (optional)
|
|
1099
|
+
* @param args.maxResults - Maximum number of events to return (default: 50, max: 100) (optional)
|
|
1100
|
+
*/
|
|
1101
|
+
searchEvents: async (args) => {
|
|
1102
|
+
return sdk.resources.call({
|
|
1103
|
+
resourceId: 'google-calendar',
|
|
1104
|
+
method: 'searchEvents',
|
|
1105
|
+
params: args || {}
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Google Drive Adapter
|
|
1112
|
+
* Category: storage
|
|
1113
|
+
*/
|
|
1114
|
+
function createGoogleDriveAdapter(sdk) {
|
|
1115
|
+
return {
|
|
1116
|
+
/**
|
|
1117
|
+
* List files in Google Drive
|
|
1118
|
+
* @param args.query - Search query (Google Drive query syntax) (optional)
|
|
1119
|
+
* @param args.pageSize - Maximum number of files to return (default: 20) (optional)
|
|
1120
|
+
*/
|
|
1121
|
+
listFiles: async (args) => {
|
|
1122
|
+
return sdk.resources.call({
|
|
1123
|
+
resourceId: 'google-drive',
|
|
1124
|
+
method: 'listFiles',
|
|
1125
|
+
params: args || {}
|
|
1126
|
+
});
|
|
1127
|
+
},
|
|
1128
|
+
/**
|
|
1129
|
+
* Create a new file in Google Drive
|
|
1130
|
+
* @param args.name - Name of the file
|
|
1131
|
+
* @param args.mimeType - MIME type of the file
|
|
1132
|
+
* @param args.folderId - Parent folder ID (optional) (optional)
|
|
1133
|
+
*/
|
|
1134
|
+
createFile: async (args) => {
|
|
1135
|
+
return sdk.resources.call({
|
|
1136
|
+
resourceId: 'google-drive',
|
|
1137
|
+
method: 'createFile',
|
|
1138
|
+
params: args || {}
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
/**
|
|
1142
|
+
* Create a new folder in Google Drive
|
|
1143
|
+
* @param args.name - Name of the folder
|
|
1144
|
+
* @param args.parentFolderId - Parent folder ID (optional) (optional)
|
|
1145
|
+
*/
|
|
1146
|
+
createFolder: async (args) => {
|
|
1147
|
+
return sdk.resources.call({
|
|
1148
|
+
resourceId: 'google-drive',
|
|
1149
|
+
method: 'createFolder',
|
|
1150
|
+
params: args || {}
|
|
1151
|
+
});
|
|
1152
|
+
},
|
|
1153
|
+
/**
|
|
1154
|
+
* Get information about a file
|
|
1155
|
+
* @param args.fileId - ID of the file
|
|
1156
|
+
*/
|
|
1157
|
+
getFileInfo: async (args) => {
|
|
1158
|
+
return sdk.resources.call({
|
|
1159
|
+
resourceId: 'google-drive',
|
|
1160
|
+
method: 'getFileInfo',
|
|
1161
|
+
params: args || {}
|
|
1162
|
+
});
|
|
1163
|
+
},
|
|
1164
|
+
/**
|
|
1165
|
+
* Share a file with others
|
|
1166
|
+
* @param args.fileId - ID of the file to share
|
|
1167
|
+
* @param args.email - Email address to share with (optional) (optional)
|
|
1168
|
+
* @param args.role - Permission role: reader, writer, commenter (default: reader) (optional)
|
|
1169
|
+
*/
|
|
1170
|
+
shareFile: async (args) => {
|
|
1171
|
+
return sdk.resources.call({
|
|
1172
|
+
resourceId: 'google-drive',
|
|
1173
|
+
method: 'shareFile',
|
|
1174
|
+
params: args || {}
|
|
1175
|
+
});
|
|
1176
|
+
},
|
|
1177
|
+
/**
|
|
1178
|
+
* Download a file from Google Drive. For Google Docs/Sheets, exports as PDF/XLSX. Returns base64-encoded data.
|
|
1179
|
+
* @param args.fileId - ID of the file to download
|
|
1180
|
+
*/
|
|
1181
|
+
downloadFile: async (args) => {
|
|
1182
|
+
return sdk.resources.call({
|
|
1183
|
+
resourceId: 'google-drive',
|
|
1184
|
+
method: 'downloadFile',
|
|
1185
|
+
params: args || {}
|
|
1186
|
+
});
|
|
1187
|
+
},
|
|
1188
|
+
/**
|
|
1189
|
+
* Move a file to a different folder
|
|
1190
|
+
* @param args.fileId - ID of the file to move
|
|
1191
|
+
* @param args.folderId - ID of the destination folder
|
|
1192
|
+
*/
|
|
1193
|
+
moveFile: async (args) => {
|
|
1194
|
+
return sdk.resources.call({
|
|
1195
|
+
resourceId: 'google-drive',
|
|
1196
|
+
method: 'moveFile',
|
|
1197
|
+
params: args || {}
|
|
1198
|
+
});
|
|
1199
|
+
},
|
|
1200
|
+
/**
|
|
1201
|
+
* Delete a file or folder. By default moves to trash; set permanently=true to delete forever.
|
|
1202
|
+
* @param args.fileId - ID of the file or folder to delete
|
|
1203
|
+
* @param args.permanently - If true, permanently delete instead of moving to trash (default: false) (optional)
|
|
1204
|
+
*/
|
|
1205
|
+
deleteFile: async (args) => {
|
|
1206
|
+
return sdk.resources.call({
|
|
1207
|
+
resourceId: 'google-drive',
|
|
1208
|
+
method: 'deleteFile',
|
|
1209
|
+
params: args || {}
|
|
1210
|
+
});
|
|
1211
|
+
},
|
|
1212
|
+
/**
|
|
1213
|
+
* Search for files using Google Drive query syntax
|
|
1214
|
+
* @param args.query - Search query using Drive syntax (e.g., "name contains 'report'", "mimeType='application/pdf'")
|
|
1215
|
+
* @param args.pageSize - Maximum number of files to return (default: 20) (optional)
|
|
1216
|
+
*/
|
|
1217
|
+
searchFiles: async (args) => {
|
|
1218
|
+
return sdk.resources.call({
|
|
1219
|
+
resourceId: 'google-drive',
|
|
1220
|
+
method: 'searchFiles',
|
|
1221
|
+
params: args || {}
|
|
1222
|
+
});
|
|
1223
|
+
},
|
|
1224
|
+
/**
|
|
1225
|
+
* Update file metadata (name, description)
|
|
1226
|
+
* @param args.fileId - ID of the file to update
|
|
1227
|
+
* @param args.name - New name for the file (optional)
|
|
1228
|
+
* @param args.description - New description for the file (optional)
|
|
1229
|
+
*/
|
|
1230
|
+
updateFile: async (args) => {
|
|
1231
|
+
return sdk.resources.call({
|
|
1232
|
+
resourceId: 'google-drive',
|
|
1233
|
+
method: 'updateFile',
|
|
1234
|
+
params: args || {}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Google Sheets Adapter
|
|
1241
|
+
* Category: productivity
|
|
1242
|
+
*/
|
|
1243
|
+
function createGoogleSheetsAdapter(sdk) {
|
|
1244
|
+
return {
|
|
1245
|
+
/**
|
|
1246
|
+
* Create a new Google Sheets spreadsheet
|
|
1247
|
+
* @param args.title - Title of the spreadsheet
|
|
1248
|
+
*/
|
|
1249
|
+
createSpreadsheet: async (args) => {
|
|
1250
|
+
return sdk.resources.call({
|
|
1251
|
+
resourceId: 'google-sheets',
|
|
1252
|
+
method: 'createSpreadsheet',
|
|
1253
|
+
params: args || {}
|
|
1254
|
+
});
|
|
1255
|
+
},
|
|
1256
|
+
/**
|
|
1257
|
+
* Read data from a range in a spreadsheet
|
|
1258
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1259
|
+
* @param args.range - Cell range (e.g., "Sheet1!A1:B10")
|
|
1260
|
+
*/
|
|
1261
|
+
readRange: async (args) => {
|
|
1262
|
+
return sdk.resources.call({
|
|
1263
|
+
resourceId: 'google-sheets',
|
|
1264
|
+
method: 'readRange',
|
|
1265
|
+
params: args || {}
|
|
1266
|
+
});
|
|
1267
|
+
},
|
|
1268
|
+
/**
|
|
1269
|
+
* Write data to a range in a spreadsheet
|
|
1270
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1271
|
+
* @param args.range - Cell range (e.g., "Sheet1!A1:B10")
|
|
1272
|
+
* @param args.values - Data to write (2D array)
|
|
1273
|
+
*/
|
|
1274
|
+
writeRange: async (args) => {
|
|
1275
|
+
return sdk.resources.call({
|
|
1276
|
+
resourceId: 'google-sheets',
|
|
1277
|
+
method: 'writeRange',
|
|
1278
|
+
params: args || {}
|
|
1279
|
+
});
|
|
1280
|
+
},
|
|
1281
|
+
/**
|
|
1282
|
+
* Append a row to a spreadsheet
|
|
1283
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1284
|
+
* @param args.sheetName - Name of the sheet
|
|
1285
|
+
* @param args.values - Row values to append
|
|
1286
|
+
*/
|
|
1287
|
+
appendRow: async (args) => {
|
|
1288
|
+
return sdk.resources.call({
|
|
1289
|
+
resourceId: 'google-sheets',
|
|
1290
|
+
method: 'appendRow',
|
|
1291
|
+
params: args || {}
|
|
1292
|
+
});
|
|
1293
|
+
},
|
|
1294
|
+
/**
|
|
1295
|
+
* Get spreadsheet metadata and properties
|
|
1296
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1297
|
+
*/
|
|
1298
|
+
getSpreadsheet: async (args) => {
|
|
1299
|
+
return sdk.resources.call({
|
|
1300
|
+
resourceId: 'google-sheets',
|
|
1301
|
+
method: 'getSpreadsheet',
|
|
1302
|
+
params: args || {}
|
|
1303
|
+
});
|
|
1304
|
+
},
|
|
1305
|
+
/**
|
|
1306
|
+
* Insert a value at a specific cell with optional formatting
|
|
1307
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1308
|
+
* @param args.cell - Cell reference in format SheetName!A1
|
|
1309
|
+
* @param args.value - Value to insert
|
|
1310
|
+
* @param args.bold - Make text bold (optional)
|
|
1311
|
+
* @param args.italic - Make text italic (optional)
|
|
1312
|
+
* @param args.foregroundColor - Text color (hex or named color) (optional)
|
|
1313
|
+
* @param args.backgroundColor - Cell background color (hex or named color) (optional)
|
|
1314
|
+
*/
|
|
1315
|
+
insertAtCell: async (args) => {
|
|
1316
|
+
return sdk.resources.call({
|
|
1317
|
+
resourceId: 'google-sheets',
|
|
1318
|
+
method: 'insertAtCell',
|
|
1319
|
+
params: args || {}
|
|
1320
|
+
});
|
|
1321
|
+
},
|
|
1322
|
+
/**
|
|
1323
|
+
* Insert a formula at a specific cell
|
|
1324
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1325
|
+
* @param args.cell - Cell reference in format SheetName!A1
|
|
1326
|
+
* @param args.formula - Formula to insert (with or without leading =)
|
|
1327
|
+
* @param args.note - Optional note to add to the cell (optional)
|
|
1328
|
+
*/
|
|
1329
|
+
insertFormula: async (args) => {
|
|
1330
|
+
return sdk.resources.call({
|
|
1331
|
+
resourceId: 'google-sheets',
|
|
1332
|
+
method: 'insertFormula',
|
|
1333
|
+
params: args || {}
|
|
1334
|
+
});
|
|
1335
|
+
},
|
|
1336
|
+
/**
|
|
1337
|
+
* Apply formatting to a range of cells
|
|
1338
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1339
|
+
* @param args.range - Range in format SheetName!A1:B10
|
|
1340
|
+
* @param args.bold - Make text bold (optional)
|
|
1341
|
+
* @param args.italic - Make text italic (optional)
|
|
1342
|
+
* @param args.foregroundColor - Text color (hex or named color) (optional)
|
|
1343
|
+
* @param args.backgroundColor - Cell background color (hex or named color) (optional)
|
|
1344
|
+
* @param args.borders - Add borders to cells (optional)
|
|
1345
|
+
*/
|
|
1346
|
+
formatRange: async (args) => {
|
|
1347
|
+
return sdk.resources.call({
|
|
1348
|
+
resourceId: 'google-sheets',
|
|
1349
|
+
method: 'formatRange',
|
|
1350
|
+
params: args || {}
|
|
1351
|
+
});
|
|
1352
|
+
},
|
|
1353
|
+
/**
|
|
1354
|
+
* Create a chart from spreadsheet data
|
|
1355
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1356
|
+
* @param args.sheetId - ID of the sheet containing data
|
|
1357
|
+
* @param args.dataRange - Data range for the chart (e.g., A1:B10)
|
|
1358
|
+
* @param args.chartType - Chart type: BAR, LINE, AREA, PIE, or SCATTER
|
|
1359
|
+
* @param args.title - Chart title
|
|
1360
|
+
* @param args.position - Chart position with row, column, rowCount, columnCount
|
|
1361
|
+
*/
|
|
1362
|
+
createChart: async (args) => {
|
|
1363
|
+
return sdk.resources.call({
|
|
1364
|
+
resourceId: 'google-sheets',
|
|
1365
|
+
method: 'createChart',
|
|
1366
|
+
params: args || {}
|
|
1367
|
+
});
|
|
1368
|
+
},
|
|
1369
|
+
/**
|
|
1370
|
+
* Find and replace text in a spreadsheet
|
|
1371
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1372
|
+
* @param args.findText - Text to find
|
|
1373
|
+
* @param args.replaceText - Text to replace with
|
|
1374
|
+
* @param args.sheetName - Limit search to specific sheet (optional)
|
|
1375
|
+
* @param args.matchCase - Case-sensitive search (optional)
|
|
1376
|
+
* @param args.matchEntireCell - Match entire cell content only (optional)
|
|
1377
|
+
*/
|
|
1378
|
+
findAndReplace: async (args) => {
|
|
1379
|
+
return sdk.resources.call({
|
|
1380
|
+
resourceId: 'google-sheets',
|
|
1381
|
+
method: 'findAndReplace',
|
|
1382
|
+
params: args || {}
|
|
1383
|
+
});
|
|
1384
|
+
},
|
|
1385
|
+
/**
|
|
1386
|
+
* Insert multiple rows of data at once
|
|
1387
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1388
|
+
* @param args.sheetName - Name of the sheet
|
|
1389
|
+
* @param args.rowsData - 2D array of row data to insert
|
|
1390
|
+
* @param args.startingRow - Row number to start insertion (1-indexed). If not provided, appends to end (optional)
|
|
1391
|
+
* @param args.formattingOptions - Optional formatting to apply (bold, italic, foregroundColor, backgroundColor, borders) (optional)
|
|
1392
|
+
*/
|
|
1393
|
+
insertMultipleRows: async (args) => {
|
|
1394
|
+
return sdk.resources.call({
|
|
1395
|
+
resourceId: 'google-sheets',
|
|
1396
|
+
method: 'insertMultipleRows',
|
|
1397
|
+
params: args || {}
|
|
1398
|
+
});
|
|
1399
|
+
},
|
|
1400
|
+
/**
|
|
1401
|
+
* Clear content from a range of cells
|
|
1402
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1403
|
+
* @param args.sheetName - Name of the sheet
|
|
1404
|
+
* @param args.range - Range to clear (e.g., A1:B10)
|
|
1405
|
+
*/
|
|
1406
|
+
clearRange: async (args) => {
|
|
1407
|
+
return sdk.resources.call({
|
|
1408
|
+
resourceId: 'google-sheets',
|
|
1409
|
+
method: 'clearRange',
|
|
1410
|
+
params: args || {}
|
|
1411
|
+
});
|
|
1412
|
+
},
|
|
1413
|
+
/**
|
|
1414
|
+
* Insert empty rows at a specific position in a sheet. IMPORTANT: Requires numeric sheetId (get from getSpreadsheet), not sheet name. Row indices are 0-indexed (row 1 in UI = index 0).
|
|
1415
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1416
|
+
* @param args.sheetId - Numeric sheet ID (get from getSpreadsheet response: sheets[0].properties.sheetId). This is NOT the sheet name.
|
|
1417
|
+
* @param args.startRowIndex - Row index to start inserting at (0-indexed). To insert before row 5 in the UI, use index 4.
|
|
1418
|
+
* @param args.numRows - Number of rows to insert
|
|
1419
|
+
*/
|
|
1420
|
+
insertRows: async (args) => {
|
|
1421
|
+
return sdk.resources.call({
|
|
1422
|
+
resourceId: 'google-sheets',
|
|
1423
|
+
method: 'insertRows',
|
|
1424
|
+
params: args || {}
|
|
1425
|
+
});
|
|
1426
|
+
},
|
|
1427
|
+
/**
|
|
1428
|
+
* Delete rows from a sheet. IMPORTANT: Requires numeric sheetId (get from getSpreadsheet), not sheet name. Row indices are 0-indexed (row 1 in UI = index 0).
|
|
1429
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1430
|
+
* @param args.sheetId - Numeric sheet ID (get from getSpreadsheet response: sheets[0].properties.sheetId). This is NOT the sheet name.
|
|
1431
|
+
* @param args.startRowIndex - Row index to start deleting from (0-indexed). To delete row 5 in the UI, use index 4.
|
|
1432
|
+
* @param args.numRows - Number of rows to delete
|
|
1433
|
+
*/
|
|
1434
|
+
deleteRows: async (args) => {
|
|
1435
|
+
return sdk.resources.call({
|
|
1436
|
+
resourceId: 'google-sheets',
|
|
1437
|
+
method: 'deleteRows',
|
|
1438
|
+
params: args || {}
|
|
1439
|
+
});
|
|
1440
|
+
},
|
|
1441
|
+
/**
|
|
1442
|
+
* Insert empty columns at a specific position in a sheet. IMPORTANT: Requires numeric sheetId (get from getSpreadsheet), not sheet name. Column indices are 0-indexed (A=0, B=1, C=2, etc.).
|
|
1443
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1444
|
+
* @param args.sheetId - Numeric sheet ID (get from getSpreadsheet response: sheets[0].properties.sheetId). This is NOT the sheet name.
|
|
1445
|
+
* @param args.startColumnIndex - Column index to start inserting at (0-indexed: A=0, B=1, C=2, D=3, etc.). To insert before column D, use index 3.
|
|
1446
|
+
* @param args.numColumns - Number of columns to insert
|
|
1447
|
+
*/
|
|
1448
|
+
insertColumns: async (args) => {
|
|
1449
|
+
return sdk.resources.call({
|
|
1450
|
+
resourceId: 'google-sheets',
|
|
1451
|
+
method: 'insertColumns',
|
|
1452
|
+
params: args || {}
|
|
1453
|
+
});
|
|
1454
|
+
},
|
|
1455
|
+
/**
|
|
1456
|
+
* Delete columns from a sheet. IMPORTANT: Requires numeric sheetId (get from getSpreadsheet), not sheet name. Column indices are 0-indexed (A=0, B=1, C=2, etc.).
|
|
1457
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1458
|
+
* @param args.sheetId - Numeric sheet ID (get from getSpreadsheet response: sheets[0].properties.sheetId). This is NOT the sheet name.
|
|
1459
|
+
* @param args.startColumnIndex - Column index to start deleting from (0-indexed: A=0, B=1, C=2, D=3, etc.). To delete column D, use index 3.
|
|
1460
|
+
* @param args.numColumns - Number of columns to delete
|
|
1461
|
+
*/
|
|
1462
|
+
deleteColumns: async (args) => {
|
|
1463
|
+
return sdk.resources.call({
|
|
1464
|
+
resourceId: 'google-sheets',
|
|
1465
|
+
method: 'deleteColumns',
|
|
1466
|
+
params: args || {}
|
|
1467
|
+
});
|
|
1468
|
+
},
|
|
1469
|
+
/**
|
|
1470
|
+
* Copy data from one range to another location within the same spreadsheet. IMPORTANT: Requires numeric sheetIds (get from getSpreadsheet), not sheet names. Can copy within same sheet or across sheets.
|
|
1471
|
+
* @param args.spreadsheetId - ID of the spreadsheet
|
|
1472
|
+
* @param args.sourceSheetId - Numeric sheet ID of the source sheet (get from getSpreadsheet response: sheets[n].properties.sheetId)
|
|
1473
|
+
* @param args.sourceRange - Source range in A1 notation WITHOUT sheet name (e.g., "A1:C5", not "Sheet1!A1:C5")
|
|
1474
|
+
* @param args.targetSheetId - Numeric sheet ID of the target sheet (can be same as sourceSheetId to copy within same sheet)
|
|
1475
|
+
* @param args.targetStartCell - Target start cell in A1 notation (e.g., "E1"). The copied data will fill cells starting from this position.
|
|
1476
|
+
*/
|
|
1477
|
+
copyRange: async (args) => {
|
|
1478
|
+
return sdk.resources.call({
|
|
1479
|
+
resourceId: 'google-sheets',
|
|
1480
|
+
method: 'copyRange',
|
|
1481
|
+
params: args || {}
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
/**
|
|
1487
|
+
* Google Docs Adapter
|
|
1488
|
+
* Category: productivity
|
|
1489
|
+
*/
|
|
1490
|
+
function createGoogleDocsAdapter(sdk) {
|
|
1491
|
+
return {
|
|
1492
|
+
/**
|
|
1493
|
+
* Create a new Google Doc
|
|
1494
|
+
* @param args.title - Title of the document
|
|
1495
|
+
*/
|
|
1496
|
+
createDocument: async (args) => {
|
|
1497
|
+
return sdk.resources.call({
|
|
1498
|
+
resourceId: 'google-docs',
|
|
1499
|
+
method: 'createDocument',
|
|
1500
|
+
params: args || {}
|
|
1501
|
+
});
|
|
1502
|
+
},
|
|
1503
|
+
/**
|
|
1504
|
+
* Get a Google Doc by ID
|
|
1505
|
+
* @param args.documentId - ID of the document
|
|
1506
|
+
*/
|
|
1507
|
+
getDocument: async (args) => {
|
|
1508
|
+
return sdk.resources.call({
|
|
1509
|
+
resourceId: 'google-docs',
|
|
1510
|
+
method: 'getDocument',
|
|
1511
|
+
params: args || {}
|
|
1512
|
+
});
|
|
1513
|
+
},
|
|
1514
|
+
/**
|
|
1515
|
+
* Append text to the end of a document
|
|
1516
|
+
* @param args.documentId - ID of the document
|
|
1517
|
+
* @param args.text - Text to append
|
|
1518
|
+
*/
|
|
1519
|
+
appendText: async (args) => {
|
|
1520
|
+
return sdk.resources.call({
|
|
1521
|
+
resourceId: 'google-docs',
|
|
1522
|
+
method: 'appendText',
|
|
1523
|
+
params: args || {}
|
|
1524
|
+
});
|
|
1525
|
+
},
|
|
1526
|
+
/**
|
|
1527
|
+
* Replace text in a document
|
|
1528
|
+
* @param args.documentId - ID of the document
|
|
1529
|
+
* @param args.searchText - Text to search for
|
|
1530
|
+
* @param args.replaceText - Text to replace with
|
|
1531
|
+
*/
|
|
1532
|
+
replaceText: async (args) => {
|
|
1533
|
+
return sdk.resources.call({
|
|
1534
|
+
resourceId: 'google-docs',
|
|
1535
|
+
method: 'replaceText',
|
|
1536
|
+
params: args || {}
|
|
1537
|
+
});
|
|
1538
|
+
},
|
|
1539
|
+
/**
|
|
1540
|
+
* Get the text content of a Google Doc
|
|
1541
|
+
* @param args.documentId - ID of the document
|
|
1542
|
+
*/
|
|
1543
|
+
getDocumentContent: async (args) => {
|
|
1544
|
+
return sdk.resources.call({
|
|
1545
|
+
resourceId: 'google-docs',
|
|
1546
|
+
method: 'getDocumentContent',
|
|
1547
|
+
params: args || {}
|
|
1548
|
+
});
|
|
1549
|
+
},
|
|
1550
|
+
/**
|
|
1551
|
+
* Insert text at a specific position in the document
|
|
1552
|
+
* @param args.documentId - ID of the document
|
|
1553
|
+
* @param args.text - Text to insert
|
|
1554
|
+
* @param args.position - Character position to insert at (1-indexed)
|
|
1555
|
+
*/
|
|
1556
|
+
insertTextAtPosition: async (args) => {
|
|
1557
|
+
return sdk.resources.call({
|
|
1558
|
+
resourceId: 'google-docs',
|
|
1559
|
+
method: 'insertTextAtPosition',
|
|
1560
|
+
params: args || {}
|
|
1561
|
+
});
|
|
1562
|
+
},
|
|
1563
|
+
/**
|
|
1564
|
+
* Insert text after a search string in the document
|
|
1565
|
+
* @param args.documentId - ID of the document
|
|
1566
|
+
* @param args.searchText - Text to search for
|
|
1567
|
+
* @param args.textToInsert - Text to insert after the search text
|
|
1568
|
+
* @param args.occurrence - Which occurrence to insert after (default: 1) (optional)
|
|
1569
|
+
*/
|
|
1570
|
+
insertTextAfter: async (args) => {
|
|
1571
|
+
return sdk.resources.call({
|
|
1572
|
+
resourceId: 'google-docs',
|
|
1573
|
+
method: 'insertTextAfter',
|
|
1574
|
+
params: args || {}
|
|
1575
|
+
});
|
|
1576
|
+
},
|
|
1577
|
+
/**
|
|
1578
|
+
* Insert a heading into the document
|
|
1579
|
+
* @param args.documentId - ID of the document
|
|
1580
|
+
* @param args.text - Heading text
|
|
1581
|
+
* @param args.level - Heading level (1-6)
|
|
1582
|
+
* @param args.position - Character position to insert at (optional)
|
|
1583
|
+
* @param args.insertAfterText - Insert after this text instead of at position (optional)
|
|
1584
|
+
*/
|
|
1585
|
+
insertHeading: async (args) => {
|
|
1586
|
+
return sdk.resources.call({
|
|
1587
|
+
resourceId: 'google-docs',
|
|
1588
|
+
method: 'insertHeading',
|
|
1589
|
+
params: args || {}
|
|
1590
|
+
});
|
|
1591
|
+
},
|
|
1592
|
+
/**
|
|
1593
|
+
* Insert a bulleted or numbered list into the document
|
|
1594
|
+
* @param args.documentId - ID of the document
|
|
1595
|
+
* @param args.items - Array of list items
|
|
1596
|
+
* @param args.listType - Type of list: "bulleted" or "numbered"
|
|
1597
|
+
* @param args.position - Character position to insert at (optional)
|
|
1598
|
+
* @param args.insertAfterText - Insert after this text instead of at position (optional)
|
|
1599
|
+
*/
|
|
1600
|
+
insertList: async (args) => {
|
|
1601
|
+
return sdk.resources.call({
|
|
1602
|
+
resourceId: 'google-docs',
|
|
1603
|
+
method: 'insertList',
|
|
1604
|
+
params: args || {}
|
|
1605
|
+
});
|
|
1606
|
+
},
|
|
1607
|
+
/**
|
|
1608
|
+
* Insert a table into the document
|
|
1609
|
+
* @param args.documentId - ID of the document
|
|
1610
|
+
* @param args.data - 2D array of table data (rows x columns)
|
|
1611
|
+
* @param args.hasHeader - Whether the first row is a header (default: true) (optional)
|
|
1612
|
+
* @param args.position - Character position to insert at (optional)
|
|
1613
|
+
* @param args.insertAfterText - Insert after this text instead of at position (optional)
|
|
1614
|
+
*/
|
|
1615
|
+
insertTable: async (args) => {
|
|
1616
|
+
return sdk.resources.call({
|
|
1617
|
+
resourceId: 'google-docs',
|
|
1618
|
+
method: 'insertTable',
|
|
1619
|
+
params: args || {}
|
|
1620
|
+
});
|
|
1621
|
+
},
|
|
1622
|
+
/**
|
|
1623
|
+
* Replace the entire content of a document
|
|
1624
|
+
* @param args.documentId - ID of the document
|
|
1625
|
+
* @param args.newContent - New content to replace existing content
|
|
1626
|
+
*/
|
|
1627
|
+
updateDocumentContent: async (args) => {
|
|
1628
|
+
return sdk.resources.call({
|
|
1629
|
+
resourceId: 'google-docs',
|
|
1630
|
+
method: 'updateDocumentContent',
|
|
1631
|
+
params: args || {}
|
|
1632
|
+
});
|
|
1633
|
+
},
|
|
1634
|
+
/**
|
|
1635
|
+
* Create a new section with a heading and content
|
|
1636
|
+
* @param args.documentId - ID of the document
|
|
1637
|
+
* @param args.heading - Section heading text
|
|
1638
|
+
* @param args.content - Section content text
|
|
1639
|
+
*/
|
|
1640
|
+
createSection: async (args) => {
|
|
1641
|
+
return sdk.resources.call({
|
|
1642
|
+
resourceId: 'google-docs',
|
|
1643
|
+
method: 'createSection',
|
|
1644
|
+
params: args || {}
|
|
1645
|
+
});
|
|
1646
|
+
},
|
|
1647
|
+
/**
|
|
1648
|
+
* Find the character position for insertion based on position or search text
|
|
1649
|
+
* @param args.documentId - ID of the document
|
|
1650
|
+
* @param args.position - Position to find (1 for start, -1 for end)
|
|
1651
|
+
* @param args.searchText - Text to search for (returns position after this text) (optional)
|
|
1652
|
+
*/
|
|
1653
|
+
findInsertionPoint: async (args) => {
|
|
1654
|
+
return sdk.resources.call({
|
|
1655
|
+
resourceId: 'google-docs',
|
|
1656
|
+
method: 'findInsertionPoint',
|
|
1657
|
+
params: args || {}
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Jira Adapter
|
|
1664
|
+
* Category: project
|
|
1665
|
+
*/
|
|
1666
|
+
function createJiraAdapter(sdk) {
|
|
1667
|
+
return {
|
|
1668
|
+
/**
|
|
1669
|
+
* Create a new Jira issue
|
|
1670
|
+
* @param args.projectKey - Jira project key (e.g., "PROJ")
|
|
1671
|
+
* @param args.summary - Issue summary/title
|
|
1672
|
+
* @param args.description - Issue description (optional)
|
|
1673
|
+
* @param args.issueType - Issue type (Task, Bug, Story, etc.) (optional)
|
|
1674
|
+
*/
|
|
1675
|
+
createIssue: async (args) => {
|
|
1676
|
+
return sdk.resources.call({
|
|
1677
|
+
resourceId: 'jira',
|
|
1678
|
+
method: 'createIssue',
|
|
1679
|
+
params: args || {}
|
|
1680
|
+
});
|
|
1681
|
+
},
|
|
1682
|
+
/**
|
|
1683
|
+
* Search Jira issues using JQL
|
|
1684
|
+
* @param args.jql - JQL query string
|
|
1685
|
+
* @param args.maxResults - Maximum number of results (default: 50, max: 100) (optional)
|
|
1686
|
+
*/
|
|
1687
|
+
searchIssues: async (args) => {
|
|
1688
|
+
return sdk.resources.call({
|
|
1689
|
+
resourceId: 'jira',
|
|
1690
|
+
method: 'searchIssues',
|
|
1691
|
+
params: args || {}
|
|
1692
|
+
});
|
|
1693
|
+
},
|
|
1694
|
+
/**
|
|
1695
|
+
* Get a specific Jira issue by key or ID
|
|
1696
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123") or ID
|
|
1697
|
+
*/
|
|
1698
|
+
getIssue: async (args) => {
|
|
1699
|
+
return sdk.resources.call({
|
|
1700
|
+
resourceId: 'jira',
|
|
1701
|
+
method: 'getIssue',
|
|
1702
|
+
params: args || {}
|
|
1703
|
+
});
|
|
1704
|
+
},
|
|
1705
|
+
/**
|
|
1706
|
+
* Update an existing Jira issue
|
|
1707
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1708
|
+
* @param args.summary - New issue summary/title (optional)
|
|
1709
|
+
* @param args.description - New issue description (optional)
|
|
1710
|
+
*/
|
|
1711
|
+
updateIssue: async (args) => {
|
|
1712
|
+
return sdk.resources.call({
|
|
1713
|
+
resourceId: 'jira',
|
|
1714
|
+
method: 'updateIssue',
|
|
1715
|
+
params: args || {}
|
|
1716
|
+
});
|
|
1717
|
+
},
|
|
1718
|
+
/**
|
|
1719
|
+
* Delete a Jira issue
|
|
1720
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1721
|
+
*/
|
|
1722
|
+
deleteIssue: async (args) => {
|
|
1723
|
+
return sdk.resources.call({
|
|
1724
|
+
resourceId: 'jira',
|
|
1725
|
+
method: 'deleteIssue',
|
|
1726
|
+
params: args || {}
|
|
1727
|
+
});
|
|
1728
|
+
},
|
|
1729
|
+
/**
|
|
1730
|
+
* Add a comment to a Jira issue
|
|
1731
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1732
|
+
* @param args.comment - Comment text
|
|
1733
|
+
*/
|
|
1734
|
+
addComment: async (args) => {
|
|
1735
|
+
return sdk.resources.call({
|
|
1736
|
+
resourceId: 'jira',
|
|
1737
|
+
method: 'addComment',
|
|
1738
|
+
params: args || {}
|
|
1739
|
+
});
|
|
1740
|
+
},
|
|
1741
|
+
/**
|
|
1742
|
+
* Transition a Jira issue to a different status
|
|
1743
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1744
|
+
* @param args.transitionId - ID of the transition to perform
|
|
1745
|
+
*/
|
|
1746
|
+
transitionIssue: async (args) => {
|
|
1747
|
+
return sdk.resources.call({
|
|
1748
|
+
resourceId: 'jira',
|
|
1749
|
+
method: 'transitionIssue',
|
|
1750
|
+
params: args || {}
|
|
1751
|
+
});
|
|
1752
|
+
},
|
|
1753
|
+
/**
|
|
1754
|
+
* Assign a Jira issue to a user
|
|
1755
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1756
|
+
* @param args.accountId - Atlassian account ID of the assignee
|
|
1757
|
+
*/
|
|
1758
|
+
assignIssue: async (args) => {
|
|
1759
|
+
return sdk.resources.call({
|
|
1760
|
+
resourceId: 'jira',
|
|
1761
|
+
method: 'assignIssue',
|
|
1762
|
+
params: args || {}
|
|
1763
|
+
});
|
|
1764
|
+
},
|
|
1765
|
+
/**
|
|
1766
|
+
* Get all accessible Jira projects
|
|
1767
|
+
*/
|
|
1768
|
+
getProjects: async (args) => {
|
|
1769
|
+
return sdk.resources.call({
|
|
1770
|
+
resourceId: 'jira',
|
|
1771
|
+
method: 'getProjects',
|
|
1772
|
+
params: args || {}
|
|
1773
|
+
});
|
|
1774
|
+
},
|
|
1775
|
+
/**
|
|
1776
|
+
* List all accessible Jira projects (alias for getProjects)
|
|
1777
|
+
*/
|
|
1778
|
+
listProjects: async (args) => {
|
|
1779
|
+
return sdk.resources.call({
|
|
1780
|
+
resourceId: 'jira',
|
|
1781
|
+
method: 'listProjects',
|
|
1782
|
+
params: args || {}
|
|
1783
|
+
});
|
|
1784
|
+
},
|
|
1785
|
+
/**
|
|
1786
|
+
* Get metadata for a specific Jira project
|
|
1787
|
+
* @param args.projectKey - Project key (e.g., "PROJ")
|
|
1788
|
+
*/
|
|
1789
|
+
getProjectMetadata: async (args) => {
|
|
1790
|
+
return sdk.resources.call({
|
|
1791
|
+
resourceId: 'jira',
|
|
1792
|
+
method: 'getProjectMetadata',
|
|
1793
|
+
params: args || {}
|
|
1794
|
+
});
|
|
1795
|
+
},
|
|
1796
|
+
/**
|
|
1797
|
+
* Get available transitions for a Jira issue
|
|
1798
|
+
* @param args.issueKey - Issue key (e.g., "PROJ-123")
|
|
1799
|
+
*/
|
|
1800
|
+
getTransitions: async (args) => {
|
|
1801
|
+
return sdk.resources.call({
|
|
1802
|
+
resourceId: 'jira',
|
|
1803
|
+
method: 'getTransitions',
|
|
1804
|
+
params: args || {}
|
|
1805
|
+
});
|
|
1806
|
+
},
|
|
1807
|
+
/**
|
|
1808
|
+
* List users that can be assigned to issues in a project
|
|
1809
|
+
* @param args.projectKey - Project key (e.g., "PROJ")
|
|
1810
|
+
*/
|
|
1811
|
+
listAssignableUsers: async (args) => {
|
|
1812
|
+
return sdk.resources.call({
|
|
1813
|
+
resourceId: 'jira',
|
|
1814
|
+
method: 'listAssignableUsers',
|
|
1815
|
+
params: args || {}
|
|
1816
|
+
});
|
|
1817
|
+
},
|
|
1818
|
+
/**
|
|
1819
|
+
* Get available issue types for a project
|
|
1820
|
+
* @param args.projectKey - Project key (e.g., "PROJ")
|
|
1821
|
+
*/
|
|
1822
|
+
getIssueTypes: async (args) => {
|
|
1823
|
+
return sdk.resources.call({
|
|
1824
|
+
resourceId: 'jira',
|
|
1825
|
+
method: 'getIssueTypes',
|
|
1826
|
+
params: args || {}
|
|
1827
|
+
});
|
|
1828
|
+
},
|
|
1829
|
+
/**
|
|
1830
|
+
* Search Jira API for available operations beyond core tools
|
|
1831
|
+
* @param args.query - Describe what you want to do (e.g., "add label to card")
|
|
1832
|
+
* @param args.limit - Max results to return (default 5) (optional)
|
|
1833
|
+
*/
|
|
1834
|
+
discoverExtended: async (args) => {
|
|
1835
|
+
return sdk.resources.call({
|
|
1836
|
+
resourceId: 'jira',
|
|
1837
|
+
method: 'discoverExtended',
|
|
1838
|
+
params: args || {}
|
|
1839
|
+
});
|
|
1840
|
+
},
|
|
1841
|
+
/**
|
|
1842
|
+
* Execute a Jira API operation by operationId
|
|
1843
|
+
* @param args.operationId - The operationId from discoverExtended results
|
|
1844
|
+
* @param args.pathParams - Path parameters, e.g., { id: "abc123" } (optional)
|
|
1845
|
+
* @param args.queryParams - Query string parameters (optional)
|
|
1846
|
+
* @param args.body - Request body for POST/PUT/PATCH operations (optional)
|
|
1847
|
+
*/
|
|
1848
|
+
executeExtended: async (args) => {
|
|
1849
|
+
return sdk.resources.call({
|
|
1850
|
+
resourceId: 'jira',
|
|
1851
|
+
method: 'executeExtended',
|
|
1852
|
+
params: args || {}
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Twitter Adapter
|
|
1859
|
+
* Category: social
|
|
1860
|
+
*/
|
|
1861
|
+
function createTwitterAdapter(sdk) {
|
|
1862
|
+
return {
|
|
1863
|
+
/**
|
|
1864
|
+
* Post a tweet
|
|
1865
|
+
* @param args.text - Tweet text (max 280 characters)
|
|
1866
|
+
*/
|
|
1867
|
+
postTweet: async (args) => {
|
|
1868
|
+
return sdk.resources.call({
|
|
1869
|
+
resourceId: 'twitter',
|
|
1870
|
+
method: 'postTweet',
|
|
1871
|
+
params: args || {}
|
|
1872
|
+
});
|
|
1873
|
+
},
|
|
1874
|
+
/**
|
|
1875
|
+
* Retrieve tweets from a Twitter user. Must provide either userId OR userName.
|
|
1876
|
+
* @param args.userId - Twitter user ID (recommended for stability and speed) (optional)
|
|
1877
|
+
* @param args.userName - Twitter username/screen name (alternative to userId) (optional)
|
|
1878
|
+
* @param args.cursor - Pagination cursor for next page of results (optional)
|
|
1879
|
+
* @param args.includeReplies - Whether to include replies in results (default: false) (optional)
|
|
1880
|
+
*/
|
|
1881
|
+
getUserTweets: async (args) => {
|
|
1882
|
+
return sdk.resources.call({
|
|
1883
|
+
resourceId: 'twitter',
|
|
1884
|
+
method: 'getUserTweets',
|
|
1885
|
+
params: args || {}
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Trello Adapter
|
|
1892
|
+
* Category: productivity
|
|
1893
|
+
*/
|
|
1894
|
+
function createTrelloAdapter(sdk) {
|
|
1895
|
+
return {
|
|
1896
|
+
/**
|
|
1897
|
+
* Get all boards for the authenticated user
|
|
1898
|
+
*/
|
|
1899
|
+
getBoards: async (args) => {
|
|
1900
|
+
return sdk.resources.call({
|
|
1901
|
+
resourceId: 'trello',
|
|
1902
|
+
method: 'getBoards',
|
|
1903
|
+
params: args || {}
|
|
1904
|
+
});
|
|
1905
|
+
},
|
|
1906
|
+
/**
|
|
1907
|
+
* Get a specific board by ID including its lists
|
|
1908
|
+
* @param args.boardId - The ID of the board to retrieve
|
|
1909
|
+
*/
|
|
1910
|
+
getBoard: async (args) => {
|
|
1911
|
+
return sdk.resources.call({
|
|
1912
|
+
resourceId: 'trello',
|
|
1913
|
+
method: 'getBoard',
|
|
1914
|
+
params: args || {}
|
|
1915
|
+
});
|
|
1916
|
+
},
|
|
1917
|
+
/**
|
|
1918
|
+
* Create a new card in a Trello list
|
|
1919
|
+
* @param args.name - Card name/title
|
|
1920
|
+
* @param args.idList - ID of the list to add the card to
|
|
1921
|
+
* @param args.desc - Card description (supports markdown) (optional)
|
|
1922
|
+
*/
|
|
1923
|
+
createCard: async (args) => {
|
|
1924
|
+
return sdk.resources.call({
|
|
1925
|
+
resourceId: 'trello',
|
|
1926
|
+
method: 'createCard',
|
|
1927
|
+
params: args || {}
|
|
1928
|
+
});
|
|
1929
|
+
},
|
|
1930
|
+
/**
|
|
1931
|
+
* Get a specific card by ID
|
|
1932
|
+
* @param args.cardId - The ID of the card to retrieve
|
|
1933
|
+
*/
|
|
1934
|
+
getCard: async (args) => {
|
|
1935
|
+
return sdk.resources.call({
|
|
1936
|
+
resourceId: 'trello',
|
|
1937
|
+
method: 'getCard',
|
|
1938
|
+
params: args || {}
|
|
1939
|
+
});
|
|
1940
|
+
},
|
|
1941
|
+
/**
|
|
1942
|
+
* Update an existing card
|
|
1943
|
+
* @param args.cardId - The ID of the card to update
|
|
1944
|
+
* @param args.name - New card name (optional)
|
|
1945
|
+
* @param args.desc - New card description (optional)
|
|
1946
|
+
* @param args.idList - Move card to a different list (optional)
|
|
1947
|
+
* @param args.closed - Archive the card (optional)
|
|
1948
|
+
*/
|
|
1949
|
+
updateCard: async (args) => {
|
|
1950
|
+
return sdk.resources.call({
|
|
1951
|
+
resourceId: 'trello',
|
|
1952
|
+
method: 'updateCard',
|
|
1953
|
+
params: args || {}
|
|
1954
|
+
});
|
|
1955
|
+
},
|
|
1956
|
+
/**
|
|
1957
|
+
* Delete a card permanently
|
|
1958
|
+
* @param args.cardId - The ID of the card to delete
|
|
1959
|
+
*/
|
|
1960
|
+
deleteCard: async (args) => {
|
|
1961
|
+
return sdk.resources.call({
|
|
1962
|
+
resourceId: 'trello',
|
|
1963
|
+
method: 'deleteCard',
|
|
1964
|
+
params: args || {}
|
|
1965
|
+
});
|
|
1966
|
+
},
|
|
1967
|
+
/**
|
|
1968
|
+
* Create a new checklist on a card
|
|
1969
|
+
* @param args.cardId - The ID of the card to add the checklist to
|
|
1970
|
+
* @param args.name - Checklist name
|
|
1971
|
+
*/
|
|
1972
|
+
createChecklist: async (args) => {
|
|
1973
|
+
return sdk.resources.call({
|
|
1974
|
+
resourceId: 'trello',
|
|
1975
|
+
method: 'createChecklist',
|
|
1976
|
+
params: args || {}
|
|
1977
|
+
});
|
|
1978
|
+
},
|
|
1979
|
+
/**
|
|
1980
|
+
* Get a specific checklist by ID
|
|
1981
|
+
* @param args.checklistId - The ID of the checklist to retrieve
|
|
1982
|
+
*/
|
|
1983
|
+
getChecklist: async (args) => {
|
|
1984
|
+
return sdk.resources.call({
|
|
1985
|
+
resourceId: 'trello',
|
|
1986
|
+
method: 'getChecklist',
|
|
1987
|
+
params: args || {}
|
|
1988
|
+
});
|
|
1989
|
+
},
|
|
1990
|
+
/**
|
|
1991
|
+
* Update a checklist name
|
|
1992
|
+
* @param args.checklistId - The ID of the checklist to update
|
|
1993
|
+
* @param args.name - New checklist name
|
|
1994
|
+
*/
|
|
1995
|
+
updateChecklist: async (args) => {
|
|
1996
|
+
return sdk.resources.call({
|
|
1997
|
+
resourceId: 'trello',
|
|
1998
|
+
method: 'updateChecklist',
|
|
1999
|
+
params: args || {}
|
|
2000
|
+
});
|
|
2001
|
+
},
|
|
2002
|
+
/**
|
|
2003
|
+
* Delete a checklist from a card
|
|
2004
|
+
* @param args.checklistId - The ID of the checklist to delete
|
|
2005
|
+
*/
|
|
2006
|
+
deleteChecklist: async (args) => {
|
|
2007
|
+
return sdk.resources.call({
|
|
2008
|
+
resourceId: 'trello',
|
|
2009
|
+
method: 'deleteChecklist',
|
|
2010
|
+
params: args || {}
|
|
2011
|
+
});
|
|
2012
|
+
},
|
|
2013
|
+
/**
|
|
2014
|
+
* Add a check item to a checklist
|
|
2015
|
+
* @param args.checklistId - The ID of the checklist to add the item to
|
|
2016
|
+
* @param args.name - Check item text
|
|
2017
|
+
*/
|
|
2018
|
+
addCheckItem: async (args) => {
|
|
2019
|
+
return sdk.resources.call({
|
|
2020
|
+
resourceId: 'trello',
|
|
2021
|
+
method: 'addCheckItem',
|
|
2022
|
+
params: args || {}
|
|
2023
|
+
});
|
|
2024
|
+
},
|
|
2025
|
+
/**
|
|
2026
|
+
* Update a check item (name or completion state)
|
|
2027
|
+
* @param args.cardId - The ID of the card containing the check item
|
|
2028
|
+
* @param args.checkItemId - The ID of the check item to update
|
|
2029
|
+
* @param args.name - New check item text (optional)
|
|
2030
|
+
* @param args.state - Check state: "complete" or "incomplete" (optional)
|
|
2031
|
+
*/
|
|
2032
|
+
updateCheckItem: async (args) => {
|
|
2033
|
+
return sdk.resources.call({
|
|
2034
|
+
resourceId: 'trello',
|
|
2035
|
+
method: 'updateCheckItem',
|
|
2036
|
+
params: args || {}
|
|
2037
|
+
});
|
|
2038
|
+
},
|
|
2039
|
+
/**
|
|
2040
|
+
* Delete a check item from a checklist
|
|
2041
|
+
* @param args.checklistId - The ID of the checklist containing the item
|
|
2042
|
+
* @param args.checkItemId - The ID of the check item to delete
|
|
2043
|
+
*/
|
|
2044
|
+
deleteCheckItem: async (args) => {
|
|
2045
|
+
return sdk.resources.call({
|
|
2046
|
+
resourceId: 'trello',
|
|
2047
|
+
method: 'deleteCheckItem',
|
|
2048
|
+
params: args || {}
|
|
2049
|
+
});
|
|
2050
|
+
},
|
|
2051
|
+
/**
|
|
2052
|
+
* Search Trello API for available operations beyond core tools
|
|
2053
|
+
* @param args.query - Describe what you want to do (e.g., "add label to card")
|
|
2054
|
+
* @param args.limit - Max results to return (default 5) (optional)
|
|
2055
|
+
*/
|
|
2056
|
+
discoverExtended: async (args) => {
|
|
2057
|
+
return sdk.resources.call({
|
|
2058
|
+
resourceId: 'trello',
|
|
2059
|
+
method: 'discoverExtended',
|
|
2060
|
+
params: args || {}
|
|
2061
|
+
});
|
|
2062
|
+
},
|
|
2063
|
+
/**
|
|
2064
|
+
* Execute a Trello API operation by operationId
|
|
2065
|
+
* @param args.operationId - The operationId from discoverExtended results
|
|
2066
|
+
* @param args.pathParams - Path parameters, e.g., { id: "abc123" } (optional)
|
|
2067
|
+
* @param args.queryParams - Query string parameters (optional)
|
|
2068
|
+
* @param args.body - Request body for POST/PUT/PATCH operations (optional)
|
|
2069
|
+
*/
|
|
2070
|
+
executeExtended: async (args) => {
|
|
2071
|
+
return sdk.resources.call({
|
|
2072
|
+
resourceId: 'trello',
|
|
2073
|
+
method: 'executeExtended',
|
|
2074
|
+
params: args || {}
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Jupiter Adapter
|
|
2081
|
+
* Category: crypto
|
|
2082
|
+
*/
|
|
2083
|
+
function createJupiterAdapter(sdk) {
|
|
2084
|
+
return {
|
|
2085
|
+
/**
|
|
2086
|
+
* Execute a token swap on Jupiter DEX
|
|
2087
|
+
* @param args.inputMint - Input token mint address
|
|
2088
|
+
* @param args.outputMint - Output token mint address
|
|
2089
|
+
* @param args.amount - Amount to swap (in smallest unit)
|
|
2090
|
+
* @param args.inputDecimals - Number of decimals for input token
|
|
2091
|
+
* @param args.slippageBps - Slippage tolerance in basis points (default: 50) (optional)
|
|
2092
|
+
*/
|
|
2093
|
+
swap: async (args) => {
|
|
2094
|
+
return sdk.resources.call({
|
|
2095
|
+
resourceId: 'jupiter',
|
|
2096
|
+
method: 'swap',
|
|
2097
|
+
params: args || {}
|
|
2098
|
+
});
|
|
2099
|
+
},
|
|
2100
|
+
/**
|
|
2101
|
+
* Get token holdings for a wallet
|
|
2102
|
+
* @param args.walletAddress - Wallet address to check (uses actor wallet if not provided) (optional)
|
|
2103
|
+
*/
|
|
2104
|
+
getHoldings: async (args) => {
|
|
2105
|
+
return sdk.resources.call({
|
|
2106
|
+
resourceId: 'jupiter',
|
|
2107
|
+
method: 'getHoldings',
|
|
2108
|
+
params: args || {}
|
|
2109
|
+
});
|
|
2110
|
+
},
|
|
2111
|
+
/**
|
|
2112
|
+
* Get token security information using Jupiter Shield
|
|
2113
|
+
* @param args.tokenMint - Token mint address to check security for
|
|
2114
|
+
*/
|
|
2115
|
+
getTokenSecurity: async (args) => {
|
|
2116
|
+
return sdk.resources.call({
|
|
2117
|
+
resourceId: 'jupiter',
|
|
2118
|
+
method: 'getTokenSecurity',
|
|
2119
|
+
params: args || {}
|
|
2120
|
+
});
|
|
2121
|
+
},
|
|
2122
|
+
/**
|
|
2123
|
+
* Search for tokens by symbol, name, or mint address
|
|
2124
|
+
* @param args.query - Search query (symbol, name, or mint address)
|
|
2125
|
+
*/
|
|
2126
|
+
searchTokens: async (args) => {
|
|
2127
|
+
return sdk.resources.call({
|
|
2128
|
+
resourceId: 'jupiter',
|
|
2129
|
+
method: 'searchTokens',
|
|
2130
|
+
params: args || {}
|
|
2131
|
+
});
|
|
2132
|
+
},
|
|
2133
|
+
/**
|
|
2134
|
+
* Refresh an expired swap with new quote and transaction
|
|
2135
|
+
* @param args.feedItemId - Feed item ID containing the swap to refresh
|
|
2136
|
+
* @param args.swapId - Original swap ID
|
|
2137
|
+
* @param args.inputMint - Input token mint address
|
|
2138
|
+
* @param args.outputMint - Output token mint address
|
|
2139
|
+
* @param args.amount - Amount to swap (in UI units)
|
|
2140
|
+
* @param args.inputDecimals - Input token decimals
|
|
2141
|
+
* @param args.slippageBps - Slippage tolerance in basis points (optional)
|
|
2142
|
+
*/
|
|
2143
|
+
refreshSwap: async (args) => {
|
|
2144
|
+
return sdk.resources.call({
|
|
2145
|
+
resourceId: 'jupiter',
|
|
2146
|
+
method: 'refreshSwap',
|
|
2147
|
+
params: args || {}
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Crypto Adapter
|
|
2154
|
+
* Category: crypto
|
|
2155
|
+
*/
|
|
2156
|
+
function createCryptoAdapter(sdk) {
|
|
2157
|
+
return {
|
|
2158
|
+
/**
|
|
2159
|
+
* Get the current price of a crypto asset
|
|
2160
|
+
* @param args.tokenAddress - Token contract address (EVM: 0x..., SVM: base58)
|
|
2161
|
+
* @param args.chainName - Specific chain name (auto-detected if not provided) (optional)
|
|
2162
|
+
*/
|
|
2163
|
+
getPrice: async (args) => {
|
|
2164
|
+
return sdk.resources.call({
|
|
2165
|
+
resourceId: 'crypto',
|
|
2166
|
+
method: 'getPrice',
|
|
2167
|
+
params: args || {}
|
|
2168
|
+
});
|
|
2169
|
+
},
|
|
2170
|
+
/**
|
|
2171
|
+
* Send cryptocurrency or tokens (creates pending transaction for signing)
|
|
2172
|
+
* @param args.recipient - Contact username, user ID, or Solana wallet address
|
|
2173
|
+
* @param args.token - Token symbol (SOL, USDC), name, or mint address
|
|
2174
|
+
* @param args.amount - Amount to send (in UI units)
|
|
2175
|
+
*/
|
|
2176
|
+
sendToken: async (args) => {
|
|
2177
|
+
return sdk.resources.call({
|
|
2178
|
+
resourceId: 'crypto',
|
|
2179
|
+
method: 'sendToken',
|
|
2180
|
+
params: args || {}
|
|
2181
|
+
});
|
|
2182
|
+
},
|
|
2183
|
+
/**
|
|
2184
|
+
* Set up automated price monitoring with progressive alerts
|
|
2185
|
+
* @param args.tokenAddress - Token contract address to monitor
|
|
2186
|
+
* @param args.direction - Alert direction: "above" or "below"
|
|
2187
|
+
* @param args.targetPrice - Target price in USD to trigger alert
|
|
2188
|
+
* @param args.scriptId - ID of the script to execute when price target is reached
|
|
2189
|
+
* @param args.chainName - Chain name (auto-detected if not provided) (optional)
|
|
2190
|
+
* @param args.percentStep - Progressive alert step percentage (default: 0.1 = 10%) (optional)
|
|
2191
|
+
*/
|
|
2192
|
+
monitorPrice: async (args) => {
|
|
2193
|
+
return sdk.resources.call({
|
|
2194
|
+
resourceId: 'crypto',
|
|
2195
|
+
method: 'monitorPrice',
|
|
2196
|
+
params: args || {}
|
|
2197
|
+
});
|
|
2198
|
+
},
|
|
2199
|
+
/**
|
|
2200
|
+
* List all active crypto price monitoring assignments
|
|
2201
|
+
*/
|
|
2202
|
+
listSubscriptions: async (args) => {
|
|
2203
|
+
return sdk.resources.call({
|
|
2204
|
+
resourceId: 'crypto',
|
|
2205
|
+
method: 'listSubscriptions',
|
|
2206
|
+
params: args || {}
|
|
2207
|
+
});
|
|
2208
|
+
},
|
|
2209
|
+
/**
|
|
2210
|
+
* Stop monitoring a crypto asset
|
|
2211
|
+
* @param args.tokenAddress - Token address to stop monitoring
|
|
2212
|
+
*/
|
|
2213
|
+
unsubscribeAsset: async (args) => {
|
|
2214
|
+
return sdk.resources.call({
|
|
2215
|
+
resourceId: 'crypto',
|
|
2216
|
+
method: 'unsubscribeAsset',
|
|
2217
|
+
params: args || {}
|
|
2218
|
+
});
|
|
2219
|
+
},
|
|
2220
|
+
/**
|
|
2221
|
+
* Refresh an expired transaction with new blockhash and updated details
|
|
2222
|
+
* @param args.feedItemId - Feed item ID containing the transaction to refresh
|
|
2223
|
+
* @param args.transferId - Original transfer ID
|
|
2224
|
+
* @param args.recipient - Recipient address
|
|
2225
|
+
* @param args.token - Token symbol or mint address
|
|
2226
|
+
* @param args.amount - Amount to send
|
|
2227
|
+
* @param args.tokenMint - Token mint address (optional, will resolve if not provided) (optional)
|
|
2228
|
+
* @param args.tokenDecimals - Token decimals (optional) (optional)
|
|
2229
|
+
*/
|
|
2230
|
+
refreshTransaction: async (args) => {
|
|
2231
|
+
return sdk.resources.call({
|
|
2232
|
+
resourceId: 'crypto',
|
|
2233
|
+
method: 'refreshTransaction',
|
|
2234
|
+
params: args || {}
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Scripts Adapter
|
|
2241
|
+
* Category: productivity
|
|
2242
|
+
*/
|
|
2243
|
+
function createScriptsAdapter(sdk) {
|
|
2244
|
+
return {
|
|
2245
|
+
/**
|
|
2246
|
+
* Create a new script with initial version and API key. IMPORTANT: The script ID for subsequent operations (deployScript, executeScript, etc.) is returned at data._id in the response.
|
|
2247
|
+
* @param args.name - Name of the script
|
|
2248
|
+
* @param args.description - Description of what the script does (optional)
|
|
2249
|
+
* @param args.runtime - Lambda runtime (default: nodejs18) (optional)
|
|
2250
|
+
* @param args.config - Script configuration (timeout, memory, maxCostPerExecution, etc.) (optional)
|
|
2251
|
+
* @param args.code - Initial JavaScript/TypeScript code for the script
|
|
2252
|
+
*/
|
|
2253
|
+
createScript: async (args) => {
|
|
2254
|
+
return sdk.resources.call({
|
|
2255
|
+
resourceId: 'scripts',
|
|
2256
|
+
method: 'createScript',
|
|
2257
|
+
params: args || {}
|
|
2258
|
+
});
|
|
2259
|
+
},
|
|
2260
|
+
/**
|
|
2261
|
+
* Delete a script and all its versions
|
|
2262
|
+
* @param args.scriptId - ID of the script to delete
|
|
2263
|
+
*/
|
|
2264
|
+
deleteScript: async (args) => {
|
|
2265
|
+
return sdk.resources.call({
|
|
2266
|
+
resourceId: 'scripts',
|
|
2267
|
+
method: 'deleteScript',
|
|
2268
|
+
params: args || {}
|
|
2269
|
+
});
|
|
2270
|
+
},
|
|
2271
|
+
/**
|
|
2272
|
+
* Create a new version of an existing script.
|
|
2273
|
+
* @param args.scriptId - ID of the script
|
|
2274
|
+
* @param args.code - Updated code for the new version
|
|
2275
|
+
* @param args.commitMessage - Description of changes in this version (optional)
|
|
2276
|
+
*/
|
|
2277
|
+
createVersion: async (args) => {
|
|
2278
|
+
return sdk.resources.call({
|
|
2279
|
+
resourceId: 'scripts',
|
|
2280
|
+
method: 'createVersion',
|
|
2281
|
+
params: args || {}
|
|
2282
|
+
});
|
|
2283
|
+
},
|
|
2284
|
+
/**
|
|
2285
|
+
* List all versions of a script
|
|
2286
|
+
* @param args.scriptId - ID of the script
|
|
2287
|
+
*/
|
|
2288
|
+
listVersions: async (args) => {
|
|
2289
|
+
return sdk.resources.call({
|
|
2290
|
+
resourceId: 'scripts',
|
|
2291
|
+
method: 'listVersions',
|
|
2292
|
+
params: args || {}
|
|
2293
|
+
});
|
|
2294
|
+
},
|
|
2295
|
+
/**
|
|
2296
|
+
* Deploy a script version to AWS Lambda. Must be called after createScript to make the script executable.
|
|
2297
|
+
* @param args.scriptId - ID of the script to deploy (from createScript response at data._id)
|
|
2298
|
+
* @param args.version - Version number to deploy (default: latest) (optional)
|
|
2299
|
+
*/
|
|
2300
|
+
deployScript: async (args) => {
|
|
2301
|
+
return sdk.resources.call({
|
|
2302
|
+
resourceId: 'scripts',
|
|
2303
|
+
method: 'deployScript',
|
|
2304
|
+
params: args || {}
|
|
2305
|
+
});
|
|
2306
|
+
},
|
|
2307
|
+
/**
|
|
2308
|
+
* Execute a deployed script with custom data. Script must be deployed first via deployScript.
|
|
2309
|
+
* @param args.scriptId - ID of the script to execute (from createScript response at data._id)
|
|
2310
|
+
* @param args.data - Input data to pass to the script (optional)
|
|
2311
|
+
* @param args.trigger - Trigger information (type, source, event) (optional)
|
|
2312
|
+
*/
|
|
2313
|
+
executeScript: async (args) => {
|
|
2314
|
+
return sdk.resources.call({
|
|
2315
|
+
resourceId: 'scripts',
|
|
2316
|
+
method: 'executeScript',
|
|
2317
|
+
params: args || {}
|
|
2318
|
+
});
|
|
2319
|
+
},
|
|
2320
|
+
/**
|
|
2321
|
+
* Get details of a specific script
|
|
2322
|
+
* @param args.scriptId - ID of the script
|
|
2323
|
+
*/
|
|
2324
|
+
getScript: async (args) => {
|
|
2325
|
+
return sdk.resources.call({
|
|
2326
|
+
resourceId: 'scripts',
|
|
2327
|
+
method: 'getScript',
|
|
2328
|
+
params: args || {}
|
|
2329
|
+
});
|
|
2330
|
+
},
|
|
2331
|
+
/**
|
|
2332
|
+
* List all scripts owned by the user
|
|
2333
|
+
*/
|
|
2334
|
+
listScripts: async (args) => {
|
|
2335
|
+
return sdk.resources.call({
|
|
2336
|
+
resourceId: 'scripts',
|
|
2337
|
+
method: 'listScripts',
|
|
2338
|
+
params: args || {}
|
|
2339
|
+
});
|
|
2340
|
+
},
|
|
2341
|
+
/**
|
|
2342
|
+
* Get execution history for a script
|
|
2343
|
+
* @param args.scriptId - ID of the script
|
|
2344
|
+
* @param args.status - Filter by status (completed, failed, running) (optional)
|
|
2345
|
+
* @param args.limit - Maximum number of executions to return (default: 100) (optional)
|
|
2346
|
+
*/
|
|
2347
|
+
getExecutions: async (args) => {
|
|
2348
|
+
return sdk.resources.call({
|
|
2349
|
+
resourceId: 'scripts',
|
|
2350
|
+
method: 'getExecutions',
|
|
2351
|
+
params: args || {}
|
|
2352
|
+
});
|
|
2353
|
+
},
|
|
2354
|
+
/**
|
|
2355
|
+
* Get details of a specific execution
|
|
2356
|
+
* @param args.executionId - ID of the execution
|
|
2357
|
+
*/
|
|
2358
|
+
getExecution: async (args) => {
|
|
2359
|
+
return sdk.resources.call({
|
|
2360
|
+
resourceId: 'scripts',
|
|
2361
|
+
method: 'getExecution',
|
|
2362
|
+
params: args || {}
|
|
2363
|
+
});
|
|
2364
|
+
},
|
|
2365
|
+
/**
|
|
2366
|
+
* Publish a script to the marketplace
|
|
2367
|
+
* @param args.scriptId - ID of the script to publish
|
|
2368
|
+
* @param args.pricing - Pricing configuration for the marketplace (optional)
|
|
2369
|
+
*/
|
|
2370
|
+
publishScript: async (args) => {
|
|
2371
|
+
return sdk.resources.call({
|
|
2372
|
+
resourceId: 'scripts',
|
|
2373
|
+
method: 'publishScript',
|
|
2374
|
+
params: args || {}
|
|
2375
|
+
});
|
|
2376
|
+
},
|
|
2377
|
+
/**
|
|
2378
|
+
* Remove a script from the marketplace
|
|
2379
|
+
* @param args.scriptId - ID of the script to unpublish
|
|
2380
|
+
*/
|
|
2381
|
+
unpublishScript: async (args) => {
|
|
2382
|
+
return sdk.resources.call({
|
|
2383
|
+
resourceId: 'scripts',
|
|
2384
|
+
method: 'unpublishScript',
|
|
2385
|
+
params: args || {}
|
|
2386
|
+
});
|
|
2387
|
+
},
|
|
2388
|
+
/**
|
|
2389
|
+
* List all published scripts in the marketplace
|
|
2390
|
+
*/
|
|
2391
|
+
listMarketplaceScripts: async (args) => {
|
|
2392
|
+
return sdk.resources.call({
|
|
2393
|
+
resourceId: 'scripts',
|
|
2394
|
+
method: 'listMarketplaceScripts',
|
|
2395
|
+
params: args || {}
|
|
2396
|
+
});
|
|
2397
|
+
},
|
|
2398
|
+
/**
|
|
2399
|
+
* Get execution metrics for a script
|
|
2400
|
+
* @param args.scriptId - ID of the script
|
|
2401
|
+
*/
|
|
2402
|
+
getMetrics: async (args) => {
|
|
2403
|
+
return sdk.resources.call({
|
|
2404
|
+
resourceId: 'scripts',
|
|
2405
|
+
method: 'getMetrics',
|
|
2406
|
+
params: args || {}
|
|
2407
|
+
});
|
|
2408
|
+
},
|
|
2409
|
+
/**
|
|
2410
|
+
* Create a webhook endpoint for the script
|
|
2411
|
+
* @param args.scriptId - ID of the script
|
|
2412
|
+
* @param args.name - Name of the webhook
|
|
2413
|
+
* @param args.enabled - Whether webhook is enabled (default: true) (optional)
|
|
2414
|
+
*/
|
|
2415
|
+
createWebhook: async (args) => {
|
|
2416
|
+
return sdk.resources.call({
|
|
2417
|
+
resourceId: 'scripts',
|
|
2418
|
+
method: 'createWebhook',
|
|
2419
|
+
params: args || {}
|
|
2420
|
+
});
|
|
2421
|
+
},
|
|
2422
|
+
/**
|
|
2423
|
+
* Create a cron schedule for the script
|
|
2424
|
+
* @param args.scriptId - ID of the script
|
|
2425
|
+
* @param args.name - Name of the schedule
|
|
2426
|
+
* @param args.cronExpression - Cron expression (e.g., "0 9 * * *" for daily at 9am)
|
|
2427
|
+
* @param args.enabled - Whether schedule is enabled (default: true) (optional)
|
|
2428
|
+
* @param args.data - Data to pass to the script on scheduled execution (optional)
|
|
2429
|
+
*/
|
|
2430
|
+
createSchedule: async (args) => {
|
|
2431
|
+
return sdk.resources.call({
|
|
2432
|
+
resourceId: 'scripts',
|
|
2433
|
+
method: 'createSchedule',
|
|
2434
|
+
params: args || {}
|
|
2435
|
+
});
|
|
2436
|
+
},
|
|
2437
|
+
/**
|
|
2438
|
+
* Get the script code for a specific flow
|
|
2439
|
+
* @param args.flowId - ID of the flow to get script code for
|
|
2440
|
+
*/
|
|
2441
|
+
getFlowScript: async (args) => {
|
|
2442
|
+
return sdk.resources.call({
|
|
2443
|
+
resourceId: 'scripts',
|
|
2444
|
+
method: 'getFlowScript',
|
|
2445
|
+
params: args || {}
|
|
2446
|
+
});
|
|
2447
|
+
},
|
|
2448
|
+
/**
|
|
2449
|
+
* Modify the script code for a flow. Automatically creates a copy if user doesn't own the original, deploys to Lambda, and updates the flow.
|
|
2450
|
+
* @param args.flowId - ID of the flow to modify
|
|
2451
|
+
* @param args.newCode - New code to deploy
|
|
2452
|
+
* @param args.commitMessage - Description of changes (optional)
|
|
2453
|
+
*/
|
|
2454
|
+
modifyFlowScript: async (args) => {
|
|
2455
|
+
return sdk.resources.call({
|
|
2456
|
+
resourceId: 'scripts',
|
|
2457
|
+
method: 'modifyFlowScript',
|
|
2458
|
+
params: args || {}
|
|
2459
|
+
});
|
|
2460
|
+
},
|
|
2461
|
+
/**
|
|
2462
|
+
* Validate script code BEFORE creating or deploying. Checks for: 1) Missing async handler wrapper (top-level await errors), 2) Invalid adapter operations. Returns validation errors with suggestions for fixes. ALWAYS use this before createScript/modifyFlowScript.
|
|
2463
|
+
* @param args.code - The script code to validate
|
|
2464
|
+
*/
|
|
2465
|
+
lintScript: async (args) => {
|
|
2466
|
+
return sdk.resources.call({
|
|
2467
|
+
resourceId: 'scripts',
|
|
2468
|
+
method: 'lintScript',
|
|
2469
|
+
params: args || {}
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
};
|
|
2473
|
+
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Feedback Adapter
|
|
2476
|
+
* Category: internal
|
|
2477
|
+
*/
|
|
2478
|
+
function createFeedbackAdapter(sdk) {
|
|
2479
|
+
return {
|
|
2480
|
+
/**
|
|
2481
|
+
* Report a bug with detailed context and reproduction steps
|
|
2482
|
+
* @param args.title - Brief bug description
|
|
2483
|
+
* @param args.description - Detailed description of the bug
|
|
2484
|
+
* @param args.severity - Bug severity: critical, high, medium, or low
|
|
2485
|
+
* @param args.stepsToReproduce - Steps to reproduce the bug (optional)
|
|
2486
|
+
* @param args.expectedBehavior - What should happen (optional)
|
|
2487
|
+
* @param args.actualBehavior - What actually happens (optional)
|
|
2488
|
+
* @param args.errorDetails - Error details: { message, stack, code } (optional)
|
|
2489
|
+
* @param args.context - Additional context: { conversationId, recentMessages, platform, appVersion } (optional)
|
|
2490
|
+
* @param args.llmAnalysis - LLM analysis of the issue (optional)
|
|
2491
|
+
*/
|
|
2492
|
+
reportBug: async (args) => {
|
|
2493
|
+
return sdk.resources.call({
|
|
2494
|
+
resourceId: 'feedback',
|
|
2495
|
+
method: 'reportBug',
|
|
2496
|
+
params: args || {}
|
|
2497
|
+
});
|
|
2498
|
+
},
|
|
2499
|
+
/**
|
|
2500
|
+
* Auto-report tool or adapter failures for debugging
|
|
2501
|
+
* @param args.adapterType - Adapter type (e.g., jupiter, crypto)
|
|
2502
|
+
* @param args.operation - Operation that failed (e.g., swap, sendToken)
|
|
2503
|
+
* @param args.errorMessage - Error message from the failure
|
|
2504
|
+
* @param args.errorCode - Error code if available (optional)
|
|
2505
|
+
* @param args.errorStack - Error stack trace (optional)
|
|
2506
|
+
* @param args.args - Sanitized arguments that caused the failure (optional)
|
|
2507
|
+
* @param args.llmAnalysis - LLM analysis of why it failed (optional)
|
|
2508
|
+
* @param args.suggestedFix - LLM suggested fix (optional)
|
|
2509
|
+
* @param args.context - Additional context: { conversationId, userId, timestamp } (optional)
|
|
2510
|
+
*/
|
|
2511
|
+
reportToolFailure: async (args) => {
|
|
2512
|
+
return sdk.resources.call({
|
|
2513
|
+
resourceId: 'feedback',
|
|
2514
|
+
method: 'reportToolFailure',
|
|
2515
|
+
params: args || {}
|
|
2516
|
+
});
|
|
2517
|
+
},
|
|
2518
|
+
/**
|
|
2519
|
+
* Report when LLM cannot fulfill a user request
|
|
2520
|
+
* @param args.userRequest - What the user asked for
|
|
2521
|
+
* @param args.reason - Why it could not be fulfilled
|
|
2522
|
+
* @param args.suggestedCapability - What capability would enable this (optional)
|
|
2523
|
+
* @param args.relatedAdapters - Adapters that might be relevant (optional)
|
|
2524
|
+
* @param args.context - Additional context: { conversationId } (optional)
|
|
2525
|
+
*/
|
|
2526
|
+
reportMissingCapability: async (args) => {
|
|
2527
|
+
return sdk.resources.call({
|
|
2528
|
+
resourceId: 'feedback',
|
|
2529
|
+
method: 'reportMissingCapability',
|
|
2530
|
+
params: args || {}
|
|
2531
|
+
});
|
|
2532
|
+
},
|
|
2533
|
+
/**
|
|
2534
|
+
* Submit general user feedback
|
|
2535
|
+
* @param args.sentiment - Sentiment: positive, negative, or neutral
|
|
2536
|
+
* @param args.feedback - Feedback content
|
|
2537
|
+
* @param args.category - Category: ux, performance, feature, or general (optional)
|
|
2538
|
+
* @param args.context - Additional context: { feature, screen } (optional)
|
|
2539
|
+
*/
|
|
2540
|
+
submitFeedback: async (args) => {
|
|
2541
|
+
return sdk.resources.call({
|
|
2542
|
+
resourceId: 'feedback',
|
|
2543
|
+
method: 'submitFeedback',
|
|
2544
|
+
params: args || {}
|
|
2545
|
+
});
|
|
2546
|
+
},
|
|
2547
|
+
/**
|
|
2548
|
+
* Submit a feature request
|
|
2549
|
+
* @param args.title - Feature title
|
|
2550
|
+
* @param args.description - Feature description
|
|
2551
|
+
* @param args.useCase - Why the user needs this feature (optional)
|
|
2552
|
+
* @param args.priority - Priority: high, medium, or low (optional)
|
|
2553
|
+
*/
|
|
2554
|
+
submitFeatureRequest: async (args) => {
|
|
2555
|
+
return sdk.resources.call({
|
|
2556
|
+
resourceId: 'feedback',
|
|
2557
|
+
method: 'submitFeatureRequest',
|
|
2558
|
+
params: args || {}
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
/**
|
|
2564
|
+
* Mirra Messaging Adapter
|
|
2565
|
+
* Category: communication
|
|
2566
|
+
*/
|
|
2567
|
+
function createMirraMessagingAdapter(sdk) {
|
|
2568
|
+
return {
|
|
2569
|
+
/**
|
|
2570
|
+
* Send a direct message to a contact. The message is sent as the authenticated user with optional automation metadata.
|
|
2571
|
+
* @param args.recipientId - User ID of the recipient (use findContact to look up by username)
|
|
2572
|
+
* @param args.content - Message text content
|
|
2573
|
+
* @param args.automation - Automation metadata: { source: "sdk" | "flow", flowId?: string, flowTitle?: string } (optional)
|
|
2574
|
+
*/
|
|
2575
|
+
sendMessage: async (args) => {
|
|
2576
|
+
return sdk.resources.call({
|
|
2577
|
+
resourceId: 'mirra-messaging',
|
|
2578
|
+
method: 'sendMessage',
|
|
2579
|
+
params: args || {}
|
|
2580
|
+
});
|
|
2581
|
+
},
|
|
2582
|
+
/**
|
|
2583
|
+
* Send a message to a group chat. The message is sent as the authenticated user with optional automation metadata.
|
|
2584
|
+
* @param args.groupId - Group ID to send the message to
|
|
2585
|
+
* @param args.content - Message text content
|
|
2586
|
+
* @param args.automation - Automation metadata: { source: "sdk" | "flow", flowId?: string, flowTitle?: string } (optional)
|
|
2587
|
+
*/
|
|
2588
|
+
sendGroupMessage: async (args) => {
|
|
2589
|
+
return sdk.resources.call({
|
|
2590
|
+
resourceId: 'mirra-messaging',
|
|
2591
|
+
method: 'sendGroupMessage',
|
|
2592
|
+
params: args || {}
|
|
2593
|
+
});
|
|
2594
|
+
},
|
|
2595
|
+
/**
|
|
2596
|
+
* Get list of accepted contacts for the user
|
|
2597
|
+
* @param args.limit - Maximum number of contacts to return (default 50) (optional)
|
|
2598
|
+
* @param args.offset - Offset for pagination (default 0) (optional)
|
|
2599
|
+
*/
|
|
2600
|
+
getContacts: async (args) => {
|
|
2601
|
+
return sdk.resources.call({
|
|
2602
|
+
resourceId: 'mirra-messaging',
|
|
2603
|
+
method: 'getContacts',
|
|
2604
|
+
params: args || {}
|
|
2605
|
+
});
|
|
2606
|
+
},
|
|
2607
|
+
/**
|
|
2608
|
+
* Find a contact by username or partial name match
|
|
2609
|
+
* @param args.query - Username or name to search for
|
|
2610
|
+
*/
|
|
2611
|
+
findContact: async (args) => {
|
|
2612
|
+
return sdk.resources.call({
|
|
2613
|
+
resourceId: 'mirra-messaging',
|
|
2614
|
+
method: 'findContact',
|
|
2615
|
+
params: args || {}
|
|
2616
|
+
});
|
|
2617
|
+
},
|
|
2618
|
+
/**
|
|
2619
|
+
* Get list of chat instances for the user
|
|
2620
|
+
* @param args.scope - Filter by scope: direct, user, group, or all (default all) (optional)
|
|
2621
|
+
* @param args.limit - Maximum number of chats to return (default 50) (optional)
|
|
2622
|
+
*/
|
|
2623
|
+
getChats: async (args) => {
|
|
2624
|
+
return sdk.resources.call({
|
|
2625
|
+
resourceId: 'mirra-messaging',
|
|
2626
|
+
method: 'getChats',
|
|
2627
|
+
params: args || {}
|
|
2628
|
+
});
|
|
2629
|
+
},
|
|
2630
|
+
/**
|
|
2631
|
+
* Get list of groups the user is a member of
|
|
2632
|
+
* @param args.limit - Maximum number of groups to return (default 50) (optional)
|
|
2633
|
+
*/
|
|
2634
|
+
getGroups: async (args) => {
|
|
2635
|
+
return sdk.resources.call({
|
|
2636
|
+
resourceId: 'mirra-messaging',
|
|
2637
|
+
method: 'getGroups',
|
|
2638
|
+
params: args || {}
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
};
|
|
2642
|
+
}
|
|
2643
|
+
// ============================================================================
|
|
2644
|
+
// Exports
|
|
2645
|
+
// ============================================================================
|
|
2646
|
+
exports.generatedAdapters = {
|
|
2647
|
+
flows: createFlowsAdapter,
|
|
2648
|
+
user: createUserAdapter,
|
|
2649
|
+
contacts: createContactsAdapter,
|
|
2650
|
+
memory: createMemoryAdapter,
|
|
2651
|
+
ai: createAiAdapter,
|
|
2652
|
+
document: createDocumentAdapter,
|
|
2653
|
+
feedItems: createFeedItemsAdapter,
|
|
2654
|
+
telegram: createTelegramAdapter,
|
|
2655
|
+
googleGmail: createGoogleGmailAdapter,
|
|
2656
|
+
googleCalendar: createGoogleCalendarAdapter,
|
|
2657
|
+
googleDrive: createGoogleDriveAdapter,
|
|
2658
|
+
googleSheets: createGoogleSheetsAdapter,
|
|
2659
|
+
googleDocs: createGoogleDocsAdapter,
|
|
2660
|
+
jira: createJiraAdapter,
|
|
2661
|
+
twitter: createTwitterAdapter,
|
|
2662
|
+
trello: createTrelloAdapter,
|
|
2663
|
+
jupiter: createJupiterAdapter,
|
|
2664
|
+
crypto: createCryptoAdapter,
|
|
2665
|
+
scripts: createScriptsAdapter,
|
|
2666
|
+
feedback: createFeedbackAdapter,
|
|
2667
|
+
mirraMessaging: createMirraMessagingAdapter
|
|
2668
|
+
};
|
|
2669
|
+
//# sourceMappingURL=adapters.js.map
|