@autenai/sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +77 -1
- package/dist/index.d.ts +77 -1
- package/dist/index.js +39 -0
- package/dist/index.mjs +39 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -351,6 +351,80 @@ declare class EventClient {
|
|
|
351
351
|
}): Promise<PollResult>;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Auten SDK — Conversations Client
|
|
356
|
+
*
|
|
357
|
+
* Create Slack ↔ Email conversation bridges with one API call.
|
|
358
|
+
* Auten handles everything: AI email generation, thread tracking,
|
|
359
|
+
* email replies back to Slack thread.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
interface CreateConversationOptions {
|
|
363
|
+
/** Customer's name */
|
|
364
|
+
customerName: string;
|
|
365
|
+
/** Customer's email */
|
|
366
|
+
customerEmail: string;
|
|
367
|
+
/** Customer's phone (optional) */
|
|
368
|
+
customerPhone?: string;
|
|
369
|
+
/** Subject or topic */
|
|
370
|
+
subject?: string;
|
|
371
|
+
/** Initial message from the customer */
|
|
372
|
+
message: string;
|
|
373
|
+
/** Slack channel to post to (default: #general) */
|
|
374
|
+
channel?: string;
|
|
375
|
+
/** Your brand/company name (used in AI-generated emails) */
|
|
376
|
+
brandName?: string;
|
|
377
|
+
/** Email signature (used in AI-generated emails) */
|
|
378
|
+
brandSignOff?: string;
|
|
379
|
+
}
|
|
380
|
+
interface Conversation {
|
|
381
|
+
conversationId: string;
|
|
382
|
+
customerName: string;
|
|
383
|
+
customerEmail: string;
|
|
384
|
+
subject: string | null;
|
|
385
|
+
status: 'new' | 'open' | 'replied' | 'closed';
|
|
386
|
+
messageCount: number;
|
|
387
|
+
createdAt: string;
|
|
388
|
+
updatedAt: string;
|
|
389
|
+
}
|
|
390
|
+
interface ConversationCreated {
|
|
391
|
+
conversationId: string;
|
|
392
|
+
slackChannel: string;
|
|
393
|
+
slackThreadTs: string;
|
|
394
|
+
customerEmail: string;
|
|
395
|
+
status: string;
|
|
396
|
+
message: string;
|
|
397
|
+
}
|
|
398
|
+
declare class ConversationClient {
|
|
399
|
+
private client;
|
|
400
|
+
constructor(client: HttpClient);
|
|
401
|
+
/**
|
|
402
|
+
* Create a new conversation bridge.
|
|
403
|
+
*
|
|
404
|
+
* This posts to Slack and sets up the full bridge:
|
|
405
|
+
* - You reply in Slack thread → AI generates professional email → sends to customer
|
|
406
|
+
* - Customer replies to email → appears in Slack thread
|
|
407
|
+
* - Repeat — full conversation via Slack
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* // From a contact form handler:
|
|
411
|
+
* const conv = await auten.conversations.create({
|
|
412
|
+
* customerName: 'Jonas Jonaitis',
|
|
413
|
+
* customerEmail: 'jonas@test.lt',
|
|
414
|
+
* message: 'Norėčiau sužinoti apie jūsų paslaugas',
|
|
415
|
+
* channel: '#sales',
|
|
416
|
+
* brandName: 'My Company',
|
|
417
|
+
* brandSignOff: 'Pagarbiai,\nMy Company komanda\n+370 600 00000',
|
|
418
|
+
* });
|
|
419
|
+
* // That's it. Reply in Slack — AI handles the rest.
|
|
420
|
+
*/
|
|
421
|
+
create(options: CreateConversationOptions): Promise<ConversationCreated>;
|
|
422
|
+
/**
|
|
423
|
+
* List all conversations.
|
|
424
|
+
*/
|
|
425
|
+
list(): Promise<Conversation[]>;
|
|
426
|
+
}
|
|
427
|
+
|
|
354
428
|
/**
|
|
355
429
|
* Auten SDK — Error Classes
|
|
356
430
|
*/
|
|
@@ -417,8 +491,10 @@ declare class Auten {
|
|
|
417
491
|
readonly webhooks: WebhookClient;
|
|
418
492
|
/** Event polling */
|
|
419
493
|
readonly events: EventClient;
|
|
494
|
+
/** Conversation bridges (Slack ↔ Email) */
|
|
495
|
+
readonly conversations: ConversationClient;
|
|
420
496
|
private readonly client;
|
|
421
497
|
constructor(config: AutenConfig);
|
|
422
498
|
}
|
|
423
499
|
|
|
424
|
-
export { type AIChainResult, type AIChainStep, type AIExecuteResult, type Agent, type AgentDetail, type AgentRunResult, type AgentSchedule, type AgentTool, Auten, AutenApiError, AutenAuthError, type AutenConfig, AutenError, AutenNotFoundError, AutenRateLimitError, type CreateAgentOptions, type CreateAgentResult, type DeployAgentOptions, type DeployResult, type ExecuteResult, type PollResult, type Provider, type ProviderCredentials, type RegisterWebhookOptions, type SdkEvent, type Webhook };
|
|
500
|
+
export { type AIChainResult, type AIChainStep, type AIExecuteResult, type Agent, type AgentDetail, type AgentRunResult, type AgentSchedule, type AgentTool, Auten, AutenApiError, AutenAuthError, type AutenConfig, AutenError, AutenNotFoundError, AutenRateLimitError, type Conversation, type ConversationCreated, type CreateAgentOptions, type CreateAgentResult, type CreateConversationOptions, type DeployAgentOptions, type DeployResult, type ExecuteResult, type PollResult, type Provider, type ProviderCredentials, type RegisterWebhookOptions, type SdkEvent, type Webhook };
|
package/dist/index.d.ts
CHANGED
|
@@ -351,6 +351,80 @@ declare class EventClient {
|
|
|
351
351
|
}): Promise<PollResult>;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Auten SDK — Conversations Client
|
|
356
|
+
*
|
|
357
|
+
* Create Slack ↔ Email conversation bridges with one API call.
|
|
358
|
+
* Auten handles everything: AI email generation, thread tracking,
|
|
359
|
+
* email replies back to Slack thread.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
interface CreateConversationOptions {
|
|
363
|
+
/** Customer's name */
|
|
364
|
+
customerName: string;
|
|
365
|
+
/** Customer's email */
|
|
366
|
+
customerEmail: string;
|
|
367
|
+
/** Customer's phone (optional) */
|
|
368
|
+
customerPhone?: string;
|
|
369
|
+
/** Subject or topic */
|
|
370
|
+
subject?: string;
|
|
371
|
+
/** Initial message from the customer */
|
|
372
|
+
message: string;
|
|
373
|
+
/** Slack channel to post to (default: #general) */
|
|
374
|
+
channel?: string;
|
|
375
|
+
/** Your brand/company name (used in AI-generated emails) */
|
|
376
|
+
brandName?: string;
|
|
377
|
+
/** Email signature (used in AI-generated emails) */
|
|
378
|
+
brandSignOff?: string;
|
|
379
|
+
}
|
|
380
|
+
interface Conversation {
|
|
381
|
+
conversationId: string;
|
|
382
|
+
customerName: string;
|
|
383
|
+
customerEmail: string;
|
|
384
|
+
subject: string | null;
|
|
385
|
+
status: 'new' | 'open' | 'replied' | 'closed';
|
|
386
|
+
messageCount: number;
|
|
387
|
+
createdAt: string;
|
|
388
|
+
updatedAt: string;
|
|
389
|
+
}
|
|
390
|
+
interface ConversationCreated {
|
|
391
|
+
conversationId: string;
|
|
392
|
+
slackChannel: string;
|
|
393
|
+
slackThreadTs: string;
|
|
394
|
+
customerEmail: string;
|
|
395
|
+
status: string;
|
|
396
|
+
message: string;
|
|
397
|
+
}
|
|
398
|
+
declare class ConversationClient {
|
|
399
|
+
private client;
|
|
400
|
+
constructor(client: HttpClient);
|
|
401
|
+
/**
|
|
402
|
+
* Create a new conversation bridge.
|
|
403
|
+
*
|
|
404
|
+
* This posts to Slack and sets up the full bridge:
|
|
405
|
+
* - You reply in Slack thread → AI generates professional email → sends to customer
|
|
406
|
+
* - Customer replies to email → appears in Slack thread
|
|
407
|
+
* - Repeat — full conversation via Slack
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* // From a contact form handler:
|
|
411
|
+
* const conv = await auten.conversations.create({
|
|
412
|
+
* customerName: 'Jonas Jonaitis',
|
|
413
|
+
* customerEmail: 'jonas@test.lt',
|
|
414
|
+
* message: 'Norėčiau sužinoti apie jūsų paslaugas',
|
|
415
|
+
* channel: '#sales',
|
|
416
|
+
* brandName: 'My Company',
|
|
417
|
+
* brandSignOff: 'Pagarbiai,\nMy Company komanda\n+370 600 00000',
|
|
418
|
+
* });
|
|
419
|
+
* // That's it. Reply in Slack — AI handles the rest.
|
|
420
|
+
*/
|
|
421
|
+
create(options: CreateConversationOptions): Promise<ConversationCreated>;
|
|
422
|
+
/**
|
|
423
|
+
* List all conversations.
|
|
424
|
+
*/
|
|
425
|
+
list(): Promise<Conversation[]>;
|
|
426
|
+
}
|
|
427
|
+
|
|
354
428
|
/**
|
|
355
429
|
* Auten SDK — Error Classes
|
|
356
430
|
*/
|
|
@@ -417,8 +491,10 @@ declare class Auten {
|
|
|
417
491
|
readonly webhooks: WebhookClient;
|
|
418
492
|
/** Event polling */
|
|
419
493
|
readonly events: EventClient;
|
|
494
|
+
/** Conversation bridges (Slack ↔ Email) */
|
|
495
|
+
readonly conversations: ConversationClient;
|
|
420
496
|
private readonly client;
|
|
421
497
|
constructor(config: AutenConfig);
|
|
422
498
|
}
|
|
423
499
|
|
|
424
|
-
export { type AIChainResult, type AIChainStep, type AIExecuteResult, type Agent, type AgentDetail, type AgentRunResult, type AgentSchedule, type AgentTool, Auten, AutenApiError, AutenAuthError, type AutenConfig, AutenError, AutenNotFoundError, AutenRateLimitError, type CreateAgentOptions, type CreateAgentResult, type DeployAgentOptions, type DeployResult, type ExecuteResult, type PollResult, type Provider, type ProviderCredentials, type RegisterWebhookOptions, type SdkEvent, type Webhook };
|
|
500
|
+
export { type AIChainResult, type AIChainStep, type AIExecuteResult, type Agent, type AgentDetail, type AgentRunResult, type AgentSchedule, type AgentTool, Auten, AutenApiError, AutenAuthError, type AutenConfig, AutenError, AutenNotFoundError, AutenRateLimitError, type Conversation, type ConversationCreated, type CreateAgentOptions, type CreateAgentResult, type CreateConversationOptions, type DeployAgentOptions, type DeployResult, type ExecuteResult, type PollResult, type Provider, type ProviderCredentials, type RegisterWebhookOptions, type SdkEvent, type Webhook };
|
package/dist/index.js
CHANGED
|
@@ -367,6 +367,42 @@ var EventClient = class {
|
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
|
|
370
|
+
// src/conversations.ts
|
|
371
|
+
var ConversationClient = class {
|
|
372
|
+
constructor(client) {
|
|
373
|
+
this.client = client;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Create a new conversation bridge.
|
|
377
|
+
*
|
|
378
|
+
* This posts to Slack and sets up the full bridge:
|
|
379
|
+
* - You reply in Slack thread → AI generates professional email → sends to customer
|
|
380
|
+
* - Customer replies to email → appears in Slack thread
|
|
381
|
+
* - Repeat — full conversation via Slack
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* // From a contact form handler:
|
|
385
|
+
* const conv = await auten.conversations.create({
|
|
386
|
+
* customerName: 'Jonas Jonaitis',
|
|
387
|
+
* customerEmail: 'jonas@test.lt',
|
|
388
|
+
* message: 'Norėčiau sužinoti apie jūsų paslaugas',
|
|
389
|
+
* channel: '#sales',
|
|
390
|
+
* brandName: 'My Company',
|
|
391
|
+
* brandSignOff: 'Pagarbiai,\nMy Company komanda\n+370 600 00000',
|
|
392
|
+
* });
|
|
393
|
+
* // That's it. Reply in Slack — AI handles the rest.
|
|
394
|
+
*/
|
|
395
|
+
async create(options) {
|
|
396
|
+
return this.client.post("/api/v1/sdk/conversations", options);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* List all conversations.
|
|
400
|
+
*/
|
|
401
|
+
async list() {
|
|
402
|
+
return this.client.get("/api/v1/sdk/conversations");
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
|
|
370
406
|
// src/index.ts
|
|
371
407
|
var DEFAULT_BASE_URL = "https://auten.ai";
|
|
372
408
|
var DEFAULT_TIMEOUT = 3e4;
|
|
@@ -382,6 +418,8 @@ var Auten = class {
|
|
|
382
418
|
webhooks;
|
|
383
419
|
/** Event polling */
|
|
384
420
|
events;
|
|
421
|
+
/** Conversation bridges (Slack ↔ Email) */
|
|
422
|
+
conversations;
|
|
385
423
|
client;
|
|
386
424
|
constructor(config) {
|
|
387
425
|
if (!config.apiKey) {
|
|
@@ -398,6 +436,7 @@ var Auten = class {
|
|
|
398
436
|
this.ai = new AIClient(this.client);
|
|
399
437
|
this.webhooks = new WebhookClient(this.client);
|
|
400
438
|
this.events = new EventClient(this.client);
|
|
439
|
+
this.conversations = new ConversationClient(this.client);
|
|
401
440
|
}
|
|
402
441
|
};
|
|
403
442
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -336,6 +336,42 @@ var EventClient = class {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
|
|
339
|
+
// src/conversations.ts
|
|
340
|
+
var ConversationClient = class {
|
|
341
|
+
constructor(client) {
|
|
342
|
+
this.client = client;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Create a new conversation bridge.
|
|
346
|
+
*
|
|
347
|
+
* This posts to Slack and sets up the full bridge:
|
|
348
|
+
* - You reply in Slack thread → AI generates professional email → sends to customer
|
|
349
|
+
* - Customer replies to email → appears in Slack thread
|
|
350
|
+
* - Repeat — full conversation via Slack
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* // From a contact form handler:
|
|
354
|
+
* const conv = await auten.conversations.create({
|
|
355
|
+
* customerName: 'Jonas Jonaitis',
|
|
356
|
+
* customerEmail: 'jonas@test.lt',
|
|
357
|
+
* message: 'Norėčiau sužinoti apie jūsų paslaugas',
|
|
358
|
+
* channel: '#sales',
|
|
359
|
+
* brandName: 'My Company',
|
|
360
|
+
* brandSignOff: 'Pagarbiai,\nMy Company komanda\n+370 600 00000',
|
|
361
|
+
* });
|
|
362
|
+
* // That's it. Reply in Slack — AI handles the rest.
|
|
363
|
+
*/
|
|
364
|
+
async create(options) {
|
|
365
|
+
return this.client.post("/api/v1/sdk/conversations", options);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* List all conversations.
|
|
369
|
+
*/
|
|
370
|
+
async list() {
|
|
371
|
+
return this.client.get("/api/v1/sdk/conversations");
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
339
375
|
// src/index.ts
|
|
340
376
|
var DEFAULT_BASE_URL = "https://auten.ai";
|
|
341
377
|
var DEFAULT_TIMEOUT = 3e4;
|
|
@@ -351,6 +387,8 @@ var Auten = class {
|
|
|
351
387
|
webhooks;
|
|
352
388
|
/** Event polling */
|
|
353
389
|
events;
|
|
390
|
+
/** Conversation bridges (Slack ↔ Email) */
|
|
391
|
+
conversations;
|
|
354
392
|
client;
|
|
355
393
|
constructor(config) {
|
|
356
394
|
if (!config.apiKey) {
|
|
@@ -367,6 +405,7 @@ var Auten = class {
|
|
|
367
405
|
this.ai = new AIClient(this.client);
|
|
368
406
|
this.webhooks = new WebhookClient(this.client);
|
|
369
407
|
this.events = new EventClient(this.client);
|
|
408
|
+
this.conversations = new ConversationClient(this.client);
|
|
370
409
|
}
|
|
371
410
|
};
|
|
372
411
|
export {
|