@agentlair/sdk 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -90
- package/dist/client.d.ts +299 -94
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +479 -159
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +10 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -18
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +273 -0
- package/dist/index.test.js.map +1 -0
- package/dist/types.d.ts +235 -16
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,156 +1,361 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @agentlair/sdk — AgentLairClient
|
|
2
|
+
* @agentlair/sdk — AgentLair + AgentLairClient
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `AgentLair` is the primary class. Accepts an API key string directly.
|
|
5
|
+
* `AgentLairClient` is the legacy class (accepts options object) — still fully supported.
|
|
6
6
|
*
|
|
7
|
-
* @example
|
|
7
|
+
* @example Three-line onboarding
|
|
8
|
+
* const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);
|
|
9
|
+
* const inbox = await lair.email.claim('my-agent'); // auto-expands to my-agent@agentlair.dev
|
|
10
|
+
* const { messages } = await lair.email.inbox('my-agent@agentlair.dev');
|
|
11
|
+
*
|
|
12
|
+
* @example Full flow
|
|
8
13
|
* // Create a new account (no API key needed)
|
|
9
|
-
* const { api_key
|
|
14
|
+
* const { api_key } = await AgentLair.createAccount({ name: 'my-agent' });
|
|
15
|
+
*
|
|
16
|
+
* const lair = new AgentLair(api_key);
|
|
17
|
+
* await lair.email.claim('my-agent');
|
|
18
|
+
* await lair.email.send({ from: 'my-agent@agentlair.dev', to: 'user@example.com', subject: 'Hello', text: 'Hi!' });
|
|
19
|
+
* const { messages } = await lair.email.inbox('my-agent@agentlair.dev');
|
|
10
20
|
*
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
* const
|
|
14
|
-
* await client.claimAddress({ address: 'my-agent@agentlair.dev' });
|
|
15
|
-
* await client.sendEmail({ from: 'my-agent@agentlair.dev', to: 'user@example.com', subject: 'Hello', text: 'Hi!' });
|
|
16
|
-
* const inbox = await client.getInbox({ address: 'my-agent@agentlair.dev' });
|
|
21
|
+
* // Vault: store secrets (zero-knowledge — use @agentlair/vault-crypto to encrypt first)
|
|
22
|
+
* await lair.vault.put('openai-key', { ciphertext: encryptedBlob });
|
|
23
|
+
* const { ciphertext } = await lair.vault.get('openai-key');
|
|
17
24
|
*/
|
|
18
|
-
import type {
|
|
25
|
+
import type { AccountMeResult, AgentLairOptions, BillingResult, CalendarFeedResult, ClaimAddressOptions, ClaimAddressResult, CreateAccountOptions, CreateAccountResult, CreateCalendarEventOptions, CreateCalendarEventResult, DeleteCalendarEventResult, DeleteMessageResult, DeleteWebhookResult, FullMessage, GetInboxOptions, GetInboxResult, ListAddressesResult, ListCalendarEventsOptions, ListCalendarEventsResult, ListWebhooksOptions, ListWebhooksResult, Observation, ObservationsTopicsResult, OutboxResult, ReadMessageOptions, ReadObservationsOptions, ReadObservationsResult, RegisterWebhookOptions, SendEmailOptions, SendEmailResult, Stack, CreateStackOptions, ListStacksResult, UpdateMessageOptions, UpdateMessageResult, UsageResult, VaultDeleteOptions, VaultDeleteResult, VaultGetOptions, VaultGetResult, VaultListResult, VaultPutOptions, VaultPutResult, WriteObservationOptions } from './types.js';
|
|
26
|
+
type RequestFn = <T>(method: string, path: string, opts?: {
|
|
27
|
+
body?: unknown;
|
|
28
|
+
query?: Record<string, string>;
|
|
29
|
+
}) => Promise<T>;
|
|
30
|
+
declare class WebhooksNamespace {
|
|
31
|
+
private readonly _req;
|
|
32
|
+
constructor(_req: RequestFn);
|
|
33
|
+
/**
|
|
34
|
+
* Register a webhook URL to receive real-time `email.received` events.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const hook = await lair.email.webhooks.create({
|
|
38
|
+
* address: 'my-agent@agentlair.dev',
|
|
39
|
+
* url: 'https://myserver.com/webhook',
|
|
40
|
+
* secret: 'my-secret',
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
create(options: RegisterWebhookOptions): Promise<{
|
|
44
|
+
id: string;
|
|
45
|
+
address: string;
|
|
46
|
+
url: string;
|
|
47
|
+
created_at: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* List registered webhooks, optionally filtered by address.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const { webhooks } = await lair.email.webhooks.list();
|
|
54
|
+
*/
|
|
55
|
+
list(options?: ListWebhooksOptions): Promise<ListWebhooksResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete a webhook by ID.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await lair.email.webhooks.delete('wh_abc123');
|
|
61
|
+
*/
|
|
62
|
+
delete(id: string): Promise<DeleteWebhookResult>;
|
|
63
|
+
}
|
|
64
|
+
declare class EmailNamespace {
|
|
65
|
+
private readonly _req;
|
|
66
|
+
/** Webhook management: webhooks.create / webhooks.list / webhooks.delete */
|
|
67
|
+
readonly webhooks: WebhooksNamespace;
|
|
68
|
+
constructor(_req: RequestFn);
|
|
69
|
+
/**
|
|
70
|
+
* Claim an @agentlair.dev email address.
|
|
71
|
+
*
|
|
72
|
+
* Pass a short name (e.g. `"my-agent"`) and it auto-expands to `my-agent@agentlair.dev`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await lair.email.claim('my-agent'); // → my-agent@agentlair.dev
|
|
76
|
+
* await lair.email.claim('my-agent@agentlair.dev'); // also works
|
|
77
|
+
*/
|
|
78
|
+
claim(address: string, options?: Omit<ClaimAddressOptions, 'address'>): Promise<ClaimAddressResult>;
|
|
79
|
+
/**
|
|
80
|
+
* List all @agentlair.dev addresses claimed by this account.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const { addresses } = await lair.email.addresses();
|
|
84
|
+
*/
|
|
85
|
+
addresses(): Promise<ListAddressesResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Get inbox messages (previews — no full body).
|
|
88
|
+
* Use `read()` for the full body of a specific message.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const { messages } = await lair.email.inbox('my-agent@agentlair.dev');
|
|
92
|
+
* const { messages } = await lair.email.inbox('my-agent', { limit: 5 });
|
|
93
|
+
*/
|
|
94
|
+
inbox(address: string, options?: Omit<GetInboxOptions, 'address'>): Promise<GetInboxResult>;
|
|
95
|
+
/**
|
|
96
|
+
* Read the full body of a message. Marks as read.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* const msg = await lair.email.read(inboxMsg.message_id_url, 'my-agent@agentlair.dev');
|
|
100
|
+
* console.log(msg.body);
|
|
101
|
+
*/
|
|
102
|
+
read(messageId: string, address: string): Promise<FullMessage>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete a message.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* await lair.email.deleteMessage(inboxMsg.message_id_url, 'my-agent@agentlair.dev');
|
|
108
|
+
*/
|
|
109
|
+
deleteMessage(messageId: string, address: string): Promise<DeleteMessageResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Update message properties (mark read/unread).
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await lair.email.update(msg.message_id_url, 'my-agent@agentlair.dev', { read: false });
|
|
115
|
+
*/
|
|
116
|
+
update(messageId: string, address: string, options: UpdateMessageOptions): Promise<UpdateMessageResult>;
|
|
117
|
+
/**
|
|
118
|
+
* Send an email from an address you own.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* await lair.email.send({
|
|
122
|
+
* from: 'my-agent@agentlair.dev',
|
|
123
|
+
* to: 'user@example.com',
|
|
124
|
+
* subject: 'Hello',
|
|
125
|
+
* text: 'Hi from an AI agent!',
|
|
126
|
+
* });
|
|
127
|
+
*/
|
|
128
|
+
send(options: SendEmailOptions): Promise<SendEmailResult>;
|
|
129
|
+
/**
|
|
130
|
+
* List sent messages (outbox).
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* const { messages } = await lair.email.outbox({ limit: 5 });
|
|
134
|
+
*/
|
|
135
|
+
outbox(options?: {
|
|
136
|
+
limit?: number;
|
|
137
|
+
}): Promise<OutboxResult>;
|
|
138
|
+
}
|
|
19
139
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* The server stores opaque encrypted blobs — plaintext never leaves your client.
|
|
24
|
-
* Use @agentlair/vault-crypto for client-side encryption helpers.
|
|
140
|
+
* Zero-knowledge secret store.
|
|
141
|
+
* Server stores opaque encrypted blobs — plaintext never leaves your client.
|
|
142
|
+
* Use @agentlair/vault-crypto for client-side encryption.
|
|
25
143
|
*/
|
|
26
144
|
declare class VaultNamespace {
|
|
27
|
-
private readonly
|
|
28
|
-
constructor(
|
|
29
|
-
body?: unknown;
|
|
30
|
-
query?: Record<string, string>;
|
|
31
|
-
}) => Promise<T>);
|
|
145
|
+
private readonly _req;
|
|
146
|
+
constructor(_req: RequestFn);
|
|
32
147
|
/**
|
|
33
|
-
* Store an encrypted blob
|
|
34
|
-
*
|
|
35
|
-
* Each PUT creates a new version (append-only, versioned).
|
|
36
|
-
* Free tier: up to 50 keys, 3 versions each.
|
|
148
|
+
* Store an encrypted blob (versioned, append-only).
|
|
37
149
|
*
|
|
38
150
|
* @example
|
|
39
|
-
*
|
|
40
|
-
* const vc = VaultCrypto.fromSeed(seed);
|
|
41
|
-
* const ciphertext = await vc.encrypt('sk-openai-...', 'openai-key');
|
|
42
|
-
* await client.vault.put('openai-key', { ciphertext });
|
|
151
|
+
* await lair.vault.put('openai-key', { ciphertext: encryptedBlob });
|
|
43
152
|
*/
|
|
44
153
|
put(key: string, options: VaultPutOptions): Promise<VaultPutResult>;
|
|
45
154
|
/**
|
|
46
|
-
* Retrieve an encrypted blob
|
|
47
|
-
*
|
|
48
|
-
* Returns the latest version by default. Pass `version` for a specific one.
|
|
155
|
+
* Retrieve an encrypted blob. Returns latest version by default.
|
|
49
156
|
*
|
|
50
157
|
* @example
|
|
51
|
-
* const { ciphertext } = await
|
|
52
|
-
*
|
|
53
|
-
* const plaintext = await vc.decrypt(ciphertext, 'openai-key');
|
|
158
|
+
* const { ciphertext } = await lair.vault.get('openai-key');
|
|
159
|
+
* const old = await lair.vault.get('openai-key', { version: 1 });
|
|
54
160
|
*/
|
|
55
161
|
get(key: string, options?: VaultGetOptions): Promise<VaultGetResult>;
|
|
56
162
|
/**
|
|
57
|
-
* List all Vault keys
|
|
163
|
+
* List all Vault keys (metadata only).
|
|
58
164
|
*
|
|
59
165
|
* @example
|
|
60
|
-
* const { keys, count, limit } = await
|
|
166
|
+
* const { keys, count, limit } = await lair.vault.list();
|
|
61
167
|
*/
|
|
62
168
|
list(): Promise<VaultListResult>;
|
|
63
169
|
/**
|
|
64
|
-
* Delete a
|
|
65
|
-
*
|
|
66
|
-
* Pass `version` to delete only that version. Omit to delete all versions.
|
|
170
|
+
* Delete a key (all versions) or a specific version.
|
|
67
171
|
*
|
|
68
172
|
* @example
|
|
69
|
-
* await
|
|
70
|
-
* await
|
|
173
|
+
* await lair.vault.delete('openai-key');
|
|
174
|
+
* await lair.vault.delete('openai-key', { version: 2 });
|
|
71
175
|
*/
|
|
72
176
|
delete(key: string, options?: VaultDeleteOptions): Promise<VaultDeleteResult>;
|
|
73
177
|
}
|
|
74
|
-
|
|
75
|
-
private readonly
|
|
76
|
-
|
|
178
|
+
declare class StacksNamespace {
|
|
179
|
+
private readonly _req;
|
|
180
|
+
constructor(_req: RequestFn);
|
|
77
181
|
/**
|
|
78
|
-
*
|
|
182
|
+
* Create a domain stack. Points nameservers to AgentLair DNS.
|
|
183
|
+
* Beta: DNS provisioning is stubbed. Full CF DNS integration coming Q2 2026.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* const stack = await lair.stacks.create({ domain: 'myagent.dev' });
|
|
79
187
|
*/
|
|
80
|
-
|
|
81
|
-
constructor(options: AgentLairClientOptions);
|
|
82
|
-
private _request;
|
|
188
|
+
create(options: CreateStackOptions): Promise<Stack>;
|
|
83
189
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* No existing account or API key needed — this is the bootstrapping method.
|
|
87
|
-
* **Save the returned `api_key` immediately** — it will not be shown again.
|
|
190
|
+
* List all domain stacks for this account.
|
|
88
191
|
*
|
|
89
|
-
* @
|
|
90
|
-
*
|
|
192
|
+
* @example
|
|
193
|
+
* const { stacks } = await lair.stacks.list();
|
|
194
|
+
*/
|
|
195
|
+
list(): Promise<ListStacksResult>;
|
|
196
|
+
}
|
|
197
|
+
declare class CalendarNamespace {
|
|
198
|
+
private readonly _req;
|
|
199
|
+
constructor(_req: RequestFn);
|
|
200
|
+
/**
|
|
201
|
+
* Create a new calendar event.
|
|
91
202
|
*
|
|
92
203
|
* @example
|
|
93
|
-
* const
|
|
94
|
-
*
|
|
95
|
-
*
|
|
204
|
+
* const event = await lair.calendar.createEvent({
|
|
205
|
+
* summary: 'Team Standup',
|
|
206
|
+
* start: '2026-03-21T10:00:00Z',
|
|
207
|
+
* end: '2026-03-21T10:30:00Z',
|
|
208
|
+
* location: 'Zoom',
|
|
209
|
+
* attendees: ['alice@example.com'],
|
|
210
|
+
* });
|
|
96
211
|
*/
|
|
97
|
-
|
|
212
|
+
createEvent(options: CreateCalendarEventOptions): Promise<CreateCalendarEventResult>;
|
|
98
213
|
/**
|
|
99
|
-
*
|
|
214
|
+
* List calendar events. Optionally filter by date range.
|
|
100
215
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
216
|
+
* @example
|
|
217
|
+
* const { events } = await lair.calendar.listEvents({ from: '2026-03-01', to: '2026-03-31' });
|
|
218
|
+
*/
|
|
219
|
+
listEvents(options?: ListCalendarEventsOptions): Promise<ListCalendarEventsResult>;
|
|
220
|
+
/**
|
|
221
|
+
* Delete a calendar event by ID.
|
|
103
222
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
223
|
+
* @example
|
|
224
|
+
* await lair.calendar.deleteEvent('evt_abc123');
|
|
225
|
+
*/
|
|
226
|
+
deleteEvent(id: string): Promise<DeleteCalendarEventResult>;
|
|
227
|
+
/**
|
|
228
|
+
* Get (or generate) the public iCal subscription URL for this calendar.
|
|
229
|
+
* Share this URL with Google Calendar / Apple Calendar / Outlook to subscribe.
|
|
106
230
|
*
|
|
107
231
|
* @example
|
|
108
|
-
*
|
|
232
|
+
* const { feed_url } = await lair.calendar.getFeed();
|
|
109
233
|
*/
|
|
110
|
-
|
|
234
|
+
getFeed(): Promise<CalendarFeedResult>;
|
|
235
|
+
}
|
|
236
|
+
declare class ObservationsNamespace {
|
|
237
|
+
private readonly _req;
|
|
238
|
+
constructor(_req: RequestFn);
|
|
111
239
|
/**
|
|
112
|
-
*
|
|
240
|
+
* Write a structured observation. Account-scoped by default.
|
|
241
|
+
* Set `shared: true` to make visible to all authenticated agents.
|
|
113
242
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
243
|
+
* @example
|
|
244
|
+
* await lair.observations.write({ topic: 'market-signals', content: 'BTC up 5%' });
|
|
245
|
+
*/
|
|
246
|
+
write(options: WriteObservationOptions): Promise<Observation>;
|
|
247
|
+
/**
|
|
248
|
+
* Read observations. Returns own + shared by default.
|
|
116
249
|
*
|
|
117
250
|
* @example
|
|
118
|
-
* await
|
|
119
|
-
*
|
|
120
|
-
* to: 'user@example.com',
|
|
121
|
-
* subject: 'Hello from AgentLair',
|
|
122
|
-
* text: 'Hi! This email was sent by an AI agent.',
|
|
123
|
-
* });
|
|
251
|
+
* const { observations } = await lair.observations.read({ topic: 'market-signals' });
|
|
252
|
+
* const shared = await lair.observations.read({ scope: 'shared' });
|
|
124
253
|
*/
|
|
125
|
-
|
|
254
|
+
read(options?: ReadObservationsOptions): Promise<ReadObservationsResult>;
|
|
126
255
|
/**
|
|
127
|
-
*
|
|
256
|
+
* List distinct topics with observation count.
|
|
128
257
|
*
|
|
129
|
-
*
|
|
258
|
+
* @example
|
|
259
|
+
* const { topics } = await lair.observations.topics();
|
|
260
|
+
*/
|
|
261
|
+
topics(): Promise<ObservationsTopicsResult>;
|
|
262
|
+
}
|
|
263
|
+
declare class AccountNamespace {
|
|
264
|
+
private readonly _req;
|
|
265
|
+
constructor(_req: RequestFn);
|
|
266
|
+
/**
|
|
267
|
+
* Get the current account profile.
|
|
130
268
|
*
|
|
131
269
|
* @example
|
|
132
|
-
* const {
|
|
133
|
-
* for (const msg of messages) {
|
|
134
|
-
* console.log(msg.from, msg.subject, msg.snippet);
|
|
135
|
-
* }
|
|
270
|
+
* const { account_id, tier } = await lair.account.me();
|
|
136
271
|
*/
|
|
137
|
-
|
|
272
|
+
me(): Promise<AccountMeResult>;
|
|
138
273
|
/**
|
|
139
|
-
*
|
|
274
|
+
* Get current usage statistics.
|
|
140
275
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
276
|
+
* @example
|
|
277
|
+
* const { emails } = await lair.account.usage();
|
|
278
|
+
* console.log(emails.daily_remaining);
|
|
279
|
+
*/
|
|
280
|
+
usage(): Promise<UsageResult>;
|
|
281
|
+
/**
|
|
282
|
+
* Get billing information.
|
|
143
283
|
*
|
|
144
|
-
* @
|
|
145
|
-
*
|
|
284
|
+
* @example
|
|
285
|
+
* const billing = await lair.account.billing();
|
|
286
|
+
*/
|
|
287
|
+
billing(): Promise<BillingResult>;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* AgentLair — primary SDK class.
|
|
291
|
+
*
|
|
292
|
+
* Accepts an API key string directly (or an options object for advanced config).
|
|
293
|
+
*
|
|
294
|
+
* @example Three-line onboarding
|
|
295
|
+
* const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);
|
|
296
|
+
* const inbox = await lair.email.claim('my-agent');
|
|
297
|
+
* const { messages } = await lair.email.inbox('my-agent@agentlair.dev');
|
|
298
|
+
*/
|
|
299
|
+
export declare class AgentLair {
|
|
300
|
+
private readonly _apiKey;
|
|
301
|
+
private readonly _baseUrl;
|
|
302
|
+
/** Email: claim / inbox / send / read / deleteMessage / update / outbox / addresses / webhooks */
|
|
303
|
+
readonly email: EmailNamespace;
|
|
304
|
+
/** Vault: put / get / list / delete */
|
|
305
|
+
readonly vault: VaultNamespace;
|
|
306
|
+
/** Stacks: create / list */
|
|
307
|
+
readonly stacks: StacksNamespace;
|
|
308
|
+
/** Calendar: createEvent / listEvents / deleteEvent / getFeed */
|
|
309
|
+
readonly calendar: CalendarNamespace;
|
|
310
|
+
/** Observations: write / read / topics */
|
|
311
|
+
readonly observations: ObservationsNamespace;
|
|
312
|
+
/** Account: me / usage / billing */
|
|
313
|
+
readonly account: AccountNamespace;
|
|
314
|
+
/**
|
|
315
|
+
* @param apiKeyOrOptions API key string (e.g. "al_live_...") or options object
|
|
316
|
+
*/
|
|
317
|
+
constructor(apiKeyOrOptions: string | AgentLairOptions);
|
|
318
|
+
private _request;
|
|
319
|
+
/**
|
|
320
|
+
* Create a new AgentLair account and get an API key.
|
|
321
|
+
* No existing account needed. **Save the returned `api_key` immediately** — not shown again.
|
|
146
322
|
*
|
|
147
323
|
* @example
|
|
148
|
-
* const
|
|
149
|
-
*
|
|
150
|
-
* address: 'my-agent@agentlair.dev',
|
|
151
|
-
* });
|
|
152
|
-
* console.log(msg.body);
|
|
324
|
+
* const { api_key } = await AgentLair.createAccount({ name: 'my-agent' });
|
|
325
|
+
* const lair = new AgentLair(api_key);
|
|
153
326
|
*/
|
|
327
|
+
static createAccount(options?: CreateAccountOptions, baseUrl?: string): Promise<CreateAccountResult>;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* @deprecated Use `AgentLair` instead — simpler string constructor, same namespaces.
|
|
331
|
+
* `AgentLairClient` is fully retained for backward compatibility.
|
|
332
|
+
*/
|
|
333
|
+
export declare class AgentLairClient {
|
|
334
|
+
private readonly _apiKey;
|
|
335
|
+
private readonly _baseUrl;
|
|
336
|
+
/** Vault: put / get / list / delete */
|
|
337
|
+
readonly vault: VaultNamespace;
|
|
338
|
+
/** Email: claim / inbox / send / read / outbox / addresses / webhooks */
|
|
339
|
+
readonly email: EmailNamespace;
|
|
340
|
+
/** Stacks: create / list */
|
|
341
|
+
readonly stacks: StacksNamespace;
|
|
342
|
+
/** Calendar: createEvent / listEvents / deleteEvent / getFeed */
|
|
343
|
+
readonly calendar: CalendarNamespace;
|
|
344
|
+
/** Observations: write / read / topics */
|
|
345
|
+
readonly observations: ObservationsNamespace;
|
|
346
|
+
/** Account: me / usage / billing */
|
|
347
|
+
readonly account: AccountNamespace;
|
|
348
|
+
constructor(options: AgentLairOptions);
|
|
349
|
+
private _request;
|
|
350
|
+
/** @deprecated Prefer `AgentLair.createAccount()` */
|
|
351
|
+
static createAccount(options?: CreateAccountOptions, baseUrl?: string): Promise<CreateAccountResult>;
|
|
352
|
+
/** @deprecated Use `client.email.claim(address)` */
|
|
353
|
+
claimAddress(options: ClaimAddressOptions): Promise<ClaimAddressResult>;
|
|
354
|
+
/** @deprecated Use `client.email.send(options)` */
|
|
355
|
+
sendEmail(options: SendEmailOptions): Promise<SendEmailResult>;
|
|
356
|
+
/** @deprecated Use `client.email.inbox(address, options)` */
|
|
357
|
+
getInbox(options: GetInboxOptions): Promise<GetInboxResult>;
|
|
358
|
+
/** @deprecated Use `client.email.read(messageId, address)` */
|
|
154
359
|
readMessage(options: ReadMessageOptions): Promise<FullMessage>;
|
|
155
360
|
}
|
|
156
361
|
export {};
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["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