clementine-agent 1.13.1 → 1.13.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.
|
@@ -54,10 +54,15 @@ async function buildOne(composio, slug, _connected) {
|
|
|
54
54
|
// mcp__outlook__OUTLOOK_LIST_MESSAGES. The alternative, composio.create()
|
|
55
55
|
// + session.tools(), uses Composio's tool-router pattern and only returns
|
|
56
56
|
// 5 meta-tools (COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, …),
|
|
57
|
-
// which doesn't match what the agent calls.
|
|
58
|
-
//
|
|
57
|
+
// which doesn't match what the agent calls.
|
|
58
|
+
//
|
|
59
|
+
// Limit MUST be high enough to include every alphabetically-late tool.
|
|
60
|
+
// Outlook has ~400+ tools; capping at 200 silently dropped the message-
|
|
61
|
+
// reading tools (OUTLOOK_LIST_MESSAGES, OUTLOOK_GET_MESSAGES, etc.) which
|
|
62
|
+
// alphabetically come after OUTLOOK_LIST_CALENDAR_GROUP_*. GitHub has
|
|
63
|
+
// 800+. Set 1000 — comfortable headroom for any single toolkit.
|
|
59
64
|
const userId = await getPreferredUserId();
|
|
60
|
-
const toolsRaw = await composio.tools.get(userId, { toolkits: [slug], limit:
|
|
65
|
+
const toolsRaw = await composio.tools.get(userId, { toolkits: [slug], limit: 1000 });
|
|
61
66
|
// tools.get can return an array OR an object depending on provider; normalise.
|
|
62
67
|
const toolsArr = Array.isArray(toolsRaw) ? toolsRaw : Object.values(toolsRaw);
|
|
63
68
|
const tools = toolsArr.filter((t) => t && typeof t.name === 'string' && typeof t.handler === 'function');
|
|
@@ -57,13 +57,15 @@ export interface ServiceAvailability {
|
|
|
57
57
|
export declare function computeAvailability(composioConnectedSlugs: Set<string>, claudeDesktopActiveNames: Set<string>, preferences: Record<string, ToolSource>): ServiceAvailability[];
|
|
58
58
|
/**
|
|
59
59
|
* Build the system-prompt instruction listing which tool source the agent
|
|
60
|
-
* should use for each service.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
60
|
+
* should use for each service. Output ONLY for services with a real
|
|
61
|
+
* conflict (both sources connected). Includes the silent-default state
|
|
62
|
+
* too, so the agent knows the current rule without falling back to
|
|
63
|
+
* memory recall (which can hold stale preferences from past conversations).
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
65
|
+
* Token shape:
|
|
66
|
+
* - 0 conflicts → empty string (zero overhead)
|
|
67
|
+
* - N conflicts → ~70 char header + ~50 chars per conflict
|
|
68
|
+
* Compare to the previous always-on hardcoded block which was ~700 chars.
|
|
67
69
|
*/
|
|
68
70
|
export declare function buildPromptInstruction(availability: ServiceAvailability[], preferences: Record<string, ToolSource>): string;
|
|
69
71
|
//# sourceMappingURL=tool-preferences.d.ts.map
|
|
@@ -81,13 +81,15 @@ export function computeAvailability(composioConnectedSlugs, claudeDesktopActiveN
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Build the system-prompt instruction listing which tool source the agent
|
|
84
|
-
* should use for each service.
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
84
|
+
* should use for each service. Output ONLY for services with a real
|
|
85
|
+
* conflict (both sources connected). Includes the silent-default state
|
|
86
|
+
* too, so the agent knows the current rule without falling back to
|
|
87
|
+
* memory recall (which can hold stale preferences from past conversations).
|
|
88
88
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
89
|
+
* Token shape:
|
|
90
|
+
* - 0 conflicts → empty string (zero overhead)
|
|
91
|
+
* - N conflicts → ~70 char header + ~50 chars per conflict
|
|
92
|
+
* Compare to the previous always-on hardcoded block which was ~700 chars.
|
|
91
93
|
*/
|
|
92
94
|
export function buildPromptInstruction(availability, preferences) {
|
|
93
95
|
const lines = [];
|
|
@@ -95,20 +97,23 @@ export function buildPromptInstruction(availability, preferences) {
|
|
|
95
97
|
if (!a.hasConflict)
|
|
96
98
|
continue;
|
|
97
99
|
const userPref = preferences[a.service.id];
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// Effective rule when no explicit preference: default to Composio.
|
|
101
|
+
// We surface this in the prompt anyway so the agent has a deterministic
|
|
102
|
+
// rule and doesn't recall a contradicting preference from memory.
|
|
103
|
+
const effective = userPref ?? 'composio';
|
|
104
|
+
if (effective === 'off') {
|
|
101
105
|
lines.push(`- ${a.service.label}: do NOT use any of its tools (user disabled)`);
|
|
102
106
|
}
|
|
103
|
-
else if (
|
|
104
|
-
|
|
107
|
+
else if (effective === 'composio' && a.service.composioSlug) {
|
|
108
|
+
const note = userPref ? '' : ' [default]';
|
|
109
|
+
lines.push(`- ${a.service.label}: \`mcp__${a.service.composioSlug}__*\` (NOT \`mcp__claude_ai_${a.service.claudeDesktopName}__*\`)${note}`);
|
|
105
110
|
}
|
|
106
|
-
else if (
|
|
107
|
-
lines.push(`- ${a.service.label}:
|
|
111
|
+
else if (effective === 'claude-desktop' && a.service.claudeDesktopName) {
|
|
112
|
+
lines.push(`- ${a.service.label}: \`mcp__claude_ai_${a.service.claudeDesktopName}__*\` (NOT \`mcp__${a.service.composioSlug}__*\`)`);
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
if (lines.length === 0)
|
|
111
116
|
return '';
|
|
112
|
-
return `## Tool Source Preferences\n\n${lines.join('\n')}`;
|
|
117
|
+
return `## Tool Source Preferences\n\nThese rules OVERRIDE any tool-source preference you may recall from memory. Do not consult memory for this — the canonical source is the dashboard's Tool Source Preferences (Settings → Integrations).\n\n${lines.join('\n')}`;
|
|
113
118
|
}
|
|
114
119
|
//# sourceMappingURL=tool-preferences.js.map
|