@mondaydotcomorg/agent-toolkit 0.1.1 → 0.1.4

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,60 @@
1
+ import { ApiClientConfig } from '@mondaydotcomorg/api';
2
+ import { ChatCompletionTool, ChatCompletionMessageToolCall, ChatCompletionToolMessageParam } from 'openai/resources';
3
+ import { ZodRawShape, z, ZodTypeAny } from 'zod';
4
+
5
+ interface Executable<Input, Output> {
6
+ execute: (input?: Input) => Promise<Output>;
7
+ }
8
+
9
+ type ToolInputType<Input extends ZodRawShape | undefined> = Input extends ZodRawShape ? z.objectOutputType<Input, ZodTypeAny> : undefined;
10
+ type ToolOutputType<T extends Record<string, unknown>> = {
11
+ content: string;
12
+ metadata?: T;
13
+ };
14
+ declare enum ToolType {
15
+ QUERY = "query",
16
+ MUTATION = "mutation",
17
+ ALL_API = "all_api"
18
+ }
19
+ interface Tool<Input extends ZodRawShape | undefined, Output extends Record<string, unknown> = never> extends Executable<ToolInputType<Input>, ToolOutputType<Output>> {
20
+ name: string;
21
+ type: ToolType;
22
+ getDescription(): string;
23
+ getInputSchema(): Input;
24
+ }
25
+
26
+ type ToolsConfiguration = {
27
+ include?: string[];
28
+ exclude?: string[];
29
+ readOnlyMode?: boolean;
30
+ enableDynamicApiTools?: boolean;
31
+ };
32
+
33
+ type MondayAgentToolkitConfig = {
34
+ mondayApiToken: ApiClientConfig['token'];
35
+ mondayApiVersion: ApiClientConfig['apiVersion'];
36
+ mondayApiRequestConfig: ApiClientConfig['requestConfig'];
37
+ toolsConfiguration?: ToolsConfiguration;
38
+ };
39
+ declare class MondayAgentToolkit {
40
+ private readonly mondayApi;
41
+ tools: Tool<any, any>[];
42
+ constructor(config: MondayAgentToolkitConfig);
43
+ /**
44
+ * Returns the tools that are available to be used in the OpenAI API.
45
+ *
46
+ * @returns {ChatCompletionTool[]} The tools that are available to be used in the OpenAI API.
47
+ */
48
+ getTools(): ChatCompletionTool[];
49
+ /**
50
+ * Processes a single OpenAI tool call by executing the requested function.
51
+ *
52
+ * @param {ChatCompletionMessageToolCall} toolCall - The tool call object from OpenAI containing
53
+ * function name, arguments, and ID.
54
+ * @returns {Promise<ChatCompletionToolMessageParam>} A promise that resolves to a tool message
55
+ * object containing the result of the tool execution with the proper format for the OpenAI API.
56
+ */
57
+ handleToolCall(toolCall: ChatCompletionMessageToolCall): Promise<ChatCompletionToolMessageParam>;
58
+ }
59
+
60
+ export { MondayAgentToolkit, MondayAgentToolkitConfig };