@budibase/types 3.10.5 → 3.10.7

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.
@@ -1,17 +1,43 @@
1
1
  import openai from "openai";
2
2
  import { EnrichedBinding } from "../../ui";
3
- export interface Message {
4
- role: "system" | "user";
3
+ import { z } from "zod";
4
+ export interface SystemMessage {
5
+ role: "system";
5
6
  content: string;
6
7
  }
8
+ export interface UserMessage {
9
+ role: "user";
10
+ content: string;
11
+ }
12
+ export interface AssistantMessage {
13
+ role: "assistant";
14
+ content: string | null;
15
+ tool_calls?: openai.ChatCompletionMessageToolCall[];
16
+ }
17
+ export interface ToolMessage {
18
+ role: "tool";
19
+ tool_call_id: string;
20
+ content: string;
21
+ }
22
+ export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
23
+ export type Tool<T extends z.ZodType = z.ZodType> = Required<ToolArgs<T>>;
24
+ export interface ToolArgs<T extends z.ZodType> {
25
+ name: string;
26
+ description: string;
27
+ parameters?: T;
28
+ handler: (args: z.infer<T>) => Promise<string>;
29
+ strict?: boolean;
30
+ }
31
+ export declare function newTool<T extends z.ZodType>(tool: ToolArgs<T>): Tool<T>;
7
32
  export type ResponseFormat = "text" | "json" | openai.ResponseFormatJSONSchema;
8
33
  export interface ChatCompletionRequest {
9
34
  messages: Message[];
10
35
  format?: ResponseFormat;
36
+ useTools?: boolean;
11
37
  }
12
38
  export interface ChatCompletionResponse {
13
- message?: string;
14
- tokensUsed?: number;
39
+ messages: Message[];
40
+ tokensUsed: number;
15
41
  }
16
42
  export interface GenerateJsRequest {
17
43
  prompt: string;
@@ -42,7 +42,7 @@ export interface ClearAutomationLogResponse {
42
42
  message: string;
43
43
  }
44
44
  export interface TriggerAutomationRequest {
45
- fields: Record<string, any>;
45
+ fields?: Record<string, any>;
46
46
  timestamp?: number;
47
47
  timeout: number;
48
48
  }
@@ -50,7 +50,8 @@ export type TriggerAutomationResponse = Record<string, any> | undefined;
50
50
  export interface TestAutomationRequest {
51
51
  id?: string;
52
52
  revision?: string;
53
- fields: Record<string, any>;
53
+ timeout?: number;
54
+ fields?: Record<string, any>;
54
55
  row?: Row;
55
56
  oldRow?: Row;
56
57
  }
@@ -32,7 +32,7 @@ export interface PreviewQueryResponse {
32
32
  extra: any;
33
33
  }
34
34
  export interface ExecuteQueryRequest {
35
- parameters?: Record<string, string>;
35
+ parameters?: Record<string, string | number | null>;
36
36
  pagination?: any;
37
37
  }
38
38
  export type ExecuteV1QueryResponse = Record<string, any>[];
@@ -0,0 +1,4 @@
1
+ import { AgentChat } from "../../../documents";
2
+ export type ChatAgentRequest = AgentChat;
3
+ export type ChatAgentResponse = AgentChat;
4
+ export type FetchAgentHistoryResponse = AgentChat[];
@@ -9,3 +9,4 @@ export * from "./email";
9
9
  export * from "./role";
10
10
  export * from "./self";
11
11
  export * from "./template";
12
+ export * from "./agents";
@@ -171,10 +171,11 @@ export type TriggerAutomationStepInputs = {
171
171
  automation: {
172
172
  automationId: string;
173
173
  };
174
- timeout: number;
174
+ timeout?: number;
175
175
  };
176
176
  export type TriggerAutomationStepOutputs = BaseAutomationOutputs & {
177
177
  value?: AutomationResults["steps"];
178
+ status: AutomationResults["status"];
178
179
  };
179
180
  export type UpdateRowStepInputs = {
180
181
  meta: Record<string, any>;
@@ -13,6 +13,7 @@ export declare enum AutomationIOType {
13
13
  ARRAY = "array",
14
14
  JSON = "json",
15
15
  DATE = "date",
16
+ DATETIME = "datetime",
16
17
  ATTACHMENT = "attachment"
17
18
  }
18
19
  export declare enum AutomationCustomIOType {
@@ -151,10 +152,12 @@ export declare enum AutomationStatus {
151
152
  ERROR = "error",
152
153
  STOPPED = "stopped",
153
154
  STOPPED_ERROR = "stopped_error",
154
- NO_CONDITION_MET = "No branch condition met"
155
+ NO_CONDITION_MET = "No branch condition met",
156
+ TIMED_OUT = "timed_out"
155
157
  }
156
158
  export declare enum AutomationStoppedReason {
157
- TRIGGER_FILTER_NOT_MET = "Automation did not run. Filter conditions in trigger were not met."
159
+ TRIGGER_FILTER_NOT_MET = "Automation did not run. Filter conditions in trigger were not met.",
160
+ TIMED_OUT = "Automation timed out."
158
161
  }
159
162
  export interface AutomationStepResultOutputs {
160
163
  success: boolean;
@@ -179,7 +182,7 @@ export interface AutomationTriggerResult {
179
182
  }
180
183
  export interface AutomationResults {
181
184
  automationId?: string;
182
- status?: AutomationStatus;
185
+ status: AutomationStatus;
183
186
  trigger: AutomationTriggerResult;
184
187
  steps: [AutomationTriggerResult, ...AutomationStepResult[]];
185
188
  }
@@ -1,10 +1,15 @@
1
1
  import { Document } from "../document";
2
2
  export interface Layout extends Document {
3
- componentLibraries: string[];
4
- title: string;
5
- favicon: string;
6
- stylesheets: string[];
3
+ componentLibraries?: string[];
4
+ title?: string;
5
+ favicon?: string;
6
+ stylesheets?: string[];
7
7
  props: any;
8
8
  layoutId?: string;
9
9
  name?: string;
10
+ navigation?: string;
11
+ pageWidth?: string;
12
+ embedded?: boolean;
13
+ logoUrl?: string;
14
+ hideTitle?: boolean;
10
15
  }
@@ -39,7 +39,8 @@ export declare enum DocumentType {
39
39
  SCIM_LOG = "scimlog",
40
40
  ROW_ACTIONS = "ra",
41
41
  OAUTH2_CONFIG = "oauth2",
42
- OAUTH2_CONFIG_LOG = "oauth2log"
42
+ OAUTH2_CONFIG_LOG = "oauth2log",
43
+ AGENT_CHAT = "agentchat"
43
44
  }
44
45
  export declare function getDocumentType(id: string): DocumentType | undefined;
45
46
  export declare const DocumentTypesToImport: DocumentType[];
@@ -0,0 +1,5 @@
1
+ import { Document, Message } from "../../";
2
+ export interface AgentChat extends Document {
3
+ title: string;
4
+ messages: Message[];
5
+ }
@@ -9,3 +9,4 @@ export * from "./environmentVariables";
9
9
  export * from "./auditLogs";
10
10
  export * from "./apikeys";
11
11
  export * from "./devInfo";
12
+ export * from "./agents";