MCPcopy Index your code
hub / github.com/simstudioai/sim / resolvePiSkills

Function resolvePiSkills

apps/sim/executor/handlers/pi/context.ts:30–50  ·  view source on GitHub ↗
(
  skillInputs: unknown,
  workspaceId: string | undefined
)

Source from the content-addressed store, hash-verified

28
29/** Resolves selected skill inputs to full `{ name, content }` entries for Pi. */
30export async function resolvePiSkills(
31 skillInputs: unknown,
32 workspaceId: string | undefined
33): Promise<PiSkill[]> {
34 if (!Array.isArray(skillInputs) || !workspaceId) return []
35
36 const skills: PiSkill[] = []
37 for (const input of skillInputs as SkillInput[]) {
38 if (!input?.skillId) continue
39 try {
40 const resolved = await resolveSkillContentById(input.skillId, workspaceId)
41 if (resolved) skills.push({ name: resolved.name, content: resolved.content })
42 } catch (error) {
43 logger.warn('Failed to resolve skill for Pi', {
44 skillId: input.skillId,
45 error: getErrorMessage(error),
46 })
47 }
48 }
49 return skills
50}
51
52/** Loads prior conversation messages to seed the Pi run. */
53export async function loadPiMemory(

Callers 1

executeMethod · 0.90

Calls 4

resolveSkillContentByIdFunction · 0.90
getErrorMessageFunction · 0.90
warnMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected