feat(mothership): send workspace skill ids and descriptions in the ch… · simstudioai/sim@463350c · GitHub
Skip to content

Commit 463350c

Browse files
authored
feat(mothership): send workspace skill ids and descriptions in the chat inventory (#9264)
The mothership agent now sees workspace skills as a catalog, name, id and description, and loads a matching one with skills get <id>, as Agent Skills clients do; with names alone it could not judge relevance and had to search for an id first. Built-ins carry their builtin-<name> id. The generated protocol copy is synced from the worker contract, where both fields are optional so either side can ship first.
1 parent 72eef16 commit 463350c

3 files changed

Lines changed: 30 additions & 8 deletions

File tree

‎apps/sim/lib/mothership/chat/workspace-inventory.test.ts‎

Lines changed: 12 additions & 2 deletions

‎apps/sim/lib/mothership/chat/workspace-inventory.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const FILE_LIMIT = 150
2020

2121
/**
2222
* What exists in the workspace, by name and id, packed with every chat request so the
23-
* agent orients without a round of listings per world. Same use cases, same principal,
23+
* agent orients without a round of listings per world. Skills also carry their description:
24+
* the agent picks one from that catalog and loads its body with `skills get <id>`. Same use cases, same principal,
2425
* same authorization as the v2 listings the agent would otherwise call one by one.
2526
*
2627
* Each world is read independently: a world that fails to list is left empty and
@@ -118,7 +119,11 @@ export async function buildWorkspaceInventory(
118119
input: { workspaceId, sortBy: 'name', sortOrder: 'asc', limit: WORLD_LIMIT, offset: 0 },
119120
})
120121
cut('skills', page.hasMore)
121-
return page.skills.map((s) => ({ name: s.name }))
122+
return page.skills.map((s) => ({
123+
id: s.id,
124+
name: s.name,
125+
...(s.description ? { description: s.description } : {}),
126+
}))
122127
}, []),
123128
world('customTools', async () => {
124129
const page = await listWorkspaceCustomToolsUseCase.execute({

‎apps/sim/lib/mothership/generated/protocol.ts‎

Lines changed: 11 additions & 4 deletions

0 commit comments

Comments
 (0)