MCPcopy
hub / github.com/simstudioai/sim / processSkillFromDb

Function processSkillFromDb

apps/sim/lib/copilot/chat/process-contents.ts:265–282  ·  view source on GitHub ↗
(
  skillId: string,
  workspaceId: string,
  tag: string
)

Source from the content-addressed store, hash-verified

263}
264
265async function processSkillFromDb(
266 skillId: string,
267 workspaceId: string,
268 tag: string
269): Promise<AgentContext | null> {
270 try {
271 const s = await getSkillById({ skillId, workspaceId })
272 if (!s) return null
273 // Skills are autoloaded: carry the full SKILL.md body so the Go side can
274 // inject it into the dynamic system message for the turn. The path lets the
275 // model re-read the canonical VFS file if it needs to.
276 const path = `agent/skills/${encodeVfsSegment(s.name)}.json`
277 return { type: 'skill', tag, content: s.content, path }
278 } catch (error) {
279 logger.error('Error processing skill context (db)', { skillId, error })
280 return null
281 }
282}
283
284async function processPastChatFromDb(
285 chatId: string,

Callers 1

processContextsServerFunction · 0.85

Calls 3

getSkillByIdFunction · 0.90
encodeVfsSegmentFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected