diff --git a/src/agent/index.ts b/src/agent/index.ts index 7e8b20cd..57f1197a 100644 --- a/src/agent/index.ts +++ b/src/agent/index.ts @@ -7,12 +7,12 @@ import * as fs from 'fs' import * as path from 'path' import { DatabaseSessionStorage } from './database-session-storage' import { analyzeAssetMediaTool } from './tools/analyze-asset-media' +import { createCreateFileTool } from './tools/create-file' +import { createCreateFolderTool } from './tools/create-folder' +import { createCreateVersionTool } from './tools/create-version' +import { createListAssetsTool } from './tools/list-assets' import { createReadSkillTool } from './tools/read-skill' import { createSandboxedBashTool } from './tools/sandboxed-bash' -import { createListAssetsTool } from './tools/list-assets' -import { createCreateFolderTool } from './tools/create-folder' -import { createCreateFileTool } from './tools/create-file' -import { createCreateVersionTool } from './tools/create-version' export interface CreateAgentSessionParams { agentId: string diff --git a/src/workflow/activities/agent.ts b/src/workflow/activities/agent.ts index ff92830e..81fbbae6 100644 --- a/src/workflow/activities/agent.ts +++ b/src/workflow/activities/agent.ts @@ -62,7 +62,15 @@ async function executeAgentPrompt(params: { const providerName = agent.provider.name const modelId = agent.modelRef.modelId - let systemPrompt = '你是shumai小助手。' + let systemPrompt = `You are the AI assistant for shumai. +shumai is a professional creative collaboration platform similar to frame.io, where users can upload creative files, manage projects, assign tasks, get precise feedback, and share their work. As the agent, your role is to help users use and manage this platform. + +shumai has its own cloud file system. If a user asks you to perform file system operations (for example: creating a folder, creating a file, stacking a version, or listing assets), you MUST use the corresponding agent system tools (e.g., 'create_folder', 'create_file', 'create_version', 'list_assets'). Do NOT use local bash commands or the local bash tool to perform these operations locally on the host environment; all operations must be executed through the platform's cloud file system tools so they are correctly registered and visible within the platform.` + + if (agent.soul) { + systemPrompt = `${systemPrompt}\n\nAgent Personality and Core Instructions:\n${agent.soul}` + } + if (params.agentsInstruction) { systemPrompt = `${systemPrompt}\n\nContext and Instructions:\n${params.agentsInstruction}` }