@optimizeoverseas/lacrm-enforcement-wrapper 1.0.2 → 1.0.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.
- package/build/index.js +5 -5
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
|
5
5
|
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
6
6
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
// --- Configuration ---
|
|
8
|
-
const MAX_UNIQUE_CONTACTS =
|
|
9
|
-
const MAX_TOTAL_OPERATIONS =
|
|
8
|
+
const MAX_UNIQUE_CONTACTS = 20;
|
|
9
|
+
const MAX_TOTAL_OPERATIONS = 80;
|
|
10
10
|
const INACTIVITY_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes
|
|
11
11
|
const DOWNSTREAM_COMMAND = 'node';
|
|
12
12
|
const DOWNSTREAM_ARGS = ['/usr/local/lib/node_modules/@optimizeoverseas/lacrm-mcp/build/index.js'];
|
|
@@ -46,17 +46,17 @@ function extractContactId(toolName, args) {
|
|
|
46
46
|
}
|
|
47
47
|
function checkBudgets(toolName, args) {
|
|
48
48
|
if (totalOperations >= MAX_TOTAL_OPERATIONS) {
|
|
49
|
-
return `
|
|
49
|
+
return `CRM operation limit reached (${MAX_TOTAL_OPERATIONS} operations). To continue, please start a new request.`;
|
|
50
50
|
}
|
|
51
51
|
if (CONTACT_MUTATING_TOOLS.has(toolName)) {
|
|
52
52
|
const contactId = extractContactId(toolName, args);
|
|
53
53
|
// For edit_contact, check if adding this contact would exceed the limit
|
|
54
54
|
if (contactId && !modifiedContacts.has(contactId) && modifiedContacts.size >= MAX_UNIQUE_CONTACTS) {
|
|
55
|
-
return `
|
|
55
|
+
return `Contact limit reached (${MAX_UNIQUE_CONTACTS} unique contacts). You can still edit contacts you've already modified: ${[...modifiedContacts].join(', ')}. To modify additional contacts, please start a new request.`;
|
|
56
56
|
}
|
|
57
57
|
// For create_contact (no contactId yet), check if there's room for one more
|
|
58
58
|
if (!contactId && modifiedContacts.size >= MAX_UNIQUE_CONTACTS) {
|
|
59
|
-
return `
|
|
59
|
+
return `Contact limit reached (${MAX_UNIQUE_CONTACTS} unique contacts). No additional contacts can be created or modified in this request. Please start a new request to continue.`;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
return null;
|