carlyemail-toolkit 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/core.js +5 -3
  2. package/package.json +1 -1
  3. package/tools.js +18 -6
package/core.js CHANGED
@@ -172,13 +172,15 @@ async function updateInbox(client, a) {
172
172
 
173
173
  async function deleteInbox(client, a) {
174
174
  const inbox = await oneInbox(client, a.inbox_id);
175
- await client.inboxes.delete(inbox);
175
+ // Only sent when true, so a refusal (`inbox_in_use`) reaches the model and
176
+ // it has to ask the person before trying again with `force`.
177
+ await client.inboxes.delete(inbox, a.force === true ? { force: true } : {});
176
178
  return { deleted: true, inbox_id: inbox };
177
179
  }
178
180
 
179
181
  async function listThreads(client, a) {
180
182
  const scope = await resolveScope(client, a.inbox_id);
181
- const q = query(a, ...PAGE, ...WINDOW, "labels", "ascending", "senders", "recipients", "subject");
183
+ const q = query(a, ...PAGE, ...WINDOW, "labels", "ascending", "senders", "recipients", "subject", "assignee");
182
184
  if (scope.inbox) return client.threads.list(scope.inbox, q);
183
185
  return guided(await client.threads.listOrg(q), scope);
184
186
  }
@@ -198,7 +200,7 @@ async function getThread(client, a) {
198
200
 
199
201
  async function updateThread(client, a) {
200
202
  const scope = await resolveScope(client, a.inbox_id);
201
- const body = pick(a, "add_labels", "remove_labels");
203
+ const body = pick(a, "add_labels", "remove_labels", "assignee_id");
202
204
  if (scope.inbox) return client.threads.update(scope.inbox, a.thread_id, body);
203
205
  return client.threads.updateOrg(a.thread_id, body);
204
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail-toolkit",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CarlyEmail's email tools for the Vercel AI SDK, LangChain, and any other agent framework.",
5
5
  "keywords": [
6
6
  "carlyemail",
package/tools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Written by tools/gen_toolkit_tools.py in the API repository. Do not edit.
2
2
  export default {
3
- "source": "app/mcp/tools.py, written by tools/gen_toolkit_tools.py",
3
+ "source": "app/mcp/tools/, written by tools/gen_toolkit_tools.py",
4
4
  "first_inbox": "Ask the person what they want their email address to be \u2014 the part before the @ \u2014 then call create_inbox with it as `username`.",
5
5
  "tools": [
6
6
  {
@@ -204,13 +204,17 @@ export default {
204
204
  {
205
205
  "name": "delete_inbox",
206
206
  "title": "Delete an inbox and its mail",
207
- "description": "Delete an inbox. Its messages go with it.",
207
+ "description": "Delete an inbox. Its messages go with it. An inbox that sent mail or whose key was used in the last 30 days is refused with `inbox_in_use`; ask the person before calling again with `force`.",
208
208
  "input_schema": {
209
209
  "type": "object",
210
210
  "properties": {
211
211
  "inbox_id": {
212
212
  "type": "string",
213
213
  "description": "Address of the inbox to act on, like agent@carlyemail.com. Optional when this key is scoped to one inbox or the organization has only one; required otherwise."
214
+ },
215
+ "force": {
216
+ "type": "boolean",
217
+ "description": "Delete even though the inbox is in use. Only after the person confirms."
214
218
  }
215
219
  },
216
220
  "required": [
@@ -366,8 +370,8 @@ export default {
366
370
  },
367
371
  {
368
372
  "name": "get_attachment",
369
- "title": "Download an attachment",
370
- "description": "Get a download URL for an attachment.",
373
+ "title": "Read an attachment",
374
+ "description": "Read an attachment. Returns a download URL and extracted text for PDF and DOCX files. Use extracted_text to read the document; check text_status, text_truncated and text_warning for limits. Scanned images are not transcribed (no OCR).",
371
375
  "input_schema": {
372
376
  "type": "object",
373
377
  "properties": {
@@ -444,7 +448,7 @@ export default {
444
448
  {
445
449
  "name": "get_thread",
446
450
  "title": "Read a conversation",
447
- "description": "Get one thread with every message in it.",
451
+ "description": "Get one thread with every message in it, the team's notes on it, and any reply someone has started.",
448
452
  "input_schema": {
449
453
  "type": "object",
450
454
  "properties": {
@@ -641,6 +645,10 @@ export default {
641
645
  "type": "string",
642
646
  "description": "Only messages whose subject contains this text."
643
647
  },
648
+ "assignee": {
649
+ "type": "string",
650
+ "description": "Only conversations assigned to this member_id or api_key_id, to \"me\", or \"none\" for unassigned."
651
+ },
644
652
  "before": {
645
653
  "type": "string",
646
654
  "description": "Only items older than this ISO 8601 timestamp."
@@ -1196,7 +1204,7 @@ export default {
1196
1204
  {
1197
1205
  "name": "update_thread",
1198
1206
  "title": "Label a conversation",
1199
- "description": "Add or remove labels on a thread.",
1207
+ "description": "Add or remove labels on a thread, or hand it to a teammate or an agent.",
1200
1208
  "input_schema": {
1201
1209
  "type": "object",
1202
1210
  "properties": {
@@ -1221,6 +1229,10 @@ export default {
1221
1229
  "type": "string"
1222
1230
  },
1223
1231
  "description": "Labels to remove. Ones not present are ignored."
1232
+ },
1233
+ "assignee_id": {
1234
+ "type": "string",
1235
+ "description": "Who handles it: a member_id (from list_members), an api_key_id, or \"me\". Pass \"\" to unassign; leave it out to keep it."
1224
1236
  }
1225
1237
  },
1226
1238
  "required": [