@zavudev/sdk 0.17.0 → 0.18.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/CHANGELOG.md +8 -0
- package/client.d.mts +11 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +11 -5
- package/client.d.ts.map +1 -1
- package/client.js +7 -1
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/addresses.d.mts +104 -0
- package/resources/addresses.d.mts.map +1 -0
- package/resources/addresses.d.ts +104 -0
- package/resources/addresses.d.ts.map +1 -0
- package/resources/addresses.js +72 -0
- package/resources/addresses.js.map +1 -0
- package/resources/addresses.mjs +68 -0
- package/resources/addresses.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +23 -1
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +23 -1
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +15 -0
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +15 -0
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/broadcasts/index.d.mts +1 -1
- package/resources/broadcasts/index.d.mts.map +1 -1
- package/resources/broadcasts/index.d.ts +1 -1
- package/resources/broadcasts/index.d.ts.map +1 -1
- package/resources/broadcasts/index.js.map +1 -1
- package/resources/broadcasts/index.mjs.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +6 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +67 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +67 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +15 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +15 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/regulatory-documents.d.mts +114 -0
- package/resources/regulatory-documents.d.mts.map +1 -0
- package/resources/regulatory-documents.d.ts +114 -0
- package/resources/regulatory-documents.d.ts.map +1 -0
- package/resources/regulatory-documents.js +84 -0
- package/resources/regulatory-documents.js.map +1 -0
- package/resources/regulatory-documents.mjs +80 -0
- package/resources/regulatory-documents.mjs.map +1 -0
- package/resources/senders/agent/agent.d.mts +230 -0
- package/resources/senders/agent/agent.d.mts.map +1 -0
- package/resources/senders/agent/agent.d.ts +230 -0
- package/resources/senders/agent/agent.d.ts.map +1 -0
- package/resources/senders/agent/agent.js +105 -0
- package/resources/senders/agent/agent.js.map +1 -0
- package/resources/senders/agent/agent.mjs +100 -0
- package/resources/senders/agent/agent.mjs.map +1 -0
- package/resources/senders/agent/executions.d.mts +32 -0
- package/resources/senders/agent/executions.d.mts.map +1 -0
- package/resources/senders/agent/executions.d.ts +32 -0
- package/resources/senders/agent/executions.d.ts.map +1 -0
- package/resources/senders/agent/executions.js +27 -0
- package/resources/senders/agent/executions.js.map +1 -0
- package/resources/senders/agent/executions.mjs +23 -0
- package/resources/senders/agent/executions.mjs.map +1 -0
- package/resources/senders/agent/flows.d.mts +301 -0
- package/resources/senders/agent/flows.d.mts.map +1 -0
- package/resources/senders/agent/flows.d.ts +301 -0
- package/resources/senders/agent/flows.d.ts.map +1 -0
- package/resources/senders/agent/flows.js +135 -0
- package/resources/senders/agent/flows.js.map +1 -0
- package/resources/senders/agent/flows.mjs +131 -0
- package/resources/senders/agent/flows.mjs.map +1 -0
- package/resources/senders/agent/index.d.mts +6 -0
- package/resources/senders/agent/index.d.mts.map +1 -0
- package/resources/senders/agent/index.d.ts +6 -0
- package/resources/senders/agent/index.d.ts.map +1 -0
- package/resources/senders/agent/index.js +15 -0
- package/resources/senders/agent/index.js.map +1 -0
- package/resources/senders/agent/index.mjs +7 -0
- package/resources/senders/agent/index.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.d.mts +86 -0
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.d.ts +86 -0
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.js +70 -0
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs +66 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.d.mts +3 -0
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.d.ts +3 -0
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.js +9 -0
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.mjs +4 -0
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +147 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +147 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js +106 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs +101 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases.d.mts +2 -0
- package/resources/senders/agent/knowledge-bases.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases.d.ts +2 -0
- package/resources/senders/agent/knowledge-bases.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases.js +6 -0
- package/resources/senders/agent/knowledge-bases.js.map +1 -0
- package/resources/senders/agent/knowledge-bases.mjs +3 -0
- package/resources/senders/agent/knowledge-bases.mjs.map +1 -0
- package/resources/senders/agent/tools.d.mts +242 -0
- package/resources/senders/agent/tools.d.mts.map +1 -0
- package/resources/senders/agent/tools.d.ts +242 -0
- package/resources/senders/agent/tools.d.ts.map +1 -0
- package/resources/senders/agent/tools.js +126 -0
- package/resources/senders/agent/tools.js.map +1 -0
- package/resources/senders/agent/tools.mjs +122 -0
- package/resources/senders/agent/tools.mjs.map +1 -0
- package/resources/senders/agent.d.mts +2 -0
- package/resources/senders/agent.d.mts.map +1 -0
- package/resources/senders/agent.d.ts +2 -0
- package/resources/senders/agent.d.ts.map +1 -0
- package/resources/senders/agent.js +6 -0
- package/resources/senders/agent.js.map +1 -0
- package/resources/senders/agent.mjs +3 -0
- package/resources/senders/agent.mjs.map +1 -0
- package/resources/senders/index.d.mts +3 -0
- package/resources/senders/index.d.mts.map +1 -0
- package/resources/senders/index.d.ts +3 -0
- package/resources/senders/index.d.ts.map +1 -0
- package/resources/senders/index.js +9 -0
- package/resources/senders/index.js.map +1 -0
- package/resources/senders/index.mjs +4 -0
- package/resources/senders/index.mjs.map +1 -0
- package/resources/senders/senders.d.mts +342 -0
- package/resources/senders/senders.d.mts.map +1 -0
- package/resources/senders/senders.d.ts +342 -0
- package/resources/senders/senders.d.ts.map +1 -0
- package/resources/senders/senders.js +150 -0
- package/resources/senders/senders.js.map +1 -0
- package/resources/senders/senders.mjs +145 -0
- package/resources/senders/senders.mjs.map +1 -0
- package/resources/senders.d.mts +1 -337
- package/resources/senders.d.mts.map +1 -1
- package/resources/senders.d.ts +1 -337
- package/resources/senders.d.ts.map +1 -1
- package/resources/senders.js +2 -138
- package/resources/senders.js.map +1 -1
- package/resources/senders.mjs +1 -136
- package/resources/senders.mjs.map +1 -1
- package/src/client.ts +79 -17
- package/src/resources/addresses.ts +160 -0
- package/src/resources/broadcasts/broadcasts.ts +33 -0
- package/src/resources/broadcasts/index.ts +2 -0
- package/src/resources/index.ts +29 -1
- package/src/resources/phone-numbers.ts +97 -0
- package/src/resources/regulatory-documents.ts +184 -0
- package/src/resources/senders/agent/agent.ts +417 -0
- package/src/resources/senders/agent/executions.ts +48 -0
- package/src/resources/senders/agent/flows.ts +409 -0
- package/src/resources/senders/agent/index.ts +60 -0
- package/src/resources/senders/agent/knowledge-bases/documents.ts +133 -0
- package/src/resources/senders/agent/knowledge-bases/index.ts +24 -0
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +251 -0
- package/src/resources/senders/agent/knowledge-bases.ts +3 -0
- package/src/resources/senders/agent/tools.ts +334 -0
- package/src/resources/senders/agent.ts +3 -0
- package/src/resources/senders/index.ts +32 -0
- package/src/resources/senders/senders.ts +506 -0
- package/src/resources/senders.ts +1 -476
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AgentResource = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const ExecutionsAPI = tslib_1.__importStar(require("./executions.js"));
|
|
8
|
+
const executions_1 = require("./executions.js");
|
|
9
|
+
const FlowsAPI = tslib_1.__importStar(require("./flows.js"));
|
|
10
|
+
const flows_1 = require("./flows.js");
|
|
11
|
+
const ToolsAPI = tslib_1.__importStar(require("./tools.js"));
|
|
12
|
+
const tools_1 = require("./tools.js");
|
|
13
|
+
const KnowledgeBasesAPI = tslib_1.__importStar(require("./knowledge-bases/knowledge-bases.js"));
|
|
14
|
+
const knowledge_bases_1 = require("./knowledge-bases/knowledge-bases.js");
|
|
15
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
16
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
17
|
+
class AgentResource extends resource_1.APIResource {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.executions = new ExecutionsAPI.Executions(this._client);
|
|
21
|
+
this.flows = new FlowsAPI.Flows(this._client);
|
|
22
|
+
this.tools = new ToolsAPI.Tools(this._client);
|
|
23
|
+
this.knowledgeBases = new KnowledgeBasesAPI.KnowledgeBases(this._client);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create an AI agent for a sender. Each sender can have at most one agent.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const agentResponse = await client.senders.agent.create(
|
|
31
|
+
* 'senderId',
|
|
32
|
+
* {
|
|
33
|
+
* model: 'gpt-4o-mini',
|
|
34
|
+
* name: 'Customer Support',
|
|
35
|
+
* provider: 'openai',
|
|
36
|
+
* systemPrompt:
|
|
37
|
+
* 'You are a helpful customer support agent. Be friendly and concise.',
|
|
38
|
+
* apiKey: 'sk-...',
|
|
39
|
+
* },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
create(senderID, body, options) {
|
|
44
|
+
return this._client.post((0, path_1.path) `/v1/senders/${senderID}/agent`, { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get the AI agent configuration for a sender.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const agentResponse = await client.senders.agent.retrieve(
|
|
52
|
+
* 'senderId',
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
retrieve(senderID, options) {
|
|
57
|
+
return this._client.get((0, path_1.path) `/v1/senders/${senderID}/agent`, options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update an AI agent's configuration.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const agentResponse = await client.senders.agent.update(
|
|
65
|
+
* 'senderId',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
update(senderID, body, options) {
|
|
70
|
+
return this._client.patch((0, path_1.path) `/v1/senders/${senderID}/agent`, { body, ...options });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Delete an AI agent.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* await client.senders.agent.delete('senderId');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
delete(senderID, options) {
|
|
81
|
+
return this._client.delete((0, path_1.path) `/v1/senders/${senderID}/agent`, {
|
|
82
|
+
...options,
|
|
83
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get statistics for an AI agent including invocations, tokens, and costs.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const agentStats = await client.senders.agent.stats(
|
|
92
|
+
* 'senderId',
|
|
93
|
+
* );
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
stats(senderID, options) {
|
|
97
|
+
return this._client.get((0, path_1.path) `/v1/senders/${senderID}/agent/stats`, options);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.AgentResource = AgentResource;
|
|
101
|
+
AgentResource.Executions = executions_1.Executions;
|
|
102
|
+
AgentResource.Flows = flows_1.Flows;
|
|
103
|
+
AgentResource.Tools = tools_1.Tools;
|
|
104
|
+
AgentResource.KnowledgeBases = knowledge_bases_1.KnowledgeBases;
|
|
105
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/resources/senders/agent/agent.ts"],"names":[],"mappings":";AAAA,sF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,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,QAAQ,EAAE;YAC9D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAgB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AApFD,sCAoFC;AAiND,aAAa,CAAC,UAAU,GAAG,uBAAU,CAAC;AACtC,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC;AAC5B,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC;AAC5B,aAAa,CAAC,cAAc,GAAG,gCAAc,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as ExecutionsAPI from "./executions.mjs";
|
|
4
|
+
import { Executions } from "./executions.mjs";
|
|
5
|
+
import * as FlowsAPI from "./flows.mjs";
|
|
6
|
+
import { Flows, } from "./flows.mjs";
|
|
7
|
+
import * as ToolsAPI from "./tools.mjs";
|
|
8
|
+
import { Tools, } from "./tools.mjs";
|
|
9
|
+
import * as KnowledgeBasesAPI from "./knowledge-bases/knowledge-bases.mjs";
|
|
10
|
+
import { KnowledgeBases, } from "./knowledge-bases/knowledge-bases.mjs";
|
|
11
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
12
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
13
|
+
export class AgentResource extends APIResource {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.executions = new ExecutionsAPI.Executions(this._client);
|
|
17
|
+
this.flows = new FlowsAPI.Flows(this._client);
|
|
18
|
+
this.tools = new ToolsAPI.Tools(this._client);
|
|
19
|
+
this.knowledgeBases = new KnowledgeBasesAPI.KnowledgeBases(this._client);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create an AI agent for a sender. Each sender can have at most one agent.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const agentResponse = await client.senders.agent.create(
|
|
27
|
+
* 'senderId',
|
|
28
|
+
* {
|
|
29
|
+
* model: 'gpt-4o-mini',
|
|
30
|
+
* name: 'Customer Support',
|
|
31
|
+
* provider: 'openai',
|
|
32
|
+
* systemPrompt:
|
|
33
|
+
* 'You are a helpful customer support agent. Be friendly and concise.',
|
|
34
|
+
* apiKey: 'sk-...',
|
|
35
|
+
* },
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
create(senderID, body, options) {
|
|
40
|
+
return this._client.post(path `/v1/senders/${senderID}/agent`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the AI agent configuration for a sender.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const agentResponse = await client.senders.agent.retrieve(
|
|
48
|
+
* 'senderId',
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
retrieve(senderID, options) {
|
|
53
|
+
return this._client.get(path `/v1/senders/${senderID}/agent`, options);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update an AI agent's configuration.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const agentResponse = await client.senders.agent.update(
|
|
61
|
+
* 'senderId',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
update(senderID, body, options) {
|
|
66
|
+
return this._client.patch(path `/v1/senders/${senderID}/agent`, { body, ...options });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete an AI agent.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* await client.senders.agent.delete('senderId');
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
delete(senderID, options) {
|
|
77
|
+
return this._client.delete(path `/v1/senders/${senderID}/agent`, {
|
|
78
|
+
...options,
|
|
79
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get statistics for an AI agent including invocations, tokens, and costs.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const agentStats = await client.senders.agent.stats(
|
|
88
|
+
* 'senderId',
|
|
89
|
+
* );
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
stats(senderID, options) {
|
|
93
|
+
return this._client.get(path `/v1/senders/${senderID}/agent/stats`, options);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
AgentResource.Executions = Executions;
|
|
97
|
+
AgentResource.Flows = Flows;
|
|
98
|
+
AgentResource.Tools = Tools;
|
|
99
|
+
AgentResource.KnowledgeBases = KnowledgeBases;
|
|
100
|
+
//# sourceMappingURL=agent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.mjs","sourceRoot":"","sources":["../../../src/resources/senders/agent/agent.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EAAuB,UAAU,EAAE;OACnC,KAAK,QAAQ;OACb,EAaL,KAAK,GACN;OACM,KAAK,QAAQ;OACb,EAaL,KAAK,GACN;OACM,KAAK,iBAAiB;OACtB,EAYL,cAAc,GACf;OAGM,EAAE,YAAY,EAA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AE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAgB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,QAAQ,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AAiND,aAAa,CAAC,UAAU,GAAG,UAAU,CAAC;AACtC,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,cAAc,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as AgentAPI from "./agent.mjs";
|
|
3
|
+
import { AgentExecutionsCursor } from "./agent.mjs";
|
|
4
|
+
import { type CursorParams, PagePromise } from "../../../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
6
|
+
export declare class Executions extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List recent agent executions with pagination.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const agentExecution of client.senders.agent.executions.list(
|
|
14
|
+
* 'senderId',
|
|
15
|
+
* )) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(senderID: string, query?: ExecutionListParams | null | undefined, options?: RequestOptions): PagePromise<AgentExecutionsCursor, AgentAPI.AgentExecution>;
|
|
21
|
+
}
|
|
22
|
+
export interface ExecutionListParams extends CursorParams {
|
|
23
|
+
/**
|
|
24
|
+
* Status of an agent execution.
|
|
25
|
+
*/
|
|
26
|
+
status?: AgentAPI.AgentExecutionStatus;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace Executions {
|
|
29
|
+
export { type ExecutionListParams as ExecutionListParams };
|
|
30
|
+
}
|
|
31
|
+
export { type AgentExecutionsCursor };
|
|
32
|
+
//# sourceMappingURL=executions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/executions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,qBAAqB,EAAE;OACzB,EAAU,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC;CAO/D;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,oBAAoB,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D;AAED,OAAO,EAAE,KAAK,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as AgentAPI from "./agent.js";
|
|
3
|
+
import { AgentExecutionsCursor } from "./agent.js";
|
|
4
|
+
import { type CursorParams, PagePromise } from "../../../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
6
|
+
export declare class Executions extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List recent agent executions with pagination.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const agentExecution of client.senders.agent.executions.list(
|
|
14
|
+
* 'senderId',
|
|
15
|
+
* )) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
list(senderID: string, query?: ExecutionListParams | null | undefined, options?: RequestOptions): PagePromise<AgentExecutionsCursor, AgentAPI.AgentExecution>;
|
|
21
|
+
}
|
|
22
|
+
export interface ExecutionListParams extends CursorParams {
|
|
23
|
+
/**
|
|
24
|
+
* Status of an agent execution.
|
|
25
|
+
*/
|
|
26
|
+
status?: AgentAPI.AgentExecutionStatus;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace Executions {
|
|
29
|
+
export { type ExecutionListParams as ExecutionListParams };
|
|
30
|
+
}
|
|
31
|
+
export { type AgentExecutionsCursor };
|
|
32
|
+
//# sourceMappingURL=executions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/executions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,qBAAqB,EAAE;OACzB,EAAU,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC;CAO/D;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,oBAAoB,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D;AAED,OAAO,EAAE,KAAK,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Executions = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
+
class Executions extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List recent agent executions with pagination.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const agentExecution of client.senders.agent.executions.list(
|
|
16
|
+
* 'senderId',
|
|
17
|
+
* )) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(senderID, query = {}, options) {
|
|
23
|
+
return this._client.getAPIList((0, path_1.path) `/v1/senders/${senderID}/agent/executions`, (pagination_1.Cursor), { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Executions = Executions;
|
|
27
|
+
//# sourceMappingURL=executions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/resources/senders/agent/executions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,4DAAkF;AAElF,0DAAoD;AAEpD,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAgB,EAChB,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,eAAe,QAAQ,mBAAmB,EAC9C,CAAA,mBAA+B,CAAA,EAC/B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAzBD,gCAyBC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../../../core/pagination.mjs";
|
|
4
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
+
export class Executions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List recent agent executions with pagination.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const agentExecution of client.senders.agent.executions.list(
|
|
13
|
+
* 'senderId',
|
|
14
|
+
* )) {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
list(senderID, query = {}, options) {
|
|
20
|
+
return this._client.getAPIList(path `/v1/senders/${senderID}/agent/executions`, (Cursor), { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=executions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.mjs","sourceRoot":"","sources":["../../../src/resources/senders/agent/executions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAgB,EAChB,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,eAAe,QAAQ,mBAAmB,EAC9C,CAAA,MAA+B,CAAA,EAC/B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Flows extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new flow for an agent.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const flow = await client.senders.agent.flows.create(
|
|
12
|
+
* 'senderId',
|
|
13
|
+
* {
|
|
14
|
+
* name: 'Lead Capture',
|
|
15
|
+
* steps: [
|
|
16
|
+
* {
|
|
17
|
+
* id: 'welcome',
|
|
18
|
+
* type: 'message',
|
|
19
|
+
* config: {
|
|
20
|
+
* text: 'Thanks for your interest! Let me get some info.',
|
|
21
|
+
* },
|
|
22
|
+
* nextStepId: 'ask_name',
|
|
23
|
+
* },
|
|
24
|
+
* {
|
|
25
|
+
* id: 'ask_name',
|
|
26
|
+
* type: 'collect',
|
|
27
|
+
* config: {
|
|
28
|
+
* variable: 'name',
|
|
29
|
+
* prompt: "What's your name?",
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* ],
|
|
33
|
+
* trigger: {
|
|
34
|
+
* type: 'keyword',
|
|
35
|
+
* keywords: ['info', 'pricing', 'demo'],
|
|
36
|
+
* },
|
|
37
|
+
* description: 'Capture lead information',
|
|
38
|
+
* },
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
create(senderID: string, body: FlowCreateParams, options?: RequestOptions): APIPromise<FlowCreateResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a specific flow.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const flow = await client.senders.agent.flows.retrieve(
|
|
49
|
+
* 'flowId',
|
|
50
|
+
* { senderId: 'senderId' },
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
retrieve(flowID: string, params: FlowRetrieveParams, options?: RequestOptions): APIPromise<FlowRetrieveResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Update a flow.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const flow = await client.senders.agent.flows.update(
|
|
61
|
+
* 'flowId',
|
|
62
|
+
* { senderId: 'senderId' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
update(flowID: string, params: FlowUpdateParams, options?: RequestOptions): APIPromise<FlowUpdateResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* List flows for an agent.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* // Automatically fetches more pages as needed.
|
|
73
|
+
* for await (const agentFlow of client.senders.agent.flows.list(
|
|
74
|
+
* 'senderId',
|
|
75
|
+
* )) {
|
|
76
|
+
* // ...
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
list(senderID: string, query?: FlowListParams | null | undefined, options?: RequestOptions): PagePromise<AgentFlowsCursor, AgentFlow>;
|
|
81
|
+
/**
|
|
82
|
+
* Delete a flow. Cannot delete flows with active sessions.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* await client.senders.agent.flows.delete('flowId', {
|
|
87
|
+
* senderId: 'senderId',
|
|
88
|
+
* });
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
delete(flowID: string, params: FlowDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Create a copy of an existing flow with a new name.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const response = await client.senders.agent.flows.duplicate(
|
|
98
|
+
* 'flowId',
|
|
99
|
+
* { senderId: 'senderId', newName: 'Lead Capture (Copy)' },
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
duplicate(flowID: string, params: FlowDuplicateParams, options?: RequestOptions): APIPromise<FlowDuplicateResponse>;
|
|
104
|
+
}
|
|
105
|
+
export type AgentFlowsCursor = Cursor<AgentFlow>;
|
|
106
|
+
export interface AgentFlow {
|
|
107
|
+
id: string;
|
|
108
|
+
agentId: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Priority when multiple flows match (higher = more priority).
|
|
114
|
+
*/
|
|
115
|
+
priority: number;
|
|
116
|
+
steps: Array<AgentFlow.Step>;
|
|
117
|
+
trigger: AgentFlow.Trigger;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
description?: string | null;
|
|
120
|
+
}
|
|
121
|
+
export declare namespace AgentFlow {
|
|
122
|
+
interface Step {
|
|
123
|
+
/**
|
|
124
|
+
* Unique step identifier.
|
|
125
|
+
*/
|
|
126
|
+
id: string;
|
|
127
|
+
/**
|
|
128
|
+
* Step configuration (varies by type).
|
|
129
|
+
*/
|
|
130
|
+
config: {
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Type of flow step.
|
|
135
|
+
*/
|
|
136
|
+
type: 'message' | 'collect' | 'condition' | 'tool' | 'llm' | 'transfer';
|
|
137
|
+
/**
|
|
138
|
+
* ID of the next step to execute.
|
|
139
|
+
*/
|
|
140
|
+
nextStepId?: string | null;
|
|
141
|
+
}
|
|
142
|
+
interface Trigger {
|
|
143
|
+
/**
|
|
144
|
+
* Type of trigger for a flow.
|
|
145
|
+
*/
|
|
146
|
+
type: 'keyword' | 'intent' | 'always' | 'manual';
|
|
147
|
+
/**
|
|
148
|
+
* Intent that triggers the flow (for intent type).
|
|
149
|
+
*/
|
|
150
|
+
intent?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Keywords that trigger the flow (for keyword type).
|
|
153
|
+
*/
|
|
154
|
+
keywords?: Array<string>;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export interface FlowCreateResponse {
|
|
158
|
+
flow: AgentFlow;
|
|
159
|
+
}
|
|
160
|
+
export interface FlowRetrieveResponse {
|
|
161
|
+
flow: AgentFlow;
|
|
162
|
+
}
|
|
163
|
+
export interface FlowUpdateResponse {
|
|
164
|
+
flow: AgentFlow;
|
|
165
|
+
}
|
|
166
|
+
export interface FlowDuplicateResponse {
|
|
167
|
+
flow: AgentFlow;
|
|
168
|
+
}
|
|
169
|
+
export interface FlowCreateParams {
|
|
170
|
+
name: string;
|
|
171
|
+
steps: Array<FlowCreateParams.Step>;
|
|
172
|
+
trigger: FlowCreateParams.Trigger;
|
|
173
|
+
description?: string;
|
|
174
|
+
enabled?: boolean;
|
|
175
|
+
priority?: number;
|
|
176
|
+
}
|
|
177
|
+
export declare namespace FlowCreateParams {
|
|
178
|
+
interface Step {
|
|
179
|
+
/**
|
|
180
|
+
* Unique step identifier.
|
|
181
|
+
*/
|
|
182
|
+
id: string;
|
|
183
|
+
/**
|
|
184
|
+
* Step configuration (varies by type).
|
|
185
|
+
*/
|
|
186
|
+
config: {
|
|
187
|
+
[key: string]: unknown;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Type of flow step.
|
|
191
|
+
*/
|
|
192
|
+
type: 'message' | 'collect' | 'condition' | 'tool' | 'llm' | 'transfer';
|
|
193
|
+
/**
|
|
194
|
+
* ID of the next step to execute.
|
|
195
|
+
*/
|
|
196
|
+
nextStepId?: string | null;
|
|
197
|
+
}
|
|
198
|
+
interface Trigger {
|
|
199
|
+
/**
|
|
200
|
+
* Type of trigger for a flow.
|
|
201
|
+
*/
|
|
202
|
+
type: 'keyword' | 'intent' | 'always' | 'manual';
|
|
203
|
+
/**
|
|
204
|
+
* Intent that triggers the flow (for intent type).
|
|
205
|
+
*/
|
|
206
|
+
intent?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Keywords that trigger the flow (for keyword type).
|
|
209
|
+
*/
|
|
210
|
+
keywords?: Array<string>;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export interface FlowRetrieveParams {
|
|
214
|
+
senderId: string;
|
|
215
|
+
}
|
|
216
|
+
export interface FlowUpdateParams {
|
|
217
|
+
/**
|
|
218
|
+
* Path param:
|
|
219
|
+
*/
|
|
220
|
+
senderId: string;
|
|
221
|
+
/**
|
|
222
|
+
* Body param:
|
|
223
|
+
*/
|
|
224
|
+
description?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Body param:
|
|
227
|
+
*/
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Body param:
|
|
231
|
+
*/
|
|
232
|
+
name?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Body param:
|
|
235
|
+
*/
|
|
236
|
+
priority?: number;
|
|
237
|
+
/**
|
|
238
|
+
* Body param:
|
|
239
|
+
*/
|
|
240
|
+
steps?: Array<FlowUpdateParams.Step>;
|
|
241
|
+
/**
|
|
242
|
+
* Body param:
|
|
243
|
+
*/
|
|
244
|
+
trigger?: FlowUpdateParams.Trigger;
|
|
245
|
+
}
|
|
246
|
+
export declare namespace FlowUpdateParams {
|
|
247
|
+
interface Step {
|
|
248
|
+
/**
|
|
249
|
+
* Unique step identifier.
|
|
250
|
+
*/
|
|
251
|
+
id: string;
|
|
252
|
+
/**
|
|
253
|
+
* Step configuration (varies by type).
|
|
254
|
+
*/
|
|
255
|
+
config: {
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Type of flow step.
|
|
260
|
+
*/
|
|
261
|
+
type: 'message' | 'collect' | 'condition' | 'tool' | 'llm' | 'transfer';
|
|
262
|
+
/**
|
|
263
|
+
* ID of the next step to execute.
|
|
264
|
+
*/
|
|
265
|
+
nextStepId?: string | null;
|
|
266
|
+
}
|
|
267
|
+
interface Trigger {
|
|
268
|
+
/**
|
|
269
|
+
* Type of trigger for a flow.
|
|
270
|
+
*/
|
|
271
|
+
type: 'keyword' | 'intent' | 'always' | 'manual';
|
|
272
|
+
/**
|
|
273
|
+
* Intent that triggers the flow (for intent type).
|
|
274
|
+
*/
|
|
275
|
+
intent?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Keywords that trigger the flow (for keyword type).
|
|
278
|
+
*/
|
|
279
|
+
keywords?: Array<string>;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
export interface FlowListParams extends CursorParams {
|
|
283
|
+
enabled?: boolean;
|
|
284
|
+
}
|
|
285
|
+
export interface FlowDeleteParams {
|
|
286
|
+
senderId: string;
|
|
287
|
+
}
|
|
288
|
+
export interface FlowDuplicateParams {
|
|
289
|
+
/**
|
|
290
|
+
* Path param:
|
|
291
|
+
*/
|
|
292
|
+
senderId: string;
|
|
293
|
+
/**
|
|
294
|
+
* Body param:
|
|
295
|
+
*/
|
|
296
|
+
newName: string;
|
|
297
|
+
}
|
|
298
|
+
export declare namespace Flows {
|
|
299
|
+
export { type AgentFlow as AgentFlow, type FlowCreateResponse as FlowCreateResponse, type FlowRetrieveResponse as FlowRetrieveResponse, type FlowUpdateResponse as FlowUpdateResponse, type FlowDuplicateResponse as FlowDuplicateResponse, type AgentFlowsCursor as AgentFlowsCursor, type FlowCreateParams as FlowCreateParams, type FlowRetrieveParams as FlowRetrieveParams, type FlowUpdateParams as FlowUpdateParams, type FlowListParams as FlowListParams, type FlowDeleteParams as FlowDeleteParams, type FlowDuplicateParams as FlowDuplicateParams, };
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=flows.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.mts","sourceRo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