importAgentSkillBundle()
This method imports a zipped skill bundle and refreshes the agent skill tree.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function example() { const client = await wachtClient(); const agentId: string = 'agentid-123'; const file: Blob = new File(['example'], 'example.txt'); const options: { replace_existing?: boolean; file_name?: string } = { replace_existing: true, file_name: 'skills.zip', }; return client.ai.importAgentSkillBundle(agentId, file, options);}Signature
function importAgentSkillBundle( agentId: string, file: Blob, options: { replace_existing?: boolean; file_name?: string }, client?: WachtClient,): Promise<SkillTreeResponse>Parameters
›agentId: string;
agentId: string;Target agent id.
›file: Blob;
file: Blob;File/blob payload uploaded using multipart form data.
›options: { replace_existing?: boolean; file_name?: string };
options: { replace_existing?: boolean; file_name?: string };Optional query/filter object used to shape list/search behavior.
›replace_existing?: boolean | undefined;
replace_existing?: boolean | undefined;replace existing value used by this request.
›file_name?: string | undefined;
file_name?: string | undefined;file name value used by this request.
Return value
›entries?: SkillTreeEntry[] | undefined;
entries?: SkillTreeEntry[] | undefined;Skill tree entries returned by backend.
Examples
AI usage pattern
import { wachtClient } from '@wacht/nextjs/server';export async function inspectSkills(agentId: string) { const client = await wachtClient(); const tree = await client.ai.listAgentSkillTree(agentId, 'agent'); const file = await client.ai.readAgentSkillFile(agentId, 'agent', '/README.md'); return { tree, file };}