listAgentSkillTree()
This method returns the virtual skill tree for one agent and scope.
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 scope: SkillScope = 'agent'; const path: string = '/'; return client.ai.listAgentSkillTree(agentId, scope, path);}Signature
function listAgentSkillTree( agentId: string, scope: SkillScope, path?: string, client?: WachtClient,): Promise<SkillTreeResponse>Parameters
›agentId: string;
agentId: string;Target agent id.
›scope: SkillScope;
scope: SkillScope;OAuth/skills scope key for the operation.
›path?: string | undefined;
path?: string | undefined;Filesystem path selector.
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 };}