Skip to content

Peer

Read-only access to another agent's storage. Permission-gated by the target agent's /permissions node. No user token required — uses API key authentication only.

Import

typescript
import { ConfigureClient } from 'configure';
const client = new ConfigureClient('sk_your_api_key');
const peer = client.peer('wealthbot');

Methods

ls

typescript
peer.ls(path?: string, opts?: CfsLsOptions): Promise<CfsLsResult>

List files and directories in the peer agent's storage. Returns an empty list if permission is denied.

Parameters

NameTypeRequiredDescription
pathstringNoDirectory path. Default: '/'.
opts.depthnumberNoListing depth. Default: 1.
opts.limitnumberNoMax entries. Default: 100.

Returns

Promise<CfsLsResult>{ entries: CfsEntry[], count: number }

Example

typescript
const listing = await client.peer('wealthbot').ls('/');
listing.entries.forEach(e => console.log(e.path));

// List peer's skills
const skills = await client.peer('wealthbot').ls('/skills/');

read

typescript
peer.read(path: string): Promise<CfsReadResult | null>

Read a file or directory from the peer agent's storage. Returns null if not found or permission is denied.

Parameters

NameTypeRequiredDescription
pathstringYesPath to read.

Returns

Promise<CfsReadResult | null>{ path, content, type, metadata, tokens, is_directory } or null.

Example

typescript
const soul = await client.peer('wealthbot').read('/soul/soul.md');
if (soul) console.log(soul.content);

typescript
peer.search(query: string, opts?: CfsSearchOptions): Promise<CfsSearchResult>

Search the peer agent's storage by keyword. Results are filtered by permission.

Parameters

NameTypeRequiredDescription
querystringYesSearch query.
opts.scopestringNoLimit to path prefix. Default: '/'.
opts.limitnumberNoMax results. Default: 10.
opts.filesOnlybooleanNoReturn only paths and scores, no snippets. Default: false.

Returns

Promise<CfsSearchResult>{ results: CfsSearchHit[], count: number }

Example

typescript
const results = await client.peer('wealthbot').search('investment strategy');
results.results.forEach(r => console.log(`${r.path}: ${r.snippet}`));

Identity and memory infrastructure for AI agents