@budibase/types 3.39.22 → 3.39.24

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.
@@ -0,0 +1,4 @@
1
+ import { AgentRequest } from "../../../documents";
2
+ export interface FetchAgentRequestsResponse {
3
+ requests: AgentRequest[];
4
+ }
@@ -126,7 +126,7 @@ export type CreateAgentResponse = Omit<Agent, "knowledgeSources" | "knowledgeBas
126
126
  export type DuplicateAgentResponse = Agent;
127
127
  export type UpdateAgentRequest = Omit<Agent, "createdAt" | "updatedAt" | "_deleted" | "createdBy" | "operations">;
128
128
  export type UpdateAgentResponse = Omit<Agent, "knowledgeSources" | "knowledgeBases">;
129
- export type AgentOperationConfigRequest = Pick<AgentOperation, "name" | "live" | "promptInstructions" | "enabledTools" | "allowKnowledgeSourceDownload">;
129
+ export type AgentOperationConfigRequest = Pick<AgentOperation, "name" | "live" | "promptInstructions" | "enabledTools" | "allowKnowledgeSourceDownload" | "escalation">;
130
130
  export type CreateAgentOperationRequest = AgentOperationConfigRequest & Pick<AgentOperation, "id">;
131
131
  export type UpdateAgentOperationRequest = Partial<AgentOperationConfigRequest>;
132
132
  export type AgentOperationMutationResponse = Omit<Agent, "knowledgeSources" | "knowledgeBases">;
@@ -11,6 +11,7 @@ export * from "./self";
11
11
  export * from "./template";
12
12
  export * from "./agents";
13
13
  export * from "./agentLogs";
14
+ export * from "./agentRequests";
14
15
  export * from "./agentTests";
15
16
  export * from "./aiConfigs";
16
17
  export * from "./github";
@@ -11,6 +11,7 @@ export * from "./layout";
11
11
  export * from "./metadata";
12
12
  export * from "./navigation";
13
13
  export * from "./oauth2";
14
+ export * from "./project";
14
15
  export * from "./permission";
15
16
  export * from "./query";
16
17
  export * from "./recaptcha";
@@ -0,0 +1,86 @@
1
+ import type { ReadStream } from "fs";
2
+ import { ResourceType, UsedResource } from "./resource";
3
+ export interface ProjectResponse {
4
+ _id: string;
5
+ _rev: string;
6
+ name: string;
7
+ description?: string;
8
+ color?: string;
9
+ createdAt: string;
10
+ updatedAt: string;
11
+ }
12
+ export interface FetchProjectsResponse {
13
+ projects: ProjectResponse[];
14
+ }
15
+ export interface CreateProjectRequest {
16
+ name: string;
17
+ description?: string;
18
+ color?: string;
19
+ }
20
+ export interface CreateProjectResponse {
21
+ project: ProjectResponse;
22
+ }
23
+ export interface UpdateProjectRequest {
24
+ _id: string;
25
+ _rev: string;
26
+ name: string;
27
+ description?: string;
28
+ color?: string;
29
+ }
30
+ export interface UpdateProjectResponse {
31
+ project: ProjectResponse;
32
+ }
33
+ export interface ExportProjectRequest {
34
+ encryptPassword?: string;
35
+ }
36
+ export type ExportProjectResponse = ReadStream;
37
+ export interface ImportProjectRequest {
38
+ encryptPassword?: string;
39
+ }
40
+ export interface ProjectImportRequirement {
41
+ type: "datasource_secrets" | "agent_secrets";
42
+ resourceId: string;
43
+ name: string;
44
+ reason: string;
45
+ }
46
+ export interface ImportProjectResponse {
47
+ project: ProjectResponse;
48
+ resources: Partial<Record<ResourceType, string[]>>;
49
+ unsupportedContent: ProjectPackageUnsupportedContent[];
50
+ requirements: ProjectImportRequirement[];
51
+ }
52
+ export interface ProjectManifestSummary {
53
+ _id: string;
54
+ name: string;
55
+ description?: string;
56
+ color?: string;
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ }
60
+ export interface ProjectPackageUnsupportedContent {
61
+ type: string;
62
+ count: number;
63
+ reason: string;
64
+ }
65
+ export interface ProjectPackageManifest {
66
+ formatVersion: number;
67
+ artifactType: "project";
68
+ budibaseVersion: string;
69
+ exportedAt: string;
70
+ project: ProjectManifestSummary;
71
+ sourceWorkspace: {
72
+ id: string;
73
+ };
74
+ resourcesByType: Partial<Record<ResourceType, number>>;
75
+ containsRows: boolean;
76
+ containsAttachments: boolean;
77
+ requiresSecrets: boolean;
78
+ unsupportedContent: ProjectPackageUnsupportedContent[];
79
+ }
80
+ export interface ProjectPackageDependencyIndex {
81
+ rootProjectId: string;
82
+ directMembers: UsedResource[];
83
+ resources: Record<string, {
84
+ dependencies: UsedResource[];
85
+ }>;
86
+ }
@@ -3,6 +3,8 @@ export declare enum UsedByType {
3
3
  AUTOMATION = "automation"
4
4
  }
5
5
  export declare enum ResourceType {
6
+ PROJECT = "project",
7
+ AGENT = "agent",
6
8
  DATASOURCE = "datasource",
7
9
  TABLE = "table",
8
10
  ROW_ACTION = "row_action",
@@ -11,11 +11,13 @@ export interface WorkspaceAppResponse {
11
11
  createdAt: string;
12
12
  updatedAt: string;
13
13
  disabled?: boolean;
14
+ projectIds?: string[];
14
15
  }
15
16
  export interface InsertWorkspaceAppRequest {
16
17
  name: string;
17
18
  url: string;
18
19
  disabled?: boolean;
20
+ projectIds?: string[];
19
21
  }
20
22
  export interface InsertWorkspaceAppResponse {
21
23
  workspaceApp: WorkspaceAppResponse;
@@ -32,6 +34,7 @@ export interface UpdateWorkspaceAppRequest {
32
34
  theme?: Theme;
33
35
  customTheme?: AppCustomTheme;
34
36
  disabled?: boolean;
37
+ projectIds?: string[];
35
38
  }
36
39
  export interface UpdateWorkspaceAppResponse {
37
40
  workspaceApp: WorkspaceAppResponse;
@@ -45,6 +45,7 @@ export declare enum DocumentType {
45
45
  AGENT_FILE = "agentfile",
46
46
  AGENT_LOG_SESSION = "agentlogsession",
47
47
  AGENT_LOG_REQUEST = "agentlogrequest",
48
+ AGENT_REQUEST = "agentrequest",
48
49
  AGENT_TEST_SUITE = "agenttestsuite",
49
50
  AGENT_TEST_RUN = "agenttestrun",
50
51
  AGENT_KNOWLEDGE_SOURCE_SYNC_STATE = "agentknowledgesync",
@@ -55,7 +56,10 @@ export declare enum DocumentType {
55
56
  KNOWLEDGE_BASE = "knowledgebase",
56
57
  WORKSPACE_APP = "workspace_app",
57
58
  WORKSPACE_FAVOURITE = "workspace_favourite",
58
- AUTO_COLUMN_STATE = "autocolumn_state"
59
+ PROJECT = "project",
60
+ AUTO_COLUMN_STATE = "autocolumn_state",
61
+ ESCALATION_CONTEXT = "escalation_context",
62
+ ESCALATION_NOTIFICATION = "escalation_notification"
59
63
  }
60
64
  export declare const DocumentTypesToImport: DocumentType[];
61
65
  export declare enum InternalTable {
@@ -0,0 +1,17 @@
1
+ import { Document } from "../../";
2
+ export type AgentRequestStatus = "completed";
3
+ export interface AgentRequestEntry {
4
+ sessionId: string;
5
+ source: string;
6
+ operationNames: string[];
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ status: AgentRequestStatus;
10
+ }
11
+ export interface AgentRequest extends Document {
12
+ title?: string;
13
+ agentId: string;
14
+ userId: string;
15
+ entries: AgentRequestEntry[];
16
+ status: AgentRequestStatus;
17
+ }
@@ -1,12 +1,14 @@
1
1
  import { Document } from "../../";
2
2
  import type { UIMessage } from "ai";
3
+ import { EscalationRecipient } from "../workspace/escalation";
3
4
  export declare enum ToolType {
4
5
  INTERNAL_TABLE = "INTERNAL_TABLE",
5
6
  EXTERNAL_TABLE = "EXTERNAL_TABLE",
6
7
  AUTOMATION = "AUTOMATION",
7
8
  REST_QUERY = "REST_QUERY",
8
9
  DATASOURCE_QUERY = "DATASOURCE_QUERY",
9
- SEARCH = "SEARCH"
10
+ SEARCH = "SEARCH",
11
+ ESCALATION = "ESCALATION"
10
12
  }
11
13
  export interface ToolMetadata {
12
14
  name: string;
@@ -32,6 +34,7 @@ export interface MSTeamsAgentIntegration extends ChatAgentIntegration {
32
34
  appId?: string;
33
35
  appPassword?: string;
34
36
  tenantId?: string;
37
+ teamId?: string;
35
38
  messagingEndpointUrl?: string;
36
39
  }
37
40
  export interface SlackAgentIntegration extends ChatAgentIntegration {
@@ -66,6 +69,10 @@ export interface AgentSharePointKnowledgeSource {
66
69
  };
67
70
  }
68
71
  export type AgentKnowledgeSource = AgentSharePointKnowledgeSource;
72
+ export interface AgentEscalationConfig {
73
+ recipients?: EscalationRecipient[];
74
+ delay?: number;
75
+ }
69
76
  export interface AgentOperation {
70
77
  id: string;
71
78
  name: string;
@@ -75,11 +82,13 @@ export interface AgentOperation {
75
82
  knowledgeBases?: string[];
76
83
  knowledgeSources?: AgentKnowledgeSource[];
77
84
  allowKnowledgeSourceDownload: boolean;
85
+ escalation?: AgentEscalationConfig;
78
86
  }
79
87
  export interface Agent extends Document {
80
88
  name: string;
81
89
  description?: string;
82
90
  aiconfig: string;
91
+ projectIds?: string[];
83
92
  operations?: AgentOperation[];
84
93
  goal?: string;
85
94
  live?: boolean;
@@ -39,6 +39,7 @@ export interface ChatConversationChannel {
39
39
  threadId?: string;
40
40
  externalUserId?: string;
41
41
  externalUserName?: string;
42
+ serviceUrl?: string;
42
43
  }
43
44
  export interface ChatConversationRequest extends Document {
44
45
  chatAppId: string;
@@ -75,4 +76,5 @@ export interface ChatIdentityLink extends Document {
75
76
  teamId?: string;
76
77
  guildId?: string;
77
78
  providerTenantId?: string;
79
+ serviceUrl?: string;
78
80
  }
@@ -13,5 +13,6 @@ export * from "./agents";
13
13
  export * from "./agentKnowledgeSourceSyncState";
14
14
  export * from "./ai";
15
15
  export * from "./chat";
16
+ export * from "./agentRequests";
16
17
  export * from "./agentTests";
17
18
  export * from "./knowledgeBase";
@@ -9,6 +9,7 @@ import { HttpMethod } from "../query";
9
9
  import { Row, RowAttachment } from "../row";
10
10
  import { LoopStepType, EmailAttachment, AutomationResults, AutomationStepResult, SupportedFileType } from "./automation";
11
11
  import { AutomationStep } from "./schema";
12
+ import type { EscalationRecipient, EscalationResponse } from "../escalation";
12
13
  export declare enum FilterCondition {
13
14
  EQUAL = "EQUAL",
14
15
  NOT_EQUAL = "NOT_EQUAL",
@@ -135,7 +136,7 @@ export type Branch = {
135
136
  id: any;
136
137
  name: string;
137
138
  condition: BranchSearchFilters;
138
- conditionUI?: UISearchFilter;
139
+ conditionUI?: UISearchFilter | null;
139
140
  };
140
141
  export type BranchSearchFilters = SearchFilters;
141
142
  export type MakeIntegrationInputs = {
@@ -370,6 +371,7 @@ export type AppActionTriggerOutputs = {
370
371
  };
371
372
  export type CronTriggerInputs = {
372
373
  cron: string;
374
+ timezone?: string;
373
375
  };
374
376
  export declare enum EmailTriggerAuthType {
375
377
  PASSWORD = "password",
@@ -440,3 +442,20 @@ export type RowActionTriggerOutputs = {
440
442
  revision?: string;
441
443
  table: Table;
442
444
  };
445
+ export type EscalationStepInputs = {
446
+ message: string;
447
+ delay: number;
448
+ operationId?: string;
449
+ agentId?: string;
450
+ notifications?: {
451
+ recipients?: EscalationRecipient[];
452
+ };
453
+ resolutionStrategy?: string;
454
+ };
455
+ export type EscalationStepOutputs = {
456
+ success: boolean;
457
+ escalationId?: string;
458
+ resolution?: "pending" | "resolved" | "expired" | "cancelled";
459
+ resolvedAt?: string;
460
+ response?: EscalationResponse;
461
+ };
@@ -16,7 +16,8 @@ export declare enum AutomationIOType {
16
16
  DATE = "date",
17
17
  DATETIME = "datetime",
18
18
  ATTACHMENT = "attachment",
19
- LONGFORM = "longform"
19
+ LONGFORM = "longform",
20
+ JS = "javascript"
20
21
  }
21
22
  export declare enum AutomationCustomIOType {
22
23
  TABLE = "table",
@@ -87,6 +88,7 @@ export declare enum AutomationActionStepId {
87
88
  EXTRACT_STATE = "EXTRACT_STATE",
88
89
  LOOP_V2 = "LOOP_V2",
89
90
  AGENT = "AGENT",
91
+ ESCALATION = "ESCALATION",
90
92
  discord = "discord",
91
93
  slack = "slack",
92
94
  zapier = "zapier",
@@ -130,6 +132,7 @@ export interface Automation extends Document {
130
132
  uiTree?: any;
131
133
  appId: string;
132
134
  live?: boolean;
135
+ projectIds?: string[];
133
136
  name: string;
134
137
  internal?: boolean;
135
138
  type?: string;
@@ -174,7 +177,8 @@ export declare enum AutomationStatus {
174
177
  STOPPED = "stopped",
175
178
  STOPPED_ERROR = "stopped_error",
176
179
  NO_CONDITION_MET = "No branch condition met",
177
- TIMED_OUT = "timed_out"
180
+ TIMED_OUT = "timed_out",
181
+ SUSPENDED = "suspended"
178
182
  }
179
183
  export declare enum AutomationStoppedReason {
180
184
  TRIGGER_FILTER_NOT_MET = "Automation did not run. Filter conditions in trigger were not met.",
@@ -234,6 +238,8 @@ export interface AutomationStepInputBase {
234
238
  emitter: ContextEmitter;
235
239
  appId: string;
236
240
  apiKey?: string;
241
+ automationId?: string;
242
+ stepId?: string;
237
243
  isTestRun?: boolean;
238
244
  }
239
245
  export type ActionImplementation<TInputs, TOutputs> = (params: {
@@ -1,6 +1,6 @@
1
1
  import { Hosting } from "../../../sdk";
2
2
  import { AutomationActionStepId, ActionImplementation, AutomationStepType, AutomationFeature, InputOutputBlock, AutomationTriggerStepId, AutomationEventType, AutomationIOType } from "./automation";
3
- import { CollectStepInputs, CollectStepOutputs, CreateRowStepInputs, CreateRowStepOutputs, DelayStepInputs, DelayStepOutputs, DeleteRowStepInputs, DeleteRowStepOutputs, ExecuteQueryStepInputs, ExecuteQueryStepOutputs, ExecuteScriptStepInputs, ExecuteScriptStepOutputs, FilterStepInputs, FilterStepOutputs, QueryRowsStepInputs, QueryRowsStepOutputs, GetRowStepInputs, GetRowStepOutputs, SmtpEmailStepInputs, ServerLogStepInputs, ServerLogStepOutputs, TriggerAutomationStepInputs, TriggerAutomationStepOutputs, UpdateRowStepInputs, UpdateRowStepOutputs, OutgoingWebhookStepInputs, ExternalAppStepOutputs, DiscordStepInputs, SlackStepInputs, ZapierStepInputs, ZapierStepOutputs, MakeIntegrationInputs, n8nStepInputs, BashStepInputs, BashStepOutputs, OpenAIStepInputs, OpenAIStepOutputs, LoopStepInputs, CronTriggerInputs, RowUpdatedTriggerInputs, RowCreatedTriggerInputs, RowDeletedTriggerInputs, BranchStepInputs, BaseAutomationOutputs, AppActionTriggerOutputs, CronTriggerOutputs, RowDeletedTriggerOutputs, RowCreatedTriggerOutputs, RowUpdatedTriggerOutputs, WebhookTriggerOutputs, RowActionTriggerInputs, ClassifyContentStepOutputs, ClassifyContentStepInputs, PromptLLMStepOutputs, PromptLLMStepInputs, TranslateStepOutputs, TranslateStepInputs, SummariseStepInputs, SummariseStepOutputs, GenerateTextStepInputs, GenerateTextStepOutputs, ExtractFileDataStepOutputs, ExtractFileDataStepInputs, APIRequestStepInputs, APIRequestStepOutputs, BranchSearchFilters, ExtractStateStepInputs, ExtractStateStepOutputs, LoopV2StepInputs, LoopV2StepOutputs, EmailTriggerInputs, AgentStepInputs, AgentStepOutputs } from "./StepInputsOutputs";
3
+ import { CollectStepInputs, CollectStepOutputs, CreateRowStepInputs, CreateRowStepOutputs, DelayStepInputs, DelayStepOutputs, DeleteRowStepInputs, DeleteRowStepOutputs, ExecuteQueryStepInputs, ExecuteQueryStepOutputs, ExecuteScriptStepInputs, ExecuteScriptStepOutputs, FilterStepInputs, FilterStepOutputs, QueryRowsStepInputs, QueryRowsStepOutputs, GetRowStepInputs, GetRowStepOutputs, SmtpEmailStepInputs, ServerLogStepInputs, ServerLogStepOutputs, TriggerAutomationStepInputs, TriggerAutomationStepOutputs, UpdateRowStepInputs, UpdateRowStepOutputs, OutgoingWebhookStepInputs, ExternalAppStepOutputs, DiscordStepInputs, SlackStepInputs, ZapierStepInputs, ZapierStepOutputs, MakeIntegrationInputs, n8nStepInputs, BashStepInputs, BashStepOutputs, OpenAIStepInputs, OpenAIStepOutputs, LoopStepInputs, CronTriggerInputs, RowUpdatedTriggerInputs, RowCreatedTriggerInputs, RowDeletedTriggerInputs, BranchStepInputs, BaseAutomationOutputs, AppActionTriggerOutputs, CronTriggerOutputs, RowDeletedTriggerOutputs, RowCreatedTriggerOutputs, RowUpdatedTriggerOutputs, WebhookTriggerOutputs, RowActionTriggerInputs, ClassifyContentStepOutputs, ClassifyContentStepInputs, PromptLLMStepOutputs, PromptLLMStepInputs, TranslateStepOutputs, TranslateStepInputs, SummariseStepInputs, SummariseStepOutputs, GenerateTextStepInputs, GenerateTextStepOutputs, ExtractFileDataStepOutputs, ExtractFileDataStepInputs, APIRequestStepInputs, APIRequestStepOutputs, BranchSearchFilters, ExtractStateStepInputs, ExtractStateStepOutputs, LoopV2StepInputs, LoopV2StepOutputs, EmailTriggerInputs, AgentStepInputs, AgentStepOutputs, EscalationStepInputs, EscalationStepOutputs } from "./StepInputsOutputs";
4
4
  export type ActionImplementations<T extends Hosting> = {
5
5
  [AutomationActionStepId.COLLECT]: ActionImplementation<CollectStepInputs, CollectStepOutputs>;
6
6
  [AutomationActionStepId.CREATE_ROW]: ActionImplementation<CreateRowStepInputs, CreateRowStepOutputs>;
@@ -32,6 +32,7 @@ export type ActionImplementations<T extends Hosting> = {
32
32
  [AutomationActionStepId.EXTRACT_FILE_DATA]: ActionImplementation<ExtractFileDataStepInputs, ExtractFileDataStepOutputs>;
33
33
  [AutomationActionStepId.EXTRACT_STATE]: ActionImplementation<ExtractStateStepInputs, ExtractStateStepOutputs>;
34
34
  [AutomationActionStepId.AGENT]: ActionImplementation<AgentStepInputs, AgentStepOutputs>;
35
+ [AutomationActionStepId.ESCALATION]?: ActionImplementation<EscalationStepInputs, EscalationStepOutputs>;
35
36
  } & (T extends "self" ? {
36
37
  [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<BashStepInputs, BashStepOutputs>;
37
38
  } : {});
@@ -55,8 +56,8 @@ export interface AutomationStepSchemaBase {
55
56
  custom?: boolean;
56
57
  features?: Partial<Record<AutomationFeature, boolean>>;
57
58
  }
58
- export type AutomationStepInputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepInputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepInputs : T extends AutomationActionStepId.DELAY ? DelayStepInputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepInputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepInputs : T extends AutomationActionStepId.API_REQUEST ? APIRequestStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2 ? ExecuteScriptStepInputs : T extends AutomationActionStepId.FILTER ? FilterStepInputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepInputs : T extends AutomationActionStepId.GET_ROW ? GetRowStepInputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? SmtpEmailStepInputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepInputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepInputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepInputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? OutgoingWebhookStepInputs : T extends AutomationActionStepId.discord ? DiscordStepInputs : T extends AutomationActionStepId.slack ? SlackStepInputs : T extends AutomationActionStepId.zapier ? ZapierStepInputs : T extends AutomationActionStepId.integromat ? MakeIntegrationInputs : T extends AutomationActionStepId.n8n ? n8nStepInputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepInputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepInputs : T extends AutomationActionStepId.LOOP ? LoopStepInputs : T extends AutomationActionStepId.BRANCH ? BranchStepInputs : T extends AutomationActionStepId.CLASSIFY_CONTENT ? ClassifyContentStepInputs : T extends AutomationActionStepId.PROMPT_LLM ? PromptLLMStepInputs : T extends AutomationActionStepId.TRANSLATE ? TranslateStepInputs : T extends AutomationActionStepId.SUMMARISE ? SummariseStepInputs : T extends AutomationActionStepId.GENERATE_TEXT ? GenerateTextStepInputs : T extends AutomationActionStepId.EXTRACT_FILE_DATA ? ExtractFileDataStepInputs : T extends AutomationActionStepId.EXTRACT_STATE ? ExtractStateStepInputs : T extends AutomationActionStepId.LOOP_V2 ? LoopV2StepInputs : T extends AutomationActionStepId.AGENT ? AgentStepInputs : never;
59
- export type AutomationStepOutputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepOutputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepOutputs : T extends AutomationActionStepId.DELAY ? DelayStepOutputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepOutputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepOutputs : T extends AutomationActionStepId.API_REQUEST ? APIRequestStepOutputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepOutputs : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2 ? ExecuteScriptStepOutputs : T extends AutomationActionStepId.FILTER ? FilterStepOutputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepOutputs : T extends AutomationActionStepId.GET_ROW ? GetRowStepOutputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? BaseAutomationOutputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepOutputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepOutputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepOutputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? ExternalAppStepOutputs : T extends AutomationActionStepId.discord ? ExternalAppStepOutputs : T extends AutomationActionStepId.slack ? ExternalAppStepOutputs : T extends AutomationActionStepId.zapier ? ZapierStepOutputs : T extends AutomationActionStepId.integromat ? ExternalAppStepOutputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepOutputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepOutputs : T extends AutomationActionStepId.LOOP ? BaseAutomationOutputs : T extends AutomationActionStepId.CLASSIFY_CONTENT ? ClassifyContentStepOutputs : T extends AutomationActionStepId.PROMPT_LLM ? PromptLLMStepOutputs : T extends AutomationActionStepId.TRANSLATE ? TranslateStepOutputs : T extends AutomationActionStepId.SUMMARISE ? SummariseStepOutputs : T extends AutomationActionStepId.GENERATE_TEXT ? GenerateTextStepOutputs : T extends AutomationActionStepId.EXTRACT_FILE_DATA ? ExtractFileDataStepOutputs : T extends AutomationActionStepId.EXTRACT_STATE ? ExtractStateStepOutputs : T extends AutomationActionStepId.LOOP_V2 ? LoopV2StepOutputs : T extends AutomationActionStepId.AGENT ? AgentStepOutputs : never;
59
+ export type AutomationStepInputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepInputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepInputs : T extends AutomationActionStepId.DELAY ? DelayStepInputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepInputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepInputs : T extends AutomationActionStepId.API_REQUEST ? APIRequestStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepInputs : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2 ? ExecuteScriptStepInputs : T extends AutomationActionStepId.FILTER ? FilterStepInputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepInputs : T extends AutomationActionStepId.GET_ROW ? GetRowStepInputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? SmtpEmailStepInputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepInputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepInputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepInputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? OutgoingWebhookStepInputs : T extends AutomationActionStepId.discord ? DiscordStepInputs : T extends AutomationActionStepId.slack ? SlackStepInputs : T extends AutomationActionStepId.zapier ? ZapierStepInputs : T extends AutomationActionStepId.integromat ? MakeIntegrationInputs : T extends AutomationActionStepId.n8n ? n8nStepInputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepInputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepInputs : T extends AutomationActionStepId.LOOP ? LoopStepInputs : T extends AutomationActionStepId.BRANCH ? BranchStepInputs : T extends AutomationActionStepId.CLASSIFY_CONTENT ? ClassifyContentStepInputs : T extends AutomationActionStepId.PROMPT_LLM ? PromptLLMStepInputs : T extends AutomationActionStepId.TRANSLATE ? TranslateStepInputs : T extends AutomationActionStepId.SUMMARISE ? SummariseStepInputs : T extends AutomationActionStepId.GENERATE_TEXT ? GenerateTextStepInputs : T extends AutomationActionStepId.EXTRACT_FILE_DATA ? ExtractFileDataStepInputs : T extends AutomationActionStepId.EXTRACT_STATE ? ExtractStateStepInputs : T extends AutomationActionStepId.LOOP_V2 ? LoopV2StepInputs : T extends AutomationActionStepId.AGENT ? AgentStepInputs : T extends AutomationActionStepId.ESCALATION ? EscalationStepInputs : never;
60
+ export type AutomationStepOutputs<T extends AutomationActionStepId> = T extends AutomationActionStepId.COLLECT ? CollectStepOutputs : T extends AutomationActionStepId.CREATE_ROW ? CreateRowStepOutputs : T extends AutomationActionStepId.DELAY ? DelayStepOutputs : T extends AutomationActionStepId.DELETE_ROW ? DeleteRowStepOutputs : T extends AutomationActionStepId.EXECUTE_QUERY ? ExecuteQueryStepOutputs : T extends AutomationActionStepId.API_REQUEST ? APIRequestStepOutputs : T extends AutomationActionStepId.EXECUTE_SCRIPT ? ExecuteScriptStepOutputs : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2 ? ExecuteScriptStepOutputs : T extends AutomationActionStepId.FILTER ? FilterStepOutputs : T extends AutomationActionStepId.QUERY_ROWS ? QueryRowsStepOutputs : T extends AutomationActionStepId.GET_ROW ? GetRowStepOutputs : T extends AutomationActionStepId.SEND_EMAIL_SMTP ? BaseAutomationOutputs : T extends AutomationActionStepId.SERVER_LOG ? ServerLogStepOutputs : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN ? TriggerAutomationStepOutputs : T extends AutomationActionStepId.UPDATE_ROW ? UpdateRowStepOutputs : T extends AutomationActionStepId.OUTGOING_WEBHOOK ? ExternalAppStepOutputs : T extends AutomationActionStepId.discord ? ExternalAppStepOutputs : T extends AutomationActionStepId.slack ? ExternalAppStepOutputs : T extends AutomationActionStepId.zapier ? ZapierStepOutputs : T extends AutomationActionStepId.integromat ? ExternalAppStepOutputs : T extends AutomationActionStepId.EXECUTE_BASH ? BashStepOutputs : T extends AutomationActionStepId.OPENAI ? OpenAIStepOutputs : T extends AutomationActionStepId.LOOP ? BaseAutomationOutputs : T extends AutomationActionStepId.CLASSIFY_CONTENT ? ClassifyContentStepOutputs : T extends AutomationActionStepId.PROMPT_LLM ? PromptLLMStepOutputs : T extends AutomationActionStepId.TRANSLATE ? TranslateStepOutputs : T extends AutomationActionStepId.SUMMARISE ? SummariseStepOutputs : T extends AutomationActionStepId.GENERATE_TEXT ? GenerateTextStepOutputs : T extends AutomationActionStepId.EXTRACT_FILE_DATA ? ExtractFileDataStepOutputs : T extends AutomationActionStepId.EXTRACT_STATE ? ExtractStateStepOutputs : T extends AutomationActionStepId.LOOP_V2 ? LoopV2StepOutputs : T extends AutomationActionStepId.AGENT ? AgentStepOutputs : T extends AutomationActionStepId.ESCALATION ? EscalationStepOutputs : never;
60
61
  export interface AutomationStepInputSettings {
61
62
  continueOnError?: boolean;
62
63
  }
@@ -97,12 +98,13 @@ export type ExtractFileDataStep = AutomationStepSchema<AutomationActionStepId.EX
97
98
  export type ExtractStateStep = AutomationStepSchema<AutomationActionStepId.EXTRACT_STATE>;
98
99
  export type LoopV2Step = AutomationStepSchema<AutomationActionStepId.LOOP_V2>;
99
100
  export type AgentStep = AutomationStepSchema<AutomationActionStepId.AGENT>;
101
+ export type EscalationStep = AutomationStepSchema<AutomationActionStepId.ESCALATION>;
100
102
  export type BranchStep = AutomationStepSchema<AutomationActionStepId.BRANCH> & {
101
103
  conditionUI?: {
102
104
  groups: BranchSearchFilters[];
103
105
  };
104
106
  };
105
- export type AutomationStep = CollectStep | CreateRowStep | DelayStep | DeleteRowStep | ExecuteQueryStep | APIRequestStep | ExecuteScriptStep | ExecuteScriptV2Step | FilterStep | QueryRowsStep | SendEmailSmtpStep | ServerLogStep | TriggerAutomationRunStep | UpdateRowStep | OutgoingWebhookStep | DiscordStep | SlackStep | ZapierStep | IntegromatStep | N8nStep | LoopStep | ExecuteBashStep | OpenAIStep | BranchStep | ClassifyContentStep | PromptLLMStep | TranslateStep | SummariseStep | GenerateTextStep | ExtractFileDataStep | ExtractStateStep | LoopV2Step | AgentStep;
107
+ export type AutomationStep = CollectStep | CreateRowStep | DelayStep | DeleteRowStep | ExecuteQueryStep | APIRequestStep | ExecuteScriptStep | ExecuteScriptV2Step | FilterStep | QueryRowsStep | SendEmailSmtpStep | ServerLogStep | TriggerAutomationRunStep | UpdateRowStep | OutgoingWebhookStep | DiscordStep | SlackStep | ZapierStep | IntegromatStep | N8nStep | LoopStep | ExecuteBashStep | OpenAIStep | BranchStep | ClassifyContentStep | PromptLLMStep | TranslateStep | SummariseStep | GenerateTextStep | ExtractFileDataStep | ExtractStateStep | LoopV2Step | AgentStep | EscalationStep;
106
108
  export declare function isBranchStep(step: AutomationStep | AutomationTrigger): step is BranchStep;
107
109
  export declare function isTrigger(step: AutomationStep | AutomationTrigger): step is AutomationTrigger;
108
110
  export declare function isRowUpdateTrigger(step: AutomationStep | AutomationTrigger): step is RowUpdatedTrigger;
@@ -6,6 +6,7 @@ import { OAuth2Config } from "./oauth2";
6
6
  export interface Datasource extends Document {
7
7
  type: string;
8
8
  name?: string;
9
+ projectIds?: string[];
9
10
  source: SourceName;
10
11
  auth?: {
11
12
  type: string;
@@ -0,0 +1,83 @@
1
+ import type { ModelMessage, UIMessage } from "ai";
2
+ import { Document } from "../document";
3
+ import { Automation, AutomationStepResult } from "./automation";
4
+ import { ChatConversationChannel } from "../global/chat";
5
+ export type EscalationResponse = Record<string, any>;
6
+ export declare function isEscalationResponse(v: unknown): v is EscalationResponse;
7
+ export declare enum EscalationSource {
8
+ AUTOMATION = "automation",
9
+ OPERATION = "operation"
10
+ }
11
+ export declare enum ResolutionStrategy {
12
+ FIRST_RESPONSE = "first_response"
13
+ }
14
+ export interface SuspendedAutomationContext {
15
+ automation: Automation;
16
+ userId?: string;
17
+ stepResults: AutomationStepResult[];
18
+ state: Record<string, any>;
19
+ }
20
+ export interface SuspendedOperationContext {
21
+ agentId: string;
22
+ operationId: string;
23
+ sessionId: string;
24
+ messages: ModelMessage[];
25
+ channel?: ChatConversationChannel;
26
+ userId?: string;
27
+ }
28
+ export type SuspendedContext = ({
29
+ source: EscalationSource.AUTOMATION;
30
+ } & SuspendedAutomationContext) | ({
31
+ source: EscalationSource.OPERATION;
32
+ } & SuspendedOperationContext);
33
+ export interface EscalationContextDoc extends Document {
34
+ source: EscalationSource;
35
+ automationId?: string;
36
+ stepId?: string;
37
+ operationId?: string;
38
+ sessionId?: string;
39
+ appId: string;
40
+ tenantId: string;
41
+ agentId?: string;
42
+ contextCompressed?: string;
43
+ delay: number;
44
+ resolution: "pending" | "resolved" | "expired" | "cancelled";
45
+ title?: string;
46
+ summary?: string;
47
+ response?: EscalationResponse;
48
+ resolvedAt?: string;
49
+ isTest?: boolean;
50
+ recipients?: EscalationRecipient[];
51
+ resolutionStrategy?: string;
52
+ resumeResultCompressed?: string;
53
+ }
54
+ export interface EscalationResult {
55
+ resolution: EscalationContextDoc["resolution"];
56
+ title?: string;
57
+ summary?: string;
58
+ resumeResult?: UIMessage;
59
+ }
60
+ export declare enum EscalationNotificationChannel {
61
+ BUDIBASE = "budibase",
62
+ SLACK = "slack",
63
+ MSTEAMS = "msteams",
64
+ DISCORD = "discord",
65
+ TELEGRAM = "telegram"
66
+ }
67
+ export interface EscalationRecipient {
68
+ type: EscalationNotificationChannel;
69
+ config: Record<string, any>;
70
+ }
71
+ export interface EscalationRespondResult {
72
+ status: "recorded" | "closed";
73
+ message?: string;
74
+ }
75
+ export interface EscalationNotificationDoc extends Document {
76
+ escalationId: string;
77
+ appId: string;
78
+ tenantId: string;
79
+ recipient: EscalationRecipient;
80
+ sentAt: string;
81
+ response?: EscalationResponse;
82
+ respondedAt?: string;
83
+ }
@@ -8,6 +8,7 @@ export * from "./layout";
8
8
  export * from "./links";
9
9
  export * from "./metadata";
10
10
  export * from "./oauth2";
11
+ export * from "./project";
11
12
  export * from "./query";
12
13
  export * from "./role";
13
14
  export * from "./row";
@@ -24,3 +25,4 @@ export * from "./workspace";
24
25
  export * from "./workspaceApp";
25
26
  export * from "./workspaceFavourite";
26
27
  export * from "./webSearchConfig";
28
+ export * from "./escalation";
@@ -0,0 +1,8 @@
1
+ import { Document } from "../document";
2
+ export interface Project extends Omit<Document, "createdAt" | "updatedAt"> {
3
+ name: string;
4
+ description?: string;
5
+ color?: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ }
@@ -33,6 +33,7 @@ export interface ImportEndpoint {
33
33
  export type QueryFields = RestQueryFields & SQLQueryFields & MongoQueryFields & GoogleSheetsQueryFields;
34
34
  export interface Query extends Document {
35
35
  datasourceId: string;
36
+ projectIds?: string[];
36
37
  name: string;
37
38
  parameters: QueryParameter[];
38
39
  fields: QueryFields;
@@ -9,6 +9,7 @@ export declare enum TableSourceType {
9
9
  }
10
10
  export interface Table extends Document {
11
11
  type: "table";
12
+ projectIds?: string[];
12
13
  sourceType: TableSourceType;
13
14
  views?: {
14
15
  [key: string]: View | ViewV2;
@@ -9,4 +9,5 @@ export interface WorkspaceApp extends Document {
9
9
  customTheme?: AppCustomTheme;
10
10
  isDefault: boolean;
11
11
  disabled?: boolean;
12
+ projectIds?: string[];
12
13
  }