primcli 1.36.0 → 1.37.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.
@@ -0,0 +1,3281 @@
1
+ import { b as __exportAll } from "./repeats-CQmyvUGQ-CMnOmWgL.js";
2
+ import { m as createConfig, p as createClient } from "./connected-agent-profile-8tpOMdq3.js";
3
+ //#region ../packages/api-core/src/api/client.gen.ts
4
+ const client = createClient(createConfig({ baseUrl: "https://api.primitive.dev/v1" }));
5
+ //#endregion
6
+ //#region ../packages/api-core/src/api/sdk.gen.ts
7
+ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
8
+ addDefaultNetworkMember: () => addDefaultNetworkMember,
9
+ addDomain: () => addDomain,
10
+ agentConnectionSetup: () => agentConnectionSetup,
11
+ awaitReply: () => awaitReply,
12
+ cancelSentEmail: () => cancelSentEmail,
13
+ checkDefaultNetworkContactAdmission: () => checkDefaultNetworkContactAdmission,
14
+ checkDomainDns: () => checkDomainDns,
15
+ claimAgentConnection: () => claimAgentConnection,
16
+ cliLogout: () => cliLogout,
17
+ completeWebhookEvent: () => completeWebhookEvent,
18
+ createAgentAccount: () => createAgentAccount,
19
+ createAgentClaimLink: () => createAgentClaimLink,
20
+ createAgentConnection: () => createAgentConnection,
21
+ createChallenge: () => createChallenge,
22
+ createEmailChallenge: () => createEmailChallenge,
23
+ createEndpoint: () => createEndpoint,
24
+ createFilter: () => createFilter,
25
+ createFunction: () => createFunction,
26
+ createFunctionSecret: () => createFunctionSecret,
27
+ createOrgSecret: () => createOrgSecret,
28
+ createRegistry: () => createRegistry,
29
+ createRoute: () => createRoute,
30
+ createWakeAuthorization: () => createWakeAuthorization,
31
+ createWakeSchedule: () => createWakeSchedule,
32
+ decideRegistryRequest: () => decideRegistryRequest,
33
+ defineAgent: () => defineAgent,
34
+ deleteAgentContact: () => deleteAgentContact,
35
+ deleteContact: () => deleteContact,
36
+ deleteDomain: () => deleteDomain,
37
+ deleteEmail: () => deleteEmail,
38
+ deleteEndpoint: () => deleteEndpoint,
39
+ deleteFilter: () => deleteFilter,
40
+ deleteFunction: () => deleteFunction,
41
+ deleteFunctionSecret: () => deleteFunctionSecret,
42
+ deleteMemory: () => deleteMemory,
43
+ deleteOrgSecret: () => deleteOrgSecret,
44
+ deleteRegistry: () => deleteRegistry,
45
+ deleteRepeatingSend: () => deleteRepeatingSend,
46
+ deleteRoute: () => deleteRoute,
47
+ deleteSentEmail: () => deleteSentEmail,
48
+ deleteWakeAuthorization: () => deleteWakeAuthorization,
49
+ deleteWakeSchedule: () => deleteWakeSchedule,
50
+ discardEmailContent: () => discardEmailContent,
51
+ downloadAttachments: () => downloadAttachments,
52
+ downloadDomainZoneFile: () => downloadDomainZoneFile,
53
+ downloadEmailAttachmentPart: () => downloadEmailAttachmentPart,
54
+ downloadRawEmail: () => downloadRawEmail,
55
+ downloadSentAttachmentPart: () => downloadSentAttachmentPart,
56
+ getAccount: () => getAccount,
57
+ getAgent: () => getAgent,
58
+ getAgentContactPolicy: () => getAgentContactPolicy,
59
+ getChallenge: () => getChallenge,
60
+ getContact: () => getContact,
61
+ getContactPolicy: () => getContactPolicy,
62
+ getConversation: () => getConversation,
63
+ getCreditBalance: () => getCreditBalance,
64
+ getDefaultNetworkAgent: () => getDefaultNetworkAgent,
65
+ getEmail: () => getEmail,
66
+ getFunction: () => getFunction,
67
+ getFunctionRouting: () => getFunctionRouting,
68
+ getFunctionTestRunTrace: () => getFunctionTestRunTrace,
69
+ getInboxStatus: () => getInboxStatus,
70
+ getMemory: () => getMemory,
71
+ getOrgRoutingTopology: () => getOrgRoutingTopology,
72
+ getOutboundStatus: () => getOutboundStatus,
73
+ getRegistry: () => getRegistry,
74
+ getRepeatingSend: () => getRepeatingSend,
75
+ getSendPermissions: () => getSendPermissions,
76
+ getSentEmail: () => getSentEmail,
77
+ getSpendPolicy: () => getSpendPolicy,
78
+ getStorageStats: () => getStorageStats,
79
+ getTemplate: () => getTemplate,
80
+ getTemplateInstall: () => getTemplateInstall,
81
+ getThread: () => getThread,
82
+ getWakeSchedule: () => getWakeSchedule,
83
+ getWebhookSecret: () => getWebhookSecret,
84
+ installTemplate: () => installTemplate,
85
+ inviteAgentConnection: () => inviteAgentConnection,
86
+ listAgentConnections: () => listAgentConnections,
87
+ listAgentContacts: () => listAgentContacts,
88
+ listAgentNetworks: () => listAgentNetworks,
89
+ listContacts: () => listContacts,
90
+ listDeclinedPayments: () => listDeclinedPayments,
91
+ listDefaultNetworkAgents: () => listDefaultNetworkAgents,
92
+ listDefaultNetworkMembers: () => listDefaultNetworkMembers,
93
+ listDeliveries: () => listDeliveries,
94
+ listDomains: () => listDomains,
95
+ listEmails: () => listEmails,
96
+ listEndpoints: () => listEndpoints,
97
+ listFilters: () => listFilters,
98
+ listFunctionLogs: () => listFunctionLogs,
99
+ listFunctionSecrets: () => listFunctionSecrets,
100
+ listFunctions: () => listFunctions,
101
+ listOrgSecrets: () => listOrgSecrets,
102
+ listPayoutAddresses: () => listPayoutAddresses,
103
+ listRegistries: () => listRegistries,
104
+ listRegistryAgents: () => listRegistryAgents,
105
+ listRegistryRequests: () => listRegistryRequests,
106
+ listRepeatingSends: () => listRepeatingSends,
107
+ listRoutes: () => listRoutes,
108
+ listSentEmails: () => listSentEmails,
109
+ listTemplates: () => listTemplates,
110
+ listWakeAuthorizations: () => listWakeAuthorizations,
111
+ listWakeDispatches: () => listWakeDispatches,
112
+ listWakeSchedules: () => listWakeSchedules,
113
+ payChallenge: () => payChallenge,
114
+ pollCliLogin: () => pollCliLogin,
115
+ provisionMemberAddress: () => provisionMemberAddress,
116
+ publishAgent: () => publishAgent,
117
+ pullWebhookEvent: () => pullWebhookEvent,
118
+ putAgentContact: () => putAgentContact,
119
+ putAgentContactPolicy: () => putAgentContactPolicy,
120
+ putContact: () => putContact,
121
+ putContactPolicy: () => putContactPolicy,
122
+ redeemCreditCode: () => redeemCreditCode,
123
+ registerPayoutAddress: () => registerPayoutAddress,
124
+ removeAgentConnection: () => removeAgentConnection,
125
+ removeDefaultNetworkMember: () => removeDefaultNetworkMember,
126
+ reorderRoutes: () => reorderRoutes,
127
+ replayDelivery: () => replayDelivery,
128
+ replayEmailWebhooks: () => replayEmailWebhooks,
129
+ replyToEmail: () => replyToEmail,
130
+ rescheduleSentEmail: () => rescheduleSentEmail,
131
+ resendAgentSignupVerification: () => resendAgentSignupVerification,
132
+ resendCliSignupVerification: () => resendCliSignupVerification,
133
+ resolveRegistryHandle: () => resolveRegistryHandle,
134
+ revokeAgentConnection: () => revokeAgentConnection,
135
+ rotateWebhookSecret: () => rotateWebhookSecret,
136
+ runWakeSchedule: () => runWakeSchedule,
137
+ searchEmails: () => searchEmails,
138
+ searchMemories: () => searchMemories,
139
+ semanticSearch: () => semanticSearch,
140
+ sendEmail: () => sendEmail,
141
+ setFunctionRoute: () => setFunctionRoute,
142
+ setFunctionSecret: () => setFunctionSecret,
143
+ setMemory: () => setMemory,
144
+ setOrgSecret: () => setOrgSecret,
145
+ simulateRoute: () => simulateRoute,
146
+ startAgentClaim: () => startAgentClaim,
147
+ startAgentSignup: () => startAgentSignup,
148
+ startCliLogin: () => startCliLogin,
149
+ startCliSignup: () => startCliSignup,
150
+ stopRepeatFromEmail: () => stopRepeatFromEmail,
151
+ testEndpoint: () => testEndpoint,
152
+ testEndpointRules: () => testEndpointRules,
153
+ testFunction: () => testFunction,
154
+ unpublishAgent: () => unpublishAgent,
155
+ unsetFunctionRoute: () => unsetFunctionRoute,
156
+ updateAccount: () => updateAccount,
157
+ updateDefaultNetworkMember: () => updateDefaultNetworkMember,
158
+ updateDomain: () => updateDomain,
159
+ updateEndpoint: () => updateEndpoint,
160
+ updateFilter: () => updateFilter,
161
+ updateFunction: () => updateFunction,
162
+ updateRegistry: () => updateRegistry,
163
+ updateRepeatingSend: () => updateRepeatingSend,
164
+ updateRoute: () => updateRoute,
165
+ updateSpendPolicy: () => updateSpendPolicy,
166
+ updateWakeAuthorization: () => updateWakeAuthorization,
167
+ updateWakeSchedule: () => updateWakeSchedule,
168
+ verifyAgentClaim: () => verifyAgentClaim,
169
+ verifyAgentSignup: () => verifyAgentSignup,
170
+ verifyCliSignup: () => verifyCliSignup,
171
+ verifyDomain: () => verifyDomain,
172
+ whoami: () => whoami
173
+ });
174
+ /**
175
+ * Start CLI browser login
176
+ *
177
+ * Starts a browser-assisted CLI login session. The response includes a
178
+ * device code for polling and a user code that the user approves in the
179
+ * browser. This endpoint does not require an API key.
180
+ *
181
+ */
182
+ const startCliLogin = (options) => (options?.client ?? client).post({
183
+ url: "/cli/login/start",
184
+ ...options,
185
+ headers: {
186
+ "Content-Type": "application/json",
187
+ ...options?.headers
188
+ }
189
+ });
190
+ /**
191
+ * Poll CLI browser login
192
+ *
193
+ * Polls a CLI login session until the browser approval either succeeds,
194
+ * is denied, expires, or is polled too quickly. The OAuth token set is
195
+ * created only after approval and is returned exactly once.
196
+ *
197
+ */
198
+ const pollCliLogin = (options) => (options.client ?? client).post({
199
+ url: "/cli/login/poll",
200
+ ...options,
201
+ headers: {
202
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
203
+ ...options.headers
204
+ }
205
+ });
206
+ /**
207
+ * Start CLI account signup
208
+ *
209
+ * Starts a terminal-native CLI signup. `signup_code` is optional;
210
+ * omit it to sign up without one. The API creates a pending signup
211
+ * session, sends an email verification code, and returns an opaque
212
+ * signup token used by the resend and verify steps. This endpoint
213
+ * does not require an API key.
214
+ *
215
+ */
216
+ const startCliSignup = (options) => (options.client ?? client).post({
217
+ url: "/cli/signup/start",
218
+ ...options,
219
+ headers: {
220
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
221
+ ...options.headers
222
+ }
223
+ });
224
+ /**
225
+ * Resend CLI signup verification code
226
+ *
227
+ * Sends a new email verification code for a pending CLI signup session.
228
+ * This endpoint does not require an API key.
229
+ *
230
+ */
231
+ const resendCliSignupVerification = (options) => (options.client ?? client).post({
232
+ url: "/cli/signup/resend",
233
+ ...options,
234
+ headers: {
235
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
236
+ ...options.headers
237
+ }
238
+ });
239
+ /**
240
+ * Verify CLI signup and create OAuth session
241
+ *
242
+ * Verifies the email code for a CLI signup session and creates the
243
+ * account. When the session was started with a `signup_code`, the
244
+ * reserved code is redeemed; sessions started without a code skip
245
+ * the redemption step. Either way an org-scoped OAuth CLI session
246
+ * is created and the token set is returned exactly once. This
247
+ * endpoint does not require an API key.
248
+ *
249
+ */
250
+ const verifyCliSignup = (options) => (options.client ?? client).post({
251
+ url: "/cli/signup/verify",
252
+ ...options,
253
+ headers: {
254
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
255
+ ...options.headers
256
+ }
257
+ });
258
+ /**
259
+ * Start agent account signup
260
+ *
261
+ * Starts an agent-native signup session. `signup_code` is optional;
262
+ * omit it to sign up without one. The API creates a pending signup
263
+ * session, sends an email verification code, and returns an opaque
264
+ * signup token used by the resend and verify steps. This endpoint
265
+ * does not require an API key.
266
+ *
267
+ */
268
+ const startAgentSignup = (options) => (options.client ?? client).post({
269
+ url: "/agent/signup/start",
270
+ ...options,
271
+ headers: {
272
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
273
+ ...options.headers
274
+ }
275
+ });
276
+ /**
277
+ * Resend agent signup verification code
278
+ *
279
+ * Sends a new email verification code for a pending agent signup session.
280
+ * This endpoint does not require an API key.
281
+ *
282
+ */
283
+ const resendAgentSignupVerification = (options) => (options.client ?? client).post({
284
+ url: "/agent/signup/resend",
285
+ ...options,
286
+ headers: {
287
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
288
+ ...options.headers
289
+ }
290
+ });
291
+ /**
292
+ * Verify agent signup and create OAuth tokens
293
+ *
294
+ * Verifies the email code for an agent signup session and creates
295
+ * the account when needed. When the session was started with a
296
+ * `signup_code`, the reserved code is redeemed; sessions started
297
+ * without a code skip the redemption step. An org-scoped OAuth
298
+ * session for CLI authentication is minted and the raw tokens are
299
+ * returned exactly once. For existing users, the optional `org_id`
300
+ * selects which accessible workspace should receive the new
301
+ * session (no signup-code redemption is performed for existing
302
+ * users regardless of how the session was started).
303
+ *
304
+ */
305
+ const verifyAgentSignup = (options) => (options.client ?? client).post({
306
+ url: "/agent/signup/verify",
307
+ ...options,
308
+ headers: {
309
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
310
+ ...options.headers
311
+ }
312
+ });
313
+ /**
314
+ * Create an emailless agent account
315
+ *
316
+ * Creates an emailless agent account without authentication and returns a
317
+ * one-time API key (prefixed `prim_`) plus a provisioned managed inbox.
318
+ * The account is on the `agent` plan: reply-only (it can send only to
319
+ * addresses that have already sent it authenticated mail) with tight send
320
+ * limits. Use the returned `api_key` as a Bearer token on later calls. The
321
+ * account can be upgraded to a full developer account by confirming an
322
+ * email through the claim flow. This endpoint does not require an API key.
323
+ *
324
+ */
325
+ const createAgentAccount = (options) => (options.client ?? client).post({
326
+ url: "/agent/accounts",
327
+ ...options,
328
+ headers: {
329
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
330
+ ...options.headers
331
+ }
332
+ });
333
+ /**
334
+ * Start an agent account email claim
335
+ *
336
+ * Begins upgrading an emailless `agent` account into a full `developer`
337
+ * account by confirming an email address. Authenticated by the agent's own
338
+ * API key (the org is taken from the credential). Sends a verification
339
+ * code to the supplied email and returns the claim session id plus resend
340
+ * timing. Submit the code to `/agent/claim/verify` to complete the
341
+ * upgrade. Confirming an email that already belongs to a Primitive account
342
+ * is rejected.
343
+ *
344
+ */
345
+ const startAgentClaim = (options) => (options.client ?? client).post({
346
+ security: [{
347
+ scheme: "bearer",
348
+ type: "http"
349
+ }],
350
+ url: "/agent/claim/start",
351
+ ...options,
352
+ headers: {
353
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
354
+ ...options.headers
355
+ }
356
+ });
357
+ /**
358
+ * Verify an agent account email claim
359
+ *
360
+ * Confirms the verification code emailed by `/agent/claim/start` and
361
+ * upgrades the account to the `developer` plan. The org id, API key, and
362
+ * managed inbox all carry over; the send cap lifts. Authenticated by the
363
+ * agent's own API key.
364
+ *
365
+ */
366
+ const verifyAgentClaim = (options) => (options.client ?? client).post({
367
+ security: [{
368
+ scheme: "bearer",
369
+ type: "http"
370
+ }],
371
+ url: "/agent/claim/verify",
372
+ ...options,
373
+ headers: {
374
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
375
+ ...options.headers
376
+ }
377
+ });
378
+ /**
379
+ * Create a browser claim link
380
+ *
381
+ * Mints an opaque, single-use link an agent can hand to a human to
382
+ * complete the email-confirmation upgrade in a browser. Authenticated by
383
+ * the agent's own API key. `claim_url` is null when the API host cannot
384
+ * resolve a web origin to build the link.
385
+ *
386
+ */
387
+ const createAgentClaimLink = (options) => (options?.client ?? client).post({
388
+ security: [{
389
+ scheme: "bearer",
390
+ type: "http"
391
+ }],
392
+ url: "/agent/claim/link",
393
+ ...options,
394
+ headers: {
395
+ "Content-Type": "application/json",
396
+ ...options?.headers
397
+ }
398
+ });
399
+ /**
400
+ * Revoke the current CLI OAuth session
401
+ *
402
+ * Revokes the OAuth grant used to authenticate the request. API-key
403
+ * authenticated legacy logout requests succeed without deleting server API
404
+ * keys so old local CLI state can be cleared safely.
405
+ *
406
+ */
407
+ const cliLogout = (options) => (options?.client ?? client).post({
408
+ security: [{
409
+ scheme: "bearer",
410
+ type: "http"
411
+ }],
412
+ url: "/cli/logout",
413
+ ...options,
414
+ headers: {
415
+ "Content-Type": "application/json",
416
+ ...options?.headers
417
+ }
418
+ });
419
+ /**
420
+ * Get account info
421
+ */
422
+ const getAccount = (options) => (options?.client ?? client).get({
423
+ security: [{
424
+ scheme: "bearer",
425
+ type: "http"
426
+ }],
427
+ url: "/account",
428
+ ...options
429
+ });
430
+ /**
431
+ * Update account settings
432
+ */
433
+ const updateAccount = (options) => (options.client ?? client).patch({
434
+ security: [{
435
+ scheme: "bearer",
436
+ type: "http"
437
+ }],
438
+ url: "/account",
439
+ ...options,
440
+ headers: {
441
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
442
+ ...options.headers
443
+ }
444
+ });
445
+ /**
446
+ * Get storage usage
447
+ */
448
+ const getStorageStats = (options) => (options?.client ?? client).get({
449
+ security: [{
450
+ scheme: "bearer",
451
+ type: "http"
452
+ }],
453
+ url: "/account/storage",
454
+ ...options
455
+ });
456
+ /**
457
+ * Get webhook signing secret
458
+ *
459
+ * Returns the webhook signing secret for your account. If no
460
+ * secret exists yet, one is generated automatically on first
461
+ * access.
462
+ *
463
+ * Signing is account-scoped, not per-endpoint. Every webhook
464
+ * delivery from any of your registered endpoints is signed
465
+ * with this single secret. Rotate via
466
+ * `POST /account/webhook-secret/rotate`.
467
+ *
468
+ * **Secret format**: the returned string looks base64-shaped
469
+ * (e.g. `XNHBBW8VqoBjRfNs1tkZj11jTk...`) but is NOT base64.
470
+ * Use it AS-IS as a UTF-8 string when computing HMAC over a
471
+ * delivery body. Base64-decoding before HMAC will silently
472
+ * produce mismatched signatures.
473
+ *
474
+ * See the API-level "Webhook signing" section for the full
475
+ * wire format (header name, signed string shape, hash algo,
476
+ * tolerance) including a language-agnostic verification
477
+ * recipe.
478
+ *
479
+ */
480
+ const getWebhookSecret = (options) => (options?.client ?? client).get({
481
+ security: [{
482
+ scheme: "bearer",
483
+ type: "http"
484
+ }],
485
+ url: "/account/webhook-secret",
486
+ ...options
487
+ });
488
+ /**
489
+ * Rotate webhook signing secret
490
+ *
491
+ * Generates a new webhook signing secret, replacing the current one.
492
+ * Rate limited to once per 60 minutes.
493
+ *
494
+ */
495
+ const rotateWebhookSecret = (options) => (options?.client ?? client).post({
496
+ security: [{
497
+ scheme: "bearer",
498
+ type: "http"
499
+ }],
500
+ url: "/account/webhook-secret/rotate",
501
+ ...options
502
+ });
503
+ /**
504
+ * Redeem a credit code
505
+ *
506
+ * Redeem a credit code for the authenticated organization. The credit is
507
+ * added to the organization prepaid credit and shows in
508
+ * `GET /credits/balance` under `prepaid_credit`.
509
+ *
510
+ * Redeeming requires an organization owner or admin. An API key redeems
511
+ * with the authority of the user who created it, based on that user's
512
+ * current role; a key without that authority gets the same
513
+ * `credit_code_invalid` refusal as an unknown code.
514
+ *
515
+ * The `Idempotency-Key` header is required. Retrying with the same key
516
+ * and code returns the original grant with `replayed: true` and grants
517
+ * nothing new; the same key with a different code is refused with
518
+ * `idempotency_key_reused`. Every refusal carries a human-readable
519
+ * `error.message` that can be shown to the user as is.
520
+ *
521
+ */
522
+ const redeemCreditCode = (options) => (options.client ?? client).post({
523
+ security: [{
524
+ scheme: "bearer",
525
+ type: "http"
526
+ }],
527
+ url: "/credits/redeem",
528
+ ...options,
529
+ headers: {
530
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
531
+ ...options.headers
532
+ }
533
+ });
534
+ /**
535
+ * Get credit balance
536
+ *
537
+ * Read the organization credit position. `prepaid_credit` is the prepaid
538
+ * usage credit (paid top-ups, redeemed credit codes and granted credit)
539
+ * that can still pay for usage. `budget` is the active agent spending
540
+ * budget an operator funded for top-ups, or null when there is none.
541
+ * Amounts are strings of integer micros (1 USD = 1000000 micros).
542
+ *
543
+ */
544
+ const getCreditBalance = (options) => (options?.client ?? client).get({
545
+ security: [{
546
+ scheme: "bearer",
547
+ type: "http"
548
+ }],
549
+ url: "/credits/balance",
550
+ ...options
551
+ });
552
+ /**
553
+ * List all domains
554
+ *
555
+ * Returns all verified and unverified domains for your organization,
556
+ * sorted by creation date (newest first). Each domain includes a
557
+ * `verified` boolean to distinguish between the two states.
558
+ *
559
+ */
560
+ const listDomains = (options) => (options?.client ?? client).get({
561
+ security: [{
562
+ scheme: "bearer",
563
+ type: "http"
564
+ }],
565
+ url: "/domains",
566
+ ...options
567
+ });
568
+ /**
569
+ * Claim a new domain
570
+ *
571
+ * Creates an unverified domain claim and returns the exact
572
+ * DNS records to publish in `dns_records`. Publish those
573
+ * records before calling the verify endpoint. To give users
574
+ * an importable DNS file, call `downloadDomainZoneFile` or run
575
+ * `primitive domains zone-file --id <domain-id>`.
576
+ *
577
+ */
578
+ const addDomain = (options) => (options.client ?? client).post({
579
+ security: [{
580
+ scheme: "bearer",
581
+ type: "http"
582
+ }],
583
+ url: "/domains",
584
+ ...options,
585
+ headers: {
586
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
587
+ ...options.headers
588
+ }
589
+ });
590
+ /**
591
+ * Delete a domain
592
+ *
593
+ * Deletes a verified or unverified domain claim.
594
+ */
595
+ const deleteDomain = (options) => (options.client ?? client).delete({
596
+ security: [{
597
+ scheme: "bearer",
598
+ type: "http"
599
+ }],
600
+ url: "/domains/{id}",
601
+ ...options
602
+ });
603
+ /**
604
+ * Update domain settings
605
+ *
606
+ * Update a verified domain's settings. Only verified domains can be
607
+ * updated. Per-domain spam thresholds require a Pro plan.
608
+ *
609
+ */
610
+ const updateDomain = (options) => (options.client ?? client).patch({
611
+ security: [{
612
+ scheme: "bearer",
613
+ type: "http"
614
+ }],
615
+ url: "/domains/{id}",
616
+ ...options,
617
+ headers: {
618
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
619
+ ...options.headers
620
+ }
621
+ });
622
+ /**
623
+ * Verify domain ownership
624
+ *
625
+ * Checks DNS records required for inbound routing, ownership,
626
+ * and outbound authentication: MX, ownership TXT, SPF, DKIM,
627
+ * DMARC, and TLS-RPT.
628
+ * On success, the domain is promoted from unverified to verified.
629
+ * On failure, returns which checks passed and which failed,
630
+ * plus the exact DNS records still expected. To give users
631
+ * an importable DNS file for missing records, call
632
+ * `downloadDomainZoneFile` or run
633
+ * `primitive domains zone-file --id <domain-id>`.
634
+ *
635
+ */
636
+ const verifyDomain = (options) => (options.client ?? client).post({
637
+ security: [{
638
+ scheme: "bearer",
639
+ type: "http"
640
+ }],
641
+ url: "/domains/{id}/verify",
642
+ ...options
643
+ });
644
+ /**
645
+ * Run an on-demand DNS health check
646
+ *
647
+ * Re-checks the domain's DNS records and persists the result as
648
+ * the domain's current DNS health state. This is the on-demand
649
+ * counterpart of the scheduled background checker: the response
650
+ * mirrors what the checker records, broken down per scope
651
+ * (`ownership`, `inbound`, `outbound`) with the exact records
652
+ * inspected and each record's individual status.
653
+ *
654
+ * Unlike /domains/{id}/verify, this call never promotes an
655
+ * unverified domain; it only re-evaluates and records health for
656
+ * an existing claim. Managed (Primitive-operated) domains are
657
+ * rejected with a validation error because their DNS is not
658
+ * customer-published.
659
+ *
660
+ * Rate limited per organization; a `Retry-After` header
661
+ * accompanies 429 responses.
662
+ *
663
+ */
664
+ const checkDomainDns = (options) => (options.client ?? client).post({
665
+ security: [{
666
+ scheme: "bearer",
667
+ type: "http"
668
+ }],
669
+ url: "/domains/{id}/dns/check",
670
+ ...options
671
+ });
672
+ /**
673
+ * Download domain DNS zone file
674
+ *
675
+ * Downloads a BIND-format DNS zone file containing the DNS records
676
+ * required for a domain claim. Agents should offer this after
677
+ * `addDomain` when users want to import DNS records instead of
678
+ * copying each record manually.
679
+ *
680
+ */
681
+ const downloadDomainZoneFile = (options) => (options.client ?? client).get({
682
+ security: [{
683
+ scheme: "bearer",
684
+ type: "http"
685
+ }],
686
+ url: "/domains/{id}/zone-file",
687
+ ...options
688
+ });
689
+ /**
690
+ * Get inbound inbox readiness
691
+ *
692
+ * Returns one consolidated view of inbound domain readiness,
693
+ * webhook/function processing routes, deployed Functions, and
694
+ * recent inbound email activity.
695
+ *
696
+ * Agents should call this before guiding a user through inbound
697
+ * setup. It answers the practical questions "can I receive mail",
698
+ * "will anything process that mail", and "what should I do next"
699
+ * without forcing clients to stitch together domains, endpoints,
700
+ * functions, and emails manually.
701
+ *
702
+ */
703
+ const getInboxStatus = (options) => (options?.client ?? client).get({
704
+ security: [{
705
+ scheme: "bearer",
706
+ type: "http"
707
+ }],
708
+ url: "/inbox/status",
709
+ ...options
710
+ });
711
+ /**
712
+ * List inbound emails
713
+ *
714
+ * Returns a paginated list of INBOUND emails received at your
715
+ * verified domains. Outbound messages sent via /send-mail are
716
+ * not included; this endpoint is the inbox view, not a
717
+ * unified send/receive history.
718
+ *
719
+ * Supports filtering by domain, status, date range, and
720
+ * free-text search across subject, sender, and recipient
721
+ * fields.
722
+ *
723
+ * For a compact text-table summary of the most recent N
724
+ * inbounds (no filters, no cursor pagination), the CLI ships
725
+ * `primitive emails:latest` as a one-line-per-email shortcut.
726
+ * It's TTY-aware so id columns are full UUIDs when piped, and
727
+ * a `--json` flag returns the same envelope this endpoint
728
+ * does. Use whichever fits the call site.
729
+ *
730
+ */
731
+ const listEmails = (options) => (options?.client ?? client).get({
732
+ security: [{
733
+ scheme: "bearer",
734
+ type: "http"
735
+ }],
736
+ url: "/emails",
737
+ ...options
738
+ });
739
+ /**
740
+ * Search inbound emails
741
+ *
742
+ * Searches inbound emails with structured filters and optional
743
+ * full-text matching across parsed email fields. This endpoint is
744
+ * optimized for filtered inbox views and CLI polling workflows:
745
+ * callers that only need new accepted mail can pass
746
+ * `sort=received_at_asc`, `snippet=false`, `include_facets=false`,
747
+ * and a `date_from` timestamp.
748
+ *
749
+ * `q`, `subject`, and `body` use the same English full-text index
750
+ * as the web inbox search. Structured filters such as `from`, `to`,
751
+ * `domain_id`, status, attachment presence, and spam score bounds
752
+ * are combined with the text query.
753
+ *
754
+ * Connected-agent credentials search only mail received by their own
755
+ * address. This applies to results, totals, facets, and every page;
756
+ * search filters cannot widen the credential's scope. When
757
+ * `reply_to_sent_email_id` is supplied, its parent send must belong
758
+ * to the connected address in the same organization. An unavailable
759
+ * parent returns 404. Sender filters are not authentication proof;
760
+ * inspect the email detail's authentication evidence before trusting it.
761
+ *
762
+ */
763
+ const searchEmails = (options) => (options?.client ?? client).get({
764
+ security: [{
765
+ scheme: "bearer",
766
+ type: "http"
767
+ }],
768
+ url: "/emails/search",
769
+ ...options
770
+ });
771
+ /**
772
+ * Delete an email
773
+ */
774
+ const deleteEmail = (options) => (options.client ?? client).delete({
775
+ security: [{
776
+ scheme: "bearer",
777
+ type: "http"
778
+ }],
779
+ url: "/emails/{id}",
780
+ ...options
781
+ });
782
+ /**
783
+ * Get inbound email by id
784
+ *
785
+ * Returns the full record for an inbound email received at one
786
+ * of your verified domains, including the parsed text and HTML
787
+ * bodies, threading metadata, SMTP envelope detail, webhook
788
+ * delivery state, and a `replies` array for any outbound sends
789
+ * recorded as replies to this inbound.
790
+ *
791
+ * For listing inbound emails (with cursor pagination, status
792
+ * and date filters, and free-text search), use
793
+ * `/emails`. Outbound (sent) email records are NOT returned
794
+ * here; use `/sent-emails/{id}` for those.
795
+ *
796
+ * The response carries four sender-shaped fields whose
797
+ * meanings overlap. `from_email` is the canonical "who sent
798
+ * this" field for most use cases (parsed bare address from
799
+ * the `From:` header, with a `sender` fallback). `from_header`
800
+ * is the raw header including any display name. `sender` and
801
+ * `smtp_mail_from` both carry the SMTP envelope MAIL FROM
802
+ * (return-path) and are equal by construction; `sender` is
803
+ * the older field name retained for compatibility. See
804
+ * `primitive describe emails:get-email | jq '.responseSchema.properties'`
805
+ * for per-field detail.
806
+ *
807
+ */
808
+ const getEmail = (options) => (options.client ?? client).get({
809
+ security: [{
810
+ scheme: "bearer",
811
+ type: "http"
812
+ }],
813
+ url: "/emails/{id}",
814
+ ...options
815
+ });
816
+ /**
817
+ * Download raw email
818
+ *
819
+ * Downloads the raw RFC 822 email file (.eml). Authenticates via
820
+ * a signed download token (provided in webhook payloads) or a
821
+ * valid session.
822
+ *
823
+ */
824
+ const downloadRawEmail = (options) => (options.client ?? client).get({
825
+ security: [{
826
+ scheme: "bearer",
827
+ type: "http"
828
+ }, {
829
+ in: "query",
830
+ name: "token",
831
+ type: "apiKey"
832
+ }],
833
+ url: "/emails/{id}/raw",
834
+ ...options
835
+ });
836
+ /**
837
+ * Download email attachments
838
+ *
839
+ * Downloads all attachments as a gzip-compressed tar archive.
840
+ * Authenticates via a signed download token (provided in webhook
841
+ * payloads) or a valid session.
842
+ *
843
+ */
844
+ const downloadAttachments = (options) => (options.client ?? client).get({
845
+ security: [{
846
+ scheme: "bearer",
847
+ type: "http"
848
+ }, {
849
+ in: "query",
850
+ name: "token",
851
+ type: "apiKey"
852
+ }],
853
+ url: "/emails/{id}/attachments.tar.gz",
854
+ ...options
855
+ });
856
+ /**
857
+ * Download one inbound email attachment
858
+ *
859
+ * Pending service release. This contract does not establish live availability.
860
+ * Downloads the original bytes of one ordinary email attachment, selected by
861
+ * its metadata `part_index`, not its position in an attachments array. Refresh
862
+ * the email detail after `attachment_changed` before choosing an index again.
863
+ * Uses bearer authentication only; signed raw-email download tokens are not accepted.
864
+ * A paired-agent credential may read only a message addressed to its claimed address.
865
+ * Function credentials are denied. Other bearer credentials retain their
866
+ * existing email access boundaries. This endpoint serves email bytes only.
867
+ *
868
+ */
869
+ const downloadEmailAttachmentPart = (options) => (options.client ?? client).get({
870
+ security: [{
871
+ scheme: "bearer",
872
+ type: "http"
873
+ }],
874
+ url: "/emails/{id}/attachments/{part_index}",
875
+ ...options
876
+ });
877
+ /**
878
+ * Download one sent email attachment
879
+ *
880
+ * Pending service release. This contract does not establish live availability.
881
+ * Downloads the original bytes of one ordinary email attachment, selected by
882
+ * its metadata `part_index`, not its position in an attachments array. Refresh
883
+ * the email detail after `attachment_changed` before choosing an index again.
884
+ * Uses bearer authentication only; signed raw-email download tokens are not accepted.
885
+ * A paired-agent credential may read only mail sent from its claimed address.
886
+ * Receiving a copy does not authorize downloading another sender's sent content.
887
+ * Function credentials are denied. Other bearer credentials retain their
888
+ * existing email access boundaries. This endpoint serves email bytes only.
889
+ *
890
+ */
891
+ const downloadSentAttachmentPart = (options) => (options.client ?? client).get({
892
+ security: [{
893
+ scheme: "bearer",
894
+ type: "http"
895
+ }],
896
+ url: "/sent-emails/{id}/attachments/{part_index}",
897
+ ...options
898
+ });
899
+ /**
900
+ * Stop the repeat behind a received message
901
+ *
902
+ * Called by the recipient of a repeating send: the connected agent's own
903
+ * credential for an agent address, or the signed-in member whose personal
904
+ * address it is. `id` is the caller's received copy of any message of the
905
+ * repeat, or the repeat id printed in the message footer, which resolves
906
+ * to the caller's newest received copy. Stops the repeat when it lets the recipient stop it, cancels the
907
+ * pending message, and replies once in the thread with a
908
+ * `repeat.stop/1` interaction so the sender sees it. A repeat call returns
909
+ * the same result without a second reply.
910
+ *
911
+ */
912
+ const stopRepeatFromEmail = (options) => (options.client ?? client).post({
913
+ security: [{
914
+ scheme: "bearer",
915
+ type: "http"
916
+ }],
917
+ url: "/emails/{id}/repeat-stop",
918
+ ...options,
919
+ headers: {
920
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
921
+ ...options.headers
922
+ }
923
+ });
924
+ /**
925
+ * Reply to an inbound email
926
+ *
927
+ * Sends an outbound reply to the inbound email identified by `id`.
928
+ * Threading headers (`In-Reply-To`, `References`), recipient
929
+ * derivation (Reply-To, then From, then bare sender), and the
930
+ * `Re:` subject prefix are all derived server-side from the
931
+ * stored inbound row. The request body carries only the message
932
+ * body, optional From override, optional attachments, optional
933
+ * `wait` flag, and optional `reply_all` flag, which also copies
934
+ * every other To and Cc address of the inbound (never Bcc).
935
+ * Passing any header or explicit recipient override is rejected
936
+ * by the schema (`additionalProperties: false`).
937
+ *
938
+ * Forwards through the same gates as `/send-mail`: the response
939
+ * status, error envelope, and `idempotent_replay` flag mirror
940
+ * the send-mail contract verbatim.
941
+ *
942
+ */
943
+ const replyToEmail = (options) => (options.client ?? client).post({
944
+ security: [{
945
+ scheme: "bearer",
946
+ type: "http"
947
+ }],
948
+ url: "/emails/{id}/reply",
949
+ ...options,
950
+ headers: {
951
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
952
+ ...options.headers
953
+ }
954
+ });
955
+ /**
956
+ * Replay email webhooks
957
+ *
958
+ * Re-delivers the webhook payload for this email to all active
959
+ * endpoints matching the email's domain. Rate limited per-email
960
+ * (short cooldown between successive replays of the same email)
961
+ * and per-org (burst + sustained windows), sharing an org-wide
962
+ * budget with delivery replays.
963
+ *
964
+ */
965
+ const replayEmailWebhooks = (options) => (options.client ?? client).post({
966
+ security: [{
967
+ scheme: "bearer",
968
+ type: "http"
969
+ }],
970
+ url: "/emails/{id}/replay",
971
+ ...options
972
+ });
973
+ /**
974
+ * Discard email content
975
+ *
976
+ * Permanently deletes the email's raw bytes, parsed body (text + HTML),
977
+ * and attachments while preserving metadata (sender, recipient,
978
+ * subject, timestamps, hashes, attachment manifest) for audit logs.
979
+ * Idempotent: a second call returns success with
980
+ * `already_discarded: true` and does no work.
981
+ *
982
+ * **Gated** on the customer's discard-content opt-in (managed in the
983
+ * dashboard at Settings > Webhooks). When the toggle is off, this
984
+ * endpoint returns `403` with code `discard_not_enabled` and a
985
+ * message pointing the human at the dashboard. There is intentionally
986
+ * no API to flip this toggle. Opting in to a destructive,
987
+ * non-reversible operation must be a deliberate human click in the
988
+ * UI.
989
+ *
990
+ */
991
+ const discardEmailContent = (options) => (options.client ?? client).post({
992
+ security: [{
993
+ scheme: "bearer",
994
+ type: "http"
995
+ }],
996
+ url: "/emails/{id}/discard-content",
997
+ ...options
998
+ });
999
+ /**
1000
+ * Get the conversation an email belongs to
1001
+ *
1002
+ * Returns the full conversation the given inbound email belongs
1003
+ * to, as ordered, ready-to-prompt turns WITH bodies. It resolves
1004
+ * the thread from the email and returns every message oldest-first,
1005
+ * so an agent that received an email can pass `messages` straight
1006
+ * to a chat model in one call instead of walking `/threads/{id}`
1007
+ * plus `/emails/{id}` and `/sent-emails/{id}` per message.
1008
+ *
1009
+ * Each message carries a `direction` (`inbound` | `outbound`) and a
1010
+ * derived `role`: `inbound` -> `user`, `outbound` -> `assistant`
1011
+ * (your own prior replies). The role mapping assumes the caller
1012
+ * owns the outbound side, which is the agent-reply case this exists
1013
+ * for. If the email has no thread yet (a brand-new message), the
1014
+ * conversation is just that one message as a single user turn.
1015
+ *
1016
+ * The message list is capped; check `truncated` to detect when
1017
+ * older messages were omitted. Consecutive same-role turns are not
1018
+ * merged here; that normalization is model-specific and left to the
1019
+ * caller.
1020
+ *
1021
+ */
1022
+ const getConversation = (options) => (options.client ?? client).get({
1023
+ security: [{
1024
+ scheme: "bearer",
1025
+ type: "http"
1026
+ }],
1027
+ url: "/emails/{id}/conversation",
1028
+ ...options
1029
+ });
1030
+ /**
1031
+ * List webhook endpoints
1032
+ *
1033
+ * Returns all active (non-deleted) webhook endpoints.
1034
+ */
1035
+ const listEndpoints = (options) => (options?.client ?? client).get({
1036
+ security: [{
1037
+ scheme: "bearer",
1038
+ type: "http"
1039
+ }],
1040
+ url: "/endpoints",
1041
+ ...options
1042
+ });
1043
+ /**
1044
+ * Create a webhook endpoint
1045
+ *
1046
+ * Creates a new webhook endpoint. If a deactivated endpoint
1047
+ * with the same URL and domain exists, it is reactivated
1048
+ * instead. Subject to plan limits on the number of active
1049
+ * endpoints.
1050
+ *
1051
+ * **Signing is account-scoped, not per-endpoint.** This call
1052
+ * does not return any signing material; every endpoint on the
1053
+ * account uses the same webhook secret, fetched via
1054
+ * `GET /account/webhook-secret`. See the API-level "Webhook
1055
+ * signing" section for the full wire format (header name,
1056
+ * signed string, hash algo, secret format, tolerance) and a
1057
+ * language-agnostic verification recipe.
1058
+ *
1059
+ * After creating the endpoint, fire a test delivery against
1060
+ * it via `POST /endpoints/{id}/test` to confirm your verifier
1061
+ * accepts the signature.
1062
+ *
1063
+ *
1064
+ * For local receiving, use kind=pull and a stable name, without url, function_id or domain_id. Named creation resumes the same active destination; omitted filters preserve its selection, while conflicting supplied configuration returns 409. New unfiltered destinations receive all subsequently ready eligible event types within their credential scope. Connected-agent credentials automatically create private subscriptions restricted to inbound email for their assigned address. Names are isolated per credential; revocation or replacement deletes its subscriptions. Address-scoped events contain parsed mail without raw MIME, signed download links, routing metadata, or sibling envelope recipients. Pull destinations do not occupy HTTP routing slots. Signing-secret setup and a test HTTP delivery are not required for pull receiving.
1065
+ */
1066
+ const createEndpoint = (options) => (options.client ?? client).post({
1067
+ security: [{
1068
+ scheme: "bearer",
1069
+ type: "http"
1070
+ }],
1071
+ url: "/endpoints",
1072
+ ...options,
1073
+ headers: {
1074
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1075
+ ...options.headers
1076
+ }
1077
+ });
1078
+ /**
1079
+ * Delete a webhook endpoint
1080
+ *
1081
+ * Soft-deletes a webhook endpoint. The endpoint will no longer
1082
+ * receive webhook deliveries.
1083
+ *
1084
+ */
1085
+ const deleteEndpoint = (options) => (options.client ?? client).delete({
1086
+ security: [{
1087
+ scheme: "bearer",
1088
+ type: "http"
1089
+ }],
1090
+ url: "/endpoints/{id}",
1091
+ ...options
1092
+ });
1093
+ /**
1094
+ * Update a webhook endpoint
1095
+ *
1096
+ * Updates an active webhook endpoint. If the URL is changed, the old
1097
+ * endpoint is deactivated and a new one is created (or an existing
1098
+ * deactivated endpoint with the new URL is reactivated).
1099
+ *
1100
+ *
1101
+ * Pull destinations cannot be assigned a URL, function or recipient-routing domain. Existing endpoint deletion disconnects the destination; creating a new destination does not backfill historical events.
1102
+ */
1103
+ const updateEndpoint = (options) => (options.client ?? client).patch({
1104
+ security: [{
1105
+ scheme: "bearer",
1106
+ type: "http"
1107
+ }],
1108
+ url: "/endpoints/{id}",
1109
+ ...options,
1110
+ headers: {
1111
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1112
+ ...options.headers
1113
+ }
1114
+ });
1115
+ /**
1116
+ * Receive a pending webhook event without a public endpoint
1117
+ *
1118
+ * Wait up to 30 seconds for one existing event. The body string preserves the exact webhook serialization; headers and canonical occurrence/type metadata travel alongside it. A fixed lease protects the attempt while a short handler accepts input. Retry may redeliver an occurrence: deduplicate event_id. Empty delivery means no offer now, not proof all input was delivered; inspect backlog and persistent gap_count/last_gap_reason. Queue retention is 24 hours and does not extend source-content retention. Disconnecting preserves pending work. Same named destination shares consumption; different destinations get independent copies.
1119
+ */
1120
+ const pullWebhookEvent = (options) => (options.client ?? client).post({
1121
+ security: [{
1122
+ scheme: "bearer",
1123
+ type: "http"
1124
+ }],
1125
+ url: "/endpoints/{id}/pull",
1126
+ ...options,
1127
+ headers: {
1128
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1129
+ ...options.headers
1130
+ }
1131
+ });
1132
+ /**
1133
+ * Report the outcome of a local webhook delivery attempt
1134
+ *
1135
+ * Report normalized handling evidence for the queue, attempt and lease. Required JSON fields: queue_id, delivery_id, lease_token, mode, duration_ms. For mode=exec include exit_code; stdout includes write_succeeded; http includes status_code and optional transport_error, error_code, confirmed. Supply this discriminated request with --raw-body in the generated CLI. The server classifies success and retry. Duplicate identical completion is idempotent; a stale lease cannot finish a newer attempt. Exec success means durable input acceptance, not completion of agent reasoning. Only successful HTTP handling with recognized confirmation evidence can confirm content discard. Never send arbitrary handler output or HTTP response bodies.
1136
+ */
1137
+ const completeWebhookEvent = (options) => (options.client ?? client).post({
1138
+ security: [{
1139
+ scheme: "bearer",
1140
+ type: "http"
1141
+ }],
1142
+ url: "/endpoints/{id}/complete",
1143
+ ...options,
1144
+ headers: {
1145
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1146
+ ...options.headers
1147
+ }
1148
+ });
1149
+ /**
1150
+ * Send a test webhook
1151
+ *
1152
+ * Sends a sample `email.received` event to the endpoint. The request
1153
+ * includes SSRF protection (private IP rejection and DNS pinning).
1154
+ * Rate limited to 4 per minute and 30 per hour (non-exempt).
1155
+ * Successful deliveries and verified-domain endpoints are exempt
1156
+ * from the rate limit.
1157
+ *
1158
+ */
1159
+ const testEndpoint = (options) => (options.client ?? client).post({
1160
+ security: [{
1161
+ scheme: "bearer",
1162
+ type: "http"
1163
+ }],
1164
+ url: "/endpoints/{id}/test",
1165
+ ...options
1166
+ });
1167
+ /**
1168
+ * Dry-run endpoint rules against a received email
1169
+ *
1170
+ * Evaluates the endpoint's filtering rules against an
1171
+ * already-received email WITHOUT delivering anything. The same
1172
+ * shared matcher the live delivery paths use produces the
1173
+ * verdict, so the response explains exactly why a webhook fired
1174
+ * or was suppressed for that message.
1175
+ *
1176
+ * When delivery would be suppressed, `rule` names the failing
1177
+ * rule and `reason` carries a human-readable explanation; both
1178
+ * are null when the message matches. `evaluated` echoes the
1179
+ * message metadata the matcher compared (size, attachments, and
1180
+ * the authenticated From identity versus the raw envelope
1181
+ * sender), so a surprising verdict can be traced to its inputs.
1182
+ *
1183
+ * Two independent gates are surfaced separately:
1184
+ * `subscribed_to_event` reports the endpoint's event-type
1185
+ * subscription (checked before message matching), and
1186
+ * `rules_valid` reports whether the stored rules blob parsed at
1187
+ * all. Delivery fails OPEN on an invalid blob (the message is
1188
+ * delivered as if unfiltered), so `rules_valid: false` exposes a
1189
+ * misconfiguration that is otherwise silent.
1190
+ *
1191
+ */
1192
+ const testEndpointRules = (options) => (options.client ?? client).post({
1193
+ security: [{
1194
+ scheme: "bearer",
1195
+ type: "http"
1196
+ }],
1197
+ url: "/endpoints/{id}/rules/test",
1198
+ ...options,
1199
+ headers: {
1200
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1201
+ ...options.headers
1202
+ }
1203
+ });
1204
+ /**
1205
+ * List filter rules
1206
+ *
1207
+ * Returns all whitelist and blocklist filter rules.
1208
+ */
1209
+ const listFilters = (options) => (options?.client ?? client).get({
1210
+ security: [{
1211
+ scheme: "bearer",
1212
+ type: "http"
1213
+ }],
1214
+ url: "/filters",
1215
+ ...options
1216
+ });
1217
+ /**
1218
+ * Create a filter rule
1219
+ *
1220
+ * Creates a new whitelist or blocklist filter. Per-domain filters
1221
+ * require a Pro plan. Patterns are stored as lowercase.
1222
+ *
1223
+ */
1224
+ const createFilter = (options) => (options.client ?? client).post({
1225
+ security: [{
1226
+ scheme: "bearer",
1227
+ type: "http"
1228
+ }],
1229
+ url: "/filters",
1230
+ ...options,
1231
+ headers: {
1232
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1233
+ ...options.headers
1234
+ }
1235
+ });
1236
+ /**
1237
+ * Delete a filter rule
1238
+ */
1239
+ const deleteFilter = (options) => (options.client ?? client).delete({
1240
+ security: [{
1241
+ scheme: "bearer",
1242
+ type: "http"
1243
+ }],
1244
+ url: "/filters/{id}",
1245
+ ...options
1246
+ });
1247
+ /**
1248
+ * Update a filter rule
1249
+ *
1250
+ * Toggle a filter's enabled state.
1251
+ */
1252
+ const updateFilter = (options) => (options.client ?? client).patch({
1253
+ security: [{
1254
+ scheme: "bearer",
1255
+ type: "http"
1256
+ }],
1257
+ url: "/filters/{id}",
1258
+ ...options,
1259
+ headers: {
1260
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1261
+ ...options.headers
1262
+ }
1263
+ });
1264
+ /**
1265
+ * List wake schedules
1266
+ *
1267
+ * Returns the org's wake.dispatch schedules.
1268
+ */
1269
+ const listWakeSchedules = (options) => (options?.client ?? client).get({
1270
+ security: [{
1271
+ scheme: "bearer",
1272
+ type: "http"
1273
+ }],
1274
+ url: "/wake/schedules",
1275
+ ...options
1276
+ });
1277
+ /**
1278
+ * Create a wake schedule
1279
+ *
1280
+ * Create a cron schedule that sends a wake.dispatch command to one of your
1281
+ * own function addresses. `from` and `to` must differ (no self-dispatch);
1282
+ * the cron expression and IANA timezone are validated and the first fire
1283
+ * time is computed without firing immediately.
1284
+ *
1285
+ */
1286
+ const createWakeSchedule = (options) => (options.client ?? client).post({
1287
+ security: [{
1288
+ scheme: "bearer",
1289
+ type: "http"
1290
+ }],
1291
+ url: "/wake/schedules",
1292
+ ...options,
1293
+ headers: {
1294
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1295
+ ...options.headers
1296
+ }
1297
+ });
1298
+ /**
1299
+ * Delete a wake schedule
1300
+ */
1301
+ const deleteWakeSchedule = (options) => (options.client ?? client).delete({
1302
+ security: [{
1303
+ scheme: "bearer",
1304
+ type: "http"
1305
+ }],
1306
+ url: "/wake/schedules/{id}",
1307
+ ...options
1308
+ });
1309
+ /**
1310
+ * Get a wake schedule
1311
+ */
1312
+ const getWakeSchedule = (options) => (options.client ?? client).get({
1313
+ security: [{
1314
+ scheme: "bearer",
1315
+ type: "http"
1316
+ }],
1317
+ url: "/wake/schedules/{id}",
1318
+ ...options
1319
+ });
1320
+ /**
1321
+ * Update a wake schedule
1322
+ *
1323
+ * Update a schedule's command, args, cadence, addresses, note, or enabled
1324
+ * state. Changing the cadence (or re-enabling) recomputes the next fire time.
1325
+ *
1326
+ */
1327
+ const updateWakeSchedule = (options) => (options.client ?? client).patch({
1328
+ security: [{
1329
+ scheme: "bearer",
1330
+ type: "http"
1331
+ }],
1332
+ url: "/wake/schedules/{id}",
1333
+ ...options,
1334
+ headers: {
1335
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1336
+ ...options.headers
1337
+ }
1338
+ });
1339
+ /**
1340
+ * Run a wake schedule now
1341
+ *
1342
+ * Fire the schedule immediately, sending one wake.dispatch via the same
1343
+ * signed-send path as a scheduled fire. Does not change the schedule's next
1344
+ * fire time.
1345
+ *
1346
+ */
1347
+ const runWakeSchedule = (options) => (options.client ?? client).post({
1348
+ security: [{
1349
+ scheme: "bearer",
1350
+ type: "http"
1351
+ }],
1352
+ url: "/wake/schedules/{id}/run",
1353
+ ...options
1354
+ });
1355
+ /**
1356
+ * List wake authorizations
1357
+ *
1358
+ * Returns the per-target allowlist grants that authorize which senders may
1359
+ * wake a function. Optionally filter by the target endpoint.
1360
+ *
1361
+ */
1362
+ const listWakeAuthorizations = (options) => (options?.client ?? client).get({
1363
+ security: [{
1364
+ scheme: "bearer",
1365
+ type: "http"
1366
+ }],
1367
+ url: "/wake/authorizations",
1368
+ ...options
1369
+ });
1370
+ /**
1371
+ * Create a wake authorization
1372
+ *
1373
+ * Grant a sender domain (and optionally a specific address and command set)
1374
+ * permission to wake a target function. The domain must be fully-qualified.
1375
+ *
1376
+ */
1377
+ const createWakeAuthorization = (options) => (options.client ?? client).post({
1378
+ security: [{
1379
+ scheme: "bearer",
1380
+ type: "http"
1381
+ }],
1382
+ url: "/wake/authorizations",
1383
+ ...options,
1384
+ headers: {
1385
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1386
+ ...options.headers
1387
+ }
1388
+ });
1389
+ /**
1390
+ * Delete a wake authorization
1391
+ */
1392
+ const deleteWakeAuthorization = (options) => (options.client ?? client).delete({
1393
+ security: [{
1394
+ scheme: "bearer",
1395
+ type: "http"
1396
+ }],
1397
+ url: "/wake/authorizations/{id}",
1398
+ ...options
1399
+ });
1400
+ /**
1401
+ * Update a wake authorization
1402
+ *
1403
+ * Toggle a wake authorization's enabled state.
1404
+ */
1405
+ const updateWakeAuthorization = (options) => (options.client ?? client).patch({
1406
+ security: [{
1407
+ scheme: "bearer",
1408
+ type: "http"
1409
+ }],
1410
+ url: "/wake/authorizations/{id}",
1411
+ ...options,
1412
+ headers: {
1413
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1414
+ ...options.headers
1415
+ }
1416
+ });
1417
+ /**
1418
+ * List recent wake dispatches
1419
+ *
1420
+ * Read-only audit of recent wake.dispatch interactions for the org.
1421
+ */
1422
+ const listWakeDispatches = (options) => (options?.client ?? client).get({
1423
+ security: [{
1424
+ scheme: "bearer",
1425
+ type: "http"
1426
+ }],
1427
+ url: "/wake/dispatches",
1428
+ ...options
1429
+ });
1430
+ /**
1431
+ * List recipient routes
1432
+ *
1433
+ * Returns the org's recipient routing rules in evaluation order. Each rule
1434
+ * binds a recipient address pattern to one endpoint; inbound mail resolves
1435
+ * to a single destination at delivery time.
1436
+ *
1437
+ */
1438
+ const listRoutes = (options) => (options?.client ?? client).get({
1439
+ security: [{
1440
+ scheme: "bearer",
1441
+ type: "http"
1442
+ }],
1443
+ url: "/routes",
1444
+ ...options
1445
+ });
1446
+ /**
1447
+ * Create a recipient route
1448
+ *
1449
+ * Binds a recipient pattern to a destination. Provide exactly one of
1450
+ * `endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,
1451
+ * a dedicated route-target endpoint is minted for that function in the same
1452
+ * transaction, enabling per-address function routing (e.g.
1453
+ * `alice@acme.com -> functionA`).
1454
+ *
1455
+ */
1456
+ const createRoute = (options) => (options.client ?? client).post({
1457
+ security: [{
1458
+ scheme: "bearer",
1459
+ type: "http"
1460
+ }],
1461
+ url: "/routes",
1462
+ ...options,
1463
+ headers: {
1464
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1465
+ ...options.headers
1466
+ }
1467
+ });
1468
+ /**
1469
+ * Reorder recipient routes
1470
+ *
1471
+ * Update the priority of one or more routes in a single call.
1472
+ */
1473
+ const reorderRoutes = (options) => (options.client ?? client).post({
1474
+ security: [{
1475
+ scheme: "bearer",
1476
+ type: "http"
1477
+ }],
1478
+ url: "/routes/reorder",
1479
+ ...options,
1480
+ headers: {
1481
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1482
+ ...options.headers
1483
+ }
1484
+ });
1485
+ /**
1486
+ * Simulate routing for a recipient
1487
+ *
1488
+ * Resolves where an inbound email to `recipient` would be delivered, with a
1489
+ * trace of every rule evaluated and why. Read-only; creates nothing.
1490
+ *
1491
+ */
1492
+ const simulateRoute = (options) => (options.client ?? client).post({
1493
+ security: [{
1494
+ scheme: "bearer",
1495
+ type: "http"
1496
+ }],
1497
+ url: "/routes/simulate",
1498
+ ...options,
1499
+ headers: {
1500
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1501
+ ...options.headers
1502
+ }
1503
+ });
1504
+ /**
1505
+ * Delete a recipient route
1506
+ */
1507
+ const deleteRoute = (options) => (options.client ?? client).delete({
1508
+ security: [{
1509
+ scheme: "bearer",
1510
+ type: "http"
1511
+ }],
1512
+ url: "/routes/{id}",
1513
+ ...options
1514
+ });
1515
+ /**
1516
+ * Update a recipient route
1517
+ */
1518
+ const updateRoute = (options) => (options.client ?? client).patch({
1519
+ security: [{
1520
+ scheme: "bearer",
1521
+ type: "http"
1522
+ }],
1523
+ url: "/routes/{id}",
1524
+ ...options,
1525
+ headers: {
1526
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1527
+ ...options.headers
1528
+ }
1529
+ });
1530
+ /**
1531
+ * List webhook deliveries
1532
+ *
1533
+ * Returns a paginated list of webhook delivery attempts. Each delivery
1534
+ * includes a nested `email` object with sender, recipient, and subject.
1535
+ *
1536
+ */
1537
+ const listDeliveries = (options) => (options?.client ?? client).get({
1538
+ security: [{
1539
+ scheme: "bearer",
1540
+ type: "http"
1541
+ }],
1542
+ url: "/webhooks/deliveries",
1543
+ ...options
1544
+ });
1545
+ /**
1546
+ * Replay a webhook delivery
1547
+ *
1548
+ * Re-sends the stored webhook payload from a previous delivery attempt.
1549
+ * If the original endpoint is still active, it is targeted. If the
1550
+ * original endpoint was deleted, the oldest active endpoint is used.
1551
+ * Deactivated endpoints cannot be replayed to. Rate limited per-org,
1552
+ * sharing an org-wide budget with email replays.
1553
+ *
1554
+ */
1555
+ const replayDelivery = (options) => (options.client ?? client).post({
1556
+ security: [{
1557
+ scheme: "bearer",
1558
+ type: "http"
1559
+ }],
1560
+ url: "/webhooks/deliveries/{id}/replay",
1561
+ ...options
1562
+ });
1563
+ /**
1564
+ * List send-permission rules
1565
+ *
1566
+ * Returns a flat list of rules describing every recipient the
1567
+ * caller may send to. Each rule has a `type`, a kind-specific
1568
+ * payload, and a human-readable `description`. If any rule
1569
+ * matches the recipient, /send-mail will accept the send under
1570
+ * the recipient-scope check.
1571
+ *
1572
+ * The endpoint is the answer to "where can I send" without
1573
+ * exposing internal entitlement names. Agents that don't
1574
+ * recognize a `type` can still read the `description` prose
1575
+ * and act on it.
1576
+ *
1577
+ * Rule kinds, ordered broadest-first so an agent can stop
1578
+ * scanning at the first match:
1579
+ *
1580
+ * 1. `any_recipient` (one entry, only when the org can send
1581
+ * anywhere): every other rule below it is redundant.
1582
+ * 2. `managed_zone` (always emitted, one per Primitive-managed
1583
+ * zone): sends to any address at *.primitive.email or
1584
+ * *.email.works always succeed; no entitlement required.
1585
+ * 3. `your_domain` (one per active verified outbound domain
1586
+ * owned by the org): sends to that domain are approved.
1587
+ * 4. `address` (one per address that has authenticated
1588
+ * inbound mail to the org, capped at `meta.address_cap`):
1589
+ * sends to that exact address are approved.
1590
+ *
1591
+ * The list is informational, not an authorization check.
1592
+ * /send-mail remains the source of truth on whether an
1593
+ * individual send will succeed (it also enforces the
1594
+ * from-address and the `send_mail` entitlement, which are
1595
+ * not recipient-scope concerns and are not represented here).
1596
+ *
1597
+ */
1598
+ const getSendPermissions = (options) => (options?.client ?? client).get({
1599
+ security: [{
1600
+ scheme: "bearer",
1601
+ type: "http"
1602
+ }],
1603
+ url: "/send-permissions",
1604
+ ...options
1605
+ });
1606
+ /**
1607
+ * Send outbound email
1608
+ *
1609
+ * Sends an outbound email through Primitive's outbound relay. By default
1610
+ * the request returns once the relay accepts the message for delivery.
1611
+ * Set `wait: true` to wait for the first downstream SMTP delivery outcome.
1612
+ *
1613
+ * **Host routing.** /send-mail is served by the canonical API host
1614
+ * (`https://api.primitive.dev/v1`) so the request body can carry
1615
+ * inline attachments up to ~30 MiB raw. The legacy dashboard
1616
+ * compatibility host (`https://www.primitive.dev/api/v1`) also accepts
1617
+ * /send-mail, but Vercel request body limits apply before proxying.
1618
+ * The typed SDKs route /send-mail to the canonical API host
1619
+ * automatically.
1620
+ *
1621
+ */
1622
+ const sendEmail = (options) => (options.client ?? client).post({
1623
+ security: [{
1624
+ scheme: "bearer",
1625
+ type: "http"
1626
+ }],
1627
+ url: "/send-mail",
1628
+ ...options,
1629
+ headers: {
1630
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1631
+ ...options.headers
1632
+ }
1633
+ });
1634
+ /**
1635
+ * Semantic search across received and sent mail
1636
+ *
1637
+ * Ranked search across both received and sent mail. The `mode`
1638
+ * field selects the ranking strategy:
1639
+ *
1640
+ * - `keyword`: lexical full-text matching only (no embeddings).
1641
+ * - `semantic`: meaning-based matching using vector embeddings.
1642
+ * - `hybrid` (default): blends the semantic and keyword signals.
1643
+ *
1644
+ * Results are ordered by a relevance `score`. Every row reports the
1645
+ * fields it matched (`matched_fields`), a match-centered excerpt per
1646
+ * field (`snippets`), and a `score_breakdown` whose components account
1647
+ * for the `score`. Page through results by passing the prior
1648
+ * response's `meta.cursor` back as `cursor`.
1649
+ *
1650
+ * Requires the Pro plan and the `semantic_search_enabled`
1651
+ * entitlement; callers without them receive `403`.
1652
+ *
1653
+ */
1654
+ const semanticSearch = (options) => (options.client ?? client).post({
1655
+ security: [{
1656
+ scheme: "bearer",
1657
+ type: "http"
1658
+ }],
1659
+ url: "/semantic-search",
1660
+ ...options,
1661
+ headers: {
1662
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1663
+ ...options.headers
1664
+ }
1665
+ });
1666
+ /**
1667
+ * Get outbound sending readiness
1668
+ *
1669
+ * The "what can I send From?" bootstrap, the outbound mirror of
1670
+ * /inbox/status. Returns per-domain sending readiness for every
1671
+ * domain in the caller's org, plus the flat `sendable_domains`
1672
+ * list of From-domains the org may send from right now. That
1673
+ * list is the same set echoed in a `cannot_send_from_domain`
1674
+ * error's details, so orienting here before a send and
1675
+ * recovering from that error use identical data.
1676
+ *
1677
+ * Each domain's `status` collapses the sending prerequisites
1678
+ * into one actionable state: `sendable`, `pending_ownership`
1679
+ * (ownership TXT not verified), `pending_outbound_dns`
1680
+ * (SPF/DKIM/DMARC not verified), or `inactive` (domain
1681
+ * deactivated). `next_actions` lists concrete remediation steps,
1682
+ * each with a suggested CLI command where one exists.
1683
+ *
1684
+ */
1685
+ const getOutboundStatus = (options) => (options?.client ?? client).get({
1686
+ security: [{
1687
+ scheme: "bearer",
1688
+ type: "http"
1689
+ }],
1690
+ url: "/outbound/status",
1691
+ ...options
1692
+ });
1693
+ /**
1694
+ * List repeating sends
1695
+ *
1696
+ * Repeating sends you created, newest first. A repeat is visible to the
1697
+ * member who created it, or to any organization API key or member for
1698
+ * repeats created with an organization API key. Agent credentials get
1699
+ * 403.
1700
+ *
1701
+ */
1702
+ const listRepeatingSends = (options) => (options?.client ?? client).get({
1703
+ security: [{
1704
+ scheme: "bearer",
1705
+ type: "http"
1706
+ }],
1707
+ url: "/repeating-sends",
1708
+ ...options
1709
+ });
1710
+ /**
1711
+ * Delete a repeating send
1712
+ *
1713
+ * Deletes the repeat and cancels its pending message. Messages already sent are not affected.
1714
+ */
1715
+ const deleteRepeatingSend = (options) => (options.client ?? client).delete({
1716
+ security: [{
1717
+ scheme: "bearer",
1718
+ type: "http"
1719
+ }],
1720
+ url: "/repeating-sends/{id}",
1721
+ ...options
1722
+ });
1723
+ /**
1724
+ * Get a repeating send
1725
+ */
1726
+ const getRepeatingSend = (options) => (options.client ?? client).get({
1727
+ security: [{
1728
+ scheme: "bearer",
1729
+ type: "http"
1730
+ }],
1731
+ url: "/repeating-sends/{id}",
1732
+ ...options
1733
+ });
1734
+ /**
1735
+ * Update a repeating send
1736
+ *
1737
+ * Pause, resume or cancel a repeat, or change its cadence, limits,
1738
+ * message or whether the recipient may stop it. `active` resumes a paused
1739
+ * repeat or one the recipient stopped; the next message goes out within
1740
+ * about a minute. A null `only_if_recipient_idle_minutes`, `max_sends`
1741
+ * or `until` clears that limit.
1742
+ *
1743
+ */
1744
+ const updateRepeatingSend = (options) => (options.client ?? client).patch({
1745
+ security: [{
1746
+ scheme: "bearer",
1747
+ type: "http"
1748
+ }],
1749
+ url: "/repeating-sends/{id}",
1750
+ ...options,
1751
+ headers: {
1752
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1753
+ ...options.headers
1754
+ }
1755
+ });
1756
+ /**
1757
+ * List outbound sent emails
1758
+ *
1759
+ * Returns a paginated list of OUTBOUND emails the caller's
1760
+ * org has sent via /send-mail (and /emails/{id}/reply, which
1761
+ * forwards through /send-mail). Includes every recorded
1762
+ * attempt, including gate-denied attempts that the agent
1763
+ * never called and rows still in `queued` state.
1764
+ *
1765
+ * For inbound mail received at your verified domains, see
1766
+ * /emails. There is no unified send/receive history endpoint;
1767
+ * the two surfaces are intentionally separate because the
1768
+ * underlying tables, statuses, and lifecycle differ.
1769
+ *
1770
+ * Email bodies (`body_text`, `body_html`) are NOT included on
1771
+ * list rows so a 50-row page can't balloon into a multi-MB
1772
+ * response when sends are near the 5MB body cap. Use
1773
+ * /sent-emails/{id} to fetch a single row with bodies, or
1774
+ * cross-reference by `client_idempotency_key` if the caller
1775
+ * already has the body locally.
1776
+ *
1777
+ */
1778
+ const listSentEmails = (options) => (options?.client ?? client).get({
1779
+ security: [{
1780
+ scheme: "bearer",
1781
+ type: "http"
1782
+ }],
1783
+ url: "/sent-emails",
1784
+ ...options
1785
+ });
1786
+ /**
1787
+ * Delete a sent email
1788
+ *
1789
+ * Permanently deletes sender mailbox history and its owned attachment archive
1790
+ * and transient payload. Allows delivered, bounced, agent_failed, gate_denied,
1791
+ * canceled, deferred and wait_timeout; other states return 409. Cancel scheduled
1792
+ * sends first. This does not recall or cancel delivery already admitted.
1793
+ * Recipient copies, received replies and independent audit records are preserved.
1794
+ * Occupied idempotency keys and delivered-reply deduplication remain reserved.
1795
+ * Keys already released by cancellation, gate denial or a never-attempted failure
1796
+ * remain reusable. Repeating a completed deletion succeeds; unknown or foreign
1797
+ * IDs return 404. Organization API keys, sessions and OAuth are supported;
1798
+ * Function and connected-agent credentials are denied.
1799
+ *
1800
+ */
1801
+ const deleteSentEmail = (options) => (options.client ?? client).delete({
1802
+ security: [{
1803
+ scheme: "bearer",
1804
+ type: "http"
1805
+ }],
1806
+ url: "/sent-emails/{id}",
1807
+ ...options
1808
+ });
1809
+ /**
1810
+ * Get a sent email by id
1811
+ *
1812
+ * Returns the full sent-email record by id, including
1813
+ * `body_text` and `body_html` (omitted from the listing
1814
+ * endpoint to keep paginated responses small). Use this when
1815
+ * diagnosing a specific send, e.g. inspecting the receiver's
1816
+ * SMTP response on a `bounced` row or pulling the gate
1817
+ * denial detail on a `gate_denied` row.
1818
+ *
1819
+ */
1820
+ const getSentEmail = (options) => (options.client ?? client).get({
1821
+ security: [{
1822
+ scheme: "bearer",
1823
+ type: "http"
1824
+ }],
1825
+ url: "/sent-emails/{id}",
1826
+ ...options
1827
+ });
1828
+ /**
1829
+ * Reschedule a scheduled send
1830
+ *
1831
+ * Moves a STILL-SCHEDULED send (status `scheduled`) to a new
1832
+ * execution time. The new `scheduled_at` must be in the future
1833
+ * and at most 30 days out, the same bounds as the create-time
1834
+ * field on /send-mail.
1835
+ *
1836
+ * The update is a compare-and-swap on `status = 'scheduled'`:
1837
+ * once the scheduler has claimed the row for execution, or it
1838
+ * was already canceled or executed, the update loses and the
1839
+ * call returns a 409 `not_scheduled` conflict naming the row's
1840
+ * current status. A due send can therefore never be moved out
1841
+ * from under an in-progress execution.
1842
+ *
1843
+ * Returns the full updated sent-email record on success.
1844
+ *
1845
+ */
1846
+ const rescheduleSentEmail = (options) => (options.client ?? client).patch({
1847
+ security: [{
1848
+ scheme: "bearer",
1849
+ type: "http"
1850
+ }],
1851
+ url: "/sent-emails/{id}",
1852
+ ...options,
1853
+ headers: {
1854
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1855
+ ...options.headers
1856
+ }
1857
+ });
1858
+ /**
1859
+ * list Agent Connections
1860
+ *
1861
+ * Address-bound external runtime pairing. Any current human organization member may create and manage their personal agent connections. Organization owners and admins may manage all connections and explicitly create shared ones. An owner removed from the organization loses personal agent access, and rejoining does not revive the old connection. Organization API keys cannot manage connections. A current connected credential may disconnect only its own exact address. Claim is authorized only by its one-use invitation. Connected means a real challenge was received and a reply sent by the current bound credential was received back. Invitations expire after 15 minutes. Reconnection preserves the address and revokes previous credentials. Status responses contain no credentials. Runtime credentials allow address-scoped mail operations, organization note reads, own-address note writes, exact-address self-disconnect, network discovery when can_view is enabled, and recipient-bound network contact admission.
1862
+ */
1863
+ const listAgentConnections = (options) => (options?.client ?? client).get({
1864
+ security: [{
1865
+ scheme: "bearer",
1866
+ type: "http"
1867
+ }],
1868
+ url: "/agent-connections",
1869
+ ...options
1870
+ });
1871
+ /**
1872
+ * create Agent Connection
1873
+ *
1874
+ * Address-bound external runtime pairing. Any current human organization member may create and manage their personal agent connections. Organization owners and admins may manage all connections and explicitly create shared ones. An owner removed from the organization loses personal agent access, and rejoining does not revive the old connection. Organization API keys cannot manage connections. A current connected credential may disconnect only its own exact address. Claim is authorized only by its one-use invitation. Connected means a real challenge was received and a reply sent by the current bound credential was received back. Invitations expire after 15 minutes. Reconnection preserves the address and revokes previous credentials. Status responses contain no credentials. Runtime credentials allow address-scoped mail operations, organization note reads, own-address note writes, exact-address self-disconnect, network discovery when can_view is enabled, and recipient-bound network contact admission. Save create_request_id before dispatch to recover an interrupted creation. Recovery returns the original current connection with recovered:true and invitation:null; it never replays a secret or rotates credentials.
1875
+ */
1876
+ const createAgentConnection = (options) => (options.client ?? client).post({
1877
+ security: [{
1878
+ scheme: "bearer",
1879
+ type: "http"
1880
+ }],
1881
+ url: "/agent-connections",
1882
+ ...options,
1883
+ headers: {
1884
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1885
+ ...options.headers
1886
+ }
1887
+ });
1888
+ /**
1889
+ * invite Agent Connection
1890
+ *
1891
+ * Address-bound external runtime pairing. Any current human organization member may create and manage their personal agent connections. Organization owners and admins may manage all connections and explicitly create shared ones. An owner removed from the organization loses personal agent access, and rejoining does not revive the old connection. Organization API keys cannot manage connections. A current connected credential may disconnect only its own exact address. Claim is authorized only by its one-use invitation. Connected means a real challenge was received and a reply sent by the current bound credential was received back. Invitations expire after 15 minutes. Reconnection preserves the address and revokes previous credentials. Status responses contain no credentials. Runtime credentials allow address-scoped mail operations, organization note reads, own-address note writes, exact-address self-disconnect, network discovery when can_view is enabled, and recipient-bound network contact admission. pending_only protects an already claimed credential. An ambiguous invitation response must not be retried automatically; invitation secrets are never replayed.
1892
+ */
1893
+ const inviteAgentConnection = (options) => (options.client ?? client).post({
1894
+ security: [{
1895
+ scheme: "bearer",
1896
+ type: "http"
1897
+ }],
1898
+ url: "/agent-connections/{address}/invitation",
1899
+ ...options,
1900
+ headers: {
1901
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1902
+ ...options.headers
1903
+ }
1904
+ });
1905
+ /**
1906
+ * revoke Agent Connection
1907
+ *
1908
+ * Disconnect an agent and invalidate its bound credential. A current personal owner may disconnect their own agent; organization owners and admins may disconnect any connection. A connected agent may disconnect only its own exact address using its current bound credential. This preserves the connection record, mail, notes and domain. A current personal owner may permanently remove their own revoked record.
1909
+ */
1910
+ const revokeAgentConnection = (options) => (options.client ?? client).delete({
1911
+ security: [{
1912
+ scheme: "bearer",
1913
+ type: "http"
1914
+ }],
1915
+ url: "/agent-connections/{address}",
1916
+ ...options
1917
+ });
1918
+ /**
1919
+ * remove Agent Connection
1920
+ *
1921
+ * Permanently remove a revoked connection record. A current personal owner may permanently remove their own record; organization owners and admins may remove any record. Disconnect first using revokeAgentConnection; an active connection returns 409 connection_not_revoked. Missing or already removed records return 404. Mail, address notes, domains and external runtimes are preserved. The same address can be paired again with a new invitation; old credentials and invitations remain invalid.
1922
+ */
1923
+ const removeAgentConnection = (options) => (options.client ?? client).post({
1924
+ security: [{
1925
+ scheme: "bearer",
1926
+ type: "http"
1927
+ }],
1928
+ url: "/agent-connections/{address}/remove",
1929
+ ...options
1930
+ });
1931
+ /**
1932
+ * claim Agent Connection
1933
+ *
1934
+ * Address-bound external runtime pairing. Any current human organization member may create and manage their personal agent connections. Organization owners and admins may manage all connections and explicitly create shared ones. An owner removed from the organization loses personal agent access, and rejoining does not revive the old connection. Organization API keys cannot manage connections. A current connected credential may disconnect only its own exact address. Claim is authorized only by its one-use invitation. Connected means a real challenge was received and a reply sent by the current bound credential was received back. Invitations expire after 15 minutes. Reconnection preserves the address and revokes previous credentials. Status responses contain no credentials. Runtime credentials allow address-scoped mail operations, organization note reads, own-address note writes, exact-address self-disconnect, network discovery when can_view is enabled, and recipient-bound network contact admission.
1935
+ */
1936
+ const claimAgentConnection = (options) => (options.client ?? client).post({
1937
+ url: "/agent-connections/claim",
1938
+ ...options,
1939
+ headers: {
1940
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
1941
+ ...options.headers
1942
+ }
1943
+ });
1944
+ /**
1945
+ * agent Connection Setup
1946
+ *
1947
+ * Instructions for pairing an external runtime. GET never consumes an invitation. The invitation token stays in the URL fragment and is submitted only in the claim POST body.
1948
+ */
1949
+ const agentConnectionSetup = (options) => (options?.client ?? client).get({
1950
+ url: "/agent-connections/setup",
1951
+ ...options
1952
+ });
1953
+ /**
1954
+ * Cancel a scheduled send
1955
+ *
1956
+ * Cancels a STILL-SCHEDULED send (status `scheduled`), moving it
1957
+ * to the terminal `canceled` status. Nothing is dispatched and
1958
+ * the row is kept for historical lookup with `canceled_at` set.
1959
+ *
1960
+ * Uses the same compare-and-swap guard as reschedule: once the
1961
+ * scheduler has claimed the row for execution, or it was already
1962
+ * canceled or executed, the call returns a 409 `not_scheduled`
1963
+ * conflict naming the row's current status. Canceling can
1964
+ * therefore never race an in-progress execution; a send that
1965
+ * reports `canceled` was never handed to the delivery path.
1966
+ *
1967
+ * Returns the full updated sent-email record on success.
1968
+ *
1969
+ */
1970
+ const cancelSentEmail = (options) => (options.client ?? client).post({
1971
+ security: [{
1972
+ scheme: "bearer",
1973
+ type: "http"
1974
+ }],
1975
+ url: "/sent-emails/{id}/cancel",
1976
+ ...options
1977
+ });
1978
+ /**
1979
+ * Get (or wait for) the reply to a sent email
1980
+ *
1981
+ * Returns the first threaded inbound reply to a send, keyed by
1982
+ * the inbound email's `reply_to_sent_email_id`. This is the
1983
+ * canonical "did a reply arrive for this send?" call: after
1984
+ * /send-mail, poll (or long-poll) here instead of hand-rolling
1985
+ * an /emails/search loop.
1986
+ *
1987
+ * By default the call returns immediately with `reply: null`
1988
+ * when nothing has arrived yet. Set `wait=true` to long-poll:
1989
+ * the server holds the request up to `wait_timeout_ms`
1990
+ * (default 10000, max 30000), returning as soon as the first
1991
+ * reply lands. On a wait that elapses with no reply, the
1992
+ * response has `reply: null` and `timed_out: true`.
1993
+ *
1994
+ * The reply object is compact (headers plus bodies); fetch
1995
+ * `/emails/{id}` with `reply.id` for the fully parsed record,
1996
+ * or `/threads/{thread_id}` for the whole back-and-forth.
1997
+ *
1998
+ */
1999
+ const awaitReply = (options) => (options.client ?? client).get({
2000
+ security: [{
2001
+ scheme: "bearer",
2002
+ type: "http"
2003
+ }],
2004
+ url: "/sent-emails/{id}/reply",
2005
+ ...options
2006
+ });
2007
+ /**
2008
+ * Get a conversation thread by id
2009
+ *
2010
+ * Returns a conversation thread: its metadata plus the inbound
2011
+ * and outbound messages that belong to it, interleaved in time
2012
+ * order (oldest first). A thread spans both received emails and
2013
+ * your sends, so an agent can reconstruct an entire back-and-forth
2014
+ * from one call instead of walking reply headers.
2015
+ *
2016
+ * Each message carries a `direction` (`inbound` | `outbound`) and
2017
+ * an `id`; fetch the full message via `/emails/{id}` or
2018
+ * `/sent-emails/{id}` accordingly. Bodies are omitted here to keep
2019
+ * the thread view lightweight.
2020
+ *
2021
+ * Discover a thread id from the `thread_id` field on any email or
2022
+ * sent-email (list or detail). The message list is capped; compare
2023
+ * `message_count` against `messages.length` to detect truncation.
2024
+ *
2025
+ */
2026
+ const getThread = (options) => (options.client ?? client).get({
2027
+ security: [{
2028
+ scheme: "bearer",
2029
+ type: "http"
2030
+ }],
2031
+ url: "/threads/{id}",
2032
+ ...options
2033
+ });
2034
+ /**
2035
+ * List functions
2036
+ *
2037
+ * Returns every active (non-deleted) function in the org, newest
2038
+ * first. Each entry carries deploy status and timestamps. To
2039
+ * inspect the source code or deploy errors, use `GET /functions/{id}`.
2040
+ *
2041
+ */
2042
+ const listFunctions = (options) => (options?.client ?? client).get({
2043
+ security: [{
2044
+ scheme: "bearer",
2045
+ type: "http"
2046
+ }],
2047
+ url: "/functions",
2048
+ ...options
2049
+ });
2050
+ /**
2051
+ * Deploy a function
2052
+ *
2053
+ * Creates and deploys a new function. The handler must be a single
2054
+ * ESM module whose default export is an object with an async
2055
+ * `fetch(request, env)` method (Workers-style). Primitive signs
2056
+ * each delivery and forwards the `Primitive-Signature` header to
2057
+ * the handler. Verify the raw request body with
2058
+ * `PRIMITIVE_WEBHOOK_SECRET` before parsing JSON; after verification
2059
+ * the request body parses to a webhook event whose `event` field is
2060
+ * `email.received` for normal inbound mail, or a machine-mail type
2061
+ * (`email.bounced`, `email.tls_report`, `email.dmarc_report`,
2062
+ * `email.dmarc_failure`) for bounces and reports. Code is bundled
2063
+ * before being uploaded; ship a single self-contained file rather
2064
+ * than relying on external imports.
2065
+ *
2066
+ * **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
2067
+ * (optional) is capped at 5 MiB UTF-8, stored with each deployment
2068
+ * attempt, and sent to the runtime so stack traces can resolve to
2069
+ * original source files.
2070
+ *
2071
+ * **Routing.** On successful deploy, the function code is live
2072
+ * in the runtime, but inbound mail will not reach it until at
2073
+ * least one route is bound. Routes are managed from the Primitive
2074
+ * dashboard. A `deploy_status` of `deployed` means the script is
2075
+ * installed, not that the function is receiving mail. The
2076
+ * internal runtime URL is not returned by the API and is not a
2077
+ * customer-facing integration surface.
2078
+ *
2079
+ * **Secrets.** New functions ship with the managed secrets
2080
+ * (`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`,
2081
+ * `PRIMITIVE_API_BASE_URL`) already bound. Add user-set secrets via
2082
+ * `POST /functions/{id}/secrets`; secret writes only land in the
2083
+ * running handler on the next redeploy.
2084
+ *
2085
+ */
2086
+ const createFunction = (options) => (options.client ?? client).post({
2087
+ security: [{
2088
+ scheme: "bearer",
2089
+ type: "http"
2090
+ }],
2091
+ url: "/functions",
2092
+ ...options,
2093
+ headers: {
2094
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2095
+ ...options.headers
2096
+ }
2097
+ });
2098
+ /**
2099
+ * Delete a function
2100
+ *
2101
+ * Soft-deletes the function row, removes the script from the edge
2102
+ * runtime, and deactivates any route bound to this function so no
2103
+ * further inbound mail is delivered. Past deploy history,
2104
+ * invocations, and logs are retained.
2105
+ *
2106
+ * Returns 502 if the runtime delete fails partway; the function
2107
+ * row stays in place and the call is safe to retry until it
2108
+ * succeeds.
2109
+ *
2110
+ */
2111
+ const deleteFunction = (options) => (options.client ?? client).delete({
2112
+ security: [{
2113
+ scheme: "bearer",
2114
+ type: "http"
2115
+ }],
2116
+ url: "/functions/{id}",
2117
+ ...options
2118
+ });
2119
+ /**
2120
+ * Get a function
2121
+ *
2122
+ * Returns the full record for a function, including its current
2123
+ * source code and the deploy status / error from the most recent
2124
+ * deploy attempt.
2125
+ *
2126
+ */
2127
+ const getFunction = (options) => (options.client ?? client).get({
2128
+ security: [{
2129
+ scheme: "bearer",
2130
+ type: "http"
2131
+ }],
2132
+ url: "/functions/{id}",
2133
+ ...options
2134
+ });
2135
+ /**
2136
+ * Update and redeploy a function
2137
+ *
2138
+ * Replaces the function's source code with the body's `code` and
2139
+ * triggers a redeploy. Same size limits as `POST /functions`.
2140
+ * Use this verb to push secret writes into the running handler:
2141
+ * passing the same `code` re-runs the deploy and refreshes the
2142
+ * binding set with the latest values from the secrets table.
2143
+ *
2144
+ * On deploy failure, the previously-deployed code stays live; the
2145
+ * runtime never serves a half-built bundle. The response uses
2146
+ * `error.code` `deploy_failed`, and the function's `deploy_error`
2147
+ * field carries the latest deploy error for dashboard/API reads.
2148
+ *
2149
+ */
2150
+ const updateFunction = (options) => (options.client ?? client).put({
2151
+ security: [{
2152
+ scheme: "bearer",
2153
+ type: "http"
2154
+ }],
2155
+ url: "/functions/{id}",
2156
+ ...options,
2157
+ headers: {
2158
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2159
+ ...options.headers
2160
+ }
2161
+ });
2162
+ /**
2163
+ * Send a test invocation
2164
+ *
2165
+ * Sends a real test email from a Primitive-controlled sender to a
2166
+ * local-part on one of the org's verified inbound domains. By
2167
+ * default the recipient is a synthetic
2168
+ * `__primitive_function_test+<random>@<domain>` address on a
2169
+ * domain selected to route to the function. Scoped functions use
2170
+ * their scoped domain; fallback functions use a domain that has
2171
+ * no enabled domain-scoped endpoint. Pass `local_part` to
2172
+ * override and exercise routing logic that branches on a specific
2173
+ * recipient (the common pattern when one function handles multiple
2174
+ * inboxes like `summarize@` and `action@`). The function fires
2175
+ * through the normal MX delivery path, so reply / send-mail calls
2176
+ * from inside the handler against the inbound's `email.id` work
2177
+ * the same as in production. Returns immediately after the send is
2178
+ * queued; the invocation appears on the function's invocations
2179
+ * list within a few seconds.
2180
+ *
2181
+ * Requires that the function is currently `deployed`. Returns 422
2182
+ * if the function is in `pending` or `failed` state, or if the
2183
+ * org has no verified inbound domain to receive the test mail.
2184
+ * Returns 400 if `local_part` is set to a value that does not
2185
+ * match the local-part character set.
2186
+ *
2187
+ */
2188
+ const testFunction = (options) => (options.client ?? client).post({
2189
+ security: [{
2190
+ scheme: "bearer",
2191
+ type: "http"
2192
+ }],
2193
+ url: "/functions/{id}/test",
2194
+ ...options,
2195
+ headers: {
2196
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2197
+ ...options.headers
2198
+ }
2199
+ });
2200
+ /**
2201
+ * Get a function test run trace
2202
+ *
2203
+ * Returns the current end-to-end trace for a function test run.
2204
+ * The trace is intentionally partial while the test is still in
2205
+ * flight: callers can poll this endpoint and watch it fill in
2206
+ * from send -> inbound -> webhook deliveries -> outbound
2207
+ * requests, logs, and replies.
2208
+ *
2209
+ */
2210
+ const getFunctionTestRunTrace = (options) => (options.client ?? client).get({
2211
+ security: [{
2212
+ scheme: "bearer",
2213
+ type: "http"
2214
+ }],
2215
+ url: "/functions/{id}/test-runs/{run_id}/trace",
2216
+ ...options
2217
+ });
2218
+ /**
2219
+ * Get the org's function routing topology
2220
+ *
2221
+ * Returns a single snapshot of how inbound mail is routed across
2222
+ * this org's active domains and functions: which active domain has
2223
+ * which function bound, the org's fallback function (if any), and
2224
+ * every deployed function with no route bound. Use this to answer
2225
+ * "which of my functions actually receive mail?" diagnostically.
2226
+ *
2227
+ */
2228
+ const getOrgRoutingTopology = (options) => (options?.client ?? client).get({
2229
+ security: [{
2230
+ scheme: "bearer",
2231
+ type: "http"
2232
+ }],
2233
+ url: "/functions/routing-topology",
2234
+ ...options
2235
+ });
2236
+ /**
2237
+ * Get a function's current route binding
2238
+ *
2239
+ * Returns the endpoint binding for the function, or null when no
2240
+ * route is currently bound. The binding identifies whether the
2241
+ * function receives mail for a specific domain (scoped) or for any
2242
+ * active domain that has no scoped binding (fallback).
2243
+ *
2244
+ */
2245
+ const getFunctionRouting = (options) => (options.client ?? client).get({
2246
+ security: [{
2247
+ scheme: "bearer",
2248
+ type: "http"
2249
+ }],
2250
+ url: "/functions/{id}/routing",
2251
+ ...options
2252
+ });
2253
+ /**
2254
+ * Unbind any route from a function
2255
+ *
2256
+ * Deactivates every active endpoint bound to this function. The
2257
+ * function stays deployed but stops receiving inbound mail. Safe
2258
+ * to call when no route is currently bound (no-op).
2259
+ *
2260
+ */
2261
+ const unsetFunctionRoute = (options) => (options.client ?? client).delete({
2262
+ security: [{
2263
+ scheme: "bearer",
2264
+ type: "http"
2265
+ }],
2266
+ url: "/functions/{id}/route",
2267
+ ...options
2268
+ });
2269
+ /**
2270
+ * Bind a route to a function
2271
+ *
2272
+ * Binds inbound mail to this function. The route target is either
2273
+ * a specific verified domain (scoped) or the org's fallback (any
2274
+ * active domain with no scoped binding). If another function is
2275
+ * already bound at the target, returns a `conflict` envelope
2276
+ * describing the holder; re-issue with `takeover: true` to
2277
+ * deactivate that prior binding and install this one.
2278
+ *
2279
+ */
2280
+ const setFunctionRoute = (options) => (options.client ?? client).put({
2281
+ security: [{
2282
+ scheme: "bearer",
2283
+ type: "http"
2284
+ }],
2285
+ url: "/functions/{id}/route",
2286
+ ...options,
2287
+ headers: {
2288
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2289
+ ...options.headers
2290
+ }
2291
+ });
2292
+ /**
2293
+ * List a function's secrets
2294
+ *
2295
+ * Returns metadata for every secret bound to the function, with
2296
+ * managed entries (provisioned by Primitive) listed first and
2297
+ * user-set entries listed alphabetically after. **Values are
2298
+ * never returned.** Secret writes are write-only.
2299
+ *
2300
+ * Managed entries (e.g. `PRIMITIVE_WEBHOOK_SECRET`,
2301
+ * `PRIMITIVE_API_KEY`, `PRIMITIVE_API_BASE_URL`) carry a
2302
+ * `description` instead of `created_at` / `updated_at`. They
2303
+ * cannot be created, updated, or deleted via this API.
2304
+ *
2305
+ */
2306
+ const listFunctionSecrets = (options) => (options.client ?? client).get({
2307
+ security: [{
2308
+ scheme: "bearer",
2309
+ type: "http"
2310
+ }],
2311
+ url: "/functions/{id}/secrets",
2312
+ ...options
2313
+ });
2314
+ /**
2315
+ * Create or update a secret
2316
+ *
2317
+ * Idempotent insert-or-update keyed on `(function_id, key)`.
2318
+ * Returns 201 the first time the key is set, 200 on subsequent
2319
+ * updates. Values are encrypted at rest and only become visible
2320
+ * to the running handler on the next deploy (`PUT /functions/{id}`
2321
+ * with the existing code is sufficient to refresh bindings).
2322
+ *
2323
+ * Keys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,
2324
+ * digits, underscores; first character is a letter or
2325
+ * underscore). Values are at most 4096 UTF-8 bytes. System-
2326
+ * managed keys are reserved and rejected.
2327
+ *
2328
+ */
2329
+ const createFunctionSecret = (options) => (options.client ?? client).post({
2330
+ security: [{
2331
+ scheme: "bearer",
2332
+ type: "http"
2333
+ }],
2334
+ url: "/functions/{id}/secrets",
2335
+ ...options,
2336
+ headers: {
2337
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2338
+ ...options.headers
2339
+ }
2340
+ });
2341
+ /**
2342
+ * Delete a secret
2343
+ *
2344
+ * Removes the secret. The binding stays live in the running
2345
+ * handler until the next deploy refreshes the binding set
2346
+ * (`PUT /functions/{id}` with the existing code is sufficient).
2347
+ * Returns 404 if the key did not exist. Managed system keys
2348
+ * cannot be deleted.
2349
+ *
2350
+ */
2351
+ const deleteFunctionSecret = (options) => (options.client ?? client).delete({
2352
+ security: [{
2353
+ scheme: "bearer",
2354
+ type: "http"
2355
+ }],
2356
+ url: "/functions/{id}/secrets/{key}",
2357
+ ...options
2358
+ });
2359
+ /**
2360
+ * Set a secret by key
2361
+ *
2362
+ * Path-keyed companion to `POST /functions/{id}/secrets`.
2363
+ * Idempotent: returns 201 the first time the key is set, 200 on
2364
+ * subsequent updates. Same validation rules and same write-only
2365
+ * guarantees as the POST verb; the new value lands in the running
2366
+ * handler on the next deploy.
2367
+ *
2368
+ */
2369
+ const setFunctionSecret = (options) => (options.client ?? client).put({
2370
+ security: [{
2371
+ scheme: "bearer",
2372
+ type: "http"
2373
+ }],
2374
+ url: "/functions/{id}/secrets/{key}",
2375
+ ...options,
2376
+ headers: {
2377
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2378
+ ...options.headers
2379
+ }
2380
+ });
2381
+ /**
2382
+ * List org-level (global) secrets
2383
+ *
2384
+ * Returns metadata for every org-level secret. Org secrets apply
2385
+ * to every function in the org and are read as `env.<KEY>` in
2386
+ * handlers. **Values are never returned.** Secret writes are
2387
+ * write-only. A function-level secret of the same name overrides
2388
+ * the org-level value for that function.
2389
+ *
2390
+ */
2391
+ const listOrgSecrets = (options) => (options?.client ?? client).get({
2392
+ security: [{
2393
+ scheme: "bearer",
2394
+ type: "http"
2395
+ }],
2396
+ url: "/org/secrets",
2397
+ ...options
2398
+ });
2399
+ /**
2400
+ * Create or update an org secret
2401
+ *
2402
+ * Idempotent insert-or-update keyed on `(org_id, key)`. Returns
2403
+ * 201 the first time the key is set, 200 on subsequent updates.
2404
+ * Values are encrypted at rest. A changed value lands in a
2405
+ * function only on that function's next deploy.
2406
+ *
2407
+ * Keys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,
2408
+ * digits, underscores; first character is a letter or
2409
+ * underscore). Values are at most 4096 UTF-8 bytes. System-
2410
+ * managed keys are reserved and rejected.
2411
+ *
2412
+ */
2413
+ const createOrgSecret = (options) => (options.client ?? client).post({
2414
+ security: [{
2415
+ scheme: "bearer",
2416
+ type: "http"
2417
+ }],
2418
+ url: "/org/secrets",
2419
+ ...options,
2420
+ headers: {
2421
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2422
+ ...options.headers
2423
+ }
2424
+ });
2425
+ /**
2426
+ * Delete an org secret
2427
+ *
2428
+ * Removes the org secret. Functions keep the previous value until
2429
+ * each is redeployed. Returns 404 if the key did not exist.
2430
+ *
2431
+ */
2432
+ const deleteOrgSecret = (options) => (options.client ?? client).delete({
2433
+ security: [{
2434
+ scheme: "bearer",
2435
+ type: "http"
2436
+ }],
2437
+ url: "/org/secrets/{key}",
2438
+ ...options
2439
+ });
2440
+ /**
2441
+ * Set an org secret by key
2442
+ *
2443
+ * Path-keyed companion to `POST /org/secrets`. Idempotent:
2444
+ * returns 201 the first time the key is set, 200 on subsequent
2445
+ * updates. Same validation and write-only guarantees as POST.
2446
+ *
2447
+ */
2448
+ const setOrgSecret = (options) => (options.client ?? client).put({
2449
+ security: [{
2450
+ scheme: "bearer",
2451
+ type: "http"
2452
+ }],
2453
+ url: "/org/secrets/{key}",
2454
+ ...options,
2455
+ headers: {
2456
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2457
+ ...options.headers
2458
+ }
2459
+ });
2460
+ /**
2461
+ * List a function's execution logs
2462
+ *
2463
+ * Returns the most recent `function_logs` rows for the function,
2464
+ * newest first. Each row is a single `console.log` / `console.error`
2465
+ * invocation captured from the running handler.
2466
+ *
2467
+ * Page through history with the opaque `cursor` returned as
2468
+ * `next_cursor`; pass it back as the `cursor` query param on the
2469
+ * next call. `next_cursor` is `null` when there are no further
2470
+ * rows. The cursor format is an implementation detail and should
2471
+ * not be parsed by callers.
2472
+ *
2473
+ */
2474
+ const listFunctionLogs = (options) => (options.client ?? client).get({
2475
+ security: [{
2476
+ scheme: "bearer",
2477
+ type: "http"
2478
+ }],
2479
+ url: "/functions/{id}/logs",
2480
+ ...options
2481
+ });
2482
+ /**
2483
+ * Delete a memory
2484
+ *
2485
+ * Delete one active memory by key and scope. Deletes are idempotent when
2486
+ * `if_version` is omitted: deleting a missing key returns `deleted:
2487
+ * false`. With `if_version`, a missing key still returns `deleted: false`,
2488
+ * but a stale version returns `memory_conflict`.
2489
+ *
2490
+ * A successful delete records memory write usage.
2491
+ *
2492
+ */
2493
+ const deleteMemory = (options) => (options.client ?? client).delete({
2494
+ security: [{
2495
+ scheme: "bearer",
2496
+ type: "http"
2497
+ }],
2498
+ url: "/memories",
2499
+ ...options
2500
+ });
2501
+ /**
2502
+ * Get a memory
2503
+ *
2504
+ * Fetch one active memory by key and scope. Omit scope parameters to use
2505
+ * the automatic default: function-authenticated context, then the
2506
+ * `x-primitive-function-id` header, then org scope. Function scope uses a
2507
+ * function id UUID in `scope_id`.
2508
+ *
2509
+ * A successful read records memory read usage and updates the memory's
2510
+ * read stats asynchronously.
2511
+ *
2512
+ */
2513
+ const getMemory = (options) => (options.client ?? client).get({
2514
+ security: [{
2515
+ scheme: "bearer",
2516
+ type: "http"
2517
+ }],
2518
+ url: "/memories",
2519
+ ...options
2520
+ });
2521
+ /**
2522
+ * Set a memory
2523
+ *
2524
+ * Create or update a durable JSON memory under an org or function scope.
2525
+ * When no explicit scope is provided, function-authenticated requests
2526
+ * use that function's id automatically; requests with
2527
+ * `x-primitive-function-id` use that function id; all other requests
2528
+ * default to org scope.
2529
+ *
2530
+ * `scope.type = function` requires the function id UUID in `scope.id`.
2531
+ * Function names are not accepted as scope identifiers. Values must be
2532
+ * valid JSON and serialize to at most 65536 UTF-8 bytes. Keys must be at
2533
+ * most 512 UTF-8 bytes. `version`, `read_count`, and `write_count` are
2534
+ * bigint counters serialized as strings.
2535
+ *
2536
+ * Passing `if_absent` turns the write into create-only. Passing
2537
+ * `if_version` turns the write into compare-and-set. These options are
2538
+ * mutually exclusive and return `memory_conflict` on a stale version or
2539
+ * existing key.
2540
+ *
2541
+ */
2542
+ const setMemory = (options) => (options.client ?? client).put({
2543
+ security: [{
2544
+ scheme: "bearer",
2545
+ type: "http"
2546
+ }],
2547
+ url: "/memories",
2548
+ ...options,
2549
+ headers: {
2550
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2551
+ ...options.headers
2552
+ }
2553
+ });
2554
+ /**
2555
+ * Search memories
2556
+ *
2557
+ * List active memories in a scope by lexicographic key prefix. Results
2558
+ * are ordered by key ascending. The `meta.cursor` value is the next key
2559
+ * cursor; pass it back as `cursor` to continue after that key.
2560
+ *
2561
+ * Search records one memory read usage event for the operation. Pass
2562
+ * `include_value=false` to return metadata only.
2563
+ *
2564
+ */
2565
+ const searchMemories = (options) => (options?.client ?? client).get({
2566
+ security: [{
2567
+ scheme: "bearer",
2568
+ type: "http"
2569
+ }],
2570
+ url: "/memories/search",
2571
+ ...options
2572
+ });
2573
+ /**
2574
+ * List function templates
2575
+ *
2576
+ * List approved Function templates available for browsing and
2577
+ * installation. Results are cacheable and paginated with
2578
+ * `data.next_cursor`.
2579
+ *
2580
+ */
2581
+ const listTemplates = (options) => (options?.client ?? client).get({
2582
+ url: "/templates",
2583
+ ...options
2584
+ });
2585
+ /**
2586
+ * Get a function template
2587
+ *
2588
+ * Fetch one approved Function template by slug, including its manifest
2589
+ * snapshot and README. The stored source files used for install are not
2590
+ * returned.
2591
+ *
2592
+ */
2593
+ const getTemplate = (options) => (options.client ?? client).get({
2594
+ url: "/templates/{id}",
2595
+ ...options
2596
+ });
2597
+ /**
2598
+ * Install a function template
2599
+ *
2600
+ * Start a one-shot deploy of an approved deploy-mode Function template.
2601
+ * The response returns an install record immediately; poll
2602
+ * `GET /templates/installs/{id}` for progress.
2603
+ *
2604
+ */
2605
+ const installTemplate = (options) => (options.client ?? client).post({
2606
+ security: [{
2607
+ scheme: "bearer",
2608
+ type: "http"
2609
+ }],
2610
+ url: "/templates/{id}/install",
2611
+ ...options,
2612
+ headers: {
2613
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2614
+ ...options.headers
2615
+ }
2616
+ });
2617
+ /**
2618
+ * Get template install status
2619
+ *
2620
+ * Fetch the current state of a template install. Reads may advance the
2621
+ * self-test phase when a reply effect has been observed.
2622
+ *
2623
+ */
2624
+ const getTemplateInstall = (options) => (options.client ?? client).get({
2625
+ security: [{
2626
+ scheme: "bearer",
2627
+ type: "http"
2628
+ }],
2629
+ url: "/templates/installs/{id}",
2630
+ ...options
2631
+ });
2632
+ /**
2633
+ * List payout addresses
2634
+ *
2635
+ * List your org's registered payout addresses, newest first.
2636
+ */
2637
+ const listPayoutAddresses = (options) => (options?.client ?? client).get({
2638
+ security: [{
2639
+ scheme: "bearer",
2640
+ type: "http"
2641
+ }],
2642
+ url: "/x402/payout-addresses",
2643
+ ...options
2644
+ });
2645
+ /**
2646
+ * Register a payout address
2647
+ *
2648
+ * Register (or update) the default payout address your org receives x402
2649
+ * payments at, for a given network. You prove control of the address with
2650
+ * an org-bound `personal_sign` signature over the message produced by the
2651
+ * SDK helper `buildPayoutRegistrationMessage`. The org id is taken from your
2652
+ * authenticated key, never the body, so a captured signature can't register
2653
+ * an address under another org. Exactly one default address exists per
2654
+ * (org, network); registering again replaces it. A payee MUST register a
2655
+ * payout address before calling `createChallenge`, because the challenge's
2656
+ * `pay_to` is resolved from this directory.
2657
+ *
2658
+ */
2659
+ const registerPayoutAddress = (options) => (options.client ?? client).post({
2660
+ security: [{
2661
+ scheme: "bearer",
2662
+ type: "http"
2663
+ }],
2664
+ url: "/x402/payout-addresses",
2665
+ ...options,
2666
+ headers: {
2667
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2668
+ ...options.headers
2669
+ }
2670
+ });
2671
+ /**
2672
+ * Create an email-native payment challenge
2673
+ *
2674
+ * Issue an x402 payment challenge over a real email thread (the payee
2675
+ * side). Unlike `createChallenge` (which mints a synthetic challenge id),
2676
+ * this sends the challenge as an email from `from` to `to` and binds the
2677
+ * payment to that DKIM-authenticated thread. The `pay_to` address and the
2678
+ * token asset are resolved server-side from your registered default payout
2679
+ * address for the network, never from the request. The response carries
2680
+ * the thread's `interaction_id` plus the `challenge` (the
2681
+ * `payment_requirements`, the `nonce_binding`, and `expires_at`) the payer
2682
+ * needs to sign; the payer replies with a signed `payment` interaction
2683
+ * step. Amounts are in token base units (USDC has 6 decimals, so `"10000"`
2684
+ * is 0.01 USDC).
2685
+ *
2686
+ */
2687
+ const createEmailChallenge = (options) => (options.client ?? client).post({
2688
+ security: [{
2689
+ scheme: "bearer",
2690
+ type: "http"
2691
+ }],
2692
+ url: "/x402/email-challenges",
2693
+ ...options,
2694
+ headers: {
2695
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2696
+ ...options.headers
2697
+ }
2698
+ });
2699
+ /**
2700
+ * Create a payment challenge
2701
+ *
2702
+ * Create an x402 payment challenge (the payee side of a payment). The
2703
+ * `pay_to` address is resolved server-side from your registered default
2704
+ * payout address for the network, never from the request. The response
2705
+ * carries the `nonce_binding` and `payment_requirements` the payer needs to
2706
+ * sign; hand the whole challenge object to the payer (for example in an
2707
+ * email reply). Amounts are in token base units (USDC has 6 decimals, so
2708
+ * `"10000"` is 0.01 USDC).
2709
+ *
2710
+ */
2711
+ const createChallenge = (options) => (options.client ?? client).post({
2712
+ security: [{
2713
+ scheme: "bearer",
2714
+ type: "http"
2715
+ }],
2716
+ url: "/x402/challenges",
2717
+ ...options,
2718
+ headers: {
2719
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2720
+ ...options.headers
2721
+ }
2722
+ });
2723
+ /**
2724
+ * Get a payment challenge
2725
+ *
2726
+ * Fetch a challenge you created, to poll its `status` and settlement
2727
+ * receipt (`settle_tx`). Scoped to the challenger org that created it.
2728
+ *
2729
+ */
2730
+ const getChallenge = (options) => (options.client ?? client).get({
2731
+ security: [{
2732
+ scheme: "bearer",
2733
+ type: "http"
2734
+ }],
2735
+ url: "/x402/challenges/{id}",
2736
+ ...options
2737
+ });
2738
+ /**
2739
+ * Pay a payment challenge
2740
+ *
2741
+ * Settle a challenge addressed to your org as payer. The request body
2742
+ * carries a signed x402 `PaymentPayload`: an EIP-3009
2743
+ * `transferWithAuthorization` signed locally with your own key, whose nonce
2744
+ * is bound to the challenge via the SDK's `deriveEip3009Nonce`. The platform
2745
+ * verifies every signed field against its own record of the challenge,
2746
+ * applies your spend policy, and settles on-chain through a facilitator.
2747
+ * Settlement is non-custodial; Primitive never holds funds. Idempotent:
2748
+ * paying an already-settled challenge returns the original receipt. Most
2749
+ * callers use the SDK `pay()` helper rather than building the payload by
2750
+ * hand.
2751
+ *
2752
+ */
2753
+ const payChallenge = (options) => (options.client ?? client).post({
2754
+ security: [{
2755
+ scheme: "bearer",
2756
+ type: "http"
2757
+ }],
2758
+ url: "/x402/challenges/{id}/pay",
2759
+ ...options,
2760
+ headers: {
2761
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2762
+ ...options.headers
2763
+ }
2764
+ });
2765
+ /**
2766
+ * Get your spend policy
2767
+ *
2768
+ * Read your org's outbound spend policy: the kill-switch, per-payment and
2769
+ * per-day caps, and the payee allowlist. Returns the defaults (no limits,
2770
+ * not paused) when no policy has been set.
2771
+ *
2772
+ */
2773
+ const getSpendPolicy = (options) => (options?.client ?? client).get({
2774
+ security: [{
2775
+ scheme: "bearer",
2776
+ type: "http"
2777
+ }],
2778
+ url: "/x402/spend-policy",
2779
+ ...options
2780
+ });
2781
+ /**
2782
+ * Update your spend policy
2783
+ *
2784
+ * Update your org's spend policy. Applied as a merge: only the fields you
2785
+ * include change, and omitted fields keep their current value, so a partial
2786
+ * update can't silently reset the kill-switch. Send an explicit `null` to
2787
+ * clear a cap. Caps are in token base units.
2788
+ *
2789
+ */
2790
+ const updateSpendPolicy = (options) => (options.client ?? client).put({
2791
+ security: [{
2792
+ scheme: "bearer",
2793
+ type: "http"
2794
+ }],
2795
+ url: "/x402/spend-policy",
2796
+ ...options,
2797
+ headers: {
2798
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2799
+ ...options.headers
2800
+ }
2801
+ });
2802
+ /**
2803
+ * List declined payments
2804
+ *
2805
+ * The 50 most recent payments your org's spend policy declined, newest
2806
+ * first. Use this to see why an outbound payment was refused (a cap, the
2807
+ * payee allowlist, or the kill-switch) instead of only reading the
2808
+ * dashboard.
2809
+ *
2810
+ */
2811
+ const listDeclinedPayments = (options) => (options?.client ?? client).get({
2812
+ security: [{
2813
+ scheme: "bearer",
2814
+ type: "http"
2815
+ }],
2816
+ url: "/x402/declined-payments",
2817
+ ...options
2818
+ });
2819
+ /**
2820
+ * List your organization's agent networks
2821
+ *
2822
+ * An organization member login or an active connected agent allowed to see the network can read networks. The default organization network is always present. can_manage_all is true only for a current owner or admin; a connected credential receives false.
2823
+ */
2824
+ const listAgentNetworks = (options) => (options?.client ?? client).get({
2825
+ security: [{
2826
+ scheme: "bearer",
2827
+ type: "http"
2828
+ }],
2829
+ url: "/agent-networks",
2830
+ ...options
2831
+ });
2832
+ /**
2833
+ * List default network memberships available to your login
2834
+ *
2835
+ * An owner or admin sees all connected addresses, including hidden and excluded members. Other human members see only personal addresses owned by their current membership. Filtering happens before pagination. Connected-agent credentials cannot read this roster. Each row includes whether the requester can manage it.
2836
+ */
2837
+ const listDefaultNetworkMembers = (options) => (options?.client ?? client).get({
2838
+ security: [{
2839
+ scheme: "bearer",
2840
+ type: "http"
2841
+ }],
2842
+ url: "/agent-networks/default/members",
2843
+ ...options
2844
+ });
2845
+ /**
2846
+ * Remove an agent from the default network
2847
+ *
2848
+ * Owner or admin login required. The explicit exclusion persists across synchronization.
2849
+ */
2850
+ const removeDefaultNetworkMember = (options) => (options.client ?? client).delete({
2851
+ security: [{
2852
+ scheme: "bearer",
2853
+ type: "http"
2854
+ }],
2855
+ url: "/agent-networks/default/members/{address}",
2856
+ ...options
2857
+ });
2858
+ /**
2859
+ * Change whether an agent can see or be seen in the network
2860
+ *
2861
+ * An owner or admin may update any active address. Other human members may update only their own current, non-excluded personal address. Connected-agent credentials cannot update visibility. Omitted settings keep their current value.
2862
+ */
2863
+ const updateDefaultNetworkMember = (options) => (options.client ?? client).patch({
2864
+ security: [{
2865
+ scheme: "bearer",
2866
+ type: "http"
2867
+ }],
2868
+ url: "/agent-networks/default/members/{address}",
2869
+ ...options,
2870
+ headers: {
2871
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2872
+ ...options.headers
2873
+ }
2874
+ });
2875
+ /**
2876
+ * Add an agent to the default network
2877
+ *
2878
+ * Owner or admin login required. Restores an explicitly excluded member.
2879
+ */
2880
+ const addDefaultNetworkMember = (options) => (options.client ?? client).post({
2881
+ security: [{
2882
+ scheme: "bearer",
2883
+ type: "http"
2884
+ }],
2885
+ url: "/agent-networks/default/members/{address}",
2886
+ ...options
2887
+ });
2888
+ /**
2889
+ * Discover listed agents in your organization network
2890
+ *
2891
+ * Requires a connected-agent credential for an active member allowed to see the network, or an organization member login.
2892
+ */
2893
+ const listDefaultNetworkAgents = (options) => (options?.client ?? client).get({
2894
+ security: [{
2895
+ scheme: "bearer",
2896
+ type: "http"
2897
+ }],
2898
+ url: "/agent-networks/default/agents",
2899
+ ...options
2900
+ });
2901
+ /**
2902
+ * Get a listed agent by email address
2903
+ *
2904
+ * Requires a connected-agent credential allowed to see the network, or an organization member login. Unlisted agents look absent.
2905
+ */
2906
+ const getDefaultNetworkAgent = (options) => (options.client ?? client).get({
2907
+ security: [{
2908
+ scheme: "bearer",
2909
+ type: "http"
2910
+ }],
2911
+ url: "/agent-networks/default/agents/{address}",
2912
+ ...options
2913
+ });
2914
+ /**
2915
+ * Check whether network mail may wake this connected agent
2916
+ *
2917
+ * Requires the recipient's connected-agent credential. The recipient
2918
+ * address is derived from that credential. The email ID must identify
2919
+ * accepted or completed inbound mail for that exact recipient, with
2920
+ * matching stored sender and delivery evidence. Returns no sender profile
2921
+ * or existence detail. Clients must also verify the email detail's sender
2922
+ * provenance and respect explicit contact silence before using the result.
2923
+ * Network wake requires the sender to be connected and able to view the
2924
+ * network, and the recipient to be connected and listed. The sender need
2925
+ * not be listed and the recipient need not view the network. Ordinary
2926
+ * known-address email remains independent. Mail received before
2927
+ * allowed_since cannot be newly admitted.
2928
+ *
2929
+ */
2930
+ const checkDefaultNetworkContactAdmission = (options) => (options.client ?? client).post({
2931
+ security: [{
2932
+ scheme: "bearer",
2933
+ type: "http"
2934
+ }],
2935
+ url: "/agent-networks/default/contact-admission",
2936
+ ...options,
2937
+ headers: {
2938
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2939
+ ...options.headers
2940
+ }
2941
+ });
2942
+ /**
2943
+ * List the registries you own
2944
+ */
2945
+ const listRegistries = (options) => (options?.client ?? client).get({
2946
+ security: [{
2947
+ scheme: "bearer",
2948
+ type: "http"
2949
+ }],
2950
+ url: "/registries",
2951
+ ...options
2952
+ });
2953
+ /**
2954
+ * Create a registry
2955
+ */
2956
+ const createRegistry = (options) => (options.client ?? client).post({
2957
+ security: [{
2958
+ scheme: "bearer",
2959
+ type: "http"
2960
+ }],
2961
+ url: "/registries",
2962
+ ...options,
2963
+ headers: {
2964
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
2965
+ ...options.headers
2966
+ }
2967
+ });
2968
+ /**
2969
+ * Delete a registry you own
2970
+ *
2971
+ * Removes the registry from discovery and frees its slug for re-creation.
2972
+ */
2973
+ const deleteRegistry = (options) => (options.client ?? client).delete({
2974
+ security: [{
2975
+ scheme: "bearer",
2976
+ type: "http"
2977
+ }],
2978
+ url: "/registries/{slug}",
2979
+ ...options
2980
+ });
2981
+ /**
2982
+ * Get a public registry's metadata
2983
+ */
2984
+ const getRegistry = (options) => (options.client ?? client).get({
2985
+ url: "/registries/{slug}",
2986
+ ...options
2987
+ });
2988
+ /**
2989
+ * Update a registry you own
2990
+ */
2991
+ const updateRegistry = (options) => (options.client ?? client).patch({
2992
+ security: [{
2993
+ scheme: "bearer",
2994
+ type: "http"
2995
+ }],
2996
+ url: "/registries/{slug}",
2997
+ ...options,
2998
+ headers: {
2999
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3000
+ ...options.headers
3001
+ }
3002
+ });
3003
+ /**
3004
+ * List agents in a registry
3005
+ */
3006
+ const listRegistryAgents = (options) => (options.client ?? client).get({
3007
+ url: "/registries/{slug}/agents",
3008
+ ...options
3009
+ });
3010
+ /**
3011
+ * Publish an agent into a registry
3012
+ */
3013
+ const publishAgent = (options) => (options.client ?? client).post({
3014
+ security: [{
3015
+ scheme: "bearer",
3016
+ type: "http"
3017
+ }],
3018
+ url: "/registries/{slug}/agents",
3019
+ ...options,
3020
+ headers: {
3021
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3022
+ ...options.headers
3023
+ }
3024
+ });
3025
+ /**
3026
+ * Unpublish an agent from a registry
3027
+ */
3028
+ const unpublishAgent = (options) => (options.client ?? client).delete({
3029
+ security: [{
3030
+ scheme: "bearer",
3031
+ type: "http"
3032
+ }],
3033
+ url: "/registries/{slug}/agents/{handle}",
3034
+ ...options
3035
+ });
3036
+ /**
3037
+ * Resolve a registry handle to its agent
3038
+ */
3039
+ const resolveRegistryHandle = (options) => (options.client ?? client).get({
3040
+ url: "/registries/{slug}/agents/{handle}",
3041
+ ...options
3042
+ });
3043
+ /**
3044
+ * List pending publication requests
3045
+ */
3046
+ const listRegistryRequests = (options) => (options.client ?? client).get({
3047
+ security: [{
3048
+ scheme: "bearer",
3049
+ type: "http"
3050
+ }],
3051
+ url: "/registries/{slug}/requests",
3052
+ ...options
3053
+ });
3054
+ /**
3055
+ * Approve or reject a publication request
3056
+ */
3057
+ const decideRegistryRequest = (options) => (options.client ?? client).post({
3058
+ security: [{
3059
+ scheme: "bearer",
3060
+ type: "http"
3061
+ }],
3062
+ url: "/registries/{slug}/requests/{id}",
3063
+ ...options,
3064
+ headers: {
3065
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3066
+ ...options.headers
3067
+ }
3068
+ });
3069
+ /**
3070
+ * Define an agent identity
3071
+ */
3072
+ const defineAgent = (options) => (options.client ?? client).post({
3073
+ security: [{
3074
+ scheme: "bearer",
3075
+ type: "http"
3076
+ }],
3077
+ url: "/agents",
3078
+ ...options,
3079
+ headers: {
3080
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3081
+ ...options.headers
3082
+ }
3083
+ });
3084
+ /**
3085
+ * Get an agent's public profile by address
3086
+ */
3087
+ const getAgent = (options) => (options.client ?? client).get({
3088
+ url: "/agents/{address}",
3089
+ ...options
3090
+ });
3091
+ /**
3092
+ * list Contacts
3093
+ *
3094
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3095
+ */
3096
+ const listContacts = (options) => (options?.client ?? client).get({
3097
+ security: [{
3098
+ scheme: "bearer",
3099
+ type: "http"
3100
+ }],
3101
+ url: "/contacts",
3102
+ ...options
3103
+ });
3104
+ /**
3105
+ * delete Contact
3106
+ *
3107
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3108
+ */
3109
+ const deleteContact = (options) => (options.client ?? client).delete({
3110
+ security: [{
3111
+ scheme: "bearer",
3112
+ type: "http"
3113
+ }],
3114
+ url: "/contacts/{address}",
3115
+ ...options
3116
+ });
3117
+ /**
3118
+ * get Contact
3119
+ *
3120
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3121
+ */
3122
+ const getContact = (options) => (options.client ?? client).get({
3123
+ security: [{
3124
+ scheme: "bearer",
3125
+ type: "http"
3126
+ }],
3127
+ url: "/contacts/{address}",
3128
+ ...options
3129
+ });
3130
+ /**
3131
+ * put Contact
3132
+ *
3133
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3134
+ */
3135
+ const putContact = (options) => (options.client ?? client).put({
3136
+ security: [{
3137
+ scheme: "bearer",
3138
+ type: "http"
3139
+ }],
3140
+ url: "/contacts/{address}",
3141
+ ...options,
3142
+ headers: {
3143
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3144
+ ...options.headers
3145
+ }
3146
+ });
3147
+ /**
3148
+ * list Agent Contacts
3149
+ *
3150
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3151
+ */
3152
+ const listAgentContacts = (options) => (options.client ?? client).get({
3153
+ security: [{
3154
+ scheme: "bearer",
3155
+ type: "http"
3156
+ }],
3157
+ url: "/agent-contacts/{agent_address}",
3158
+ ...options
3159
+ });
3160
+ /**
3161
+ * delete Agent Contact
3162
+ *
3163
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3164
+ */
3165
+ const deleteAgentContact = (options) => (options.client ?? client).delete({
3166
+ security: [{
3167
+ scheme: "bearer",
3168
+ type: "http"
3169
+ }],
3170
+ url: "/agent-contacts/{agent_address}/{contact_address}",
3171
+ ...options
3172
+ });
3173
+ /**
3174
+ * put Agent Contact
3175
+ *
3176
+ * Organization directory and agent preferences; no profiles, message history or runtime presence. Existing organization credentials use tenant permissions. Connected keys may read the directory, create address-only missing contacts using if_absent:true, and access only their own agent memberships; they cannot edit shared labels or delete directory entries. Function credentials are not granted access. Memberships require an existing local agent connection (including revoked connections) and an existing contact. PUT requires exactly one precondition. if_absent returns an existing row unchanged when supplied fields agree; otherwise 409. notify defaults false. Off-to-on generates a new server timestamp and generation; on-to-on and purpose-only edits preserve them. Disable clears activation metadata. Deletion atomically removes membership eligibility. Receivers must recheck generation/preferences before dispatch and pause admission when their policy cache is older than 30 seconds; explicit reply waits are independent. DELETE requires if_version, returns deleted:false for an absent row, and rejects stale versions of recreated rows. Pages use ascending canonical address, with meta.cursor null on the last page. Lists are live pages, not snapshots.
3177
+ */
3178
+ const putAgentContact = (options) => (options.client ?? client).put({
3179
+ security: [{
3180
+ scheme: "bearer",
3181
+ type: "http"
3182
+ }],
3183
+ url: "/agent-contacts/{agent_address}/{contact_address}",
3184
+ ...options,
3185
+ headers: {
3186
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3187
+ ...options.headers
3188
+ }
3189
+ });
3190
+ /**
3191
+ * Read organization contact policy
3192
+ *
3193
+ * Receiver-side email notification admission preferences; never task, tool, code execution or account authority. Rules take effect only in receivers implementing this current contact-policy contract. Older receivers may continue their previous exact-contact notifications until updated. Ordinary email delivery, storage, webhooks and explicit reply waits remain independent of these preferences. Organization owners/admins using session, OAuth or signed dashboard credentials may read/write policies. Connected credentials may only GET their own agent composite; they cannot write either policy. Function and signed capability credentials are not granted access. Rules are unordered. Exact membership notify:false always silences. Next use matching agent rules, otherwise matching organization rules; silence wins ties within that scope. If neither scope matches, existing exact membership notify:true allows using its own activation metadata; otherwise only enabled contact-request intake is allowed. Owner policy silence therefore cannot be bypassed by a connected agent adding a notify:true membership. Patterns are canonical lowercase bare mailboxes, *@example.com, research-*@example.com or *@*.example.com. Only a terminal local-part * and a leading whole domain-label *. are supported; subdomain patterns exclude the apex and require a literal multi-label suffix. No regular expressions, question marks, universal domains or wildcard TLDs. Domain-only UI input must be converted to *@domain. PUT fully replaces up to 100 rules and the request-intake option using exactly one CAS precondition. Duplicate pattern/effect pairs are rejected. if_absent returns an identical existing document, otherwise 409. A missing document reads as empty rules, null version/timestamps, false request intake for the organization and null (inherit) for the agent. Reset overrides with empty rules and null request intake. Allow rules preserve server activation metadata while retained unchanged; removing/recreating or changing a rule to allow resets it. Request intake defaults off; agent null inherits the organization. No-op writes preserve versions. Agent composite effective_version changes with either policy document, connection identity, generation or successful claim; effective_since is the latest policy mutation, connection creation or successful claim. Reclaiming a connection invalidates prior admission snapshots and starts a fresh rule/request cutoff; routine heartbeats do not. Rule/request admissions require received_at >= both the selected activation time and effective_since. Consequently even unrelated policy edits suppress queued older rule/request admissions, without deleting email history or affecting explicit reply waits. Exact membership fallback retains its own notify_since and generation but must still recheck current policy denies and effective_version. Before dispatch, receivers must recheck the current composite version and applicable activation generation and membership; stop new admissions when policy is unavailable or older than 30 seconds. Snapshot fields explain scope and matched rules locally; the API does not execute tasks or dispatch notifications.
3194
+ */
3195
+ const getContactPolicy = (options) => (options?.client ?? client).get({
3196
+ security: [{
3197
+ scheme: "bearer",
3198
+ type: "http"
3199
+ }],
3200
+ url: "/contact-policy",
3201
+ ...options
3202
+ });
3203
+ /**
3204
+ * Replace organization contact policy
3205
+ *
3206
+ * Receiver-side email notification admission preferences; never task, tool, code execution or account authority. Rules take effect only in receivers implementing this current contact-policy contract. Older receivers may continue their previous exact-contact notifications until updated. Ordinary email delivery, storage, webhooks and explicit reply waits remain independent of these preferences. Organization owners/admins using session, OAuth or signed dashboard credentials may read/write policies. Connected credentials may only GET their own agent composite; they cannot write either policy. Function and signed capability credentials are not granted access. Rules are unordered. Exact membership notify:false always silences. Next use matching agent rules, otherwise matching organization rules; silence wins ties within that scope. If neither scope matches, existing exact membership notify:true allows using its own activation metadata; otherwise only enabled contact-request intake is allowed. Owner policy silence therefore cannot be bypassed by a connected agent adding a notify:true membership. Patterns are canonical lowercase bare mailboxes, *@example.com, research-*@example.com or *@*.example.com. Only a terminal local-part * and a leading whole domain-label *. are supported; subdomain patterns exclude the apex and require a literal multi-label suffix. No regular expressions, question marks, universal domains or wildcard TLDs. Domain-only UI input must be converted to *@domain. PUT fully replaces up to 100 rules and the request-intake option using exactly one CAS precondition. Duplicate pattern/effect pairs are rejected. if_absent returns an identical existing document, otherwise 409. A missing document reads as empty rules, null version/timestamps, false request intake for the organization and null (inherit) for the agent. Reset overrides with empty rules and null request intake. Allow rules preserve server activation metadata while retained unchanged; removing/recreating or changing a rule to allow resets it. Request intake defaults off; agent null inherits the organization. No-op writes preserve versions. Agent composite effective_version changes with either policy document, connection identity, generation or successful claim; effective_since is the latest policy mutation, connection creation or successful claim. Reclaiming a connection invalidates prior admission snapshots and starts a fresh rule/request cutoff; routine heartbeats do not. Rule/request admissions require received_at >= both the selected activation time and effective_since. Consequently even unrelated policy edits suppress queued older rule/request admissions, without deleting email history or affecting explicit reply waits. Exact membership fallback retains its own notify_since and generation but must still recheck current policy denies and effective_version. Before dispatch, receivers must recheck the current composite version and applicable activation generation and membership; stop new admissions when policy is unavailable or older than 30 seconds. Snapshot fields explain scope and matched rules locally; the API does not execute tasks or dispatch notifications.
3207
+ */
3208
+ const putContactPolicy = (options) => (options.client ?? client).put({
3209
+ security: [{
3210
+ scheme: "bearer",
3211
+ type: "http"
3212
+ }],
3213
+ url: "/contact-policy",
3214
+ ...options,
3215
+ headers: {
3216
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3217
+ ...options.headers
3218
+ }
3219
+ });
3220
+ /**
3221
+ * Read agent contact policy
3222
+ *
3223
+ * Receiver-side email notification admission preferences; never task, tool, code execution or account authority. Rules take effect only in receivers implementing this current contact-policy contract. Older receivers may continue their previous exact-contact notifications until updated. Ordinary email delivery, storage, webhooks and explicit reply waits remain independent of these preferences. Organization owners/admins using session, OAuth or signed dashboard credentials may read/write policies. Connected credentials may only GET their own agent composite; they cannot write either policy. Function and signed capability credentials are not granted access. Rules are unordered. Exact membership notify:false always silences. Next use matching agent rules, otherwise matching organization rules; silence wins ties within that scope. If neither scope matches, existing exact membership notify:true allows using its own activation metadata; otherwise only enabled contact-request intake is allowed. Owner policy silence therefore cannot be bypassed by a connected agent adding a notify:true membership. Patterns are canonical lowercase bare mailboxes, *@example.com, research-*@example.com or *@*.example.com. Only a terminal local-part * and a leading whole domain-label *. are supported; subdomain patterns exclude the apex and require a literal multi-label suffix. No regular expressions, question marks, universal domains or wildcard TLDs. Domain-only UI input must be converted to *@domain. PUT fully replaces up to 100 rules and the request-intake option using exactly one CAS precondition. Duplicate pattern/effect pairs are rejected. if_absent returns an identical existing document, otherwise 409. A missing document reads as empty rules, null version/timestamps, false request intake for the organization and null (inherit) for the agent. Reset overrides with empty rules and null request intake. Allow rules preserve server activation metadata while retained unchanged; removing/recreating or changing a rule to allow resets it. Request intake defaults off; agent null inherits the organization. No-op writes preserve versions. Agent composite effective_version changes with either policy document, connection identity, generation or successful claim; effective_since is the latest policy mutation, connection creation or successful claim. Reclaiming a connection invalidates prior admission snapshots and starts a fresh rule/request cutoff; routine heartbeats do not. Rule/request admissions require received_at >= both the selected activation time and effective_since. Consequently even unrelated policy edits suppress queued older rule/request admissions, without deleting email history or affecting explicit reply waits. Exact membership fallback retains its own notify_since and generation but must still recheck current policy denies and effective_version. Before dispatch, receivers must recheck the current composite version and applicable activation generation and membership; stop new admissions when policy is unavailable or older than 30 seconds. Snapshot fields explain scope and matched rules locally; the API does not execute tasks or dispatch notifications.
3224
+ */
3225
+ const getAgentContactPolicy = (options) => (options.client ?? client).get({
3226
+ security: [{
3227
+ scheme: "bearer",
3228
+ type: "http"
3229
+ }],
3230
+ url: "/agent-contact-policy/{agent_address}",
3231
+ ...options
3232
+ });
3233
+ /**
3234
+ * Replace agent contact policy
3235
+ *
3236
+ * Receiver-side email notification admission preferences; never task, tool, code execution or account authority. Rules take effect only in receivers implementing this current contact-policy contract. Older receivers may continue their previous exact-contact notifications until updated. Ordinary email delivery, storage, webhooks and explicit reply waits remain independent of these preferences. Organization owners/admins using session, OAuth or signed dashboard credentials may read/write policies. Connected credentials may only GET their own agent composite; they cannot write either policy. Function and signed capability credentials are not granted access. Rules are unordered. Exact membership notify:false always silences. Next use matching agent rules, otherwise matching organization rules; silence wins ties within that scope. If neither scope matches, existing exact membership notify:true allows using its own activation metadata; otherwise only enabled contact-request intake is allowed. Owner policy silence therefore cannot be bypassed by a connected agent adding a notify:true membership. Patterns are canonical lowercase bare mailboxes, *@example.com, research-*@example.com or *@*.example.com. Only a terminal local-part * and a leading whole domain-label *. are supported; subdomain patterns exclude the apex and require a literal multi-label suffix. No regular expressions, question marks, universal domains or wildcard TLDs. Domain-only UI input must be converted to *@domain. PUT fully replaces up to 100 rules and the request-intake option using exactly one CAS precondition. Duplicate pattern/effect pairs are rejected. if_absent returns an identical existing document, otherwise 409. A missing document reads as empty rules, null version/timestamps, false request intake for the organization and null (inherit) for the agent. Reset overrides with empty rules and null request intake. Allow rules preserve server activation metadata while retained unchanged; removing/recreating or changing a rule to allow resets it. Request intake defaults off; agent null inherits the organization. No-op writes preserve versions. Agent composite effective_version changes with either policy document, connection identity, generation or successful claim; effective_since is the latest policy mutation, connection creation or successful claim. Reclaiming a connection invalidates prior admission snapshots and starts a fresh rule/request cutoff; routine heartbeats do not. Rule/request admissions require received_at >= both the selected activation time and effective_since. Consequently even unrelated policy edits suppress queued older rule/request admissions, without deleting email history or affecting explicit reply waits. Exact membership fallback retains its own notify_since and generation but must still recheck current policy denies and effective_version. Before dispatch, receivers must recheck the current composite version and applicable activation generation and membership; stop new admissions when policy is unavailable or older than 30 seconds. Snapshot fields explain scope and matched rules locally; the API does not execute tasks or dispatch notifications.
3237
+ */
3238
+ const putAgentContactPolicy = (options) => (options.client ?? client).put({
3239
+ security: [{
3240
+ scheme: "bearer",
3241
+ type: "http"
3242
+ }],
3243
+ url: "/agent-contact-policy/{agent_address}",
3244
+ ...options,
3245
+ headers: {
3246
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3247
+ ...options.headers
3248
+ }
3249
+ });
3250
+ /**
3251
+ * Get current caller identity
3252
+ *
3253
+ * Current authenticated identity. member_address is null for machine credentials or an unavailable member address.
3254
+ */
3255
+ const whoami = (options) => (options?.client ?? client).get({
3256
+ security: [{
3257
+ scheme: "bearer",
3258
+ type: "http"
3259
+ }],
3260
+ url: "/whoami",
3261
+ ...options
3262
+ });
3263
+ /**
3264
+ * Provision your member email address
3265
+ *
3266
+ * Provision or return this authenticated human member's stable managed address in this organization. API keys, connected agents and Functions cannot provision or impersonate humans. The owner explicitly chooses the address. Existing retained mail requires confirmation; reserved identities cannot be overridden. There is no target user input. An unavailable domain never silently changes the address.
3267
+ */
3268
+ const provisionMemberAddress = (options) => (options.client ?? client).put({
3269
+ security: [{
3270
+ scheme: "bearer",
3271
+ type: "http"
3272
+ }],
3273
+ url: "/account/member-address",
3274
+ ...options,
3275
+ headers: {
3276
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3277
+ ...options.headers
3278
+ }
3279
+ });
3280
+ //#endregion
3281
+ export { putAgentContactPolicy as $, getRepeatingSend as A, listEmails as B, getEmail as C, updateFunction as Ct, getInboxStatus as D, updateWakeSchedule as Dt, getFunctionTestRunTrace as E, updateWakeAuthorization as Et, listAgentNetworks as F, listRoutes as G, listFunctionLogs as H, listContacts as I, listWakeDispatches as J, listSentEmails as K, listDefaultNetworkAgents as L, getThread as M, getWakeSchedule as N, getMemory as O, verifyAgentClaim as Ot, listAgentContacts as P, putAgentContact as Q, listDefaultNetworkMembers as R, getDefaultNetworkAgent as S, updateDefaultNetworkMember as St, getFunctionRouting as T, updateRoute as Tt, listFunctions as U, listEndpoints as V, listRepeatingSends as W, pollCliLogin as X, listWakeSchedules as Y, pullWebhookEvent as Z, getAccount as _, startAgentSignup as _t, createEndpoint as a, resendAgentSignupVerification as at, getConversation as b, testFunction as bt, createWakeAuthorization as c, searchEmails as ct, deleteContact as d, sendEmail as dt, putContact as et, deleteMemory as f, setFunctionRoute as ft, downloadEmailAttachmentPart as g, startAgentClaim as gt, deleteWakeSchedule as h, simulateRoute as ht, completeWebhookEvent as i, replyToEmail as it, getSentEmail as j, getOrgRoutingTopology as k, verifyAgentSignup as kt, createWakeSchedule as l, searchMemories as lt, deleteWakeAuthorization as m, setMemory as mt, checkDefaultNetworkContactAdmission as n, removeDefaultNetworkMember as nt, createFunction as o, runWakeSchedule as ot, deleteRoute as p, setFunctionSecret as pt, listWakeAuthorizations as q, cliLogout as r, reorderRoutes as rt, createRoute as s, sdk_gen_exports as st, addDefaultNetworkMember as t, redeemCreditCode as tt, deleteAgentContact as u, semanticSearch as ut, getAgentContactPolicy as v, startCliLogin as vt, getFunction as w, updateRepeatingSend as wt, getCreditBalance as x, unsetFunctionRoute as xt, getContact as y, stopRepeatFromEmail as yt, listDomains as z };