@joai/core 0.15.0 → 0.17.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 +107 -29
- package/dist/react/index.d.mts +1 -0
- package/dist/react/index.mjs +29 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as IHttpService, r as IRequestOptions, t as IAppResponse } from "./types-CWSaEVa7.mjs";
|
|
2
|
-
import { Warp, WarpActionInput, WarpBrandUrls, WarpChainInfo, WarpChainName, WarpI18nText, WarpLocale, WarpSecret, WarpText, WarpWalletProvider } from "@joai/warps";
|
|
2
|
+
import { Warp, WarpActionInput, WarpBrandUrls, WarpChainInfo, WarpChainName, WarpI18nText, WarpLocale, WarpNativeValue, WarpSecret, WarpText, WarpWalletProvider } from "@joai/warps";
|
|
3
3
|
|
|
4
4
|
//#region src/auth/types.d.ts
|
|
5
5
|
type SocialAuthProvider = 'github' | 'apple' | 'google' | 'x' | 'telegram' | 'slack';
|
|
@@ -294,7 +294,7 @@ type AppSubscription = {
|
|
|
294
294
|
updatedAt: string;
|
|
295
295
|
};
|
|
296
296
|
type PaymentProvider = 'xmoney' | 'lemonsqueezy' | 'stripe' | 'apple' | 'google' | 'blockchain' | 'offline';
|
|
297
|
-
type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'mcp' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | '
|
|
297
|
+
type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'mcp' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical';
|
|
298
298
|
type PlanBenefit = {
|
|
299
299
|
label: Partial<Record<WarpLocale, string>>;
|
|
300
300
|
tip?: Partial<Record<WarpLocale, string>>;
|
|
@@ -385,9 +385,26 @@ type ProductRelation = {
|
|
|
385
385
|
type VolumePrice = {
|
|
386
386
|
id: number;
|
|
387
387
|
minQty: number;
|
|
388
|
-
maxQty: number | null;
|
|
389
388
|
unitPrice: number;
|
|
390
389
|
};
|
|
390
|
+
type ProductConfiguration = Record<string, WarpNativeValue>;
|
|
391
|
+
type OrderConfigurationItem = {
|
|
392
|
+
itemId: string | null;
|
|
393
|
+
type: string;
|
|
394
|
+
configuration: ProductConfiguration;
|
|
395
|
+
};
|
|
396
|
+
type ProductVariationMeta = {
|
|
397
|
+
itemGroupId?: string | null;
|
|
398
|
+
appleProductId: string | null;
|
|
399
|
+
googleProductId: string | null;
|
|
400
|
+
gtin?: string | null;
|
|
401
|
+
mpn?: string | null;
|
|
402
|
+
condition?: 'new' | 'used' | 'refurbished';
|
|
403
|
+
};
|
|
404
|
+
type ProductMeta = {
|
|
405
|
+
googleProductCategory?: number | null;
|
|
406
|
+
brand?: string | null;
|
|
407
|
+
};
|
|
391
408
|
type ProductVariation = {
|
|
392
409
|
resource?: 'product-variation';
|
|
393
410
|
id?: string;
|
|
@@ -399,6 +416,9 @@ type ProductVariation = {
|
|
|
399
416
|
badge?: string;
|
|
400
417
|
quantity?: number;
|
|
401
418
|
media?: Media[];
|
|
419
|
+
preview?: Media[];
|
|
420
|
+
stock?: number | null;
|
|
421
|
+
weight?: number | null;
|
|
402
422
|
preorder?: boolean;
|
|
403
423
|
active?: boolean;
|
|
404
424
|
hidden?: boolean;
|
|
@@ -406,11 +426,9 @@ type ProductVariation = {
|
|
|
406
426
|
order?: number | null;
|
|
407
427
|
pieces?: ProductPieces | null;
|
|
408
428
|
discount?: ProductDiscount | null;
|
|
429
|
+
settings?: Record<string, unknown> | null;
|
|
409
430
|
product?: Product;
|
|
410
|
-
meta?:
|
|
411
|
-
appleProductId: string | null;
|
|
412
|
-
googleProductId: string | null;
|
|
413
|
-
};
|
|
431
|
+
meta?: ProductVariationMeta;
|
|
414
432
|
nativePriceStr?: string | null;
|
|
415
433
|
};
|
|
416
434
|
type Product = {
|
|
@@ -418,8 +436,10 @@ type Product = {
|
|
|
418
436
|
name: TranslatableValue;
|
|
419
437
|
description?: Partial<Record<WarpLocale, string>>;
|
|
420
438
|
price?: number;
|
|
421
|
-
unit?:
|
|
439
|
+
unit?: TranslatableValue | null;
|
|
422
440
|
active?: boolean;
|
|
441
|
+
public?: boolean;
|
|
442
|
+
meta?: ProductMeta;
|
|
423
443
|
virtual?: boolean;
|
|
424
444
|
tags?: string[] | null;
|
|
425
445
|
createdAt?: string;
|
|
@@ -429,6 +449,7 @@ type Product = {
|
|
|
429
449
|
rating?: ProductRating;
|
|
430
450
|
settings?: Record<string, unknown> | null;
|
|
431
451
|
volumePrices?: VolumePrice[];
|
|
452
|
+
media?: Media[];
|
|
432
453
|
};
|
|
433
454
|
type OrderItem = {
|
|
434
455
|
id: string;
|
|
@@ -448,6 +469,7 @@ type Order = {
|
|
|
448
469
|
createdAt: string;
|
|
449
470
|
invoiceDate: string;
|
|
450
471
|
meta: Record<string, any> | null;
|
|
472
|
+
configuration?: OrderConfigurationItem[];
|
|
451
473
|
items: OrderItem[];
|
|
452
474
|
plan: Plan | null;
|
|
453
475
|
user: UserPrivate | null;
|
|
@@ -462,7 +484,9 @@ type CartItem = {
|
|
|
462
484
|
type: 'service' | 'product';
|
|
463
485
|
sku: string | null;
|
|
464
486
|
badge: string | null;
|
|
487
|
+
configuration?: ProductConfiguration;
|
|
465
488
|
media: Media[];
|
|
489
|
+
product?: Product | null;
|
|
466
490
|
};
|
|
467
491
|
type Cart = {
|
|
468
492
|
subtotal: number;
|
|
@@ -493,6 +517,7 @@ type PurchaseOptions = {
|
|
|
493
517
|
};
|
|
494
518
|
//#endregion
|
|
495
519
|
//#region src/team/types.d.ts
|
|
520
|
+
type TeamFeature = 'shop' | 'appointments';
|
|
496
521
|
type TeamMember = User & {
|
|
497
522
|
role: UserRole | null;
|
|
498
523
|
roleAcceptedAt: string | null;
|
|
@@ -502,10 +527,14 @@ type Team = {
|
|
|
502
527
|
slug: string;
|
|
503
528
|
name: string;
|
|
504
529
|
personal: boolean;
|
|
505
|
-
description:
|
|
530
|
+
description: TranslatableValue | null;
|
|
506
531
|
locale: WarpLocale;
|
|
507
532
|
timezone: string;
|
|
533
|
+
settings?: TeamSettings;
|
|
534
|
+
features?: TeamFeature[];
|
|
535
|
+
cover?: string | null;
|
|
508
536
|
logo: string | null;
|
|
537
|
+
tagline?: TranslatableValue | null;
|
|
509
538
|
public: boolean;
|
|
510
539
|
createdAt: string;
|
|
511
540
|
blueprints?: Blueprint[];
|
|
@@ -529,7 +558,8 @@ type TeamPrivate = {
|
|
|
529
558
|
slug: string;
|
|
530
559
|
name: string;
|
|
531
560
|
personal: boolean;
|
|
532
|
-
description:
|
|
561
|
+
description: TranslatableValue | null;
|
|
562
|
+
tagline: TranslatableValue | null;
|
|
533
563
|
balance: number;
|
|
534
564
|
locale: WarpLocale;
|
|
535
565
|
timezone: string;
|
|
@@ -580,6 +610,7 @@ type TeamSettings = {
|
|
|
580
610
|
'board.auto.enabled'?: boolean;
|
|
581
611
|
'payments.online'?: boolean;
|
|
582
612
|
'payments.coupons'?: boolean;
|
|
613
|
+
'stock.enabled'?: boolean;
|
|
583
614
|
'branding'?: TeamBrand | null;
|
|
584
615
|
};
|
|
585
616
|
type TeamUsage = Partial<Record<PlanFeature, TeamFeatureUsage>> & {
|
|
@@ -955,6 +986,7 @@ type BrandBackend = {
|
|
|
955
986
|
locales: WarpLocale[];
|
|
956
987
|
warps: WarpBackend[];
|
|
957
988
|
isTeamOwned?: boolean;
|
|
989
|
+
isPublic?: boolean;
|
|
958
990
|
inviteCode?: string;
|
|
959
991
|
source?: BrandSourceConfig | null;
|
|
960
992
|
contract?: string;
|
|
@@ -1190,21 +1222,50 @@ type Alert = {
|
|
|
1190
1222
|
type ApiToken = {
|
|
1191
1223
|
id: number;
|
|
1192
1224
|
name: string;
|
|
1225
|
+
teams: Team[];
|
|
1193
1226
|
createdAt: string;
|
|
1194
1227
|
token?: string;
|
|
1195
1228
|
};
|
|
1196
1229
|
//#endregion
|
|
1230
|
+
//#region src/service/types.d.ts
|
|
1231
|
+
type Service = {
|
|
1232
|
+
id: string;
|
|
1233
|
+
slug: string;
|
|
1234
|
+
name: TranslatableValue;
|
|
1235
|
+
price: number;
|
|
1236
|
+
durationMinutes: number;
|
|
1237
|
+
tags?: string[] | null;
|
|
1238
|
+
description: TranslatableValue | null;
|
|
1239
|
+
active: boolean;
|
|
1240
|
+
digital: boolean;
|
|
1241
|
+
public: boolean;
|
|
1242
|
+
createdAt: string;
|
|
1243
|
+
updatedAt: string;
|
|
1244
|
+
};
|
|
1245
|
+
//#endregion
|
|
1197
1246
|
//#region src/appointment/types.d.ts
|
|
1198
1247
|
type AppointmentSlot = {
|
|
1199
1248
|
start: string;
|
|
1200
1249
|
end: string;
|
|
1201
1250
|
label?: string;
|
|
1202
1251
|
};
|
|
1252
|
+
type AppointmentAvailabilityService = {
|
|
1253
|
+
slug: string;
|
|
1254
|
+
name: string | null;
|
|
1255
|
+
durationMinutes: number | null;
|
|
1256
|
+
};
|
|
1257
|
+
type AppointmentAvailabilitySlot = {
|
|
1258
|
+
startAt: string;
|
|
1259
|
+
endAt: string;
|
|
1260
|
+
agentUuid: string;
|
|
1261
|
+
agentName: string;
|
|
1262
|
+
serviceSlug: string | null;
|
|
1263
|
+
};
|
|
1203
1264
|
type AppointmentAvailability = {
|
|
1204
1265
|
connected: boolean;
|
|
1205
1266
|
timezone: string;
|
|
1206
|
-
service:
|
|
1207
|
-
slots:
|
|
1267
|
+
service: AppointmentAvailabilityService | null;
|
|
1268
|
+
slots: AppointmentAvailabilitySlot[];
|
|
1208
1269
|
};
|
|
1209
1270
|
type AppointmentPolicy = {
|
|
1210
1271
|
timezone: string | null;
|
|
@@ -1219,6 +1280,18 @@ type AppointmentPolicy = {
|
|
|
1219
1280
|
blockedDates: string[] | null;
|
|
1220
1281
|
holidays: string[] | null;
|
|
1221
1282
|
conferenceEnabled: boolean | null;
|
|
1283
|
+
serviceSelectionEnabled?: boolean | null;
|
|
1284
|
+
paymentEnabled?: boolean | null;
|
|
1285
|
+
};
|
|
1286
|
+
type AppointmentBookingContext = {
|
|
1287
|
+
resolved: AppointmentPolicy | null;
|
|
1288
|
+
policy: AppointmentPolicy | null;
|
|
1289
|
+
services: Service[];
|
|
1290
|
+
availableStaff: {
|
|
1291
|
+
uuid: string;
|
|
1292
|
+
name: string;
|
|
1293
|
+
}[];
|
|
1294
|
+
requestStatuses: string[];
|
|
1222
1295
|
};
|
|
1223
1296
|
type AppointmentBooking = {
|
|
1224
1297
|
id: string;
|
|
@@ -1228,6 +1301,7 @@ type AppointmentBooking = {
|
|
|
1228
1301
|
timezone: string | null;
|
|
1229
1302
|
conferenceUrl: string | null;
|
|
1230
1303
|
conferenceProvider: string | null;
|
|
1304
|
+
inviteUrl?: string | null;
|
|
1231
1305
|
status: string;
|
|
1232
1306
|
attendeeEmail: string | null;
|
|
1233
1307
|
attendeeName: string | null;
|
|
@@ -2699,22 +2773,6 @@ type Reminder = {
|
|
|
2699
2773
|
createdAt: string;
|
|
2700
2774
|
};
|
|
2701
2775
|
//#endregion
|
|
2702
|
-
//#region src/service/types.d.ts
|
|
2703
|
-
type Service = {
|
|
2704
|
-
id: string;
|
|
2705
|
-
slug: string;
|
|
2706
|
-
name: TranslatableValue;
|
|
2707
|
-
price: number;
|
|
2708
|
-
durationMinutes: number;
|
|
2709
|
-
category: string | null;
|
|
2710
|
-
description: TranslatableValue | null;
|
|
2711
|
-
active: boolean;
|
|
2712
|
-
digital: boolean;
|
|
2713
|
-
public: boolean;
|
|
2714
|
-
createdAt: string;
|
|
2715
|
-
updatedAt: string;
|
|
2716
|
-
};
|
|
2717
|
-
//#endregion
|
|
2718
2776
|
//#region src/shortcut/types.d.ts
|
|
2719
2777
|
type Shortcut = {
|
|
2720
2778
|
id: string;
|
|
@@ -2826,6 +2884,13 @@ type LinkCreatePayload = {
|
|
|
2826
2884
|
title: string;
|
|
2827
2885
|
};
|
|
2828
2886
|
type LinkUpdatePayload = Partial<LinkCreatePayload>;
|
|
2887
|
+
type LinkStats = {
|
|
2888
|
+
totalLinks: number;
|
|
2889
|
+
activeLinks: number;
|
|
2890
|
+
totalScans: number;
|
|
2891
|
+
scanHistory: number[];
|
|
2892
|
+
scanGeography: Record<string, number>;
|
|
2893
|
+
};
|
|
2829
2894
|
//#endregion
|
|
2830
2895
|
//#region src/store/types.d.ts
|
|
2831
2896
|
type StoreVisibility = 'private' | 'team' | 'public';
|
|
@@ -2882,6 +2947,7 @@ type Update = {
|
|
|
2882
2947
|
title: string;
|
|
2883
2948
|
body: string | null;
|
|
2884
2949
|
imageUrl: string | null;
|
|
2950
|
+
media: Media[];
|
|
2885
2951
|
linkUrl: string | null;
|
|
2886
2952
|
startsAt: string | null;
|
|
2887
2953
|
endsAt: string | null;
|
|
@@ -2893,12 +2959,24 @@ type UpdateCreatePayload = {
|
|
|
2893
2959
|
type: UpdateType;
|
|
2894
2960
|
body?: string;
|
|
2895
2961
|
imageUrl?: string;
|
|
2962
|
+
media?: MediaLibraryItems;
|
|
2896
2963
|
linkUrl?: string;
|
|
2897
2964
|
startsAt?: string;
|
|
2898
2965
|
endsAt?: string;
|
|
2899
2966
|
status?: UpdateStatus;
|
|
2900
2967
|
};
|
|
2901
2968
|
type UpdateUpdatePayload = Partial<UpdateCreatePayload>;
|
|
2969
|
+
type UpdateStats = {
|
|
2970
|
+
totalUpdates: number;
|
|
2971
|
+
activeUpdates: number;
|
|
2972
|
+
dealsCount: number;
|
|
2973
|
+
eventsCount: number;
|
|
2974
|
+
newsCount: number;
|
|
2975
|
+
publishedCount: number;
|
|
2976
|
+
draftCount: number;
|
|
2977
|
+
archivedCount: number;
|
|
2978
|
+
creationHistory: number[];
|
|
2979
|
+
};
|
|
2902
2980
|
//#endregion
|
|
2903
2981
|
//#region src/swarm/types.d.ts
|
|
2904
2982
|
type Swarm = {
|
|
@@ -3076,4 +3154,4 @@ type CliSessionStatus = {
|
|
|
3076
3154
|
meta: CliSessionMeta | null;
|
|
3077
3155
|
};
|
|
3078
3156
|
//#endregion
|
|
3079
|
-
export { Achievement, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AgentWebhookWarp, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppSubscription, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentRequest, AppointmentSlot, BillingAddress, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Card, Cart, CartItem, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CliSessionMeta, CliSessionStatus, Contact, ContactActivity, ContactActivityAuthor, ContactFormData, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationDetails, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, Kyc, KycStatus, Link, LinkCreatePayload, LinkUpdatePayload, LocalAgentWallet, MarketplaceAgent, MarketplaceCheckoutItem, MarketplaceData, MarketplaceEntityType, MarketplaceInfo, MarketplaceItem, MarketplaceListing, MarketplacePriceTier, MarketplacePricing, MarketplacePurchasable, MarketplacePurchaseResult, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaLibraryItems, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MultimodalContent, MultimodalFile, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderItem, OrderStatus, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDiscount, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationType, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, Reminder, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, Store, StoreCreatePayload, StoreEntry, StoreEntryPayload, StoreEntryResult, StoreToggleResult, StoreVisibility, StoreWithEntries, Streak, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, Swarm, Task, Team, TeamBrand, TeamFeatureUsage, TeamMember, TeamPrivate, TeamSettings, TeamUsage, Tier, TierFeature, TierName, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, Update, UpdateCreatePayload, UpdateStatus, UpdateType, UpdateUpdatePayload, User, UserInterest, UserMode, UserPrivate, UserRole, UserSettings, UserSocialAccount, UserStats, VolumePrice, Wallet, WalletList, WarpApprovable, WarpBackend, WarpBackendCategory, WarpBackendStatus, WarpBatchItem, WarpBatchable, WarpCloudExecutable, WarpCreateable, WarpExecutable, WarpExtras, WarpExtrasFaq, WarpInputable, WarpScreenshotVariant, WarpSearchHit, WarpSelectable, WarpSelectableDetails, WarpSuggestion, WarpTestable, WarpViewable, Webhook, WebhookTriggerEvent, WorkspaceCloudFile, WorkspaceContext, WorkspaceInfo, WorkspaceSettings, XIntegrationStatus, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getMcpServerAgentUrl, getSiteUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, localize, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
|
|
3157
|
+
export { Achievement, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AgentWebhookWarp, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppSubscription, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentRequest, AppointmentSlot, BillingAddress, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Card, Cart, CartItem, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CliSessionMeta, CliSessionStatus, Contact, ContactActivity, ContactActivityAuthor, ContactFormData, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationDetails, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, Kyc, KycStatus, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LocalAgentWallet, MarketplaceAgent, MarketplaceCheckoutItem, MarketplaceData, MarketplaceEntityType, MarketplaceInfo, MarketplaceItem, MarketplaceListing, MarketplacePriceTier, MarketplacePricing, MarketplacePurchasable, MarketplacePurchaseResult, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaLibraryItems, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MultimodalContent, MultimodalFile, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderConfigurationItem, OrderItem, OrderStatus, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductConfiguration, ProductDiscount, ProductMeta, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationMeta, ProductVariationType, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, Reminder, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, Store, StoreCreatePayload, StoreEntry, StoreEntryPayload, StoreEntryResult, StoreToggleResult, StoreVisibility, StoreWithEntries, Streak, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, Swarm, Task, Team, TeamBrand, TeamFeature, TeamFeatureUsage, TeamMember, TeamPrivate, TeamSettings, TeamUsage, Tier, TierFeature, TierName, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, Update, UpdateCreatePayload, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, User, UserInterest, UserMode, UserPrivate, UserRole, UserSettings, UserSocialAccount, UserStats, VolumePrice, Wallet, WalletList, WarpApprovable, WarpBackend, WarpBackendCategory, WarpBackendStatus, WarpBatchItem, WarpBatchable, WarpCloudExecutable, WarpCreateable, WarpExecutable, WarpExtras, WarpExtrasFaq, WarpInputable, WarpScreenshotVariant, WarpSearchHit, WarpSelectable, WarpSelectableDetails, WarpSuggestion, WarpTestable, WarpViewable, Webhook, WebhookTriggerEvent, WorkspaceCloudFile, WorkspaceContext, WorkspaceInfo, WorkspaceSettings, XIntegrationStatus, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getMcpServerAgentUrl, getSiteUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, localize, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
|
package/dist/react/index.d.mts
CHANGED
|
@@ -98,6 +98,7 @@ declare function useEmbedChat({
|
|
|
98
98
|
roomId: string | null;
|
|
99
99
|
setRoomId: react.Dispatch<react.SetStateAction<string | null>>;
|
|
100
100
|
send: (message: string) => Promise<void>;
|
|
101
|
+
connectionError: boolean;
|
|
101
102
|
};
|
|
102
103
|
//#endregion
|
|
103
104
|
export { EmbedChatInput, EmbedChatItem, EmbedChatList, StreamDataHandler, clearRoom, getOrCreateGuestId, loadRoom, openEventSourceStream, saveRoom, useEmbedChat };
|
package/dist/react/index.mjs
CHANGED
|
@@ -159,18 +159,22 @@ function EmbedChatInput({ onSend, disabled, placeholder = "Type a message...", m
|
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/react/use-embed-chat.ts
|
|
162
|
+
const RESPONSE_TIMEOUT_MS = 3e4;
|
|
162
163
|
function useEmbedChat({ agentUuid, http, cortexBaseUrl, guestId, roomStorageKey, enabled = true, extraPayload }) {
|
|
163
164
|
const [items, setItems] = useState([]);
|
|
164
165
|
const [sending, setSending] = useState(false);
|
|
165
166
|
const [awaitingResponse, setAwaitingResponse] = useState(false);
|
|
166
167
|
const [roomId, setRoomId] = useState(null);
|
|
168
|
+
const [connectionError, setConnectionError] = useState(false);
|
|
167
169
|
const roomIdRef = useRef(null);
|
|
168
170
|
roomIdRef.current = roomId;
|
|
169
171
|
const extraPayloadRef = useRef(extraPayload);
|
|
170
172
|
extraPayloadRef.current = extraPayload;
|
|
171
173
|
useEffect(() => {
|
|
172
174
|
if (!roomId) return;
|
|
175
|
+
setConnectionError(false);
|
|
173
176
|
return openEventSourceStream(`${cortexBaseUrl}/agents/stream/${roomId}`, (raw) => {
|
|
177
|
+
setConnectionError(false);
|
|
174
178
|
const data = raw;
|
|
175
179
|
if (data.type === "response:chunk") {
|
|
176
180
|
setAwaitingResponse(false);
|
|
@@ -206,12 +210,27 @@ function useEmbedChat({ agentUuid, http, cortexBaseUrl, guestId, roomStorageKey,
|
|
|
206
210
|
});
|
|
207
211
|
return updated;
|
|
208
212
|
});
|
|
209
|
-
} else if (data.type === "complete")
|
|
210
|
-
|
|
211
|
-
streaming
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
} else if (data.type === "complete") {
|
|
214
|
+
setAwaitingResponse(false);
|
|
215
|
+
setItems((prev) => prev.map((item) => item.streaming ? {
|
|
216
|
+
...item,
|
|
217
|
+
streaming: false
|
|
218
|
+
} : item));
|
|
219
|
+
}
|
|
220
|
+
}, { onConnectionError: () => setConnectionError(true) });
|
|
214
221
|
}, [roomId, cortexBaseUrl]);
|
|
222
|
+
useEffect(() => {
|
|
223
|
+
if (!awaitingResponse) return;
|
|
224
|
+
const timer = setTimeout(() => {
|
|
225
|
+
setAwaitingResponse(false);
|
|
226
|
+
setItems((prev) => [...prev, {
|
|
227
|
+
content: "Response timed out. Please try again.",
|
|
228
|
+
byUser: false,
|
|
229
|
+
error: true
|
|
230
|
+
}]);
|
|
231
|
+
}, RESPONSE_TIMEOUT_MS);
|
|
232
|
+
return () => clearTimeout(timer);
|
|
233
|
+
}, [awaitingResponse]);
|
|
215
234
|
return {
|
|
216
235
|
items,
|
|
217
236
|
setItems,
|
|
@@ -226,6 +245,7 @@ function useEmbedChat({ agentUuid, http, cortexBaseUrl, guestId, roomStorageKey,
|
|
|
226
245
|
byUser: true
|
|
227
246
|
}]);
|
|
228
247
|
setSending(true);
|
|
248
|
+
setConnectionError(false);
|
|
229
249
|
try {
|
|
230
250
|
const res = await http.post(`integrations/embed/${agentUuid}/execute`, {
|
|
231
251
|
message,
|
|
@@ -233,8 +253,9 @@ function useEmbedChat({ agentUuid, http, cortexBaseUrl, guestId, roomStorageKey,
|
|
|
233
253
|
...extraPayloadRef.current
|
|
234
254
|
});
|
|
235
255
|
if (!res.ok) {
|
|
256
|
+
const msg = res.data && typeof res.data === "object" && "message" in res.data ? res.data.message : "Something went wrong. Please try again.";
|
|
236
257
|
setItems((prev) => [...prev, {
|
|
237
|
-
content:
|
|
258
|
+
content: msg,
|
|
238
259
|
byUser: false,
|
|
239
260
|
error: true
|
|
240
261
|
}]);
|
|
@@ -262,7 +283,8 @@ function useEmbedChat({ agentUuid, http, cortexBaseUrl, guestId, roomStorageKey,
|
|
|
262
283
|
http,
|
|
263
284
|
guestId,
|
|
264
285
|
roomStorageKey
|
|
265
|
-
])
|
|
286
|
+
]),
|
|
287
|
+
connectionError
|
|
266
288
|
};
|
|
267
289
|
}
|
|
268
290
|
//#endregion
|