carlyemail-toolkit 0.1.1 → 0.1.2

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 +5 -1
package/core.js CHANGED
@@ -172,7 +172,9 @@ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail-toolkit",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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
@@ -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": [