feat: expose image generation to page agents
This commit is contained in:
+17
-1
@@ -288,7 +288,15 @@ export function sandboxDeveloperTools(capabilities) {
|
||||
export function sandboxMcpTools(capabilities) {
|
||||
const tools = [];
|
||||
if (capabilities.static_publish) {
|
||||
tools.push('read_file', 'write_file', 'edit_file', 'create_dir', 'generate_docx', 'generate_long_image');
|
||||
tools.push(
|
||||
'read_file',
|
||||
'write_file',
|
||||
'edit_file',
|
||||
'create_dir',
|
||||
'generate_image',
|
||||
'generate_docx',
|
||||
'generate_long_image',
|
||||
);
|
||||
if (capabilities.shell || capabilities.code_browse) tools.push('list_dir');
|
||||
}
|
||||
if (capabilities.private_data_space) {
|
||||
@@ -344,6 +352,14 @@ function sandboxMcpEnvs(sandboxMcp, mcpTools) {
|
||||
if (sandboxMcp.workspaceRoot || localRoot) envs.MINDSPACE_WORKSPACE_ROOT = sandboxMcp.workspaceRoot || localRoot;
|
||||
if (sandboxMcp.workspaceRef) envs.MINDSPACE_WORKSPACE_REF = sandboxMcp.workspaceRef;
|
||||
if (sandboxMcp.userId) envs.PRIVATE_DATA_USER_ID = sandboxMcp.userId;
|
||||
if (mcpTools.includes('generate_image')) {
|
||||
if (sandboxMcp.agentApiBaseUrl) {
|
||||
envs.MINDSPACE_AGENT_API_BASE_URL = sandboxMcp.agentApiBaseUrl;
|
||||
}
|
||||
if (sandboxMcp.internalAgentSecret) {
|
||||
envs.MINDSPACE_INTERNAL_AGENT_SECRET = sandboxMcp.internalAgentSecret;
|
||||
}
|
||||
}
|
||||
if (mcpTools.includes('private_data_info')) {
|
||||
const userDataPgUrl = resolveSandboxMcpUserDataPgUrl({
|
||||
portalUrl: sandboxMcp.userDataPgUrl ?? process.env.MINDSPACE_USERDATA_PG_URL,
|
||||
|
||||
Reference in New Issue
Block a user