twenty-sdk 2.55.0 → 2.56.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.
@@ -18,34 +18,6 @@ type AgentJsonResponseFormat = {
18
18
  };
19
19
  type AgentResponseFormat = AgentTextResponseFormat | AgentJsonResponseFormat;
20
20
 
21
- declare enum FieldMetadataType {
22
- ACTOR = "ACTOR",
23
- ADDRESS = "ADDRESS",
24
- ARRAY = "ARRAY",
25
- BOOLEAN = "BOOLEAN",
26
- CURRENCY = "CURRENCY",
27
- DATE = "DATE",
28
- DATE_TIME = "DATE_TIME",
29
- EMAILS = "EMAILS",
30
- FILES = "FILES",
31
- FULL_NAME = "FULL_NAME",
32
- LINKS = "LINKS",
33
- MORPH_RELATION = "MORPH_RELATION",
34
- MULTI_SELECT = "MULTI_SELECT",
35
- NUMBER = "NUMBER",
36
- NUMERIC = "NUMERIC",
37
- PHONES = "PHONES",
38
- POSITION = "POSITION",
39
- RATING = "RATING",
40
- RAW_JSON = "RAW_JSON",
41
- RELATION = "RELATION",
42
- RICH_TEXT = "RICH_TEXT",
43
- SELECT = "SELECT",
44
- TEXT = "TEXT",
45
- TS_VECTOR = "TS_VECTOR",
46
- UUID = "UUID"
47
- }
48
-
49
21
  type _JSONSchema = boolean | JSONSchema;
50
22
  type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
51
23
  type JSONSchema = {
@@ -2084,6 +2056,11 @@ interface ZodString extends _ZodString<$ZodStringInternals<string>> {
2084
2056
  duration(params?: string | $ZodCheckISODurationParams): this;
2085
2057
  }
2086
2058
  declare const ZodString: $constructor<ZodString>;
2059
+ interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {
2060
+ }
2061
+ interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {
2062
+ }
2063
+ declare const ZodBoolean: $constructor<ZodBoolean>;
2087
2064
  interface ZodAny extends _ZodType<$ZodAnyInternals> {
2088
2065
  }
2089
2066
  declare const ZodAny: $constructor<ZodAny>;
@@ -2231,6 +2208,34 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
2231
2208
  }
2232
2209
  declare const ZodReadonly: $constructor<ZodReadonly>;
2233
2210
 
2211
+ declare enum FieldMetadataType {
2212
+ ACTOR = "ACTOR",
2213
+ ADDRESS = "ADDRESS",
2214
+ ARRAY = "ARRAY",
2215
+ BOOLEAN = "BOOLEAN",
2216
+ CURRENCY = "CURRENCY",
2217
+ DATE = "DATE",
2218
+ DATE_TIME = "DATE_TIME",
2219
+ EMAILS = "EMAILS",
2220
+ FILES = "FILES",
2221
+ FULL_NAME = "FULL_NAME",
2222
+ LINKS = "LINKS",
2223
+ MORPH_RELATION = "MORPH_RELATION",
2224
+ MULTI_SELECT = "MULTI_SELECT",
2225
+ NUMBER = "NUMBER",
2226
+ NUMERIC = "NUMERIC",
2227
+ PHONES = "PHONES",
2228
+ POSITION = "POSITION",
2229
+ RATING = "RATING",
2230
+ RAW_JSON = "RAW_JSON",
2231
+ RELATION = "RELATION",
2232
+ RICH_TEXT = "RICH_TEXT",
2233
+ SELECT = "SELECT",
2234
+ TEXT = "TEXT",
2235
+ TS_VECTOR = "TS_VECTOR",
2236
+ UUID = "UUID"
2237
+ }
2238
+
2234
2239
  declare enum HTTPMethod {
2235
2240
  GET = "GET",
2236
2241
  POST = "POST",
@@ -2385,6 +2390,11 @@ type HttpRouteTriggerSettings = {
2385
2390
  forwardedRequestHeaders?: string[];
2386
2391
  };
2387
2392
 
2393
+ type AiRunUsage = {
2394
+ inputTokens: number;
2395
+ outputTokens: number;
2396
+ };
2397
+
2388
2398
  type AppConnectionBase = {
2389
2399
  id: string;
2390
2400
  providerName: string;
@@ -2499,6 +2509,15 @@ type JobStatusResult = {
2499
2509
  finishedAt?: number | null;
2500
2510
  };
2501
2511
 
2512
+ type GenerateResult = {
2513
+ success: boolean;
2514
+ text: string | null;
2515
+ object: Record<string, unknown> | null;
2516
+ error: string | null;
2517
+ runId: string;
2518
+ usage: AiRunUsage;
2519
+ };
2520
+
2502
2521
  type IdentifyAccountPayload = {
2503
2522
  connectionProviderId: string;
2504
2523
  connectionProviderName: string;
@@ -2568,6 +2587,7 @@ type RunAgentInput = {
2568
2587
  });
2569
2588
  type RunAgentResult = {
2570
2589
  threadId: string;
2590
+ runId: string;
2571
2591
  status: 'COMPLETED' | 'SUSPENDED' | 'FAILED' | 'RUNNING';
2572
2592
  result: object | null;
2573
2593
  error: string | null;
@@ -2907,6 +2927,135 @@ declare const syncMessageFolders: (input: SyncMessageFoldersInput) => Promise<Ap
2907
2927
 
2908
2928
  declare const runAgent: ({ input, ...rest }: RunAgentInput) => Promise<RunAgentResult>;
2909
2929
 
2930
+ type AgentConversationInput = {
2931
+ agentUniversalIdentifier: string;
2932
+ threadKey: string;
2933
+ };
2934
+ type AgentConversationMessage = {
2935
+ id: string;
2936
+ role: 'system' | 'user' | 'assistant';
2937
+ parts: ({
2938
+ type: string;
2939
+ } & Record<string, unknown>)[];
2940
+ metadata?: {
2941
+ createdAt?: string;
2942
+ startedAt?: string;
2943
+ finishedAt?: string;
2944
+ senderWorkspaceMemberId?: string | null;
2945
+ turnId?: string | null;
2946
+ };
2947
+ };
2948
+ type AgentConversationHistory = {
2949
+ messages: AgentConversationMessage[];
2950
+ streamCatchup: {
2951
+ chunks: Record<string, unknown>[];
2952
+ maxSeq: number;
2953
+ error: {
2954
+ code: string;
2955
+ message: string;
2956
+ } | null;
2957
+ };
2958
+ };
2959
+
2960
+ declare const listConversationMessages: (conversation: AgentConversationInput) => Promise<AgentConversationHistory>;
2961
+
2962
+ type AgentMessageReactionSummary = {
2963
+ emoji: string;
2964
+ workspaceMemberIds: string[];
2965
+ agentIds: string[];
2966
+ hasAssistantReacted: boolean;
2967
+ };
2968
+
2969
+ type AgentChatSubscriptionEvent = {
2970
+ type: 'stream-chunk';
2971
+ chunk: Record<string, unknown>;
2972
+ seq?: number;
2973
+ } | {
2974
+ type: 'message-persisted';
2975
+ messageId: string;
2976
+ turnId?: string;
2977
+ } | {
2978
+ type: 'stream-ended';
2979
+ } | {
2980
+ type: 'run-finished';
2981
+ turnId: string;
2982
+ } | {
2983
+ type: 'message-added';
2984
+ messageId: string;
2985
+ } | {
2986
+ type: 'queue-updated';
2987
+ } | {
2988
+ type: 'tool-call-resolved';
2989
+ toolCallId: string;
2990
+ } | {
2991
+ type: 'message-reactions-updated';
2992
+ messageId: string;
2993
+ reactions: AgentMessageReactionSummary[];
2994
+ revision: number;
2995
+ } | {
2996
+ type: 'stream-error';
2997
+ code: string;
2998
+ message: string;
2999
+ } | {
3000
+ type: 'credits-exhausted';
3001
+ turnId?: string;
3002
+ } | {
3003
+ type: 'user-credits-exhausted';
3004
+ workspaceMemberId: string;
3005
+ isFallingBackToWorkspaceCredits: boolean;
3006
+ renewsAt: string;
3007
+ } | {
3008
+ type: 'keepalive';
3009
+ };
3010
+
3011
+ declare const aiRunScopeSchema: ZodObject<{
3012
+ canReadAllObjectRecords: ZodOptional<ZodBoolean>;
3013
+ canUpdateAllObjectRecords: ZodOptional<ZodBoolean>;
3014
+ canSoftDeleteAllObjectRecords: ZodOptional<ZodBoolean>;
3015
+ canDestroyAllObjectRecords: ZodOptional<ZodBoolean>;
3016
+ canUpdateAllSettings: ZodOptional<ZodBoolean>;
3017
+ canAccessAllTools: ZodOptional<ZodBoolean>;
3018
+ objectPermissions: ZodOptional<ZodArray<ZodObject<{
3019
+ objectUniversalIdentifier: ZodString;
3020
+ canReadObjectRecords: ZodOptional<ZodBoolean>;
3021
+ canUpdateObjectRecords: ZodOptional<ZodBoolean>;
3022
+ canSoftDeleteObjectRecords: ZodOptional<ZodBoolean>;
3023
+ canDestroyObjectRecords: ZodOptional<ZodBoolean>;
3024
+ }, $strict>>>;
3025
+ fieldPermissions: ZodOptional<ZodArray<ZodObject<{
3026
+ objectUniversalIdentifier: ZodString;
3027
+ fieldUniversalIdentifier: ZodString;
3028
+ canReadFieldValue: ZodOptional<ZodBoolean>;
3029
+ canUpdateFieldValue: ZodOptional<ZodBoolean>;
3030
+ }, $strict>>>;
3031
+ permissionFlagUniversalIdentifiers: ZodOptional<ZodArray<ZodString>>;
3032
+ }, $strict>;
3033
+
3034
+ type AiRunScope = output<typeof aiRunScopeSchema>;
3035
+
3036
+ declare const isAgentChatTurnEndEvent: (event: AgentChatSubscriptionEvent) => boolean;
3037
+
3038
+ type StreamConversationInput = AgentConversationInput & {
3039
+ signal?: AbortSignal;
3040
+ };
3041
+ declare const streamConversation: ({ signal, ...conversation }: StreamConversationInput) => AsyncGenerator<AgentChatSubscriptionEvent>;
3042
+
3043
+ type GenerateChunk = {
3044
+ type: string;
3045
+ } & Record<string, unknown>;
3046
+ type GenerateInput = {
3047
+ input: string | RunAgentMessage[];
3048
+ instructions?: string | null;
3049
+ modelId?: string | null;
3050
+ responseFormat?: AgentResponseFormat | null;
3051
+ scope?: AiRunScope | null;
3052
+ onChunk?: (chunk: GenerateChunk) => void | Promise<void>;
3053
+ signal?: AbortSignal;
3054
+ };
3055
+ declare const ai: {
3056
+ generate: ({ input, onChunk, signal, ...rest }: GenerateInput) => Promise<GenerateResult>;
3057
+ };
3058
+
2910
3059
  declare const sendInboxMessage: (input: SendInboxMessageInput) => Promise<SendInboxMessageResult>;
2911
3060
 
2912
3061
  declare const inboxMention: ({ workspaceMemberId, }: {
@@ -2976,5 +3125,5 @@ declare class Response implements LogicFunctionHttpResponse {
2976
3125
  constructor(body: unknown, init?: ResponseInit);
2977
3126
  }
2978
3127
 
2979
- export { AppConnectionAuthFailedError, INBOX_ASSISTANT_MENTION, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, attachRecordToInboxThread, createMessageChannel, createTimelineActivity, deleteMessageChannel, detachRecordFromInboxThread, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, getJobs, inboxMention, inboxReferenceRecord, ingestMessages, jsonSchemaToInputSchema, kv, listConnections, listMessageChannels, listMessageFolders, reportConnectionAuthFailure, runAgent, sendInboxMessage, syncMessageFolders, updateMessageChannel };
2980
- export type { AppConnection, AppKeyValue, AppKeyValueScope, AppMessageChannel, AppMessageFolder, AuthorizeConnectionPayload, AuthorizeConnectionResult, ConnectionCallbackPayload, ConnectionCallbackResult, CreateMessageChannelInput, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventBatchPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobItem, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, IdentifyAccountPayload, IdentifyAccountResult, InboxThreadRecordInput, IngestMessage, IngestMessageParticipant, IngestedMessage, InputJsonSchema, InstallHandler, InstallPayload, JobStatusResult, JobStatusState, ListConnectionsFilter, ListMessageChannelsFilter, ListMessageFoldersFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, SendAppMessagePayload, SendAppMessageRecipient, SendAppMessageResult, SendInboxMessageInput, SendInboxMessageResult, ServerRouteDispatchResult, ServerRouteResolverResult, SyncMessageFoldersInput, UninstallHandler, UninstallPayload, UpdateMessageChannelInput };
3128
+ export { AppConnectionAuthFailedError, INBOX_ASSISTANT_MENTION, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, ai, attachRecordToInboxThread, createMessageChannel, createTimelineActivity, deleteMessageChannel, detachRecordFromInboxThread, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, getJobs, inboxMention, inboxReferenceRecord, ingestMessages, isAgentChatTurnEndEvent, jsonSchemaToInputSchema, kv, listConnections, listConversationMessages, listMessageChannels, listMessageFolders, reportConnectionAuthFailure, runAgent, sendInboxMessage, streamConversation, syncMessageFolders, updateMessageChannel };
3129
+ export type { AgentChatSubscriptionEvent, AgentConversationHistory, AgentConversationInput, AgentConversationMessage, AiRunScope, AppConnection, AppKeyValue, AppKeyValueScope, AppMessageChannel, AppMessageFolder, AuthorizeConnectionPayload, AuthorizeConnectionResult, ConnectionCallbackPayload, ConnectionCallbackResult, CreateMessageChannelInput, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventBatchPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobItem, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, GenerateInput, GenerateResult, IdentifyAccountPayload, IdentifyAccountResult, InboxThreadRecordInput, IngestMessage, IngestMessageParticipant, IngestedMessage, InputJsonSchema, InstallHandler, InstallPayload, JobStatusResult, JobStatusState, ListConnectionsFilter, ListMessageChannelsFilter, ListMessageFoldersFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, SendAppMessagePayload, SendAppMessageRecipient, SendAppMessageResult, SendInboxMessageInput, SendInboxMessageResult, ServerRouteDispatchResult, ServerRouteResolverResult, StreamConversationInput, SyncMessageFoldersInput, UninstallHandler, UninstallPayload, UpdateMessageChannelInput };