carlyemail-toolkit 0.1.4 → 0.1.5

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 +3 -1
  2. package/package.json +1 -1
  3. package/tools.js +1 -1
package/core.js CHANGED
@@ -245,7 +245,9 @@ async function updateMessage(client, a) {
245
245
 
246
246
  async function getAttachment(client, a) {
247
247
  const inbox = await oneInbox(client, a.inbox_id);
248
- return client.messages.getAttachment(inbox, a.message_id, a.attachment_id);
248
+ // A draft's id where a message's is asked for, as the hosted tool takes it.
249
+ const owner = String(a.message_id).startsWith("draft_") ? client.drafts : client.messages;
250
+ return owner.getAttachment(inbox, a.message_id, a.attachment_id);
249
251
  }
250
252
 
251
253
  async function createDraft(client, a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail-toolkit",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
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
@@ -402,7 +402,7 @@ export default {
402
402
  {
403
403
  "name": "get_attachment",
404
404
  "title": "Read an attachment",
405
- "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).",
405
+ "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). To read a file on a draft, pass its draft_id as message_id.",
406
406
  "input_schema": {
407
407
  "type": "object",
408
408
  "properties": {