@sendinel/mcp-server 1.0.76 → 1.0.77
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { checkAgentMailboxLimit } from '@sendinel/domain';
|
|
3
|
+
import { db, requestContext } from '../db.js';
|
|
3
4
|
import { getProjectId } from '../project.js';
|
|
4
5
|
import { withApproval, approvalExcerpt } from '../lib/action-approvals.js';
|
|
5
6
|
import { checked, mailboxDb, mailboxAudit, messageOutput, resolveMailbox, sendAgentReply, visibleMessage, visibleMessages } from '../lib/agent-mailbox.js';
|
|
@@ -96,6 +97,16 @@ export function registerAgentMailboxTools(server) {
|
|
|
96
97
|
const actorId = requestContext()?.actorId;
|
|
97
98
|
if (!actorId)
|
|
98
99
|
throw new Error('An authenticated admin login is required to create a mailbox');
|
|
100
|
+
// Before the approval prompt, and again when the approved call executes (both calls pass through here).
|
|
101
|
+
const limit = await checkAgentMailboxLimit(db(), getProjectId());
|
|
102
|
+
if (!limit.allowed) {
|
|
103
|
+
return { ...j({
|
|
104
|
+
code: 'AGENT_MAILBOX_LIMIT_REACHED', current: limit.current, limit: limit.limit,
|
|
105
|
+
message: limit.limit === 0
|
|
106
|
+
? 'Agent mailboxes are not included in the Free plan. They start on the BYOD plan.'
|
|
107
|
+
: `This project's plan allows ${limit.limit} agent mailbox${limit.limit === 1 ? '' : 'es'} and it already has ${limit.current}.`,
|
|
108
|
+
}), isError: true };
|
|
109
|
+
}
|
|
99
110
|
const boundArgs = { ...args, login_actor_id: actorId };
|
|
100
111
|
return withApproval('create_agent_mailbox', async (_approved) => {
|
|
101
112
|
const mailbox = checked(await mailboxDb().rpc('provision_agent_mailbox', { p_project_id: getProjectId(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendinel/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77",
|
|
4
4
|
"description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
|
|
5
5
|
"mcpName": "ai.sendinel/mcp-server",
|
|
6
6
|
"type": "module",
|