clementine-agent 1.0.51 → 1.0.53
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 +14 -1
- package/dist/tools/admin-tools.js +6 -2
- package/package.json +1 -1
package/dist/agent/assistant.js
CHANGED
|
@@ -1093,7 +1093,9 @@ The **only source of truth for tool availability is your function schema**. Do n
|
|
|
1093
1093
|
|
|
1094
1094
|
**Never** say the tool "isn't loaded in this session," "doesn't carry over from Claude Desktop," "the tools array is empty," or "MCP server still connecting." If any of those phrasings come to mind, call the tool directly and report what actually happens instead.
|
|
1095
1095
|
|
|
1096
|
-
\`list_allowed_tools\` / \`disallow_tool\` manage the whitelist. \`integration_status\` is for env-var (API key) integrations — not for claude_ai_* connectors, which are schema-driven.
|
|
1096
|
+
\`list_allowed_tools\` / \`disallow_tool\` manage the whitelist. \`integration_status\` is for env-var (API key) integrations — **not** for claude_ai_* connectors, which are schema-driven. Don't use \`integration_status\` as a proxy for "can I call Drive / Gmail / etc." — those are always tried by direct tool call, not status lookup.
|
|
1097
|
+
|
|
1098
|
+
**Critical rule: if the user asks you to use a claude_ai_* connector, you call the connector tool. Full stop.** Do not report "I tried and it failed" unless there was an actual tool call that returned an actual error — your audit log records every tool call, so narrating a failed attempt when the audit shows no call will be spotted.
|
|
1097
1099
|
|
|
1098
1100
|
## Context Window Management
|
|
1099
1101
|
|
|
@@ -1613,9 +1615,17 @@ You have a cost budget per message — not a hard turn limit. Work until the tas
|
|
|
1613
1615
|
type: 'stdio',
|
|
1614
1616
|
command: 'node',
|
|
1615
1617
|
args: [MCP_SERVER_SCRIPT],
|
|
1618
|
+
// Spread process.env so the MCP subprocess sees the full environment
|
|
1619
|
+
// the daemon is running with — API keys hydrated from .env/Keychain,
|
|
1620
|
+
// PATH, HOME, etc. Without this, tools that inspect env vars
|
|
1621
|
+
// (integration_status, Outlook/Graph, Salesforce) see only the
|
|
1622
|
+
// handful we pass and report everything as "missing." Our explicit
|
|
1623
|
+
// keys come after the spread so we always win on overlaps.
|
|
1616
1624
|
env: {
|
|
1625
|
+
...process.env,
|
|
1617
1626
|
CLEMENTINE_HOME: BASE_DIR,
|
|
1618
1627
|
CLEMENTINE_TEAM_AGENT: profile?.slug ?? 'clementine',
|
|
1628
|
+
CLEMENTINE_INTERACTION_SOURCE: sourceOverride ?? inferInteractionSource(sessionKey),
|
|
1619
1629
|
},
|
|
1620
1630
|
},
|
|
1621
1631
|
...externalMcpServers,
|
|
@@ -3066,8 +3076,11 @@ You have a cost budget per message — not a hard turn limit. Work until the tas
|
|
|
3066
3076
|
command: 'node',
|
|
3067
3077
|
args: [MCP_SERVER_SCRIPT],
|
|
3068
3078
|
env: {
|
|
3079
|
+
...process.env,
|
|
3069
3080
|
CLEMENTINE_HOME: BASE_DIR,
|
|
3070
3081
|
CLEMENTINE_TEAM_AGENT: profile?.slug ?? 'clementine',
|
|
3082
|
+
// Auto-memory extractor runs autonomously.
|
|
3083
|
+
CLEMENTINE_INTERACTION_SOURCE: 'autonomous',
|
|
3071
3084
|
},
|
|
3072
3085
|
},
|
|
3073
3086
|
},
|
|
@@ -65,11 +65,15 @@ function maskSecret(value) {
|
|
|
65
65
|
return value.slice(0, 4) + '…' + value.slice(-4);
|
|
66
66
|
}
|
|
67
67
|
function requireOwnerDm() {
|
|
68
|
-
|
|
68
|
+
// The MCP server runs as a subprocess, so getInteractionSource() reads the
|
|
69
|
+
// subprocess's own module state — always the 'autonomous' default. The
|
|
70
|
+
// parent daemon propagates the real source via CLEMENTINE_INTERACTION_SOURCE.
|
|
71
|
+
// Fall back to the in-module state only if env isn't set (tool-runner tests).
|
|
72
|
+
const source = process.env.CLEMENTINE_INTERACTION_SOURCE ?? getInteractionSource();
|
|
69
73
|
if (source !== 'owner-dm') {
|
|
70
74
|
return {
|
|
71
75
|
ok: false,
|
|
72
|
-
message: `
|
|
76
|
+
message: `This tool is restricted to direct owner conversations. Current interaction source: ${source}. Ask the owner to message directly if they want to run this.`,
|
|
73
77
|
};
|
|
74
78
|
}
|
|
75
79
|
return { ok: true };
|