@cargo-ai/types 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/build/src/ai/ai.d.ts +462 -0
- package/build/src/ai/ai.d.ts.map +1 -0
- package/build/src/ai/ai.js +1 -0
- package/build/src/ai/index.d.ts +3 -0
- package/build/src/ai/index.d.ts.map +1 -0
- package/build/src/ai/index.js +2 -0
- package/build/src/ai/utils.d.ts +6 -0
- package/build/src/ai/utils.d.ts.map +1 -0
- package/build/src/ai/utils.js +82 -0
- package/build/src/billing/billing.d.ts +100 -0
- package/build/src/billing/billing.d.ts.map +1 -0
- package/build/src/billing/billing.js +1 -0
- package/build/src/billing/index.d.ts +2 -0
- package/build/src/billing/index.d.ts.map +1 -0
- package/build/src/billing/index.js +1 -0
- package/build/src/connection/connection.d.ts +650 -0
- package/build/src/connection/connection.d.ts.map +1 -0
- package/build/src/connection/connection.js +2 -0
- package/build/src/connection/index.d.ts +2 -0
- package/build/src/connection/index.d.ts.map +1 -0
- package/build/src/connection/index.js +1 -0
- package/build/src/expression/expression.d.ts +66 -0
- package/build/src/expression/expression.d.ts.map +1 -0
- package/build/src/expression/expression.js +2 -0
- package/build/src/expression/index.d.ts +3 -0
- package/build/src/expression/index.d.ts.map +1 -0
- package/build/src/expression/index.js +2 -0
- package/build/src/expression/utils.d.ts +4 -0
- package/build/src/expression/utils.d.ts.map +1 -0
- package/build/src/expression/utils.js +63 -0
- package/build/src/global/index.d.ts +2 -0
- package/build/src/global/index.d.ts.map +1 -0
- package/build/src/global/index.js +1 -0
- package/build/src/global/utils.d.ts +5 -0
- package/build/src/global/utils.d.ts.map +1 -0
- package/build/src/global/utils.js +32 -0
- package/build/src/index.d.ts +13 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +12 -0
- package/build/src/orchestration/index.d.ts +3 -0
- package/build/src/orchestration/index.d.ts.map +1 -0
- package/build/src/orchestration/index.js +2 -0
- package/build/src/orchestration/orchestration.d.ts +534 -0
- package/build/src/orchestration/orchestration.d.ts.map +1 -0
- package/build/src/orchestration/orchestration.js +1 -0
- package/build/src/orchestration/utils.d.ts +7 -0
- package/build/src/orchestration/utils.d.ts.map +1 -0
- package/build/src/orchestration/utils.js +90 -0
- package/build/src/revenueOrganization/index.d.ts +2 -0
- package/build/src/revenueOrganization/index.d.ts.map +1 -0
- package/build/src/revenueOrganization/index.js +1 -0
- package/build/src/revenueOrganization/revenueOrganization.d.ts +114 -0
- package/build/src/revenueOrganization/revenueOrganization.d.ts.map +1 -0
- package/build/src/revenueOrganization/revenueOrganization.js +2 -0
- package/build/src/segmentation/index.d.ts +2 -0
- package/build/src/segmentation/index.d.ts.map +1 -0
- package/build/src/segmentation/index.js +1 -0
- package/build/src/segmentation/segmentation.d.ts +74 -0
- package/build/src/segmentation/segmentation.d.ts.map +1 -0
- package/build/src/segmentation/segmentation.js +1 -0
- package/build/src/storage/index.d.ts +2 -0
- package/build/src/storage/index.d.ts.map +1 -0
- package/build/src/storage/index.js +1 -0
- package/build/src/storage/storage.d.ts +144 -0
- package/build/src/storage/storage.d.ts.map +1 -0
- package/build/src/storage/storage.js +2 -0
- package/build/src/systemOfRecordIntegration/clients/bigQuery.d.ts +26 -0
- package/build/src/systemOfRecordIntegration/clients/bigQuery.d.ts.map +1 -0
- package/build/src/systemOfRecordIntegration/clients/bigQuery.js +1 -0
- package/build/src/systemOfRecordIntegration/clients/snowflake.d.ts +26 -0
- package/build/src/systemOfRecordIntegration/clients/snowflake.d.ts.map +1 -0
- package/build/src/systemOfRecordIntegration/clients/snowflake.js +1 -0
- package/build/src/systemOfRecordIntegration/index.d.ts +2 -0
- package/build/src/systemOfRecordIntegration/index.d.ts.map +1 -0
- package/build/src/systemOfRecordIntegration/index.js +1 -0
- package/build/src/systemOfRecordIntegration/systemOfRecordIntegration.d.ts +777 -0
- package/build/src/systemOfRecordIntegration/systemOfRecordIntegration.d.ts.map +1 -0
- package/build/src/systemOfRecordIntegration/systemOfRecordIntegration.js +2 -0
- package/build/src/userManagement/index.d.ts +2 -0
- package/build/src/userManagement/index.d.ts.map +1 -0
- package/build/src/userManagement/index.js +1 -0
- package/build/src/userManagement/userManagement.d.ts +21 -0
- package/build/src/userManagement/userManagement.d.ts.map +1 -0
- package/build/src/userManagement/userManagement.js +1 -0
- package/build/src/utils.d.ts +9 -0
- package/build/src/utils.d.ts.map +1 -0
- package/build/src/utils.js +1 -0
- package/build/src/workspaceManagement/index.d.ts +2 -0
- package/build/src/workspaceManagement/index.d.ts.map +1 -0
- package/build/src/workspaceManagement/index.js +1 -0
- package/build/src/workspaceManagement/workspaceManagement.d.ts +79 -0
- package/build/src/workspaceManagement/workspaceManagement.d.ts.map +1 -0
- package/build/src/workspaceManagement/workspaceManagement.js +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +8 -2
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Cargo Types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types and domain models for Cargo.
|
|
4
|
+
|
|
5
|
+
This package provides the canonical type definitions and domain structures used across Cargo products (e.g. **@cargo-ai/api**, backends, and internal tooling). It includes Zod schemas and domain-specific utilities where applicable.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @@cargo-ai/types
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Dependency
|
|
14
|
+
|
|
15
|
+
`@cargo-ai/types` depends on **@cargo-ai/utils**. Install it if your environment does not already provide it:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @cargo-ai/utils
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Contents
|
|
22
|
+
|
|
23
|
+
Domain-oriented types and helpers for:
|
|
24
|
+
|
|
25
|
+
- **Ai** – AI resources, agents, MCP servers, files, templates
|
|
26
|
+
- **Billing** – billing and subscription types
|
|
27
|
+
- **Connection** – connectors, integrations, filters, extractors
|
|
28
|
+
- **Expression** – expression types and `ExpressionUtils`
|
|
29
|
+
- **Orchestration** – workflows, plays, tools, templates, `OrchestrationUtils`
|
|
30
|
+
- **RevenueOrganization** – members, capacities, territories
|
|
31
|
+
- **Segmentation** – segment types
|
|
32
|
+
- **Storage** – datasets, models, relationships, columns
|
|
33
|
+
- **SystemOfRecordIntegration** – system of records, clients
|
|
34
|
+
- **UserManagement** – user and permission types
|
|
35
|
+
- **WorkspaceManagement** – workspaces, folders, roles, tokens
|
|
36
|
+
- **Global** – shared utilities used across domains
|
|
37
|
+
|
|
38
|
+
Use these types when you need to type payloads, validate data, or share structures with the Cargo API and backend without depending on the full **@cargo-ai/api** client.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Node.js 22.x
|
|
43
|
+
- TypeScript (for types)
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
See the root of the repository for license information.
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import type { UIMessagePart, UITool } from "ai";
|
|
2
|
+
import type { Schema as JsonSchema } from "jsonschema";
|
|
3
|
+
import type { SegmentationTypes } from "../segmentation/segmentation.js";
|
|
4
|
+
export declare namespace AiTypes {
|
|
5
|
+
type BaseTool = {
|
|
6
|
+
name: string | null;
|
|
7
|
+
slug: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
isBulkAllowed: boolean;
|
|
10
|
+
config: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
export type ToolTool = BaseTool & {
|
|
13
|
+
kind: "tool";
|
|
14
|
+
toolUuid: string | null;
|
|
15
|
+
templateSlug: string | null;
|
|
16
|
+
};
|
|
17
|
+
export type AgentTool = BaseTool & {
|
|
18
|
+
kind: "agent";
|
|
19
|
+
agentUuid: string | null;
|
|
20
|
+
templateSlug: string | null;
|
|
21
|
+
};
|
|
22
|
+
export type ConnectorTool = BaseTool & {
|
|
23
|
+
kind: "connector";
|
|
24
|
+
integrationSlug: string;
|
|
25
|
+
connectorUuid: string | null;
|
|
26
|
+
actionSlug: string;
|
|
27
|
+
};
|
|
28
|
+
export type Tool = ToolTool | AgentTool | ConnectorTool;
|
|
29
|
+
export type Capability = {
|
|
30
|
+
slug: string;
|
|
31
|
+
};
|
|
32
|
+
type BaseResource = {
|
|
33
|
+
name: string | null;
|
|
34
|
+
slug: string;
|
|
35
|
+
description: string | null;
|
|
36
|
+
prompt: string | null;
|
|
37
|
+
};
|
|
38
|
+
export type ModelResource = BaseResource & {
|
|
39
|
+
kind: "model";
|
|
40
|
+
integrationSlug: string | null;
|
|
41
|
+
modelUuid: string | null;
|
|
42
|
+
filter: SegmentationTypes.Filter | null;
|
|
43
|
+
selectedColumnSlugs: string[] | null;
|
|
44
|
+
limit: number | null;
|
|
45
|
+
};
|
|
46
|
+
export type FileOrFolder = {
|
|
47
|
+
kind: "file";
|
|
48
|
+
fileUuid: string;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "folder";
|
|
51
|
+
folderUuid: string;
|
|
52
|
+
};
|
|
53
|
+
export type FileResource = BaseResource & {
|
|
54
|
+
kind: "file";
|
|
55
|
+
items: FileOrFolder[];
|
|
56
|
+
};
|
|
57
|
+
export type Resource = ModelResource | FileResource;
|
|
58
|
+
export type McpServer = {
|
|
59
|
+
uuid: string;
|
|
60
|
+
workspaceUuid: string;
|
|
61
|
+
userUuid: string;
|
|
62
|
+
name: string;
|
|
63
|
+
tools: Tool[];
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
updatedAt: Date;
|
|
66
|
+
deletedAt: Date | null;
|
|
67
|
+
};
|
|
68
|
+
export type AgentTriggerConnector = {
|
|
69
|
+
name: string;
|
|
70
|
+
description: string | null;
|
|
71
|
+
type: "connector";
|
|
72
|
+
connectorUuid: string | null;
|
|
73
|
+
integrationSlug: string;
|
|
74
|
+
config: Record<string, unknown>;
|
|
75
|
+
};
|
|
76
|
+
export type AgentTriggerCron = {
|
|
77
|
+
name: string;
|
|
78
|
+
description: string | null;
|
|
79
|
+
type: "cron";
|
|
80
|
+
cron: string;
|
|
81
|
+
temporalScheduleWorkflowId: string;
|
|
82
|
+
text: string;
|
|
83
|
+
};
|
|
84
|
+
export type AgentTrigger = AgentTriggerConnector | AgentTriggerCron;
|
|
85
|
+
export type AgentIcon = {
|
|
86
|
+
color: "grey" | "green" | "purple" | "yellow" | "blue" | "red";
|
|
87
|
+
face: string;
|
|
88
|
+
};
|
|
89
|
+
export type Agent = {
|
|
90
|
+
uuid: string;
|
|
91
|
+
workspaceUuid: string;
|
|
92
|
+
userUuid: string | null;
|
|
93
|
+
name: string;
|
|
94
|
+
icon: AgentIcon;
|
|
95
|
+
description: string | null;
|
|
96
|
+
triggers: AgentTrigger[];
|
|
97
|
+
deployedRelease: {
|
|
98
|
+
uuid: string;
|
|
99
|
+
userUuid: string;
|
|
100
|
+
description: string | null;
|
|
101
|
+
templateSlug: string | null;
|
|
102
|
+
version: string | null;
|
|
103
|
+
tools: Tool[];
|
|
104
|
+
capabilities: Capability[];
|
|
105
|
+
suggestedActions: SuggestedAction[];
|
|
106
|
+
systemPrompt: string;
|
|
107
|
+
withReasoning: boolean;
|
|
108
|
+
temperature: number;
|
|
109
|
+
maxSteps: number;
|
|
110
|
+
integrationSlug: string;
|
|
111
|
+
connectorUuid: string | null;
|
|
112
|
+
languageModelSlug: string;
|
|
113
|
+
mcpClients: McpClient[];
|
|
114
|
+
resources: Resource[];
|
|
115
|
+
deployedAt: Date | null;
|
|
116
|
+
createdAt: Date;
|
|
117
|
+
} | null;
|
|
118
|
+
folderUuid: string | null;
|
|
119
|
+
isReadOnly: boolean;
|
|
120
|
+
createdAt: Date;
|
|
121
|
+
updatedAt: Date;
|
|
122
|
+
deletedAt: Date | null;
|
|
123
|
+
};
|
|
124
|
+
export type TemplateCategory = "prospecting" | "ops" | "enablement" | "outreach" | "expansion";
|
|
125
|
+
type TemplateAuthor = {
|
|
126
|
+
name: string;
|
|
127
|
+
title: string;
|
|
128
|
+
company: {
|
|
129
|
+
name: string;
|
|
130
|
+
url: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export type ToolTemplate = (Omit<ToolTool, "toolUuid" | "templateSlug"> & {
|
|
134
|
+
toolUuid: null;
|
|
135
|
+
templateSlug: string;
|
|
136
|
+
}) | (Omit<AgentTool, "agentUuid" | "templateSlug"> & {
|
|
137
|
+
agentUuid: null;
|
|
138
|
+
templateSlug: string;
|
|
139
|
+
}) | (Omit<ConnectorTool, "connectorUuid"> & {
|
|
140
|
+
connectorUuid: null;
|
|
141
|
+
});
|
|
142
|
+
export type ModelResourceTemplate = Omit<ModelResource, "name" | "modelUuid"> & {
|
|
143
|
+
name: string;
|
|
144
|
+
modelUuid: null;
|
|
145
|
+
};
|
|
146
|
+
export type FileResourceTemplate = Omit<FileResource, "name"> & {
|
|
147
|
+
name: string;
|
|
148
|
+
};
|
|
149
|
+
export type ResourceTemplate = ModelResourceTemplate | FileResourceTemplate;
|
|
150
|
+
type TemplateBase = {
|
|
151
|
+
slug: string;
|
|
152
|
+
name: string;
|
|
153
|
+
description: string;
|
|
154
|
+
categories: TemplateCategory[];
|
|
155
|
+
author: TemplateAuthor;
|
|
156
|
+
publishedAt: string;
|
|
157
|
+
};
|
|
158
|
+
export type AgentTemplate = TemplateBase & {
|
|
159
|
+
kind: "agent";
|
|
160
|
+
icon: AgentIcon;
|
|
161
|
+
isReadOnly: boolean;
|
|
162
|
+
systemPrompt: string;
|
|
163
|
+
withReasoning: boolean;
|
|
164
|
+
temperature: number;
|
|
165
|
+
maxSteps: number;
|
|
166
|
+
integrationSlug: string;
|
|
167
|
+
languageModelSlug: string;
|
|
168
|
+
suggestedActions: SuggestedAction[];
|
|
169
|
+
capabilities: Capability[];
|
|
170
|
+
tools: ToolTemplate[];
|
|
171
|
+
resources: ResourceTemplate[];
|
|
172
|
+
};
|
|
173
|
+
export type Template = AgentTemplate;
|
|
174
|
+
export type SuggestedActionTool = {
|
|
175
|
+
slug: string;
|
|
176
|
+
};
|
|
177
|
+
export type SuggestedAction = {
|
|
178
|
+
text: string;
|
|
179
|
+
tools: SuggestedActionTool[];
|
|
180
|
+
};
|
|
181
|
+
export type ReleaseStatus = "draft" | "deployed" | "archived";
|
|
182
|
+
export type McpClientAuthentication = {
|
|
183
|
+
issuedAt: string;
|
|
184
|
+
accessToken: string;
|
|
185
|
+
expiresIn?: number;
|
|
186
|
+
refreshToken?: string;
|
|
187
|
+
scope?: string;
|
|
188
|
+
tokenType?: string;
|
|
189
|
+
clientId?: string;
|
|
190
|
+
};
|
|
191
|
+
export type McpClient = {
|
|
192
|
+
name: string;
|
|
193
|
+
url: string;
|
|
194
|
+
authentication: McpClientAuthentication | null;
|
|
195
|
+
disabledToolSlugs: string[];
|
|
196
|
+
};
|
|
197
|
+
export type Release = {
|
|
198
|
+
uuid: string;
|
|
199
|
+
parentUuid: string | null;
|
|
200
|
+
workspaceUuid: string;
|
|
201
|
+
userUuid: string;
|
|
202
|
+
agentUuid: string;
|
|
203
|
+
description: string | null;
|
|
204
|
+
templateSlug: string | null;
|
|
205
|
+
version: string | null;
|
|
206
|
+
status: ReleaseStatus;
|
|
207
|
+
tools: Tool[];
|
|
208
|
+
resources: Resource[];
|
|
209
|
+
capabilities: Capability[];
|
|
210
|
+
suggestedActions: SuggestedAction[];
|
|
211
|
+
systemPrompt: string;
|
|
212
|
+
withReasoning: boolean;
|
|
213
|
+
temperature: number;
|
|
214
|
+
maxSteps: number;
|
|
215
|
+
integrationSlug: string;
|
|
216
|
+
connectorUuid: string | null;
|
|
217
|
+
languageModelSlug: string;
|
|
218
|
+
mcpClients: McpClient[];
|
|
219
|
+
deployedAt: Date | null;
|
|
220
|
+
createdAt: Date;
|
|
221
|
+
updatedAt: Date;
|
|
222
|
+
};
|
|
223
|
+
export type ChatTrigger = {
|
|
224
|
+
type: "chat";
|
|
225
|
+
uuid: string;
|
|
226
|
+
agentUuid: string | null;
|
|
227
|
+
messageUuid: string | null;
|
|
228
|
+
} | {
|
|
229
|
+
type: "connector";
|
|
230
|
+
connectorUuid: string;
|
|
231
|
+
meta: Record<string, unknown>;
|
|
232
|
+
} | {
|
|
233
|
+
type: "draft";
|
|
234
|
+
} | {
|
|
235
|
+
type: "web_extension";
|
|
236
|
+
url: string | null;
|
|
237
|
+
} | {
|
|
238
|
+
type: "app";
|
|
239
|
+
} | {
|
|
240
|
+
type: "workflow";
|
|
241
|
+
uuid: string;
|
|
242
|
+
nodeUuid: string;
|
|
243
|
+
runUuid: string | null;
|
|
244
|
+
} | {
|
|
245
|
+
type: "schedule";
|
|
246
|
+
};
|
|
247
|
+
export type Chat = {
|
|
248
|
+
uuid: string;
|
|
249
|
+
slug: string;
|
|
250
|
+
workspaceUuid: string;
|
|
251
|
+
userUuid: string | null;
|
|
252
|
+
agentUuid: string | null;
|
|
253
|
+
releaseUuid: string | null;
|
|
254
|
+
name: string | null;
|
|
255
|
+
trigger: ChatTrigger;
|
|
256
|
+
activeStreamUuid: string | null;
|
|
257
|
+
creditsUsedCount: number;
|
|
258
|
+
createdAt: Date;
|
|
259
|
+
updatedAt: Date;
|
|
260
|
+
deletedAt: Date | null;
|
|
261
|
+
lastMessage: {
|
|
262
|
+
uuid: string;
|
|
263
|
+
workspaceUuid: string;
|
|
264
|
+
agentUuid: string | null;
|
|
265
|
+
releaseUuid: string | null;
|
|
266
|
+
chatUuid: string;
|
|
267
|
+
userUuid: string | null;
|
|
268
|
+
status: MessageStatus;
|
|
269
|
+
errorMessage: string | null;
|
|
270
|
+
type: MessageType;
|
|
271
|
+
createdAt: Date;
|
|
272
|
+
updatedAt: Date;
|
|
273
|
+
finishedAt: Date | null;
|
|
274
|
+
deletedAt: Date | null;
|
|
275
|
+
} | null;
|
|
276
|
+
};
|
|
277
|
+
export type Memory = {
|
|
278
|
+
mem0Id: string;
|
|
279
|
+
content: string;
|
|
280
|
+
createdAt: Date;
|
|
281
|
+
updatedAt: Date;
|
|
282
|
+
} & ({
|
|
283
|
+
scope: "workspace";
|
|
284
|
+
workspaceUuid: string;
|
|
285
|
+
} | {
|
|
286
|
+
scope: "user";
|
|
287
|
+
userUuid: string;
|
|
288
|
+
} | {
|
|
289
|
+
scope: "agent";
|
|
290
|
+
agentUuid: string;
|
|
291
|
+
workspaceUuid: string;
|
|
292
|
+
});
|
|
293
|
+
export type MessageStatus = "pending" | "generating" | "success" | "error" | "cancelling" | "cancelled";
|
|
294
|
+
export type MessageType = "user" | "assistant";
|
|
295
|
+
export type MessageS3FilePart = {
|
|
296
|
+
type: "s3File";
|
|
297
|
+
name: string;
|
|
298
|
+
s3Filename: string;
|
|
299
|
+
contentType: string;
|
|
300
|
+
};
|
|
301
|
+
export type MessagePart = UIMessagePart<Record<string, unknown>, Record<string, UITool>> | MessageS3FilePart;
|
|
302
|
+
export type EvaluatedTool = {
|
|
303
|
+
kind: "tool";
|
|
304
|
+
name: string;
|
|
305
|
+
toolUuid: string;
|
|
306
|
+
isBulk: boolean;
|
|
307
|
+
} | {
|
|
308
|
+
kind: "connector";
|
|
309
|
+
name: string;
|
|
310
|
+
integrationSlug: string;
|
|
311
|
+
connectorUuid: string;
|
|
312
|
+
actionSlug: string;
|
|
313
|
+
isBulk: boolean;
|
|
314
|
+
} | {
|
|
315
|
+
kind: "agent";
|
|
316
|
+
name: string;
|
|
317
|
+
agentUuid: string;
|
|
318
|
+
isBulk: boolean;
|
|
319
|
+
} | {
|
|
320
|
+
kind: "model";
|
|
321
|
+
name: string;
|
|
322
|
+
modelUuid: string;
|
|
323
|
+
} | {
|
|
324
|
+
kind: "file";
|
|
325
|
+
name: string;
|
|
326
|
+
items: FileOrFolder[];
|
|
327
|
+
} | {
|
|
328
|
+
kind: "mcpServer";
|
|
329
|
+
name: string;
|
|
330
|
+
url: string;
|
|
331
|
+
} | {
|
|
332
|
+
kind: "autocomplete";
|
|
333
|
+
name: string;
|
|
334
|
+
integrationSlug: string;
|
|
335
|
+
autocompleteSlug: string;
|
|
336
|
+
} | {
|
|
337
|
+
kind: "capability";
|
|
338
|
+
name: string;
|
|
339
|
+
slug: string;
|
|
340
|
+
};
|
|
341
|
+
export type EvaluatedToolInvocationOutput<T> = {
|
|
342
|
+
outcome: "notExecuted";
|
|
343
|
+
errorMessage: string;
|
|
344
|
+
runUuid?: string;
|
|
345
|
+
batchUuid?: string;
|
|
346
|
+
} | {
|
|
347
|
+
outcome: "executing";
|
|
348
|
+
batchUuid?: string;
|
|
349
|
+
runUuid?: string;
|
|
350
|
+
} | {
|
|
351
|
+
outcome: "executed";
|
|
352
|
+
data?: T;
|
|
353
|
+
batchUuid?: string;
|
|
354
|
+
runUuid?: string;
|
|
355
|
+
creditsUsedCount?: number;
|
|
356
|
+
};
|
|
357
|
+
export type EvaluatedToolInvocation<Input = unknown, Output = unknown> = {
|
|
358
|
+
id: string;
|
|
359
|
+
input: Input;
|
|
360
|
+
output: EvaluatedToolInvocationOutput<Output>;
|
|
361
|
+
};
|
|
362
|
+
export type MessageUsage = {
|
|
363
|
+
tokensUsedCount: number;
|
|
364
|
+
creditsUsedCount: number;
|
|
365
|
+
languageModelSlug: string;
|
|
366
|
+
connectorUuid: string;
|
|
367
|
+
};
|
|
368
|
+
export type MessageMetadata = {
|
|
369
|
+
agentUuid?: string;
|
|
370
|
+
createdAt?: string;
|
|
371
|
+
evaluatedTools?: Record<string, EvaluatedTool>;
|
|
372
|
+
usage?: MessageUsage;
|
|
373
|
+
suggestedActions?: SuggestedAction[];
|
|
374
|
+
};
|
|
375
|
+
export type MessageOutput = {
|
|
376
|
+
type: "text";
|
|
377
|
+
} | {
|
|
378
|
+
type: "jsonSchema";
|
|
379
|
+
jsonSchema: JsonSchema;
|
|
380
|
+
};
|
|
381
|
+
export type Message = {
|
|
382
|
+
uuid: string;
|
|
383
|
+
workspaceUuid: string;
|
|
384
|
+
agentUuid: string | null;
|
|
385
|
+
releaseUuid: string | null;
|
|
386
|
+
chatUuid: string;
|
|
387
|
+
userUuid: string | null;
|
|
388
|
+
status: MessageStatus;
|
|
389
|
+
errorMessage: string | null;
|
|
390
|
+
type: MessageType;
|
|
391
|
+
parts: MessagePart[];
|
|
392
|
+
tools: Tool[];
|
|
393
|
+
resources: Resource[];
|
|
394
|
+
capabilities: Capability[];
|
|
395
|
+
mcpClients: McpClient[];
|
|
396
|
+
systemPrompt: string | null;
|
|
397
|
+
withReasoning: boolean | null;
|
|
398
|
+
temperature: number | null;
|
|
399
|
+
maxSteps: number | null;
|
|
400
|
+
integrationSlug: string | null;
|
|
401
|
+
connectorUuid: string | null;
|
|
402
|
+
languageModelSlug: string | null;
|
|
403
|
+
evaluatedTools: Record<string, EvaluatedTool>;
|
|
404
|
+
usage: MessageUsage | null;
|
|
405
|
+
output: MessageOutput;
|
|
406
|
+
meta: Record<string, unknown> | null;
|
|
407
|
+
suggestedActions: SuggestedAction[];
|
|
408
|
+
temporalWorkflowId: string | null;
|
|
409
|
+
createdAt: Date;
|
|
410
|
+
updatedAt: Date;
|
|
411
|
+
finishedAt: Date | null;
|
|
412
|
+
deletedAt: Date | null;
|
|
413
|
+
};
|
|
414
|
+
export type Vote = {
|
|
415
|
+
workspaceUuid: string;
|
|
416
|
+
userUuid: string;
|
|
417
|
+
chatUuid: string;
|
|
418
|
+
messageUuid: string;
|
|
419
|
+
isUpvoted: boolean;
|
|
420
|
+
updatedAt: Date;
|
|
421
|
+
};
|
|
422
|
+
export type DocumentKind = "text" | "code" | "image" | "sheet";
|
|
423
|
+
export type Document = {
|
|
424
|
+
uuid: string;
|
|
425
|
+
workspaceUuid: string;
|
|
426
|
+
userUuid: string;
|
|
427
|
+
title: string | null;
|
|
428
|
+
content: string;
|
|
429
|
+
kind: DocumentKind;
|
|
430
|
+
createdAt: Date;
|
|
431
|
+
deletedAt: Date | null;
|
|
432
|
+
};
|
|
433
|
+
export type DocumentSuggestion = {
|
|
434
|
+
uuid: string;
|
|
435
|
+
workspaceUuid: string;
|
|
436
|
+
userUuid: string;
|
|
437
|
+
documentUuid: string;
|
|
438
|
+
documentCreatedAt: Date;
|
|
439
|
+
originalText: string;
|
|
440
|
+
suggestedText: string;
|
|
441
|
+
description: string | null;
|
|
442
|
+
isResolved: boolean;
|
|
443
|
+
createdAt: Date;
|
|
444
|
+
};
|
|
445
|
+
export type File = {
|
|
446
|
+
uuid: string;
|
|
447
|
+
workspaceUuid: string;
|
|
448
|
+
userUuid: string | null;
|
|
449
|
+
name: string;
|
|
450
|
+
isTemporary: boolean;
|
|
451
|
+
folderUuid: string | null;
|
|
452
|
+
s3Filename: string;
|
|
453
|
+
openAiFileId: string;
|
|
454
|
+
contentType: string;
|
|
455
|
+
size: number;
|
|
456
|
+
createdAt: Date;
|
|
457
|
+
updatedAt: Date;
|
|
458
|
+
deletedAt: Date | null;
|
|
459
|
+
};
|
|
460
|
+
export {};
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../src/ai/ai.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGzE,yBAAiB,OAAO,CAAC;IACvB,KAAK,QAAQ,GAAG;QACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,aAAa,EAAE,OAAO,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACjC,CAAC;IAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;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,IAAI,EAAE,YAAY,CAAC;QACnB,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;KACxB,CAAC;IAEF,MAAM,MAAM,kBAAkB,GAAG;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,IAAI,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,UAAU,EAAE,OAAO,CAAC;QACpB,SAAS,EAAE,IAAI,CAAC;KACjB,CAAC;IAEF,MAAM,MAAM,IAAI,GAAG;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;QACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;KACxB,CAAC;;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/ai/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,eAAO,MAAM,WAAW,EAAE;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAmFnC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { GlobalUtils } from "../global/index.js";
|
|
2
|
+
export const agentConfig = {
|
|
3
|
+
jsonSchema: {
|
|
4
|
+
type: "object",
|
|
5
|
+
properties: {
|
|
6
|
+
prompt: {
|
|
7
|
+
type: "string",
|
|
8
|
+
title: "Prompt",
|
|
9
|
+
},
|
|
10
|
+
output: {
|
|
11
|
+
type: "object",
|
|
12
|
+
title: "Output",
|
|
13
|
+
properties: {
|
|
14
|
+
type: {
|
|
15
|
+
title: "Response format",
|
|
16
|
+
description: "Validate that the agent produces the output in the expected format",
|
|
17
|
+
type: "string",
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
const: "text",
|
|
21
|
+
title: "Text",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
const: "jsonSchema",
|
|
25
|
+
title: "JSON schema",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
default: "text",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
allOf: [
|
|
32
|
+
{
|
|
33
|
+
if: {
|
|
34
|
+
properties: {
|
|
35
|
+
type: {
|
|
36
|
+
const: "jsonSchema",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
then: {
|
|
41
|
+
properties: {
|
|
42
|
+
jsonSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
title: "JSON Schema",
|
|
45
|
+
description: "To learn how to use JSON schemas, check https://json-schema.org/understanding-json-schema",
|
|
46
|
+
additionalProperties: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: ["jsonSchema"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
required: ["type"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ["prompt"],
|
|
57
|
+
definitions: GlobalUtils.jsonSchemaDefinitions,
|
|
58
|
+
},
|
|
59
|
+
uiSchema: {
|
|
60
|
+
prompt: {
|
|
61
|
+
"ui:options": {
|
|
62
|
+
height: 200,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
output: {
|
|
66
|
+
type: {
|
|
67
|
+
"ui:widget": "RadioWidget",
|
|
68
|
+
},
|
|
69
|
+
jsonSchema: {
|
|
70
|
+
"ui:widget": "JsonWidget",
|
|
71
|
+
"ui:placeholder": `{
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"status": { "type": "string" }
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": ["status"]
|
|
78
|
+
}`,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|