clementine-agent 1.0.39 → 1.0.40
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/dist/agent/assistant.js +30 -2
- package/dist/agent/mcp-bridge.js +6 -1
- package/package.json +1 -1
package/dist/agent/assistant.js
CHANGED
|
@@ -1046,12 +1046,40 @@ Delegate data-heavy work (SEO, analytics, bulk API calls for 3+ entities) to sub
|
|
|
1046
1046
|
Never spawn a sub-agent with vague instructions like "handle this brief" — tell it exactly what to read, what to change, and where to write the result.
|
|
1047
1047
|
`);
|
|
1048
1048
|
}
|
|
1049
|
-
// Inject Claude Desktop integration awareness
|
|
1049
|
+
// Inject Claude Desktop integration awareness. Two lists:
|
|
1050
|
+
// - Known-confirmed: integrations the agent has actually used before
|
|
1051
|
+
// (persisted in claude-integrations.json). High confidence.
|
|
1052
|
+
// - Possibly-available: common integrations the owner may have connected
|
|
1053
|
+
// at claude.ai level that we don't have a usage record for yet. The
|
|
1054
|
+
// integrations-file is written reactively — only entries with
|
|
1055
|
+
// successful tool uses get captured — so a freshly-connected
|
|
1056
|
+
// Google Drive / Gmail / Slack connector is invisible to us until we
|
|
1057
|
+
// try it. Hint the agent that it can try these blindly; the tool
|
|
1058
|
+
// call will either succeed or return an auth error, at which point
|
|
1059
|
+
// the record gets captured.
|
|
1050
1060
|
try {
|
|
1051
1061
|
const integrations = _mcpBridge?.getClaudeIntegrations() ?? [];
|
|
1062
|
+
const knownNames = new Set(integrations.map(ig => ig.name));
|
|
1052
1063
|
if (integrations.length > 0) {
|
|
1053
1064
|
const names = integrations.map(ig => ig.label).join(', ');
|
|
1054
|
-
parts.push(`**Connected via Claude Desktop:** ${names}. Use their \`mcp__claude_ai_*\` tools
|
|
1065
|
+
parts.push(`**Connected via Claude Desktop:** ${names}. Use their \`mcp__claude_ai_*\` tools (e.g. \`mcp__claude_ai_Google_Drive__search_files\`).`);
|
|
1066
|
+
}
|
|
1067
|
+
// Common integrations to speculatively mention. If the owner has
|
|
1068
|
+
// connected any of these at claude.ai, the corresponding tool names
|
|
1069
|
+
// will work even if no prior record exists.
|
|
1070
|
+
const SPECULATIVE = [
|
|
1071
|
+
['Google_Drive', 'Google Drive'], ['Gmail', 'Gmail'],
|
|
1072
|
+
['Google_Calendar', 'Google Calendar'], ['Google_Workspace', 'Google Workspace'],
|
|
1073
|
+
['Slack', 'Slack'], ['Notion', 'Notion'], ['GitHub', 'GitHub'],
|
|
1074
|
+
['Linear', 'Linear'], ['Asana', 'Asana'], ['Jira', 'Jira'],
|
|
1075
|
+
['Dropbox', 'Dropbox'], ['Salesforce', 'Salesforce'],
|
|
1076
|
+
['Microsoft_365', 'Microsoft 365'],
|
|
1077
|
+
];
|
|
1078
|
+
const maybe = SPECULATIVE.filter(([name]) => !knownNames.has(name)).map(([, label]) => label);
|
|
1079
|
+
if (maybe.length > 0) {
|
|
1080
|
+
parts.push(`**Possibly connected (try them — they'll either work or return an auth error):** ${maybe.join(', ')}. ` +
|
|
1081
|
+
`Tool names follow \`mcp__claude_ai_<IntegrationName>__<tool>\` — e.g. \`mcp__claude_ai_Google_Drive__search_files\`, \`mcp__claude_ai_Gmail__authenticate\`. ` +
|
|
1082
|
+
`Don't tell ${owner} an integration is "not available" without first attempting the tool call — a fresh connection won't be in your recorded list until after first use.`);
|
|
1055
1083
|
}
|
|
1056
1084
|
}
|
|
1057
1085
|
catch { /* non-fatal */ }
|
package/dist/agent/mcp-bridge.js
CHANGED
|
@@ -329,7 +329,12 @@ function parseClaudeDesktopTool(toolName) {
|
|
|
329
329
|
const match = toolName.match(/^mcp__claude_ai_([^_]+(?:_[^_]+)*)__(.+)$/);
|
|
330
330
|
if (!match)
|
|
331
331
|
return null;
|
|
332
|
-
|
|
332
|
+
const raw = match[1];
|
|
333
|
+
// Normalize against the known canonical set (case-insensitive) so we don't
|
|
334
|
+
// create both `Microsoft_365` and `microsoft_365` entries when the SDK
|
|
335
|
+
// occasionally hands us a lowercased tool name.
|
|
336
|
+
const canonical = Object.keys(INTEGRATION_LABELS).find(k => k.toLowerCase() === raw.toLowerCase()) ?? raw;
|
|
337
|
+
return { integration: canonical, tool: match[2] };
|
|
333
338
|
}
|
|
334
339
|
/** Load persisted integrations from disk. */
|
|
335
340
|
export function loadClaudeIntegrations() {
|