clementine-agent 1.18.51 → 1.18.52

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.
@@ -41,18 +41,18 @@ export interface ClaudeIntegration {
41
41
  connected: boolean;
42
42
  }
43
43
  /**
44
- * Check if a tool name is a Claude Desktop integration tool.
44
+ * Check if a tool name is a claude.ai integration tool.
45
45
  * Format: mcp__claude_ai_<IntegrationName>__<tool_name>
46
46
  */
47
47
  export declare function isClaudeDesktopTool(toolName: string): boolean;
48
48
  /** Load persisted integrations from disk. */
49
49
  export declare function loadClaudeIntegrations(): Record<string, ClaudeIntegration>;
50
50
  /**
51
- * Record a Claude Desktop integration tool use.
51
+ * Record a claude.ai integration tool use.
52
52
  * Call this whenever a mcp__claude_ai_* tool is seen in a tool_use block.
53
53
  */
54
54
  export declare function recordClaudeIntegrationUse(toolName: string): void;
55
- /** Get all discovered Claude Desktop integrations as a list. */
55
+ /** Get all discovered claude.ai integrations as a list. */
56
56
  export declare function getClaudeIntegrations(): ClaudeIntegration[];
57
57
  export interface ToolInventory {
58
58
  /** ISO timestamp of the probe */
@@ -66,17 +66,18 @@ export declare function loadToolInventory(): ToolInventory | null;
66
66
  * returns every tool Claude Code is actually surfacing — claude_ai_*
67
67
  * connectors, plugins, built-ins, custom MCP servers. Cached for 24h.
68
68
  * This removes any need to hardcode user-specific tool names in the
69
- * system prompt; whatever Claude Desktop is currently connecting to the
70
- * user's account becomes automatically available to the agent.
69
+ * system prompt; whatever the SDK currently surfaces (claude.ai
70
+ * connectors, Composio toolkits, local stdio MCP servers) becomes
71
+ * automatically available to the agent.
71
72
  */
72
73
  export declare function probeAvailableTools(force?: boolean): Promise<ToolInventory>;
73
74
  /**
74
75
  * Register every integration found in a tool inventory. The SDK's system
75
76
  * init message (subtype='init') includes a `tools: string[]` with the full
76
77
  * set of tools the agent actually has access to this session — including
77
- * every mcp__claude_ai_* tool Claude Desktop is surfacing. Walking that
78
- * list on init gives us the authoritative, up-to-date integration set
79
- * without waiting for the agent to blindly try each one.
78
+ * every mcp__claude_ai_* tool the SDK is surfacing from claude.ai
79
+ * connectors. Walking that list on init gives us the authoritative,
80
+ * up-to-date integration set without waiting for the agent to blindly try each one.
80
81
  *
81
82
  * Idempotent: if an entry already exists, we merge new tool names into it
82
83
  * and bump `connected = true` without touching firstSeen/lastUsed.
@@ -318,7 +318,7 @@ const INTEGRATION_LABELS = {
318
318
  'Salesforce': 'Salesforce',
319
319
  };
320
320
  /**
321
- * Check if a tool name is a Claude Desktop integration tool.
321
+ * Check if a tool name is a claude.ai integration tool.
322
322
  * Format: mcp__claude_ai_<IntegrationName>__<tool_name>
323
323
  */
324
324
  export function isClaudeDesktopTool(toolName) {
@@ -351,7 +351,7 @@ function saveClaudeIntegrations(integrations) {
351
351
  writeFileSync(INTEGRATIONS_FILE, JSON.stringify(integrations, null, 2));
352
352
  }
353
353
  /**
354
- * Record a Claude Desktop integration tool use.
354
+ * Record a claude.ai integration tool use.
355
355
  * Call this whenever a mcp__claude_ai_* tool is seen in a tool_use block.
356
356
  */
357
357
  export function recordClaudeIntegrationUse(toolName) {
@@ -380,7 +380,7 @@ export function recordClaudeIntegrationUse(toolName) {
380
380
  }
381
381
  saveClaudeIntegrations(integrations);
382
382
  }
383
- /** Get all discovered Claude Desktop integrations as a list. */
383
+ /** Get all discovered claude.ai integrations as a list. */
384
384
  export function getClaudeIntegrations() {
385
385
  return Object.values(loadClaudeIntegrations());
386
386
  }
@@ -414,8 +414,9 @@ function saveToolInventory(inv) {
414
414
  * returns every tool Claude Code is actually surfacing — claude_ai_*
415
415
  * connectors, plugins, built-ins, custom MCP servers. Cached for 24h.
416
416
  * This removes any need to hardcode user-specific tool names in the
417
- * system prompt; whatever Claude Desktop is currently connecting to the
418
- * user's account becomes automatically available to the agent.
417
+ * system prompt; whatever the SDK currently surfaces (claude.ai
418
+ * connectors, Composio toolkits, local stdio MCP servers) becomes
419
+ * automatically available to the agent.
419
420
  */
420
421
  export async function probeAvailableTools(force = false) {
421
422
  const cached = loadToolInventory();
@@ -487,9 +488,9 @@ export async function probeAvailableTools(force = false) {
487
488
  * Register every integration found in a tool inventory. The SDK's system
488
489
  * init message (subtype='init') includes a `tools: string[]` with the full
489
490
  * set of tools the agent actually has access to this session — including
490
- * every mcp__claude_ai_* tool Claude Desktop is surfacing. Walking that
491
- * list on init gives us the authoritative, up-to-date integration set
492
- * without waiting for the agent to blindly try each one.
491
+ * every mcp__claude_ai_* tool the SDK is surfacing from claude.ai
492
+ * connectors. Walking that list on init gives us the authoritative,
493
+ * up-to-date integration set without waiting for the agent to blindly try each one.
493
494
  *
494
495
  * Idempotent: if an entry already exists, we merge new tool names into it
495
496
  * and bump `connected = true` without touching firstSeen/lastUsed.
@@ -583,7 +584,7 @@ export function bootstrapClaudeIntegrationsFromAuditLog(auditLogPath) {
583
584
  }
584
585
  if (changed) {
585
586
  saveClaudeIntegrations(integrations);
586
- logger.info({ count: Object.keys(integrations).length }, 'Bootstrapped Claude Desktop integrations from audit log');
587
+ logger.info({ count: Object.keys(integrations).length }, 'Bootstrapped claude.ai integrations from audit log');
587
588
  }
588
589
  }
589
590
  catch (err) {
package/dist/index.js CHANGED
@@ -571,14 +571,22 @@ async function asyncMain() {
571
571
  // refresh_tool_inventory after intentionally adding connectors.
572
572
  const inv = loadToolInventory();
573
573
  if (inv) {
574
- const integrations = new Set();
574
+ const claudeAiIntegrations = new Set();
575
+ let claudeAiToolCount = 0;
575
576
  for (const t of inv.tools) {
576
577
  const m = t.match(/^mcp__claude_ai_([^_]+(?:_[^_]+)*)__/);
577
- if (m)
578
- integrations.add(m[1].replace(/_/g, ' '));
578
+ if (m) {
579
+ claudeAiIntegrations.add(m[1].replace(/_/g, ' '));
580
+ claudeAiToolCount++;
581
+ }
579
582
  }
580
- if (integrations.size > 0) {
581
- logger.info({ integrations: [...integrations].sort(), toolCount: inv.tools.length, probedAt: inv.probedAt }, '🦞 Cached Claude Desktop integrations loaded');
583
+ if (claudeAiIntegrations.size > 0) {
584
+ logger.info({
585
+ claudeAiIntegrations: [...claudeAiIntegrations].sort(),
586
+ claudeAiToolCount,
587
+ totalToolInventory: inv.tools.length,
588
+ probedAt: inv.probedAt,
589
+ }, '🦞 Cached claude.ai integrations loaded');
582
590
  }
583
591
  // After inventory is live, fetch canonical schemas from every stdio
584
592
  // MCP server we can reach, then synthesize auto-skills for every
@@ -325,7 +325,7 @@ export function registerAdminTools(server) {
325
325
  const unique = [...new Set(tools)].sort();
326
326
  writeFileSync(ALLOWED_TOOLS_EXTRA, JSON.stringify(unique, null, 2));
327
327
  }
328
- server.tool('allow_tool', 'Add a tool name to your self-managed allowedTools list. Use when you see a tool in the SDK inventory but get "not in function schema" when you try to call it. Writes to ~/.clementine/allowed-tools-extra.json; takes effect on your NEXT query. If the tool name isn\'t yet in the cached inventory, this auto-refreshes the probe first — covers the case where the owner just added a new Claude Desktop connector. Owner-DM only.', {
328
+ server.tool('allow_tool', 'Add a tool name to your self-managed allowedTools list. Use when you see a tool in the SDK inventory but get "not in function schema" when you try to call it. Writes to ~/.clementine/allowed-tools-extra.json; takes effect on your NEXT query. If the tool name isn\'t yet in the cached inventory, this auto-refreshes the probe first — covers the case where the owner just added a new claude.ai connector or local MCP server. Owner-DM only.', {
329
329
  name: z.string().describe('Exact tool name (e.g. "mcp__claude_ai_Google_Drive__search_files")'),
330
330
  reason: z.string().optional().describe('Brief note: why you need this tool. For audit trail.'),
331
331
  }, async ({ name, reason }) => {
@@ -368,7 +368,7 @@ export function registerAdminTools(server) {
368
368
  logger.info({ name: trimmed, reason, totalExtras: current.length }, 'allow_tool');
369
369
  return textResult(`Added ${trimmed} to ~/.clementine/allowed-tools-extra.json (${current.length} total extras)${refreshNote}. Active on your next query — no daemon restart needed.${reason ? ` Reason: ${reason}` : ''}`);
370
370
  });
371
- server.tool('refresh_tool_inventory', 'Force a fresh probe of the SDK\'s tool inventory, picking up any Claude Desktop connectors the owner has added since the last cache refresh. Owner-DM only. Use this when the owner says "I just added X at claude.ai" or when an expected integration isn\'t showing up. Updates ~/.clementine/.tool-inventory.json and syncs claude-integrations.json. Returns a diff of what changed.', {}, async () => {
371
+ server.tool('refresh_tool_inventory', 'Force a fresh probe of the SDK\'s tool inventory, picking up any claude.ai connectors, Composio toolkits, or local MCP servers the owner has added since the last cache refresh. Owner-DM only. Use this when the owner says "I just added X at claude.ai" or when an expected integration isn\'t showing up. Updates ~/.clementine/.tool-inventory.json and syncs claude-integrations.json. Returns a diff of what changed.', {}, async () => {
372
372
  const gate = requireOwnerDm();
373
373
  if (!gate.ok)
374
374
  return textResult(gate.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clementine-agent",
3
- "version": "1.18.51",
3
+ "version": "1.18.52",
4
4
  "description": "Clementine — Personal AI Assistant (TypeScript)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",