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
| Name | Type | Required | Description |
|---|---|---|---|
path | string | No | Directory path. Default: '/'. |
opts.depth | number | No | Listing depth. Default: 1. |
opts.limit | number | No | Max 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
| Name | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path 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);search
typescript
peer.search(query: string, opts?: CfsSearchOptions): Promise<CfsSearchResult>Search the peer agent's storage by keyword. Results are filtered by permission.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query. |
opts.scope | string | No | Limit to path prefix. Default: '/'. |
opts.limit | number | No | Max results. Default: 10. |
opts.filesOnly | boolean | No | Return 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}`));