@joai/sdk 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +531 -121
- package/dist/index.mjs +238 -2
- package/package.json +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type WarpWalletProvider = BuiltInWarpWalletProvider | (string & {});
|
|
5
|
-
declare enum WarpChainName {
|
|
6
|
-
Multiversx = "multiversx",
|
|
7
|
-
Claws = "claws",
|
|
8
|
-
Sui = "sui",
|
|
9
|
-
Ethereum = "ethereum",
|
|
10
|
-
Base = "base",
|
|
11
|
-
Arbitrum = "arbitrum",
|
|
12
|
-
Polygon = "polygon",
|
|
13
|
-
Somnia = "somnia",
|
|
14
|
-
Tempo = "tempo",
|
|
15
|
-
Fastset = "fastset",
|
|
16
|
-
Solana = "solana",
|
|
17
|
-
Near = "near"
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region ../core/dist/index.d.mts
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/config/types.d.ts
|
|
23
|
-
type AppEnv = 'mainnet' | 'testnet' | 'devnet' | 'local'; //#endregion
|
|
24
|
-
//#region src/config/urls.d.ts
|
|
25
|
-
//#endregion
|
|
1
|
+
import { WarpBrandUrls, WarpChainName, WarpClient, WarpI18nText, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
|
|
2
|
+
|
|
3
|
+
//#region ../core/dist/types-C4eYYzWF.d.mts
|
|
26
4
|
//#region src/http/types.d.ts
|
|
27
5
|
interface IHttpService {
|
|
28
6
|
readonly baseUrl: string;
|
|
@@ -52,14 +30,20 @@ interface IRequestOptions {
|
|
|
52
30
|
[name: string]: string;
|
|
53
31
|
};
|
|
54
32
|
} //#endregion
|
|
55
|
-
//#
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../core/dist/index.d.mts
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/config/types.d.ts
|
|
37
|
+
type AppEnv = 'mainnet' | 'testnet' | 'devnet' | 'local'; //#endregion
|
|
38
|
+
//#region src/config/urls.d.ts
|
|
56
39
|
//#endregion
|
|
57
40
|
//#region src/ingestion/types.d.ts
|
|
58
41
|
type IngestionSourceType = 'note' | 'meeting' | 'article' | 'email' | 'chat' | 'post' | 'webhook';
|
|
59
42
|
type IngestionStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'dead_lettered';
|
|
60
43
|
type AppIngestion = {
|
|
61
44
|
id: string;
|
|
62
|
-
|
|
45
|
+
slug: string | null;
|
|
46
|
+
isPublic: boolean;
|
|
63
47
|
sourceUrl: string | null;
|
|
64
48
|
viewCount: number;
|
|
65
49
|
signupCount: number;
|
|
@@ -71,6 +55,43 @@ type AppIngestion = {
|
|
|
71
55
|
summary: string | null;
|
|
72
56
|
hook: string | null;
|
|
73
57
|
primitivesCreated: Record<string, number>;
|
|
58
|
+
extracted?: {
|
|
59
|
+
memories?: Array<{
|
|
60
|
+
content: string;
|
|
61
|
+
thought?: string;
|
|
62
|
+
category?: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
}>;
|
|
65
|
+
actionItems?: Array<{
|
|
66
|
+
title: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
thought?: string;
|
|
69
|
+
priority?: string;
|
|
70
|
+
dueDate?: string;
|
|
71
|
+
}>;
|
|
72
|
+
reminders?: Array<{
|
|
73
|
+
text: string;
|
|
74
|
+
thought?: string;
|
|
75
|
+
scheduledAt?: string;
|
|
76
|
+
}>;
|
|
77
|
+
contacts?: Array<{
|
|
78
|
+
name: string;
|
|
79
|
+
company?: string;
|
|
80
|
+
thought?: string;
|
|
81
|
+
email?: string;
|
|
82
|
+
phone?: string;
|
|
83
|
+
tags?: string[];
|
|
84
|
+
}>;
|
|
85
|
+
goals?: Array<{
|
|
86
|
+
title: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
thought?: string;
|
|
89
|
+
}>;
|
|
90
|
+
documents?: Array<{
|
|
91
|
+
title: string;
|
|
92
|
+
thought?: string;
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
74
95
|
failureReason: string | null;
|
|
75
96
|
lastError: string | null;
|
|
76
97
|
processedAt: string | null;
|
|
@@ -81,8 +102,251 @@ type Character = {
|
|
|
81
102
|
id: string;
|
|
82
103
|
name: string;
|
|
83
104
|
system: string;
|
|
84
|
-
bio:
|
|
105
|
+
bio: WarpText | null;
|
|
106
|
+
}; //#endregion
|
|
107
|
+
//#region src/media/types.d.ts
|
|
108
|
+
type MediaLibraryAttributes = {
|
|
109
|
+
uuid: string;
|
|
110
|
+
order: number;
|
|
111
|
+
name: string;
|
|
112
|
+
custom_properties: {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
};
|
|
115
|
+
preview_url: null | string;
|
|
116
|
+
original_url: null | string;
|
|
117
|
+
extension?: string;
|
|
118
|
+
size?: number;
|
|
119
|
+
};
|
|
120
|
+
type MediaMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'video/x-msvideo' | 'audio/mpeg' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'audio/aac' | 'audio/m4a' | 'audio/m4b' | 'audio/m4p' | 'audio/m4v' | 'application/pdf' | 'application/json';
|
|
121
|
+
type Media = {
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
mime: MediaMime;
|
|
125
|
+
url: string;
|
|
126
|
+
library: MediaLibraryAttributes;
|
|
85
127
|
}; //#endregion
|
|
128
|
+
//#region src/wallet/types.d.ts
|
|
129
|
+
type Wallet = {
|
|
130
|
+
chain: WarpChainName;
|
|
131
|
+
active: boolean;
|
|
132
|
+
provider: WarpWalletProvider;
|
|
133
|
+
address: string;
|
|
134
|
+
privateKey?: string;
|
|
135
|
+
mnemonic?: string;
|
|
136
|
+
};
|
|
137
|
+
type Team = {
|
|
138
|
+
slug: string;
|
|
139
|
+
name: string;
|
|
140
|
+
personal: boolean;
|
|
141
|
+
description: string | null;
|
|
142
|
+
locale: WarpLocale;
|
|
143
|
+
timezone: string;
|
|
144
|
+
logo: string | null;
|
|
145
|
+
public: boolean;
|
|
146
|
+
createdAt: string;
|
|
147
|
+
blueprints?: Blueprint[];
|
|
148
|
+
flows?: Flow[];
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/flow/types.d.ts
|
|
152
|
+
type FlowCategory = 'none' | 'defi' | 'nft' | 'social' | 'devtools' | 'productivity' | 'trading' | 'portfolio';
|
|
153
|
+
type FlowStatus = 'draft' | 'published';
|
|
154
|
+
type Flow = {
|
|
155
|
+
slug: string;
|
|
156
|
+
team: Team;
|
|
157
|
+
name: string;
|
|
158
|
+
description: string | null;
|
|
159
|
+
category: FlowCategory;
|
|
160
|
+
status: FlowStatus;
|
|
161
|
+
publishedAt: string | null;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
steps: FlowStep[];
|
|
165
|
+
locales: WarpLocale[];
|
|
166
|
+
marketplace: MarketplaceInfo;
|
|
167
|
+
screenshots: string[];
|
|
168
|
+
};
|
|
169
|
+
type FlowStep = {
|
|
170
|
+
stepId: string;
|
|
171
|
+
order: number;
|
|
172
|
+
type: 'warp' | 'condition' | 'delay';
|
|
173
|
+
warpIdentifier: string | null;
|
|
174
|
+
dependsOn: string[] | null;
|
|
175
|
+
inputMappings: FlowInputMapping[] | null;
|
|
176
|
+
staticInputs: Record<string, any> | null;
|
|
177
|
+
condition: Record<string, any> | null;
|
|
178
|
+
};
|
|
179
|
+
type FlowInputMapping = {
|
|
180
|
+
sourceStepId: string;
|
|
181
|
+
sourceKey: string;
|
|
182
|
+
targetInput: string;
|
|
183
|
+
transform?: string;
|
|
184
|
+
}; //#endregion
|
|
185
|
+
//#region src/skill/types.d.ts
|
|
186
|
+
declare const SkillScope: {
|
|
187
|
+
readonly Agent: "agent";
|
|
188
|
+
readonly Team: "team";
|
|
189
|
+
};
|
|
190
|
+
type SkillScopeValue = (typeof SkillScope)[keyof typeof SkillScope];
|
|
191
|
+
type Skill = {
|
|
192
|
+
id: string;
|
|
193
|
+
name: string;
|
|
194
|
+
description: string;
|
|
195
|
+
content: string;
|
|
196
|
+
meta: Record<string, unknown> | null;
|
|
197
|
+
license: string | null;
|
|
198
|
+
compatibility: string | null;
|
|
199
|
+
allowedTools: string | null;
|
|
200
|
+
source: string;
|
|
201
|
+
sourcePath: string | null;
|
|
202
|
+
scope?: SkillScopeValue;
|
|
203
|
+
active: boolean;
|
|
204
|
+
marketplace: MarketplaceInfo;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
media?: Media[];
|
|
207
|
+
screenshots: string[];
|
|
208
|
+
}; //#endregion
|
|
209
|
+
//#region src/warp/types.d.ts
|
|
210
|
+
type WarpExtrasFaq = {
|
|
211
|
+
question: string;
|
|
212
|
+
answer: string;
|
|
213
|
+
};
|
|
214
|
+
type WarpExtras = {
|
|
215
|
+
keywords?: Record<string, string[]>;
|
|
216
|
+
useCases?: Record<string, string[]>;
|
|
217
|
+
category?: string;
|
|
218
|
+
faq?: Record<string, WarpExtrasFaq[]>;
|
|
219
|
+
};
|
|
220
|
+
type WarpBackend = {
|
|
221
|
+
hash: string;
|
|
222
|
+
identifier: string;
|
|
223
|
+
chain: WarpChainName | null;
|
|
224
|
+
alias: string;
|
|
225
|
+
name: string;
|
|
226
|
+
title: string;
|
|
227
|
+
description: string;
|
|
228
|
+
preview: string | null;
|
|
229
|
+
creator: string;
|
|
230
|
+
status: WarpBackendStatus;
|
|
231
|
+
active: boolean;
|
|
232
|
+
category: WarpBackendCategory;
|
|
233
|
+
featured: boolean;
|
|
234
|
+
price?: number | null;
|
|
235
|
+
primaryAddress: string | null;
|
|
236
|
+
primaryFunc: string | null;
|
|
237
|
+
locales: WarpLocale[];
|
|
238
|
+
brand: BrandBackend | null;
|
|
239
|
+
definition?: Record<string, any> | null;
|
|
240
|
+
extras?: WarpExtras | null;
|
|
241
|
+
};
|
|
242
|
+
type WarpBackendStatus = 'unverified' | 'verified' | 'blacklisted';
|
|
243
|
+
type WarpBackendCategory = 'none';
|
|
244
|
+
type BrandSourceConfig = {
|
|
245
|
+
type: string;
|
|
246
|
+
chain?: string;
|
|
247
|
+
url?: string;
|
|
248
|
+
contract?: string;
|
|
249
|
+
endpoints?: string[];
|
|
250
|
+
};
|
|
251
|
+
type BrandIntegrationProvider = 'claude' | 'codex' | 'cursor' | 'openai';
|
|
252
|
+
type BrandIntegrationAction = {
|
|
253
|
+
type: 'copy' | 'link' | 'deeplink';
|
|
254
|
+
label: string;
|
|
255
|
+
value: string;
|
|
256
|
+
};
|
|
257
|
+
type BrandIntegration = {
|
|
258
|
+
provider: BrandIntegrationProvider;
|
|
259
|
+
available: boolean;
|
|
260
|
+
status: 'disabled' | 'planned' | 'ready' | 'runtime_ready' | 'submission_ready';
|
|
261
|
+
title: string;
|
|
262
|
+
description: string;
|
|
263
|
+
primaryAction: BrandIntegrationAction;
|
|
264
|
+
secondaryAction?: BrandIntegrationAction | null;
|
|
265
|
+
sourceUrl?: string | null;
|
|
266
|
+
fallbackUrl?: string | null;
|
|
267
|
+
notes?: string[];
|
|
268
|
+
};
|
|
269
|
+
type BrandBackend = {
|
|
270
|
+
hash: string;
|
|
271
|
+
slug: string;
|
|
272
|
+
name: string;
|
|
273
|
+
description: string;
|
|
274
|
+
logo: string;
|
|
275
|
+
colors: string;
|
|
276
|
+
urls: WarpBrandUrls;
|
|
277
|
+
locales: WarpLocale[];
|
|
278
|
+
warps: WarpBackend[];
|
|
279
|
+
isTeamOwned?: boolean;
|
|
280
|
+
inviteCode?: string;
|
|
281
|
+
source?: BrandSourceConfig | null;
|
|
282
|
+
contract?: string;
|
|
283
|
+
isContractBrand?: boolean;
|
|
284
|
+
meta?: {
|
|
285
|
+
rating?: number;
|
|
286
|
+
reviewCount?: number;
|
|
287
|
+
};
|
|
288
|
+
external?: {
|
|
289
|
+
mcp?: string | null;
|
|
290
|
+
integrations?: Partial<Record<BrandIntegrationProvider, BrandIntegration>>;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
type PricingModel = 'free' | 'one-time' | 'monthly' | 'per-run';
|
|
294
|
+
type MarketplacePricing = {
|
|
295
|
+
model: PricingModel;
|
|
296
|
+
amount: string;
|
|
297
|
+
currency: string;
|
|
298
|
+
chain?: WarpChainName | null;
|
|
299
|
+
planSku?: string | null;
|
|
300
|
+
freeTier?: {
|
|
301
|
+
runs?: number;
|
|
302
|
+
trialDays?: number;
|
|
303
|
+
} | null;
|
|
304
|
+
};
|
|
305
|
+
type MarketplaceInfo = {
|
|
306
|
+
price: number | null;
|
|
307
|
+
purchased: boolean;
|
|
308
|
+
uses: number;
|
|
309
|
+
public: boolean;
|
|
310
|
+
pricing: MarketplacePricing;
|
|
311
|
+
};
|
|
312
|
+
type MarketplaceAgent = {
|
|
313
|
+
uuid: string;
|
|
314
|
+
name: string;
|
|
315
|
+
description: string | null;
|
|
316
|
+
avatar: string | null;
|
|
317
|
+
wallets: {
|
|
318
|
+
address: string;
|
|
319
|
+
chain: WarpChainName;
|
|
320
|
+
}[];
|
|
321
|
+
character: {
|
|
322
|
+
name: string | null;
|
|
323
|
+
bio: string | null;
|
|
324
|
+
} | null;
|
|
325
|
+
marketplace: MarketplaceInfo;
|
|
326
|
+
screenshots: string[];
|
|
327
|
+
};
|
|
328
|
+
type MarketplaceItem = {
|
|
329
|
+
type: 'agent';
|
|
330
|
+
item: MarketplaceAgent;
|
|
331
|
+
} | {
|
|
332
|
+
type: 'blueprint';
|
|
333
|
+
item: Blueprint;
|
|
334
|
+
} | {
|
|
335
|
+
type: 'flow';
|
|
336
|
+
item: Flow;
|
|
337
|
+
} | {
|
|
338
|
+
type: 'skill';
|
|
339
|
+
item: Skill;
|
|
340
|
+
};
|
|
341
|
+
type MarketplaceData = {
|
|
342
|
+
blueprints: Blueprint[];
|
|
343
|
+
skills: Skill[];
|
|
344
|
+
flows: Flow[];
|
|
345
|
+
creators: BrandBackend[];
|
|
346
|
+
agents: MarketplaceAgent[];
|
|
347
|
+
items: MarketplaceItem[];
|
|
348
|
+
};
|
|
349
|
+
//#endregion
|
|
86
350
|
//#region src/blueprint/types.d.ts
|
|
87
351
|
type BlueprintTeam = {
|
|
88
352
|
slug: string;
|
|
@@ -97,11 +361,11 @@ type Blueprint = {
|
|
|
97
361
|
avatar: string | null;
|
|
98
362
|
settings: BlueprintSettings;
|
|
99
363
|
verified: boolean;
|
|
100
|
-
public: boolean;
|
|
101
364
|
createdAt: string;
|
|
102
365
|
locales: WarpLocale[];
|
|
103
|
-
|
|
104
|
-
|
|
366
|
+
marketplace: MarketplaceInfo;
|
|
367
|
+
tags: string[];
|
|
368
|
+
screenshots: string[];
|
|
105
369
|
};
|
|
106
370
|
type BlueprintSettings = {
|
|
107
371
|
wallets: WarpChainName[];
|
|
@@ -113,7 +377,7 @@ type BlueprintSettings = {
|
|
|
113
377
|
onboarding: BlueprintOnboardingStep[];
|
|
114
378
|
redirect: BlueprintRedirect;
|
|
115
379
|
};
|
|
116
|
-
type BlueprintOnboardingStep = 'wallet' | 'fund'
|
|
380
|
+
type BlueprintOnboardingStep = 'wallet' | 'fund' | `@${string}`;
|
|
117
381
|
type BlueprintRedirect = 'interact' | null;
|
|
118
382
|
type BlueprintTask = {
|
|
119
383
|
warp: string;
|
|
@@ -127,26 +391,7 @@ type BlueprintShortcut = {
|
|
|
127
391
|
chat: boolean;
|
|
128
392
|
}; //#endregion
|
|
129
393
|
//#region src/helpers/string.d.ts
|
|
130
|
-
|
|
131
|
-
uuid: string;
|
|
132
|
-
order: number;
|
|
133
|
-
name: string;
|
|
134
|
-
custom_properties: {
|
|
135
|
-
[key: string]: any;
|
|
136
|
-
};
|
|
137
|
-
preview_url: null | string;
|
|
138
|
-
original_url: null | string;
|
|
139
|
-
extension?: string;
|
|
140
|
-
size?: number;
|
|
141
|
-
};
|
|
142
|
-
type MediaMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'video/x-msvideo' | 'audio/mpeg' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'audio/aac' | 'audio/m4a' | 'audio/m4b' | 'audio/m4p' | 'audio/m4v';
|
|
143
|
-
type Media = {
|
|
144
|
-
id: string;
|
|
145
|
-
name: string;
|
|
146
|
-
mime: MediaMime;
|
|
147
|
-
url: string;
|
|
148
|
-
library: MediaLibraryAttributes;
|
|
149
|
-
}; //#endregion
|
|
394
|
+
//#endregion
|
|
150
395
|
//#region src/integration/types.d.ts
|
|
151
396
|
type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'n8n' | 'ai-nexus' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'sentry' | 'readwise';
|
|
152
397
|
type IntegrationDetails = {
|
|
@@ -167,6 +412,7 @@ type Integration = {
|
|
|
167
412
|
createdAt: string;
|
|
168
413
|
details?: IntegrationDetails;
|
|
169
414
|
};
|
|
415
|
+
type EmailProvider = 'resend' | 'mailgun' | 'sendgrid';
|
|
170
416
|
type RoomKind = 'default' | 'phone' | 'meeting';
|
|
171
417
|
type Room = {
|
|
172
418
|
id: string;
|
|
@@ -174,29 +420,16 @@ type Room = {
|
|
|
174
420
|
description: string | null;
|
|
175
421
|
public: boolean;
|
|
176
422
|
default: boolean;
|
|
423
|
+
active: boolean;
|
|
177
424
|
kind?: RoomKind | null;
|
|
178
425
|
archivedAt?: string | null;
|
|
179
426
|
secKey: string | null;
|
|
180
427
|
createdAt: string | null;
|
|
428
|
+
contactId?: string | null;
|
|
181
429
|
agent: AgentSimple;
|
|
182
430
|
integration: Integration | null;
|
|
183
431
|
}; //#endregion
|
|
184
|
-
//#region src/wallet/types.d.ts
|
|
185
|
-
type Wallet = {
|
|
186
|
-
chain: WarpChainName;
|
|
187
|
-
active: boolean;
|
|
188
|
-
provider: WarpWalletProvider;
|
|
189
|
-
address: string;
|
|
190
|
-
privateKey?: string;
|
|
191
|
-
mnemonic?: string;
|
|
192
|
-
};
|
|
193
|
-
//#endregion
|
|
194
432
|
//#region src/agent/types.d.ts
|
|
195
|
-
type AgentMpp = {
|
|
196
|
-
price: number;
|
|
197
|
-
currency?: string;
|
|
198
|
-
chain?: string;
|
|
199
|
-
};
|
|
200
433
|
type AgentPrivate = {
|
|
201
434
|
uuid: string;
|
|
202
435
|
name: string;
|
|
@@ -204,7 +437,7 @@ type AgentPrivate = {
|
|
|
204
437
|
avatar: string;
|
|
205
438
|
wallets: Wallet[];
|
|
206
439
|
settings: AgentSettings;
|
|
207
|
-
|
|
440
|
+
marketplace: MarketplaceInfo;
|
|
208
441
|
password: string | null;
|
|
209
442
|
authKey: string | null;
|
|
210
443
|
secKey: string;
|
|
@@ -238,55 +471,7 @@ type AgentSettings = {
|
|
|
238
471
|
'training.url'?: string | null;
|
|
239
472
|
'training.status'?: 'idle' | 'training' | 'completed' | 'failed' | null;
|
|
240
473
|
'training.recrawlInterval'?: number | null;
|
|
241
|
-
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/flow/types.d.ts
|
|
244
|
-
type FlowCategory = 'none' | 'defi' | 'nft' | 'social' | 'devtools' | 'productivity' | 'trading' | 'portfolio';
|
|
245
|
-
type FlowStatus = 'draft' | 'published';
|
|
246
|
-
type Flow = {
|
|
247
|
-
slug: string;
|
|
248
|
-
team: Team;
|
|
249
|
-
name: string;
|
|
250
|
-
description: string | null;
|
|
251
|
-
category: FlowCategory;
|
|
252
|
-
status: FlowStatus;
|
|
253
|
-
publishedAt: string | null;
|
|
254
|
-
createdAt: string;
|
|
255
|
-
updatedAt: string;
|
|
256
|
-
steps: FlowStep[];
|
|
257
|
-
locales: WarpLocale[];
|
|
258
|
-
price: number | null;
|
|
259
|
-
purchased: boolean;
|
|
260
|
-
};
|
|
261
|
-
type FlowStep = {
|
|
262
|
-
stepId: string;
|
|
263
|
-
order: number;
|
|
264
|
-
type: 'warp' | 'condition' | 'delay';
|
|
265
|
-
warpIdentifier: string | null;
|
|
266
|
-
dependsOn: string[] | null;
|
|
267
|
-
inputMappings: FlowInputMapping[] | null;
|
|
268
|
-
staticInputs: Record<string, any> | null;
|
|
269
|
-
condition: Record<string, any> | null;
|
|
270
|
-
};
|
|
271
|
-
type FlowInputMapping = {
|
|
272
|
-
sourceStepId: string;
|
|
273
|
-
sourceKey: string;
|
|
274
|
-
targetInput: string;
|
|
275
|
-
transform?: string;
|
|
276
|
-
}; //#endregion
|
|
277
|
-
//#region src/user/types.d.ts
|
|
278
|
-
type Team = {
|
|
279
|
-
slug: string;
|
|
280
|
-
name: string;
|
|
281
|
-
personal: boolean;
|
|
282
|
-
description: string | null;
|
|
283
|
-
locale: WarpLocale;
|
|
284
|
-
timezone: string;
|
|
285
|
-
logo: string | null;
|
|
286
|
-
public: boolean;
|
|
287
|
-
createdAt: string;
|
|
288
|
-
blueprints?: Blueprint[];
|
|
289
|
-
flows?: Flow[];
|
|
474
|
+
'email_provider'?: EmailProvider | null;
|
|
290
475
|
};
|
|
291
476
|
//#endregion
|
|
292
477
|
//#region src/contact/types.d.ts
|
|
@@ -300,9 +485,19 @@ type Contact = {
|
|
|
300
485
|
title: string | null;
|
|
301
486
|
birthday: string | null;
|
|
302
487
|
website: string | null;
|
|
488
|
+
location: string | null;
|
|
303
489
|
socials: Record<string, string> | null;
|
|
304
490
|
notes: string | null;
|
|
305
491
|
tags: string[] | null;
|
|
492
|
+
props?: Record<string, string> | null;
|
|
493
|
+
};
|
|
494
|
+
type ContactActivity = {
|
|
495
|
+
id: string;
|
|
496
|
+
type: 'note' | 'call' | 'meeting' | 'email' | 'task' | 'update' | 'custom';
|
|
497
|
+
description: string | null;
|
|
498
|
+
meta: Record<string, any> | null;
|
|
499
|
+
agentName: string | null;
|
|
500
|
+
createdAt: string;
|
|
306
501
|
};
|
|
307
502
|
type ContactFormData = {
|
|
308
503
|
name?: string;
|
|
@@ -312,9 +507,11 @@ type ContactFormData = {
|
|
|
312
507
|
title?: string | null;
|
|
313
508
|
birthday?: string | null;
|
|
314
509
|
website?: string | null;
|
|
510
|
+
location?: string | null;
|
|
315
511
|
socials?: Record<string, string> | null;
|
|
316
512
|
notes?: string | null;
|
|
317
513
|
tags?: string[] | null;
|
|
514
|
+
props?: Record<string, string> | null;
|
|
318
515
|
}; //#endregion
|
|
319
516
|
//#region src/contract/types.d.ts
|
|
320
517
|
//#endregion
|
|
@@ -364,6 +561,8 @@ type Item = {
|
|
|
364
561
|
goalId: string | null;
|
|
365
562
|
order: number | null;
|
|
366
563
|
assignedAgents: string[];
|
|
564
|
+
assignedContacts: string[];
|
|
565
|
+
assignedToUserIds: string[];
|
|
367
566
|
executionStatus: ItemExecutionStatus | null;
|
|
368
567
|
createdAt: string;
|
|
369
568
|
updatedAt: string;
|
|
@@ -376,8 +575,35 @@ type ItemCreatePayload = {
|
|
|
376
575
|
dueDate?: string;
|
|
377
576
|
goalId?: string;
|
|
378
577
|
status?: ItemStatus;
|
|
379
|
-
|
|
380
|
-
|
|
578
|
+
agents?: string[];
|
|
579
|
+
contactIds?: string[];
|
|
580
|
+
assignedToIds?: string[];
|
|
581
|
+
};
|
|
582
|
+
type MeetingStatus = 'active' | 'completed' | 'analyzed' | 'scheduled' | 'cancelled';
|
|
583
|
+
type MeetingConferenceProvider = 'google_meet' | 'teams' | 'zoom';
|
|
584
|
+
type MeetingFeature = 'transcription' | 'summary' | 'insights' | 'actions';
|
|
585
|
+
type MeetingJoinTeam = {
|
|
586
|
+
name: string;
|
|
587
|
+
logo: string | null;
|
|
588
|
+
};
|
|
589
|
+
type MeetingJoinInfo = {
|
|
590
|
+
id: string;
|
|
591
|
+
code: string;
|
|
592
|
+
name: string | null;
|
|
593
|
+
inviteUrl: string;
|
|
594
|
+
agentName: string;
|
|
595
|
+
team: MeetingJoinTeam;
|
|
596
|
+
status: MeetingStatus;
|
|
597
|
+
isPhysical: boolean;
|
|
598
|
+
scheduledAt: string | null;
|
|
599
|
+
scheduledEndAt: string | null;
|
|
600
|
+
timezone: string;
|
|
601
|
+
conferenceUrl: string | null;
|
|
602
|
+
conferenceProvider: MeetingConferenceProvider | null;
|
|
603
|
+
endedAt: string | null;
|
|
604
|
+
canCancel: boolean;
|
|
605
|
+
features: Record<MeetingFeature, boolean>;
|
|
606
|
+
};
|
|
381
607
|
//#endregion
|
|
382
608
|
//#region src/memory/types.d.ts
|
|
383
609
|
type Memory = {
|
|
@@ -387,7 +613,7 @@ type Memory = {
|
|
|
387
613
|
createdAt: string;
|
|
388
614
|
}; //#endregion
|
|
389
615
|
//#region src/peerme/types.d.ts
|
|
390
|
-
type ChatClientAction = 'AGENT_DELEGATE' | 'WARP_EXECUTE' | 'WARP_VIEW' | 'WARP_CREATE' | 'WARP_TEST' | 'WARP_INPUT' | 'WARP_APPROVE' | 'WARP_SELECT' | 'WARP_BATCH' | 'WARP_BULK' | 'ENTITY_PROPOSE' | 'ENTITY_SIGN' | 'SECRET_SET' | 'SECRET_AUTHORIZE' | 'HEALTH_QUERY' | 'HEALTH_WRITE' | 'ITEM_VIEW' | 'BOARD_SUMMARY' | 'GOAL_PROGRESS' | 'CONTACT_VIEW' | 'MARKETPLACE_PURCHASE' | 'WARP_CLOUD_EXECUTE' | 'MISSION_VIEW' | 'ACTIVITY' | 'PERSONA_QUESTION' | '
|
|
616
|
+
type ChatClientAction = 'AGENT_DELEGATE' | 'WARP_EXECUTE' | 'WARP_VIEW' | 'WARP_CREATE' | 'WARP_TEST' | 'WARP_INPUT' | 'WARP_APPROVE' | 'WARP_SELECT' | 'WARP_BATCH' | 'WARP_BULK' | 'ENTITY_PROPOSE' | 'ENTITY_SIGN' | 'SECRET_SET' | 'SECRET_AUTHORIZE' | 'HEALTH_QUERY' | 'HEALTH_WRITE' | 'ITEM_VIEW' | 'BOARD_SUMMARY' | 'GOAL_PROGRESS' | 'CONTACT_VIEW' | 'MARKETPLACE_PURCHASE' | 'WARP_CLOUD_EXECUTE' | 'MISSION_VIEW' | 'ACTIVITY' | 'PERSONA_QUESTION' | 'NFC_WRITE' | 'twilio.sms';
|
|
391
617
|
type Message = {
|
|
392
618
|
id: string;
|
|
393
619
|
room: string;
|
|
@@ -421,13 +647,63 @@ type Reminder = {
|
|
|
421
647
|
dispatchedAt?: string | null;
|
|
422
648
|
createdAt: string;
|
|
423
649
|
}; //#endregion
|
|
650
|
+
//#region src/service/types.d.ts
|
|
651
|
+
type Service = {
|
|
652
|
+
id: string;
|
|
653
|
+
slug: string;
|
|
654
|
+
name: string;
|
|
655
|
+
price: number;
|
|
656
|
+
durationMinutes: number;
|
|
657
|
+
category: string | null;
|
|
658
|
+
description: string | null;
|
|
659
|
+
active: boolean;
|
|
660
|
+
digital: boolean;
|
|
661
|
+
public: boolean;
|
|
662
|
+
createdAt: string;
|
|
663
|
+
updatedAt: string;
|
|
664
|
+
}; //#endregion
|
|
424
665
|
//#region src/shortcut/types.d.ts
|
|
425
666
|
//#endregion
|
|
667
|
+
//#region src/site/types.d.ts
|
|
668
|
+
type SiteTeam = {
|
|
669
|
+
name: string;
|
|
670
|
+
slug: string;
|
|
671
|
+
logoUrl: string | null;
|
|
672
|
+
};
|
|
673
|
+
type SiteAgent = {
|
|
674
|
+
uuid: string | null;
|
|
675
|
+
};
|
|
676
|
+
type Site = {
|
|
677
|
+
id: number;
|
|
678
|
+
brandSlug: string;
|
|
679
|
+
customDomain: string | null;
|
|
680
|
+
enabled: boolean;
|
|
681
|
+
team: SiteTeam | null;
|
|
682
|
+
agent: SiteAgent | null;
|
|
683
|
+
settings: Record<string, unknown>;
|
|
684
|
+
};
|
|
685
|
+
type SiteRoute = {
|
|
686
|
+
path: string;
|
|
687
|
+
warp: string;
|
|
688
|
+
label: WarpI18nText;
|
|
689
|
+
nav?: boolean;
|
|
690
|
+
hiddenFields?: string[];
|
|
691
|
+
};
|
|
692
|
+
type BrandSiteConfig = {
|
|
693
|
+
enabled: boolean;
|
|
694
|
+
auth?: boolean;
|
|
695
|
+
indexPath: string;
|
|
696
|
+
routes: SiteRoute[];
|
|
697
|
+
name?: string;
|
|
698
|
+
logoUrl?: string | null;
|
|
699
|
+
};
|
|
700
|
+
//#endregion
|
|
426
701
|
//#region src/resources/agents.d.ts
|
|
427
702
|
declare class AgentsResource {
|
|
428
703
|
private readonly http;
|
|
429
704
|
constructor(http: IHttpService);
|
|
430
705
|
list(): Promise<IAppResponse<AgentPrivate[]>>;
|
|
706
|
+
get(uuid: string): Promise<MarketplaceAgent | null>;
|
|
431
707
|
execute(agentUuid: string, payload: {
|
|
432
708
|
room: string;
|
|
433
709
|
message?: string;
|
|
@@ -438,9 +714,64 @@ declare class AgentsResource {
|
|
|
438
714
|
declare class BlueprintsResource {
|
|
439
715
|
private readonly http;
|
|
440
716
|
constructor(http: IHttpService);
|
|
717
|
+
list(params?: {
|
|
718
|
+
page?: number;
|
|
719
|
+
size?: number;
|
|
720
|
+
}): Promise<IAppResponse<Blueprint[]>>;
|
|
441
721
|
get(slug: string, locale?: string): Promise<IAppResponse<Blueprint>>;
|
|
442
722
|
}
|
|
443
723
|
//#endregion
|
|
724
|
+
//#region src/resources/flows.d.ts
|
|
725
|
+
declare class FlowsResource {
|
|
726
|
+
private readonly http;
|
|
727
|
+
constructor(http: IHttpService);
|
|
728
|
+
list(params?: {
|
|
729
|
+
locale?: string;
|
|
730
|
+
page?: number;
|
|
731
|
+
}): Promise<IAppResponse<Flow[]>>;
|
|
732
|
+
get(slug: string, locale?: string): Promise<IAppResponse<Flow>>;
|
|
733
|
+
}
|
|
734
|
+
//#endregion
|
|
735
|
+
//#region src/resources/marketplace.d.ts
|
|
736
|
+
declare class MarketplaceResource {
|
|
737
|
+
private readonly http;
|
|
738
|
+
constructor(http: IHttpService);
|
|
739
|
+
get(locale?: string): Promise<MarketplaceData>;
|
|
740
|
+
}
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/resources/services.d.ts
|
|
743
|
+
declare class ServicesResource {
|
|
744
|
+
private readonly http;
|
|
745
|
+
constructor(http: IHttpService);
|
|
746
|
+
get(id: string): Promise<IAppResponse<Service>>;
|
|
747
|
+
list(team: string): Promise<IAppResponse<Service[]>>;
|
|
748
|
+
store(team: string, data: {
|
|
749
|
+
name: string;
|
|
750
|
+
price: number;
|
|
751
|
+
durationMinutes: number;
|
|
752
|
+
category?: string;
|
|
753
|
+
description?: string;
|
|
754
|
+
digital?: boolean;
|
|
755
|
+
public?: boolean;
|
|
756
|
+
}): Promise<IAppResponse<Service>>;
|
|
757
|
+
update(id: string, data: Partial<Pick<Service, 'name' | 'price' | 'durationMinutes' | 'category' | 'description' | 'active' | 'digital' | 'public'>>): Promise<IAppResponse<Service>>;
|
|
758
|
+
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
759
|
+
}
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region src/resources/skills.d.ts
|
|
762
|
+
declare class SkillsResource {
|
|
763
|
+
private readonly http;
|
|
764
|
+
constructor(http: IHttpService);
|
|
765
|
+
get(id: string): Promise<IAppResponse<Skill>>;
|
|
766
|
+
}
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/resources/hub.d.ts
|
|
769
|
+
declare class HubResource {
|
|
770
|
+
private readonly http;
|
|
771
|
+
constructor(http: IHttpService);
|
|
772
|
+
subscribe(email: string, tag: 'blueprint' | 'digest' | 'marketplace'): Promise<IAppResponse<void>>;
|
|
773
|
+
}
|
|
774
|
+
//#endregion
|
|
444
775
|
//#region src/resources/contacts.d.ts
|
|
445
776
|
declare class ContactsResource {
|
|
446
777
|
private readonly http;
|
|
@@ -456,6 +787,11 @@ declare class ContactsResource {
|
|
|
456
787
|
}): Promise<IAppResponse<Contact>>;
|
|
457
788
|
update(id: string, data: ContactFormData): Promise<IAppResponse<Contact>>;
|
|
458
789
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
790
|
+
listActivities(id: string): Promise<IAppResponse<ContactActivity[]>>;
|
|
791
|
+
addActivity(id: string, data: {
|
|
792
|
+
type: ContactActivity['type'];
|
|
793
|
+
description?: string;
|
|
794
|
+
}): Promise<IAppResponse<ContactActivity>>;
|
|
459
795
|
}
|
|
460
796
|
//#endregion
|
|
461
797
|
//#region src/resources/documents.d.ts
|
|
@@ -481,10 +817,21 @@ declare class GoalsResource {
|
|
|
481
817
|
update(id: string, data: Partial<Goal>): Promise<IAppResponse<Goal>>;
|
|
482
818
|
}
|
|
483
819
|
//#endregion
|
|
820
|
+
//#region src/resources/meetings.d.ts
|
|
821
|
+
declare class MeetingsResource {
|
|
822
|
+
private readonly http;
|
|
823
|
+
constructor(http: IHttpService);
|
|
824
|
+
join(code: string): Promise<IAppResponse<MeetingJoinInfo>>;
|
|
825
|
+
}
|
|
826
|
+
//#endregion
|
|
484
827
|
//#region src/resources/ingestions.d.ts
|
|
485
828
|
declare class IngestionsResource {
|
|
486
829
|
private readonly http;
|
|
487
830
|
constructor(http: IHttpService);
|
|
831
|
+
list(params?: {
|
|
832
|
+
page?: number;
|
|
833
|
+
size?: number;
|
|
834
|
+
}): Promise<IAppResponse<AppIngestion[]>>;
|
|
488
835
|
getShared(shareToken: string): Promise<IAppResponse<AppIngestion>>;
|
|
489
836
|
}
|
|
490
837
|
//#endregion
|
|
@@ -544,11 +891,57 @@ declare class RoomsResource {
|
|
|
544
891
|
}): Promise<IAppResponse<Message[]>>;
|
|
545
892
|
}
|
|
546
893
|
//#endregion
|
|
894
|
+
//#region src/resources/sites.d.ts
|
|
895
|
+
declare class SitesResource {
|
|
896
|
+
private readonly http;
|
|
897
|
+
constructor(http: IHttpService);
|
|
898
|
+
listMine(teamSlug: string): Promise<IAppResponse<Site[]>>;
|
|
899
|
+
resolve(teamSlug: string, brandSlug: string): Promise<IAppResponse<Site>>;
|
|
900
|
+
resolveByDomain(domain: string): Promise<IAppResponse<Site>>;
|
|
901
|
+
update(siteSlug: string, data: {
|
|
902
|
+
customDomain?: string | null;
|
|
903
|
+
enabled?: boolean;
|
|
904
|
+
}): Promise<IAppResponse<{
|
|
905
|
+
updated: boolean;
|
|
906
|
+
}>>;
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
547
909
|
//#region src/resources/teams.d.ts
|
|
548
910
|
declare class TeamsResource {
|
|
549
911
|
private readonly http;
|
|
550
912
|
constructor(http: IHttpService);
|
|
551
913
|
list(): Promise<IAppResponse<Team[]>>;
|
|
914
|
+
invite(teamSlug: string, payload: {
|
|
915
|
+
email: string;
|
|
916
|
+
role: 'owner' | 'admin' | 'member';
|
|
917
|
+
}): Promise<IAppResponse<unknown>>;
|
|
918
|
+
}
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/resources/warps.d.ts
|
|
921
|
+
type WarpResponseData = {
|
|
922
|
+
id: string;
|
|
923
|
+
title: string;
|
|
924
|
+
url: string;
|
|
925
|
+
definition: Record<string, any>;
|
|
926
|
+
brand: {
|
|
927
|
+
name: string;
|
|
928
|
+
description?: string;
|
|
929
|
+
logo?: string | null;
|
|
930
|
+
} | null;
|
|
931
|
+
};
|
|
932
|
+
declare class WarpsResource {
|
|
933
|
+
private readonly http;
|
|
934
|
+
constructor(http: IHttpService);
|
|
935
|
+
list(brand?: string): Promise<IAppResponse<WarpResponseData[]>>;
|
|
936
|
+
show(identifier: string): Promise<IAppResponse<WarpResponseData>>;
|
|
937
|
+
create(data: {
|
|
938
|
+
brand: string;
|
|
939
|
+
definition: Record<string, any>;
|
|
940
|
+
public?: boolean;
|
|
941
|
+
}): Promise<IAppResponse<{
|
|
942
|
+
id: string;
|
|
943
|
+
}>>;
|
|
944
|
+
destroy(identifier: string): Promise<IAppResponse<unknown>>;
|
|
552
945
|
}
|
|
553
946
|
//#endregion
|
|
554
947
|
//#region src/client.d.ts
|
|
@@ -556,12 +949,19 @@ interface JoAiClientConfig {
|
|
|
556
949
|
apiToken?: string;
|
|
557
950
|
team?: string;
|
|
558
951
|
env?: AppEnv;
|
|
952
|
+
agentAuthKey?: string;
|
|
559
953
|
}
|
|
560
954
|
declare class JoAiClient {
|
|
561
955
|
readonly http: IHttpService;
|
|
956
|
+
private readonly env;
|
|
957
|
+
readonly hub: HubResource;
|
|
562
958
|
readonly teams: TeamsResource;
|
|
563
959
|
readonly agents: AgentsResource;
|
|
564
960
|
readonly blueprints: BlueprintsResource;
|
|
961
|
+
readonly flows: FlowsResource;
|
|
962
|
+
readonly marketplace: MarketplaceResource;
|
|
963
|
+
readonly services: ServicesResource;
|
|
964
|
+
readonly skills: SkillsResource;
|
|
565
965
|
readonly ingestions: IngestionsResource;
|
|
566
966
|
readonly rooms: RoomsResource;
|
|
567
967
|
readonly contacts: ContactsResource;
|
|
@@ -569,9 +969,19 @@ declare class JoAiClient {
|
|
|
569
969
|
readonly memories: MemoriesResource;
|
|
570
970
|
readonly goals: GoalsResource;
|
|
571
971
|
readonly reminders: RemindersResource;
|
|
972
|
+
readonly sites: SitesResource;
|
|
572
973
|
readonly documents: DocumentsResource;
|
|
974
|
+
readonly meetings: MeetingsResource;
|
|
975
|
+
readonly privateWarps: WarpsResource;
|
|
573
976
|
constructor(config: JoAiClientConfig);
|
|
977
|
+
warps(locale?: WarpLocale): WarpClient;
|
|
574
978
|
}
|
|
575
979
|
declare function createClient(config: JoAiClientConfig): JoAiClient;
|
|
576
980
|
//#endregion
|
|
577
|
-
|
|
981
|
+
//#region src/resources/distribution.d.ts
|
|
982
|
+
declare class DistributionResource {
|
|
983
|
+
getBrandSiteConfig(env: AppEnv, brandSlug: string): Promise<BrandSiteConfig | null>;
|
|
984
|
+
private fetchDistribution;
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
987
|
+
export { BlueprintsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, ServicesResource, SitesResource, SkillsResource, createClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WarpClient } from "@joai/warps";
|
|
1
2
|
//#region ../core/dist/index.mjs
|
|
2
3
|
const toSubdomainBaseUrl = (env, subdomain) => {
|
|
3
4
|
if (env === "local") return `http://${subdomain}.joai--api.test`;
|
|
@@ -116,6 +117,10 @@ var AgentsResource = class {
|
|
|
116
117
|
list() {
|
|
117
118
|
return this.http.get("agents");
|
|
118
119
|
}
|
|
120
|
+
async get(uuid) {
|
|
121
|
+
const res = await this.http.get(`agents/${uuid}`);
|
|
122
|
+
return res.ok ? res.data : null;
|
|
123
|
+
}
|
|
119
124
|
execute(agentUuid, payload) {
|
|
120
125
|
return this.http.post(`agents/${agentUuid}/execute`, payload);
|
|
121
126
|
}
|
|
@@ -126,11 +131,127 @@ var BlueprintsResource = class {
|
|
|
126
131
|
constructor(http) {
|
|
127
132
|
this.http = http;
|
|
128
133
|
}
|
|
134
|
+
list(params) {
|
|
135
|
+
const query = new URLSearchParams();
|
|
136
|
+
if (params?.page !== void 0) query.set("page", String(params.page));
|
|
137
|
+
if (params?.size !== void 0) query.set("size", String(params.size));
|
|
138
|
+
const qs = query.toString();
|
|
139
|
+
return this.http.get(qs ? `blueprints?${qs}` : "blueprints");
|
|
140
|
+
}
|
|
129
141
|
get(slug, locale = "en") {
|
|
130
142
|
return this.http.get(`blueprints/${slug}?locale=${locale}`);
|
|
131
143
|
}
|
|
132
144
|
};
|
|
133
145
|
//#endregion
|
|
146
|
+
//#region src/resources/flows.ts
|
|
147
|
+
var FlowsResource = class {
|
|
148
|
+
constructor(http) {
|
|
149
|
+
this.http = http;
|
|
150
|
+
}
|
|
151
|
+
list(params) {
|
|
152
|
+
const query = new URLSearchParams();
|
|
153
|
+
if (params?.locale) query.set("locale", params.locale);
|
|
154
|
+
if (params?.page !== void 0) query.set("page", String(params.page));
|
|
155
|
+
const qs = query.toString();
|
|
156
|
+
return this.http.get(qs ? `flows?${qs}` : "flows");
|
|
157
|
+
}
|
|
158
|
+
get(slug, locale = "en") {
|
|
159
|
+
return this.http.get(`flows/${slug}?locale=${locale}`);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/resources/marketplace.ts
|
|
164
|
+
var MarketplaceResource = class {
|
|
165
|
+
constructor(http) {
|
|
166
|
+
this.http = http;
|
|
167
|
+
}
|
|
168
|
+
async get(locale = "en") {
|
|
169
|
+
const res = await this.http.get(`marketplace?locale=${locale}`);
|
|
170
|
+
if (!res.ok || !res.data) return {
|
|
171
|
+
blueprints: [],
|
|
172
|
+
skills: [],
|
|
173
|
+
flows: [],
|
|
174
|
+
creators: [],
|
|
175
|
+
agents: [],
|
|
176
|
+
items: []
|
|
177
|
+
};
|
|
178
|
+
const { blueprints = [], skills = [], flows = [], creators = [], agents = [] } = res.data;
|
|
179
|
+
return {
|
|
180
|
+
blueprints,
|
|
181
|
+
skills,
|
|
182
|
+
flows,
|
|
183
|
+
creators,
|
|
184
|
+
agents,
|
|
185
|
+
items: [
|
|
186
|
+
...agents.map((item) => ({
|
|
187
|
+
type: "agent",
|
|
188
|
+
item
|
|
189
|
+
})),
|
|
190
|
+
...blueprints.map((item) => ({
|
|
191
|
+
type: "blueprint",
|
|
192
|
+
item
|
|
193
|
+
})),
|
|
194
|
+
...flows.map((item) => ({
|
|
195
|
+
type: "flow",
|
|
196
|
+
item
|
|
197
|
+
})),
|
|
198
|
+
...skills.map((item) => ({
|
|
199
|
+
type: "skill",
|
|
200
|
+
item
|
|
201
|
+
}))
|
|
202
|
+
]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/resources/services.ts
|
|
208
|
+
var ServicesResource = class {
|
|
209
|
+
constructor(http) {
|
|
210
|
+
this.http = http;
|
|
211
|
+
}
|
|
212
|
+
get(id) {
|
|
213
|
+
return this.http.get(`services/${id}`);
|
|
214
|
+
}
|
|
215
|
+
list(team) {
|
|
216
|
+
return this.http.get(`services?team=${encodeURIComponent(team)}`);
|
|
217
|
+
}
|
|
218
|
+
store(team, data) {
|
|
219
|
+
return this.http.post("services", {
|
|
220
|
+
team,
|
|
221
|
+
...data
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
update(id, data) {
|
|
225
|
+
return this.http.put(`services/${id}`, data);
|
|
226
|
+
}
|
|
227
|
+
delete(id) {
|
|
228
|
+
return this.http.delete(`services/${id}`);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/resources/skills.ts
|
|
233
|
+
var SkillsResource = class {
|
|
234
|
+
constructor(http) {
|
|
235
|
+
this.http = http;
|
|
236
|
+
}
|
|
237
|
+
get(id) {
|
|
238
|
+
return this.http.get(`skills/${id}`);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/resources/hub.ts
|
|
243
|
+
var HubResource = class {
|
|
244
|
+
constructor(http) {
|
|
245
|
+
this.http = http;
|
|
246
|
+
}
|
|
247
|
+
subscribe(email, tag) {
|
|
248
|
+
return this.http.post("hub/subscribe", {
|
|
249
|
+
email,
|
|
250
|
+
tag
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
//#endregion
|
|
134
255
|
//#region src/resources/contacts.ts
|
|
135
256
|
var ContactsResource = class {
|
|
136
257
|
constructor(http) {
|
|
@@ -154,6 +275,12 @@ var ContactsResource = class {
|
|
|
154
275
|
delete(id) {
|
|
155
276
|
return this.http.delete(`contacts/${id}`);
|
|
156
277
|
}
|
|
278
|
+
listActivities(id) {
|
|
279
|
+
return this.http.get(`contacts/${id}/activities`);
|
|
280
|
+
}
|
|
281
|
+
addActivity(id, data) {
|
|
282
|
+
return this.http.post(`contacts/${id}/activities`, data);
|
|
283
|
+
}
|
|
157
284
|
};
|
|
158
285
|
//#endregion
|
|
159
286
|
//#region src/resources/documents.ts
|
|
@@ -182,11 +309,27 @@ var GoalsResource = class {
|
|
|
182
309
|
}
|
|
183
310
|
};
|
|
184
311
|
//#endregion
|
|
312
|
+
//#region src/resources/meetings.ts
|
|
313
|
+
var MeetingsResource = class {
|
|
314
|
+
constructor(http) {
|
|
315
|
+
this.http = http;
|
|
316
|
+
}
|
|
317
|
+
join(code) {
|
|
318
|
+
return this.http.get(`meetings/join/${code}`);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
//#endregion
|
|
185
322
|
//#region src/resources/ingestions.ts
|
|
186
323
|
var IngestionsResource = class {
|
|
187
324
|
constructor(http) {
|
|
188
325
|
this.http = http;
|
|
189
326
|
}
|
|
327
|
+
list(params) {
|
|
328
|
+
const query = new URLSearchParams({ public: "true" });
|
|
329
|
+
if (params?.page !== void 0) query.set("page", String(params.page));
|
|
330
|
+
if (params?.size !== void 0) query.set("size", String(params.size));
|
|
331
|
+
return this.http.get(`ingestions?${query}`);
|
|
332
|
+
}
|
|
190
333
|
getShared(shareToken) {
|
|
191
334
|
return this.http.get(`ingestions/${shareToken}`);
|
|
192
335
|
}
|
|
@@ -268,6 +411,25 @@ var RoomsResource = class {
|
|
|
268
411
|
}
|
|
269
412
|
};
|
|
270
413
|
//#endregion
|
|
414
|
+
//#region src/resources/sites.ts
|
|
415
|
+
var SitesResource = class {
|
|
416
|
+
constructor(http) {
|
|
417
|
+
this.http = http;
|
|
418
|
+
}
|
|
419
|
+
listMine(teamSlug) {
|
|
420
|
+
return this.http.get(`sites/mine?team=${encodeURIComponent(teamSlug)}`);
|
|
421
|
+
}
|
|
422
|
+
resolve(teamSlug, brandSlug) {
|
|
423
|
+
return this.http.get(`sites/resolve?team=${encodeURIComponent(teamSlug)}&brand=${encodeURIComponent(brandSlug)}`);
|
|
424
|
+
}
|
|
425
|
+
resolveByDomain(domain) {
|
|
426
|
+
return this.http.get(`sites/resolve?domain=${encodeURIComponent(domain)}`);
|
|
427
|
+
}
|
|
428
|
+
update(siteSlug, data) {
|
|
429
|
+
return this.http.put(`sites/${encodeURIComponent(siteSlug)}`, data);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
//#endregion
|
|
271
433
|
//#region src/resources/teams.ts
|
|
272
434
|
var TeamsResource = class {
|
|
273
435
|
constructor(http) {
|
|
@@ -276,15 +438,52 @@ var TeamsResource = class {
|
|
|
276
438
|
list() {
|
|
277
439
|
return this.http.get("teams");
|
|
278
440
|
}
|
|
441
|
+
invite(teamSlug, payload) {
|
|
442
|
+
return this.http.post(`teams/${teamSlug}/invitations`, payload);
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/resources/warps.ts
|
|
447
|
+
var WarpsResource = class {
|
|
448
|
+
constructor(http) {
|
|
449
|
+
this.http = http;
|
|
450
|
+
}
|
|
451
|
+
list(brand) {
|
|
452
|
+
const url = brand ? `warps?brand=${encodeURIComponent(brand)}` : "warps";
|
|
453
|
+
return this.http.get(url);
|
|
454
|
+
}
|
|
455
|
+
show(identifier) {
|
|
456
|
+
return this.http.get(`warps/${identifier}`);
|
|
457
|
+
}
|
|
458
|
+
create(data) {
|
|
459
|
+
return this.http.post("warps", data);
|
|
460
|
+
}
|
|
461
|
+
destroy(identifier) {
|
|
462
|
+
return this.http.delete(`warps/${identifier}`);
|
|
463
|
+
}
|
|
279
464
|
};
|
|
280
465
|
//#endregion
|
|
281
466
|
//#region src/client.ts
|
|
467
|
+
function toWarpEnv(env) {
|
|
468
|
+
if (env === "devnet") return "devnet";
|
|
469
|
+
if (env === "testnet") return "testnet";
|
|
470
|
+
return "mainnet";
|
|
471
|
+
}
|
|
282
472
|
var JoAiClient = class {
|
|
283
473
|
constructor(config) {
|
|
284
|
-
this.
|
|
474
|
+
this.env = config.env ?? "mainnet";
|
|
475
|
+
const headers = {};
|
|
476
|
+
if (config.team) headers["X-Team"] = config.team;
|
|
477
|
+
if (config.agentAuthKey) headers["X-Agent-Auth-Key"] = config.agentAuthKey;
|
|
478
|
+
this.http = new HttpService(`${getApiBaseUrl(config.env ?? "mainnet")}/v1`, void 0, config.apiToken, { headers });
|
|
479
|
+
this.hub = new HubResource(this.http);
|
|
285
480
|
this.teams = new TeamsResource(this.http);
|
|
286
481
|
this.agents = new AgentsResource(this.http);
|
|
287
482
|
this.blueprints = new BlueprintsResource(this.http);
|
|
483
|
+
this.flows = new FlowsResource(this.http);
|
|
484
|
+
this.marketplace = new MarketplaceResource(this.http);
|
|
485
|
+
this.services = new ServicesResource(this.http);
|
|
486
|
+
this.skills = new SkillsResource(this.http);
|
|
288
487
|
this.ingestions = new IngestionsResource(this.http);
|
|
289
488
|
this.rooms = new RoomsResource(this.http);
|
|
290
489
|
this.contacts = new ContactsResource(this.http);
|
|
@@ -292,11 +491,48 @@ var JoAiClient = class {
|
|
|
292
491
|
this.memories = new MemoriesResource(this.http);
|
|
293
492
|
this.goals = new GoalsResource(this.http);
|
|
294
493
|
this.reminders = new RemindersResource(this.http);
|
|
494
|
+
this.sites = new SitesResource(this.http);
|
|
295
495
|
this.documents = new DocumentsResource(this.http);
|
|
496
|
+
this.meetings = new MeetingsResource(this.http);
|
|
497
|
+
this.privateWarps = new WarpsResource(this.http);
|
|
498
|
+
}
|
|
499
|
+
warps(locale = "en") {
|
|
500
|
+
return new WarpClient({
|
|
501
|
+
env: toWarpEnv(this.env),
|
|
502
|
+
preferences: { locale }
|
|
503
|
+
}, { chains: [] });
|
|
296
504
|
}
|
|
297
505
|
};
|
|
298
506
|
function createClient(config) {
|
|
299
507
|
return new JoAiClient(config);
|
|
300
508
|
}
|
|
301
509
|
//#endregion
|
|
302
|
-
|
|
510
|
+
//#region src/resources/distribution.ts
|
|
511
|
+
const DISTRIBUTION_URLS = {
|
|
512
|
+
local: "https://raw.githubusercontent.com/JoAiHQ/warps/refs/heads/dev/catalog/devnet/distribution.json",
|
|
513
|
+
devnet: "https://raw.githubusercontent.com/JoAiHQ/warps/refs/heads/dev/catalog/devnet/distribution.json",
|
|
514
|
+
testnet: "https://raw.githubusercontent.com/JoAiHQ/warps/refs/heads/main/catalog/mainnet/distribution.json",
|
|
515
|
+
mainnet: "https://raw.githubusercontent.com/JoAiHQ/warps/refs/heads/main/catalog/mainnet/distribution.json"
|
|
516
|
+
};
|
|
517
|
+
const TTL_MS = 3600 * 1e3;
|
|
518
|
+
const cache = /* @__PURE__ */ new Map();
|
|
519
|
+
var DistributionResource = class {
|
|
520
|
+
async getBrandSiteConfig(env, brandSlug) {
|
|
521
|
+
const url = DISTRIBUTION_URLS[env];
|
|
522
|
+
return (await this.fetchDistribution(url))?.apps.find((a) => a.slug === brandSlug)?.site ?? null;
|
|
523
|
+
}
|
|
524
|
+
async fetchDistribution(url) {
|
|
525
|
+
const cached = cache.get(url);
|
|
526
|
+
if (cached && cached.expiresAt > Date.now()) return cached.data;
|
|
527
|
+
const response = await fetch(url);
|
|
528
|
+
if (!response.ok) return null;
|
|
529
|
+
const data = await response.json();
|
|
530
|
+
cache.set(url, {
|
|
531
|
+
data,
|
|
532
|
+
expiresAt: Date.now() + TTL_MS
|
|
533
|
+
});
|
|
534
|
+
return data;
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
//#endregion
|
|
538
|
+
export { BlueprintsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ServicesResource, SitesResource, SkillsResource, createClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "JoAi public API SDK — build with your AI agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
"build": "tsdown",
|
|
34
34
|
"dev": "tsdown --watch"
|
|
35
35
|
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@joai/warps": "*"
|
|
38
|
+
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@joai/core": "*",
|
|
38
41
|
"tsdown": "^0.21.0",
|