@exreve/exk 1.0.18 → 1.0.20
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/agentSession.js +11 -2
- package/dist/moduleMcpServer.js +17 -0
- package/dist/ttc-cli.tar.gz +0 -0
- package/package.json +1 -1
package/dist/agentSession.js
CHANGED
|
@@ -4,7 +4,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from '
|
|
|
4
4
|
import { symlink as fsSymlink } from 'fs';
|
|
5
5
|
import { getSkillContent } from './skills/index.js';
|
|
6
6
|
import { isLocalModel, unwrapModelName, startOpenAIAdapter, getAdapterConfig } from './openaiAdapter.js';
|
|
7
|
-
import { createModuleMcpServer } from './moduleMcpServer.js';
|
|
7
|
+
import { createModuleMcpServer, getModuleToolHint } from './moduleMcpServer.js';
|
|
8
8
|
import path from 'path';
|
|
9
9
|
import os from 'os';
|
|
10
10
|
import { createRequire } from 'module';
|
|
@@ -195,6 +195,8 @@ function envForClaudeCodeChild(localModel) {
|
|
|
195
195
|
// ~/.claude/settings.json (which may have ANTHROPIC_BASE_URL set to z.ai)
|
|
196
196
|
// is never read during the CLI process initialization.
|
|
197
197
|
env.CLAUDE_CONFIG_DIR = getEmptyConfigDir();
|
|
198
|
+
// Allow Claude to run as root (e.g. inside Docker containers)
|
|
199
|
+
env.IS_SANDBOX = '1';
|
|
198
200
|
return env;
|
|
199
201
|
}
|
|
200
202
|
/** Get env overrides for a local model (adapter proxy URL + dummy key). Returns null if not a local model. */
|
|
@@ -443,7 +445,14 @@ export class AgentSessionManager {
|
|
|
443
445
|
// Create a fresh MCP server for each query call (SDK connects transport internally, cannot reuse)
|
|
444
446
|
...(() => {
|
|
445
447
|
const mcpServer = this.buildMcpServer(sessionId);
|
|
446
|
-
|
|
448
|
+
if (mcpServer) {
|
|
449
|
+
const toolHint = getModuleToolHint(session.enabledModules || []);
|
|
450
|
+
return {
|
|
451
|
+
mcpServers: [mcpServer],
|
|
452
|
+
...(toolHint ? { systemPrompt: toolHint } : {})
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
return {};
|
|
447
456
|
})(),
|
|
448
457
|
...(pathToClaudeCodeExecutable ? { pathToClaudeCodeExecutable } : {}),
|
|
449
458
|
spawnClaudeCodeProcess: (spawnOptions) => {
|
package/dist/moduleMcpServer.js
CHANGED
|
@@ -91,3 +91,20 @@ export function createModuleMcpServer(config) {
|
|
|
91
91
|
});
|
|
92
92
|
return server;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Get a system prompt hint describing available module tools.
|
|
96
|
+
* This ensures the model knows about custom MCP tools upfront without
|
|
97
|
+
* having to discover them through the MCP tool-listing mechanism.
|
|
98
|
+
*/
|
|
99
|
+
export function getModuleToolHint(enabledModules) {
|
|
100
|
+
if (enabledModules.length === 0)
|
|
101
|
+
return null;
|
|
102
|
+
const toolDescriptions = [];
|
|
103
|
+
if (enabledModules.includes('user-choice')) {
|
|
104
|
+
toolDescriptions.push('- user_choice_request: Request user input when making decisions. Presents a modal to the user with options and waits for their response. Use this when you need the user to choose between options or confirm an action.');
|
|
105
|
+
}
|
|
106
|
+
// Add more module tool descriptions here as they are implemented
|
|
107
|
+
if (toolDescriptions.length === 0)
|
|
108
|
+
return null;
|
|
109
|
+
return `You have access to the following custom MCP tools:\n${toolDescriptions.join('\n')}\n\nUse these tools proactively when they are relevant to the task.`;
|
|
110
|
+
}
|
package/dist/ttc-cli.tar.gz
CHANGED
|
Binary file
|