@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,301 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
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.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/flows.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI1G;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAK1G;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,cA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ED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,135 @@
|
|
|
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.Flows = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
9
|
+
class Flows extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new flow for an agent.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const flow = await client.senders.agent.flows.create(
|
|
16
|
+
* 'senderId',
|
|
17
|
+
* {
|
|
18
|
+
* name: 'Lead Capture',
|
|
19
|
+
* steps: [
|
|
20
|
+
* {
|
|
21
|
+
* id: 'welcome',
|
|
22
|
+
* type: 'message',
|
|
23
|
+
* config: {
|
|
24
|
+
* text: 'Thanks for your interest! Let me get some info.',
|
|
25
|
+
* },
|
|
26
|
+
* nextStepId: 'ask_name',
|
|
27
|
+
* },
|
|
28
|
+
* {
|
|
29
|
+
* id: 'ask_name',
|
|
30
|
+
* type: 'collect',
|
|
31
|
+
* config: {
|
|
32
|
+
* variable: 'name',
|
|
33
|
+
* prompt: "What's your name?",
|
|
34
|
+
* },
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* trigger: {
|
|
38
|
+
* type: 'keyword',
|
|
39
|
+
* keywords: ['info', 'pricing', 'demo'],
|
|
40
|
+
* },
|
|
41
|
+
* description: 'Capture lead information',
|
|
42
|
+
* },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
create(senderID, body, options) {
|
|
47
|
+
return this._client.post((0, path_1.path) `/v1/senders/${senderID}/agent/flows`, { body, ...options });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get a specific flow.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const flow = await client.senders.agent.flows.retrieve(
|
|
55
|
+
* 'flowId',
|
|
56
|
+
* { senderId: 'senderId' },
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
retrieve(flowID, params, options) {
|
|
61
|
+
const { senderId } = params;
|
|
62
|
+
return this._client.get((0, path_1.path) `/v1/senders/${senderId}/agent/flows/${flowID}`, options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Update a flow.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const flow = await client.senders.agent.flows.update(
|
|
70
|
+
* 'flowId',
|
|
71
|
+
* { senderId: 'senderId' },
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
update(flowID, params, options) {
|
|
76
|
+
const { senderId, ...body } = params;
|
|
77
|
+
return this._client.patch((0, path_1.path) `/v1/senders/${senderId}/agent/flows/${flowID}`, { body, ...options });
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* List flows for an agent.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* // Automatically fetches more pages as needed.
|
|
85
|
+
* for await (const agentFlow of client.senders.agent.flows.list(
|
|
86
|
+
* 'senderId',
|
|
87
|
+
* )) {
|
|
88
|
+
* // ...
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
list(senderID, query = {}, options) {
|
|
93
|
+
return this._client.getAPIList((0, path_1.path) `/v1/senders/${senderID}/agent/flows`, (pagination_1.Cursor), {
|
|
94
|
+
query,
|
|
95
|
+
...options,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Delete a flow. Cannot delete flows with active sessions.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* await client.senders.agent.flows.delete('flowId', {
|
|
104
|
+
* senderId: 'senderId',
|
|
105
|
+
* });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
delete(flowID, params, options) {
|
|
109
|
+
const { senderId } = params;
|
|
110
|
+
return this._client.delete((0, path_1.path) `/v1/senders/${senderId}/agent/flows/${flowID}`, {
|
|
111
|
+
...options,
|
|
112
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create a copy of an existing flow with a new name.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const response = await client.senders.agent.flows.duplicate(
|
|
121
|
+
* 'flowId',
|
|
122
|
+
* { senderId: 'senderId', newName: 'Lead Capture (Copy)' },
|
|
123
|
+
* );
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
duplicate(flowID, params, options) {
|
|
127
|
+
const { senderId, ...body } = params;
|
|
128
|
+
return this._client.post((0, path_1.path) `/v1/senders/${senderId}/agent/flows/${flowID}/duplicate`, {
|
|
129
|
+
body,
|
|
130
|
+
...options,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.Flows = Flows;
|
|
135
|
+
//# sourceMappingURL=flows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../src/resources/senders/agent/flows.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAAkF;AAClF,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAsB,EAAE,OAAwB;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,gBAAgB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,gBAAgB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAgB,EAChB,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,cAAc,EAAE,CAAA,mBAAiB,CAAA,EAAE;YAC3F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,gBAAgB,MAAM,EAAE,EAAE;YAC9E,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;;;;;;;;;;OAUG;IACH,SAAS,CACP,MAAc,EACd,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,gBAAgB,MAAM,YAAY,EAAE;YACtF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA7ID,sBA6IC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
6
|
+
export class Flows extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new flow for an agent.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const flow = await client.senders.agent.flows.create(
|
|
13
|
+
* 'senderId',
|
|
14
|
+
* {
|
|
15
|
+
* name: 'Lead Capture',
|
|
16
|
+
* steps: [
|
|
17
|
+
* {
|
|
18
|
+
* id: 'welcome',
|
|
19
|
+
* type: 'message',
|
|
20
|
+
* config: {
|
|
21
|
+
* text: 'Thanks for your interest! Let me get some info.',
|
|
22
|
+
* },
|
|
23
|
+
* nextStepId: 'ask_name',
|
|
24
|
+
* },
|
|
25
|
+
* {
|
|
26
|
+
* id: 'ask_name',
|
|
27
|
+
* type: 'collect',
|
|
28
|
+
* config: {
|
|
29
|
+
* variable: 'name',
|
|
30
|
+
* prompt: "What's your name?",
|
|
31
|
+
* },
|
|
32
|
+
* },
|
|
33
|
+
* ],
|
|
34
|
+
* trigger: {
|
|
35
|
+
* type: 'keyword',
|
|
36
|
+
* keywords: ['info', 'pricing', 'demo'],
|
|
37
|
+
* },
|
|
38
|
+
* description: 'Capture lead information',
|
|
39
|
+
* },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
create(senderID, body, options) {
|
|
44
|
+
return this._client.post(path `/v1/senders/${senderID}/agent/flows`, { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a specific flow.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const flow = await client.senders.agent.flows.retrieve(
|
|
52
|
+
* 'flowId',
|
|
53
|
+
* { senderId: 'senderId' },
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
retrieve(flowID, params, options) {
|
|
58
|
+
const { senderId } = params;
|
|
59
|
+
return this._client.get(path `/v1/senders/${senderId}/agent/flows/${flowID}`, options);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Update a flow.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const flow = await client.senders.agent.flows.update(
|
|
67
|
+
* 'flowId',
|
|
68
|
+
* { senderId: 'senderId' },
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
update(flowID, params, options) {
|
|
73
|
+
const { senderId, ...body } = params;
|
|
74
|
+
return this._client.patch(path `/v1/senders/${senderId}/agent/flows/${flowID}`, { body, ...options });
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* List flows for an agent.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* // Automatically fetches more pages as needed.
|
|
82
|
+
* for await (const agentFlow of client.senders.agent.flows.list(
|
|
83
|
+
* 'senderId',
|
|
84
|
+
* )) {
|
|
85
|
+
* // ...
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
list(senderID, query = {}, options) {
|
|
90
|
+
return this._client.getAPIList(path `/v1/senders/${senderID}/agent/flows`, (Cursor), {
|
|
91
|
+
query,
|
|
92
|
+
...options,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Delete a flow. Cannot delete flows with active sessions.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* await client.senders.agent.flows.delete('flowId', {
|
|
101
|
+
* senderId: 'senderId',
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
delete(flowID, params, options) {
|
|
106
|
+
const { senderId } = params;
|
|
107
|
+
return this._client.delete(path `/v1/senders/${senderId}/agent/flows/${flowID}`, {
|
|
108
|
+
...options,
|
|
109
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Create a copy of an existing flow with a new name.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const response = await client.senders.agent.flows.duplicate(
|
|
118
|
+
* 'flowId',
|
|
119
|
+
* { senderId: 'senderId', newName: 'Lead Capture (Copy)' },
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
duplicate(flowID, params, options) {
|
|
124
|
+
const { senderId, ...body } = params;
|
|
125
|
+
return this._client.post(path `/v1/senders/${senderId}/agent/flows/${flowID}/duplicate`, {
|
|
126
|
+
body,
|
|
127
|
+
...options,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=flows.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.mjs","sourceRoot":"","sources":["../../../src/resources/senders/agent/flows.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAsB,EAAE,OAAwB;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,eAAe,QAAQ,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAA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e,QAAQ,gBAAgB,MAAM,YAAY,EAAE;YACtF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AgentResource, type Agent, type AgentExecution, type AgentExecutionStatus, type AgentProvider, type AgentResponse, type AgentStats, type AgentCreateParams, type AgentUpdateParams, type AgentExecutionsCursor, } from "./agent.mjs";
|
|
2
|
+
export { Executions, type ExecutionListParams } from "./executions.mjs";
|
|
3
|
+
export { Flows, type AgentFlow, type FlowCreateResponse, type FlowRetrieveResponse, type FlowUpdateResponse, type FlowDuplicateResponse, type FlowCreateParams, type FlowRetrieveParams, type FlowUpdateParams, type FlowListParams, type FlowDeleteParams, type FlowDuplicateParams, type AgentFlowsCursor, } from "./flows.mjs";
|
|
4
|
+
export { KnowledgeBases, type AgentDocument, type AgentKnowledgeBase, type KnowledgeBaseCreateResponse, type KnowledgeBaseRetrieveResponse, type KnowledgeBaseUpdateResponse, type KnowledgeBaseCreateParams, type KnowledgeBaseRetrieveParams, type KnowledgeBaseUpdateParams, type KnowledgeBaseListParams, type KnowledgeBaseDeleteParams, type AgentDocumentsCursor, type AgentKnowledgeBasesCursor, } from "./knowledge-bases/index.mjs";
|
|
5
|
+
export { Tools, type AgentTool, type ToolCreateResponse, type ToolRetrieveResponse, type ToolUpdateResponse, type ToolTestResponse, type ToolCreateParams, type ToolRetrieveParams, type ToolUpdateParams, type ToolListParams, type ToolDeleteParams, type ToolTestParams, type AgentToolsCursor, } from "./tools.mjs";
|
|
6
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B;OACM,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE;OACxC,EACL,KAAK,EACL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB;OACM,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B;OACM,EACL,KAAK,EACL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AgentResource, type Agent, type AgentExecution, type AgentExecutionStatus, type AgentProvider, type AgentResponse, type AgentStats, type AgentCreateParams, type AgentUpdateParams, type AgentExecutionsCursor, } from "./agent.js";
|
|
2
|
+
export { Executions, type ExecutionListParams } from "./executions.js";
|
|
3
|
+
export { Flows, type AgentFlow, type FlowCreateResponse, type FlowRetrieveResponse, type FlowUpdateResponse, type FlowDuplicateResponse, type FlowCreateParams, type FlowRetrieveParams, type FlowUpdateParams, type FlowListParams, type FlowDeleteParams, type FlowDuplicateParams, type AgentFlowsCursor, } from "./flows.js";
|
|
4
|
+
export { KnowledgeBases, type AgentDocument, type AgentKnowledgeBase, type KnowledgeBaseCreateResponse, type KnowledgeBaseRetrieveResponse, type KnowledgeBaseUpdateResponse, type KnowledgeBaseCreateParams, type KnowledgeBaseRetrieveParams, type KnowledgeBaseUpdateParams, type KnowledgeBaseListParams, type KnowledgeBaseDeleteParams, type AgentDocumentsCursor, type AgentKnowledgeBasesCursor, } from "./knowledge-bases/index.js";
|
|
5
|
+
export { Tools, type AgentTool, type ToolCreateResponse, type ToolRetrieveResponse, type ToolUpdateResponse, type ToolTestResponse, type ToolCreateParams, type ToolRetrieveParams, type ToolUpdateParams, type ToolListParams, type ToolDeleteParams, type ToolTestParams, type AgentToolsCursor, } from "./tools.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B;OACM,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE;OACxC,EACL,KAAK,EACL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB;OACM,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B;OACM,EACL,KAAK,EACL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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.Tools = exports.KnowledgeBases = exports.Flows = exports.Executions = exports.AgentResource = void 0;
|
|
5
|
+
var agent_1 = require("./agent.js");
|
|
6
|
+
Object.defineProperty(exports, "AgentResource", { enumerable: true, get: function () { return agent_1.AgentResource; } });
|
|
7
|
+
var executions_1 = require("./executions.js");
|
|
8
|
+
Object.defineProperty(exports, "Executions", { enumerable: true, get: function () { return executions_1.Executions; } });
|
|
9
|
+
var flows_1 = require("./flows.js");
|
|
10
|
+
Object.defineProperty(exports, "Flows", { enumerable: true, get: function () { return flows_1.Flows; } });
|
|
11
|
+
var index_1 = require("./knowledge-bases/index.js");
|
|
12
|
+
Object.defineProperty(exports, "KnowledgeBases", { enumerable: true, get: function () { return index_1.KnowledgeBases; } });
|
|
13
|
+
var tools_1 = require("./tools.js");
|
|
14
|
+
Object.defineProperty(exports, "Tools", { enumerable: true, get: function () { return tools_1.Tools; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/senders/agent/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAWiB;AAVf,sGAAA,aAAa,OAAA;AAWf,8CAAoE;AAA3D,wGAAA,UAAU,OAAA;AACnB,oCAciB;AAbf,8FAAA,KAAK,OAAA;AAcP,oDAciC;AAb/B,uGAAA,cAAc,OAAA;AAchB,oCAciB;AAbf,8FAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export { AgentResource, } from "./agent.mjs";
|
|
3
|
+
export { Executions } from "./executions.mjs";
|
|
4
|
+
export { Flows, } from "./flows.mjs";
|
|
5
|
+
export { KnowledgeBases, } from "./knowledge-bases/index.mjs";
|
|
6
|
+
export { Tools, } from "./tools.mjs";
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/senders/agent/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,aAAa,GAUd;OACM,EAAE,UAAU,EAA4B;OACxC,EACL,KAAK,GAaN;OACM,EACL,cAAc,GAaf;OACM,EACL,KAAK,GAaN"}
|