@mondaydotcomorg/agent-toolkit 2.0.6 → 2.0.8
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/cjs/core/index.d.ts +3 -0
- package/dist/cjs/core/index.js +9 -9
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +6 -6
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +6 -6
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.d.ts +3 -0
- package/dist/esm/core/index.js +6 -6
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +6 -6
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +7 -7
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/core/index.d.ts
CHANGED
|
@@ -350,9 +350,12 @@ declare const allMondayApiToolSchema: {
|
|
|
350
350
|
declare class AllMondayApiTool extends BaseMondayApiTool<typeof allMondayApiToolSchema> {
|
|
351
351
|
name: string;
|
|
352
352
|
type: ToolType;
|
|
353
|
+
private static schemaCache;
|
|
353
354
|
constructor(mondayApi: ApiClient, context?: MondayApiToolContext);
|
|
354
355
|
getDescription(): string;
|
|
355
356
|
getInputSchema(): typeof allMondayApiToolSchema;
|
|
357
|
+
private loadSchema;
|
|
358
|
+
private validateOperation;
|
|
356
359
|
execute(input: ToolInputType<typeof allMondayApiToolSchema>): Promise<ToolOutputType<never>>;
|
|
357
360
|
}
|
|
358
361
|
|
package/dist/esm/core/index.js
CHANGED
|
@@ -151,7 +151,7 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
`,jt=At`
|
|
155
155
|
query IntrospectionQuery {
|
|
156
156
|
__schema {
|
|
157
157
|
queryType {
|
|
@@ -253,7 +253,7 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
`,Mt=At`
|
|
257
257
|
mutation createCustomActivity($color: CustomActivityColor!, $icon_id: CustomActivityIcon!, $name: String!) {
|
|
258
258
|
create_custom_activity(color: $color, icon_id: $icon_id, name: $name) {
|
|
259
259
|
color
|
|
@@ -261,7 +261,7 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
261
261
|
name
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
`,
|
|
264
|
+
`,Gt=At`
|
|
265
265
|
mutation createTimelineItem(
|
|
266
266
|
$item_id: ID!
|
|
267
267
|
$custom_activity_id: String!
|
|
@@ -294,7 +294,7 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
294
294
|
type
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`,qt=At`
|
|
298
298
|
query fetchCustomActivity {
|
|
299
299
|
custom_activity {
|
|
300
300
|
color
|
|
@@ -304,7 +304,7 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
304
304
|
type
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
`,qt={itemId:e.number()};class Yt extends r{constructor(){super(...arguments),this.name="delete_item",this.type=o.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return qt}async execute(e){const p={id:e.itemId.toString()},a=await this.mondayApi.request(Ot,p);return{content:`Item ${a.delete_item?.id} successfully deleted`}}}const Jt={term:e.string()},zt={boardId:e.number(),...Jt};class Qt extends r{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=o.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?Jt:zt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},a=await this.mondayApi.request(Vt,p);return{content:`Items ${a.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}}const Kt={name:e.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},Ht={boardId:e.number().describe("The id of the board to which the new item will be added"),...Kt};class Xt extends r{constructor(){super(...arguments),this.name="create_item",this.type=o.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?Kt:Ht}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},a=await this.mondayApi.request(Lt,p);return{content:`Item ${a.create_item?.id} successfully created`}}}const Wt={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update to be created, must be relevant to the user's request")};class Zt extends r{constructor(){super(...arguments),this.name="create_update",this.type=o.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Wt}async execute(e){const p={itemId:e.itemId.toString(),body:e.body},a=await this.mondayApi.request(Ct,p);return{content:`Update ${a.create_update?.id} successfully created on item ${e.itemId}`}}}const ei={boardId:e.number().describe("The id of the board to get the schema of")};class pi extends r{constructor(){super(...arguments),this.name="get_board_schema",this.type=o.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return ei}async execute(e){const p=this.context?.boardId??e.boardId,a={boardId:p.toString()},d=await this.mondayApi.request(Ft,a);return{content:`The current schema of the board ${p} is: \n \n\nColumns:\n ${d.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${d.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}}const ai={name:e.string().optional().describe("The name or partial name of the user to get")};class di extends r{constructor(){super(...arguments),this.name="get_users_by_name",this.type=o.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return ai}async execute(e){const p={name:e.name},a=await this.mondayApi.request(xt,p);return{content:`Relevant users:\n ${a.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}}const ti={itemId:e.number().describe("The ID of the item to be updated"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},ii={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...ti};class ni extends r{constructor(){super(...arguments),this.name="change_item_column_values",this.type=o.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?ti:ii}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request(kt,p);return{content:`Item ${a.change_multiple_column_values?.id} successfully updated with the new column values`}}}const oi={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};class ri extends r{constructor(){super(...arguments),this.name="move_item_to_group",this.type=o.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return oi}async execute(e){const p={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Rt,p);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}}var si,li,mi,ui,ci,vi,hi,fi,_i,wi,yi,Ni,Ti,gi,Ei,bi,Ii,Di,Si,Ai,Oi,Vi,Li,Ci,Fi,xi,ki,Ri,$i,Ui,Pi,Bi,ji,Mi,Gi,qi,Yi,Ji,zi,Qi,Ki,Hi,Xi,Wi,Zi,en,pn,an,dn,tn,nn,on,rn,sn,ln;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(si||(si={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(li||(li={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(mi||(mi={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(ui||(ui={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(ci||(ci={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(vi||(vi={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(hi||(hi={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(fi||(fi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(_i||(_i={})),function(e){e.Description="description",e.Title="title"}(wi||(wi={})),function(e){e.AutoNumber="auto_number",e.BoardRelation="board_relation",e.Button="button",e.Checkbox="checkbox",e.ColorPicker="color_picker",e.Country="country",e.CreationLog="creation_log",e.Date="date",e.Dependency="dependency",e.DirectDoc="direct_doc",e.Doc="doc",e.Dropdown="dropdown",e.Email="email",e.File="file",e.Formula="formula",e.Group="group",e.Hour="hour",e.Integration="integration",e.ItemAssignees="item_assignees",e.ItemId="item_id",e.LastUpdated="last_updated",e.Link="link",e.Location="location",e.LongText="long_text",e.Mirror="mirror",e.Name="name",e.Numbers="numbers",e.People="people",e.Person="person",e.Phone="phone",e.Progress="progress",e.Rating="rating",e.Status="status",e.Subtasks="subtasks",e.Tags="tags",e.Team="team",e.Text="text",e.TimeTracking="time_tracking",e.Timeline="timeline",e.Unsupported="unsupported",e.Vote="vote",e.Week="week",e.WorldClock="world_clock"}(yi||(yi={})),function(e){e.BrinkPink="BRINK_PINK",e.CelticBlue="CELTIC_BLUE",e.CornflowerBlue="CORNFLOWER_BLUE",e.DingyDungeon="DINGY_DUNGEON",e.GoGreen="GO_GREEN",e.Gray="GRAY",e.LightDeepPink="LIGHT_DEEP_PINK",e.LightHotPink="LIGHT_HOT_PINK",e.MayaBlue="MAYA_BLUE",e.MediumTurquoise="MEDIUM_TURQUOISE",e.ParadisePink="PARADISE_PINK",e.PhilippineGreen="PHILIPPINE_GREEN",e.PhilippineYellow="PHILIPPINE_YELLOW",e.SlateBlue="SLATE_BLUE",e.VividCerulean="VIVID_CERULEAN",e.YankeesBlue="YANKEES_BLUE",e.YellowGreen="YELLOW_GREEN",e.YellowOrange="YELLOW_ORANGE"}(Ni||(Ni={})),function(e){e.Ascending="ASCENDING",e.Camera="CAMERA",e.Conference="CONFERENCE",e.Flag="FLAG",e.Gift="GIFT",e.Headphones="HEADPHONES",e.Homekeys="HOMEKEYS",e.Location="LOCATION",e.Notebook="NOTEBOOK",e.Paperplane="PAPERPLANE",e.Plane="PLANE",e.Pliers="PLIERS",e.Tripod="TRIPOD",e.Twoflags="TWOFLAGS",e.Utencils="UTENCILS"}(Ti||(Ti={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(gi||(gi={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(Ei||(Ei={})),function(e){e.BulletedList="bulleted_list",e.CheckList="check_list",e.Code="code",e.Divider="divider",e.Image="image",e.LargeTitle="large_title",e.Layout="layout",e.MediumTitle="medium_title",e.NormalText="normal_text",e.NoticeBox="notice_box",e.NumberedList="numbered_list",e.PageBreak="page_break",e.Quote="quote",e.SmallTitle="small_title",e.Table="table",e.Video="video"}(bi||(bi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Ii||(Ii={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(Di||(Di={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Si||(Si={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Ai||(Ai={})),function(e){e.Monday="monday",e.Sunday="sunday"}(Oi||(Oi={})),function(e){e.Aquamarine="AQUAMARINE",e.BrightBlue="BRIGHT_BLUE",e.BrightGreen="BRIGHT_GREEN",e.ChiliBlue="CHILI_BLUE",e.DarkOrange="DARK_ORANGE",e.DarkPurple="DARK_PURPLE",e.DarkRed="DARK_RED",e.DoneGreen="DONE_GREEN",e.Indigo="INDIGO",e.Lipstick="LIPSTICK",e.Null="NULL",e.Purple="PURPLE",e.SofiaPink="SOFIA_PINK",e.StuckRed="STUCK_RED",e.Sunset="SUNSET",e.WorkingOrange="WORKING_ORANGE"}(Vi||(Vi={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(Li||(Li={})),function(e){e.FontWeightBold="FONT_WEIGHT_BOLD",e.FontWeightLight="FONT_WEIGHT_LIGHT",e.FontWeightNormal="FONT_WEIGHT_NORMAL",e.FontWeightVeryLight="FONT_WEIGHT_VERY_LIGHT",e.Null="NULL"}(Ci||(Ci={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(Fi||(Fi={})),function(e){e.Error="ERROR"}(xi||(xi={})),function(e){e.Asc="asc",e.Desc="desc"}(ki||(ki={})),function(e){e.And="and",e.Or="or"}(Ri||(Ri={})),function(e){e.AnyOf="any_of",e.Between="between",e.ContainsTerms="contains_terms",e.ContainsText="contains_text",e.EndsWith="ends_with",e.GreaterThan="greater_than",e.GreaterThanOrEquals="greater_than_or_equals",e.IsEmpty="is_empty",e.IsNotEmpty="is_not_empty",e.LowerThan="lower_than",e.LowerThanOrEqual="lower_than_or_equal",e.NotAnyOf="not_any_of",e.NotContainsText="not_contains_text",e.StartsWith="starts_with",e.WithinTheLast="within_the_last",e.WithinTheNext="within_the_next"}($i||($i={})),function(e){e.Person="person",e.Team="team"}(Ui||(Ui={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(Pi||(Pi={})),function(e){e.Dropdown="dropdown",e.Status="status"}(Bi||(Bi={})),function(e){e.Post="Post",e.Project="Project"}(ji||(ji={})),function(e){e.Left="left",e.Right="right"}(Mi||(Mi={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(Gi||(Gi={})),function(e){e.Crm="crm",e.Dev="dev",e.Forms="forms",e.Knowledge="knowledge",e.Service="service",e.Whiteboard="whiteboard",e.WorkManagement="work_management",e.Workflows="workflows"}(qi||(qi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(Yi||(Yi={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(Ji||(Ji={})),function(e){e.AmericanGray="american_gray",e.Aquamarine="aquamarine",e.Berry="berry",e.Blackish="blackish",e.BrightBlue="bright_blue",e.BrightGreen="bright_green",e.Brown="brown",e.Bubble="bubble",e.ChiliBlue="chili_blue",e.Coffee="coffee",e.DarkBlue="dark_blue",e.DarkIndigo="dark_indigo",e.DarkOrange="dark_orange",e.DarkPurple="dark_purple",e.DarkRed="dark_red",e.DoneGreen="done_green",e.EggYolk="egg_yolk",e.Explosive="explosive",e.GrassGreen="grass_green",e.Indigo="indigo",e.Lavender="lavender",e.Lilac="lilac",e.Lipstick="lipstick",e.Navy="navy",e.Orchid="orchid",e.Peach="peach",e.Pecan="pecan",e.Purple="purple",e.River="river",e.Royal="royal",e.Saladish="saladish",e.Sky="sky",e.SofiaPink="sofia_pink",e.Steel="steel",e.StuckRed="stuck_red",e.Sunset="sunset",e.Tan="tan",e.Teal="teal",e.Winter="winter",e.WorkingOrange="working_orange"}(zi||(zi={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Qi||(Qi={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(Ki||(Ki={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Hi||(Hi={})),function(e){e.Active="active",e.Inactive="inactive"}(Xi||(Xi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UpdateEmailDomainError="UPDATE_EMAIL_DOMAIN_ERROR",e.UserNotFound="USER_NOT_FOUND"}(Wi||(Wi={})),function(e){e.InvalidField="INVALID_FIELD"}(Zi||(Zi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(en||(en={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(pn||(pn={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(an||(an={})),function(e){e.Current="current",e.Deprecated="deprecated",e.Dev="dev",e.Maintenance="maintenance",e.OldMaintenance="old__maintenance",e.OldPreviousMaintenance="old_previous_maintenance",e.PreviousMaintenance="previous_maintenance",e.ReleaseCandidate="release_candidate"}(dn||(dn={})),function(e){e.ChangeColumnValue="change_column_value",e.ChangeName="change_name",e.ChangeSpecificColumnValue="change_specific_column_value",e.ChangeStatusColumnValue="change_status_column_value",e.ChangeSubitemColumnValue="change_subitem_column_value",e.ChangeSubitemName="change_subitem_name",e.CreateColumn="create_column",e.CreateItem="create_item",e.CreateSubitem="create_subitem",e.CreateSubitemUpdate="create_subitem_update",e.CreateUpdate="create_update",e.DeleteUpdate="delete_update",e.EditUpdate="edit_update",e.ItemArchived="item_archived",e.ItemDeleted="item_deleted",e.ItemMovedToAnyGroup="item_moved_to_any_group",e.ItemMovedToSpecificGroup="item_moved_to_specific_group",e.ItemRestored="item_restored",e.MoveSubitem="move_subitem",e.SubitemArchived="subitem_archived",e.SubitemDeleted="subitem_deleted"}(tn||(tn={})),function(e){e.Closed="closed",e.Open="open"}(nn||(nn={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(on||(on={})),function(e){e.CreatedAt="created_at"}(rn||(rn={})),function(e){e.Query="QUERY",e.Mutation="MUTATION",e.Subscription="SUBSCRIPTION",e.Field="FIELD",e.FragmentDefinition="FRAGMENT_DEFINITION",e.FragmentSpread="FRAGMENT_SPREAD",e.InlineFragment="INLINE_FRAGMENT",e.VariableDefinition="VARIABLE_DEFINITION",e.Schema="SCHEMA",e.Scalar="SCALAR",e.Object="OBJECT",e.FieldDefinition="FIELD_DEFINITION",e.ArgumentDefinition="ARGUMENT_DEFINITION",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.EnumValue="ENUM_VALUE",e.InputObject="INPUT_OBJECT",e.InputFieldDefinition="INPUT_FIELD_DEFINITION"}(sn||(sn={})),function(e){e.Scalar="SCALAR",e.Object="OBJECT",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.InputObject="INPUT_OBJECT",e.List="LIST",e.NonNull="NON_NULL"}(ln||(ln={}));const mn={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(vi).default(vi.Public).describe("The kind of board to create"),boardDescription:e.string().optional().describe("The description of the board to create"),workspaceId:e.string().optional().describe("The ID of the workspace to create the board in")};class un extends r{constructor(){super(...arguments),this.name="create_board",this.type=o.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return mn}async execute(e){const p={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request($t,p);return{content:`Board ${a.create_board?.id} successfully created`}}}const cn={columnType:e.nativeEnum(yi).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.array(e.string()).optional().describe("The default values for the new column (relevant only for column type 'status' or 'dropdown') when possible make the values relevant to the user's request")},vn={boardId:e.number().describe("The id of the board to which the new column will be added"),...cn};class hn extends r{constructor(){super(...arguments),this.name="create_column",this.type=o.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?cn:vn}async execute(e){const p=this.context?.boardId??e.boardId;let a;e.columnSettings&&e.columnType===yi.Status?a=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,p)=>[String(p+1),e])))}):e.columnSettings&&e.columnType===yi.Dropdown&&(a=JSON.stringify({settings:{labels:e.columnSettings.map(((e,p)=>({id:p+1,name:e})))}}));const d={boardId:p.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:a},t=await this.mondayApi.request(Ut,d);return{content:`Column ${t.create_column?.id} successfully created`}}}const fn={columnId:e.string().describe("The id of the column to be deleted")},_n={boardId:e.number().describe("The id of the board to which the new column will be added"),...fn};class wn extends r{constructor(){super(...arguments),this.name="delete_column",this.type=o.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?fn:_n}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Pt,p);return{content:`Column ${a.delete_column?.id} successfully deleted`}}}const yn={};async function Nn(e,p){const a=await async function(e){if(yn[e])return yn[e];try{const p=`https://api.monday.com/v2/get_schema?version=${e}`,a=await fetch(p),{data:d}=await a.json(),t=ld(d);return yn[e]=t,t}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}(p);var d;return sd(a,new te(e,d).parseDocument()).map((e=>e.message))}const Tn={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class gn extends r{constructor(e,p){super(e,p),this.name="all_monday_api",this.type=o.ALL_API,this.mondayApi}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically"}getInputSchema(){return Tn}async execute(e){const{query:p,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const d=this.mondayApi.apiVersion,t=await Nn(p,d);if(t.length>0)return{content:t.join(", ")};const i=await this.mondayApi.request(p,e);return{content:JSON.stringify(i)}}catch(e){const p=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const p=e;if(p.response?.errors)return{content:p.response.errors.map((e=>e.message)).join(", ")}}return{content:p}}}}const En={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional()};class bn extends r{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=o.ALL_API}getDescription(){return"Fetch the Monday.com GraphQL schema structure including query and mutation definitions"}getInputSchema(){return En}async execute(){try{const e=await this.mondayApi.request(Bt),p=e.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",a=e.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",d=e.__schema,t=d?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";return{content:`\n## GraphQL Schema\n- Query Type: ${e.__schema?.queryType?.name}\n- Mutation Type: ${e.__schema?.mutationType?.name}\n\n## Query Fields\n${p}\n\n## Mutation Fields\n${a}\n\n## Available Types\n${t}\n\nTo get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.\n`}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}}const In={typeName:e.string().describe("The name of the GraphQL type to get details for")};class Dn extends r{constructor(){super(...arguments),this.name="get_type_details",this.type=o.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return In}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(p=e.typeName,At`
|
|
307
|
+
`,Yt={itemId:e.number()};class Jt extends r{constructor(){super(...arguments),this.name="delete_item",this.type=o.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return Yt}async execute(e){const p={id:e.itemId.toString()},a=await this.mondayApi.request(Ot,p);return{content:`Item ${a.delete_item?.id} successfully deleted`}}}const zt={term:e.string()},Qt={boardId:e.number(),...zt};class Kt extends r{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=o.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?zt:Qt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},a=await this.mondayApi.request(Vt,p);return{content:`Items ${a.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}}const Ht={name:e.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:e.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},Xt={boardId:e.number().describe("The id of the board to which the new item will be added"),...Ht};class Wt extends r{constructor(){super(...arguments),this.name="create_item",this.type=o.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?Ht:Xt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},a=await this.mondayApi.request(Lt,p);return{content:`Item ${a.create_item?.id} successfully created`}}}const Zt={itemId:e.number().describe("The id of the item to which the update will be added"),body:e.string().describe("The update to be created, must be relevant to the user's request")};class ei extends r{constructor(){super(...arguments),this.name="create_update",this.type=o.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Zt}async execute(e){const p={itemId:e.itemId.toString(),body:e.body},a=await this.mondayApi.request(Ct,p);return{content:`Update ${a.create_update?.id} successfully created on item ${e.itemId}`}}}const pi={boardId:e.number().describe("The id of the board to get the schema of")};class ai extends r{constructor(){super(...arguments),this.name="get_board_schema",this.type=o.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return pi}async execute(e){const p=this.context?.boardId??e.boardId,a={boardId:p.toString()},d=await this.mondayApi.request(Ft,a);return{content:`The current schema of the board ${p} is: \n \n\nColumns:\n ${d.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${d.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}}const di={name:e.string().optional().describe("The name or partial name of the user to get")};class ti extends r{constructor(){super(...arguments),this.name="get_users_by_name",this.type=o.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return di}async execute(e){const p={name:e.name},a=await this.mondayApi.request(xt,p);return{content:`Relevant users:\n ${a.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}}const ii={itemId:e.number().describe("The ID of the item to be updated"),columnValues:e.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},ni={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...ii};class oi extends r{constructor(){super(...arguments),this.name="change_item_column_values",this.type=o.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?ii:ni}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request(kt,p);return{content:`Item ${a.change_multiple_column_values?.id} successfully updated with the new column values`}}}const ri={itemId:e.number().describe("The id of the item to which the update will be added"),groupId:e.string().describe("The id of the group to which the item will be moved")};class si extends r{constructor(){super(...arguments),this.name="move_item_to_group",this.type=o.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return ri}async execute(e){const p={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Rt,p);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}}var li,mi,ui,ci,vi,hi,fi,_i,wi,yi,Ni,Ti,gi,Ei,bi,Ii,Di,Si,Ai,Oi,Vi,Li,Ci,Fi,xi,ki,Ri,$i,Ui,Pi,Bi,ji,Mi,Gi,qi,Yi,Ji,zi,Qi,Ki,Hi,Xi,Wi,Zi,en,pn,an,dn,tn,nn,on,rn,sn,ln,mn;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(li||(li={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(mi||(mi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(ui||(ui={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(ci||(ci={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(vi||(vi={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(hi||(hi={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(fi||(fi={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(_i||(_i={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(wi||(wi={})),function(e){e.Description="description",e.Title="title"}(yi||(yi={})),function(e){e.AutoNumber="auto_number",e.BoardRelation="board_relation",e.Button="button",e.Checkbox="checkbox",e.ColorPicker="color_picker",e.Country="country",e.CreationLog="creation_log",e.Date="date",e.Dependency="dependency",e.DirectDoc="direct_doc",e.Doc="doc",e.Dropdown="dropdown",e.Email="email",e.File="file",e.Formula="formula",e.Group="group",e.Hour="hour",e.Integration="integration",e.ItemAssignees="item_assignees",e.ItemId="item_id",e.LastUpdated="last_updated",e.Link="link",e.Location="location",e.LongText="long_text",e.Mirror="mirror",e.Name="name",e.Numbers="numbers",e.People="people",e.Person="person",e.Phone="phone",e.Progress="progress",e.Rating="rating",e.Status="status",e.Subtasks="subtasks",e.Tags="tags",e.Team="team",e.Text="text",e.TimeTracking="time_tracking",e.Timeline="timeline",e.Unsupported="unsupported",e.Vote="vote",e.Week="week",e.WorldClock="world_clock"}(Ni||(Ni={})),function(e){e.BrinkPink="BRINK_PINK",e.CelticBlue="CELTIC_BLUE",e.CornflowerBlue="CORNFLOWER_BLUE",e.DingyDungeon="DINGY_DUNGEON",e.GoGreen="GO_GREEN",e.Gray="GRAY",e.LightDeepPink="LIGHT_DEEP_PINK",e.LightHotPink="LIGHT_HOT_PINK",e.MayaBlue="MAYA_BLUE",e.MediumTurquoise="MEDIUM_TURQUOISE",e.ParadisePink="PARADISE_PINK",e.PhilippineGreen="PHILIPPINE_GREEN",e.PhilippineYellow="PHILIPPINE_YELLOW",e.SlateBlue="SLATE_BLUE",e.VividCerulean="VIVID_CERULEAN",e.YankeesBlue="YANKEES_BLUE",e.YellowGreen="YELLOW_GREEN",e.YellowOrange="YELLOW_ORANGE"}(Ti||(Ti={})),function(e){e.Ascending="ASCENDING",e.Camera="CAMERA",e.Conference="CONFERENCE",e.Flag="FLAG",e.Gift="GIFT",e.Headphones="HEADPHONES",e.Homekeys="HOMEKEYS",e.Location="LOCATION",e.Notebook="NOTEBOOK",e.Paperplane="PAPERPLANE",e.Plane="PLANE",e.Pliers="PLIERS",e.Tripod="TRIPOD",e.Twoflags="TWOFLAGS",e.Utencils="UTENCILS"}(gi||(gi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Ei||(Ei={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(bi||(bi={})),function(e){e.BulletedList="bulleted_list",e.CheckList="check_list",e.Code="code",e.Divider="divider",e.Image="image",e.LargeTitle="large_title",e.Layout="layout",e.MediumTitle="medium_title",e.NormalText="normal_text",e.NoticeBox="notice_box",e.NumberedList="numbered_list",e.PageBreak="page_break",e.Quote="quote",e.SmallTitle="small_title",e.Table="table",e.Video="video"}(Ii||(Ii={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Di||(Di={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(Si||(Si={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Ai||(Ai={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Oi||(Oi={})),function(e){e.Monday="monday",e.Sunday="sunday"}(Vi||(Vi={})),function(e){e.Aquamarine="AQUAMARINE",e.BrightBlue="BRIGHT_BLUE",e.BrightGreen="BRIGHT_GREEN",e.ChiliBlue="CHILI_BLUE",e.DarkOrange="DARK_ORANGE",e.DarkPurple="DARK_PURPLE",e.DarkRed="DARK_RED",e.DoneGreen="DONE_GREEN",e.Indigo="INDIGO",e.Lipstick="LIPSTICK",e.Null="NULL",e.Purple="PURPLE",e.SofiaPink="SOFIA_PINK",e.StuckRed="STUCK_RED",e.Sunset="SUNSET",e.WorkingOrange="WORKING_ORANGE"}(Li||(Li={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(Ci||(Ci={})),function(e){e.FontWeightBold="FONT_WEIGHT_BOLD",e.FontWeightLight="FONT_WEIGHT_LIGHT",e.FontWeightNormal="FONT_WEIGHT_NORMAL",e.FontWeightVeryLight="FONT_WEIGHT_VERY_LIGHT",e.Null="NULL"}(Fi||(Fi={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(xi||(xi={})),function(e){e.Error="ERROR"}(ki||(ki={})),function(e){e.Asc="asc",e.Desc="desc"}(Ri||(Ri={})),function(e){e.And="and",e.Or="or"}($i||($i={})),function(e){e.AnyOf="any_of",e.Between="between",e.ContainsTerms="contains_terms",e.ContainsText="contains_text",e.EndsWith="ends_with",e.GreaterThan="greater_than",e.GreaterThanOrEquals="greater_than_or_equals",e.IsEmpty="is_empty",e.IsNotEmpty="is_not_empty",e.LowerThan="lower_than",e.LowerThanOrEqual="lower_than_or_equal",e.NotAnyOf="not_any_of",e.NotContainsText="not_contains_text",e.StartsWith="starts_with",e.WithinTheLast="within_the_last",e.WithinTheNext="within_the_next"}(Ui||(Ui={})),function(e){e.Person="person",e.Team="team"}(Pi||(Pi={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(Bi||(Bi={})),function(e){e.Dropdown="dropdown",e.Status="status"}(ji||(ji={})),function(e){e.Post="Post",e.Project="Project"}(Mi||(Mi={})),function(e){e.Left="left",e.Right="right"}(Gi||(Gi={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(qi||(qi={})),function(e){e.Crm="crm",e.Dev="dev",e.Forms="forms",e.Knowledge="knowledge",e.Service="service",e.Whiteboard="whiteboard",e.WorkManagement="work_management",e.Workflows="workflows"}(Yi||(Yi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(Ji||(Ji={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(zi||(zi={})),function(e){e.AmericanGray="american_gray",e.Aquamarine="aquamarine",e.Berry="berry",e.Blackish="blackish",e.BrightBlue="bright_blue",e.BrightGreen="bright_green",e.Brown="brown",e.Bubble="bubble",e.ChiliBlue="chili_blue",e.Coffee="coffee",e.DarkBlue="dark_blue",e.DarkIndigo="dark_indigo",e.DarkOrange="dark_orange",e.DarkPurple="dark_purple",e.DarkRed="dark_red",e.DoneGreen="done_green",e.EggYolk="egg_yolk",e.Explosive="explosive",e.GrassGreen="grass_green",e.Indigo="indigo",e.Lavender="lavender",e.Lilac="lilac",e.Lipstick="lipstick",e.Navy="navy",e.Orchid="orchid",e.Peach="peach",e.Pecan="pecan",e.Purple="purple",e.River="river",e.Royal="royal",e.Saladish="saladish",e.Sky="sky",e.SofiaPink="sofia_pink",e.Steel="steel",e.StuckRed="stuck_red",e.Sunset="sunset",e.Tan="tan",e.Teal="teal",e.Winter="winter",e.WorkingOrange="working_orange"}(Qi||(Qi={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Ki||(Ki={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(Hi||(Hi={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Xi||(Xi={})),function(e){e.Active="active",e.Inactive="inactive"}(Wi||(Wi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UpdateEmailDomainError="UPDATE_EMAIL_DOMAIN_ERROR",e.UserNotFound="USER_NOT_FOUND"}(Zi||(Zi={})),function(e){e.InvalidField="INVALID_FIELD"}(en||(en={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(pn||(pn={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(an||(an={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(dn||(dn={})),function(e){e.Current="current",e.Deprecated="deprecated",e.Dev="dev",e.Maintenance="maintenance",e.OldMaintenance="old__maintenance",e.OldPreviousMaintenance="old_previous_maintenance",e.PreviousMaintenance="previous_maintenance",e.ReleaseCandidate="release_candidate"}(tn||(tn={})),function(e){e.ChangeColumnValue="change_column_value",e.ChangeName="change_name",e.ChangeSpecificColumnValue="change_specific_column_value",e.ChangeStatusColumnValue="change_status_column_value",e.ChangeSubitemColumnValue="change_subitem_column_value",e.ChangeSubitemName="change_subitem_name",e.CreateColumn="create_column",e.CreateItem="create_item",e.CreateSubitem="create_subitem",e.CreateSubitemUpdate="create_subitem_update",e.CreateUpdate="create_update",e.DeleteUpdate="delete_update",e.EditUpdate="edit_update",e.ItemArchived="item_archived",e.ItemDeleted="item_deleted",e.ItemMovedToAnyGroup="item_moved_to_any_group",e.ItemMovedToSpecificGroup="item_moved_to_specific_group",e.ItemRestored="item_restored",e.MoveSubitem="move_subitem",e.SubitemArchived="subitem_archived",e.SubitemDeleted="subitem_deleted"}(nn||(nn={})),function(e){e.Closed="closed",e.Open="open"}(on||(on={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(rn||(rn={})),function(e){e.CreatedAt="created_at"}(sn||(sn={})),function(e){e.Query="QUERY",e.Mutation="MUTATION",e.Subscription="SUBSCRIPTION",e.Field="FIELD",e.FragmentDefinition="FRAGMENT_DEFINITION",e.FragmentSpread="FRAGMENT_SPREAD",e.InlineFragment="INLINE_FRAGMENT",e.VariableDefinition="VARIABLE_DEFINITION",e.Schema="SCHEMA",e.Scalar="SCALAR",e.Object="OBJECT",e.FieldDefinition="FIELD_DEFINITION",e.ArgumentDefinition="ARGUMENT_DEFINITION",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.EnumValue="ENUM_VALUE",e.InputObject="INPUT_OBJECT",e.InputFieldDefinition="INPUT_FIELD_DEFINITION"}(ln||(ln={})),function(e){e.Scalar="SCALAR",e.Object="OBJECT",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.InputObject="INPUT_OBJECT",e.List="LIST",e.NonNull="NON_NULL"}(mn||(mn={}));const un={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(hi).default(hi.Public).describe("The kind of board to create"),boardDescription:e.string().optional().describe("The description of the board to create"),workspaceId:e.string().optional().describe("The ID of the workspace to create the board in")};class cn extends r{constructor(){super(...arguments),this.name="create_board",this.type=o.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return un}async execute(e){const p={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request($t,p);return{content:`Board ${a.create_board?.id} successfully created`}}}const vn={columnType:e.nativeEnum(Ni).describe("The type of the column to be created"),columnTitle:e.string().describe("The title of the column to be created"),columnDescription:e.string().optional().describe("The description of the column to be created"),columnSettings:e.array(e.string()).optional().describe("The default values for the new column (relevant only for column type 'status' or 'dropdown') when possible make the values relevant to the user's request")},hn={boardId:e.number().describe("The id of the board to which the new column will be added"),...vn};class fn extends r{constructor(){super(...arguments),this.name="create_column",this.type=o.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?vn:hn}async execute(e){const p=this.context?.boardId??e.boardId;let a;e.columnSettings&&e.columnType===Ni.Status?a=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,p)=>[String(p+1),e])))}):e.columnSettings&&e.columnType===Ni.Dropdown&&(a=JSON.stringify({settings:{labels:e.columnSettings.map(((e,p)=>({id:p+1,name:e})))}}));const d={boardId:p.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:a},t=await this.mondayApi.request(Ut,d);return{content:`Column ${t.create_column?.id} successfully created`}}}const _n={columnId:e.string().describe("The id of the column to be deleted")},wn={boardId:e.number().describe("The id of the board to which the new column will be added"),..._n};class yn extends r{constructor(){super(...arguments),this.name="delete_column",this.type=o.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?_n:wn}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(Pt,p);return{content:`Column ${a.delete_column?.id} successfully deleted`}}}const Nn={query:e.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:e.string().describe("JSON string containing the variables for the GraphQL operation")};class Tn extends r{constructor(e,p){super(e,p),this.name="all_monday_api",this.type=o.ALL_API}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically"}getInputSchema(){return Nn}async loadSchema(e){if(Tn.schemaCache[e])return Tn.schemaCache[e];try{const p=await this.mondayApi.rawRequest(jt),{data:a}=p,d=ld(a);return Tn.schemaCache[e]=d,d}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,p){var a;return sd(await this.loadSchema(p),new te(e,a).parseDocument()).map((e=>e.message))}async execute(e){const{query:p,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const d=this.mondayApi.apiVersion,t=await this.validateOperation(p,d);if(t.length>0)return{content:t.join(", ")};const i=await this.mondayApi.request(p,e);return{content:JSON.stringify(i)}}catch(e){const p=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const p=e;if(p.response?.errors)return{content:p.response.errors.map((e=>e.message)).join(", ")}}return{content:p}}}}Tn.schemaCache={};const gn={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional()};class En extends r{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=o.ALL_API}getDescription(){return"Fetch the Monday.com GraphQL schema structure including query and mutation definitions"}getInputSchema(){return gn}async execute(){try{const e=await this.mondayApi.request(Bt),p=e.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",a=e.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",d=e.__schema,t=d?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";return{content:`\n## GraphQL Schema\n- Query Type: ${e.__schema?.queryType?.name}\n- Mutation Type: ${e.__schema?.mutationType?.name}\n\n## Query Fields\n${p}\n\n## Mutation Fields\n${a}\n\n## Available Types\n${t}\n\nTo get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.\n`}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}}const bn={typeName:e.string().describe("The name of the GraphQL type to get details for")};class In extends r{constructor(){super(...arguments),this.name="get_type_details",this.type=o.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return bn}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(p=e.typeName,At`
|
|
308
308
|
query getTypeDetails {
|
|
309
309
|
__type(name: "${p}") {
|
|
310
310
|
name
|
|
@@ -392,5 +392,5 @@ import{z as e}from"zod";import p from"stream";import a from"http";import d from"
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`),d=await this.mondayApi.request(a);if(!d.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let t=`## Type: ${d.__type.name||"Unnamed"} ${e.typeName===d.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${d.__type.kind}\n${d.__type.description?`Description: ${d.__type.description}`:""}\n\n`;return d.__type.fields&&d.__type.fields.length>0&&(t+="## Fields\n",d.__type.fields.forEach((e=>{const p=
|
|
395
|
+
`),d=await this.mondayApi.request(a);if(!d.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let t=`## Type: ${d.__type.name||"Unnamed"} ${e.typeName===d.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${d.__type.kind}\n${d.__type.description?`Description: ${d.__type.description}`:""}\n\n`;return d.__type.fields&&d.__type.fields.length>0&&(t+="## Fields\n",d.__type.fields.forEach((e=>{const p=Dn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(t+=" Arguments:\n",e.args.forEach((e=>{const p=Dn(e.type);t+=` - ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),t+="\n"),d.__type.inputFields&&d.__type.inputFields.length>0&&(t+="## Input Fields\n",d.__type.inputFields.forEach((e=>{const p=Dn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),t+="\n"),d.__type.interfaces&&d.__type.interfaces.length>0&&(t+="## Implements\n",d.__type.interfaces.forEach((e=>{t+=`- ${e.name}\n`})),t+="\n"),d.__type.enumValues&&d.__type.enumValues.length>0&&(t+="## Enum Values\n",d.__type.enumValues.forEach((e=>{t+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),t+="\n"),d.__type.possibleTypes&&d.__type.possibleTypes.length>0&&(t+="## Possible Types\n",d.__type.possibleTypes.forEach((e=>{t+=`- ${e.name}\n`}))),t+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${d.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:t}}catch(e){const p=e instanceof Error?e.message:"Unknown error",a=p.includes("JSON");return{content:`Error fetching type details: ${p}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var p}}function Dn(e){return e?"NON_NULL"===e.kind?`${Dn(e.ofType)}!`:"LIST"===e.kind?`[${Dn(e.ofType)}]`:e.name||"unknown":"unknown"}const Sn={color:e.nativeEnum(Ti).describe("The color of the custom activity"),icon_id:e.nativeEnum(gi).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};class An extends r{constructor(){super(...arguments),this.name="create_custom_activity",this.type=o.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Sn}async execute(e){const p={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Mt,p),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}}const On={item_id:e.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:e.string().describe("The ID of the custom activity for the timeline item"),title:e.string().describe("The title of the new timeline item"),summary:e.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:e.string().optional().describe("The content of the new timeline item"),timestamp:e.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:e.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:e.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:e.string().optional().describe("The location to add to the new timeline item"),phone:e.string().optional().describe("The phone number to add to the new timeline item"),url:e.string().optional().describe("The URL to add to the new timeline item")};class Vn extends r{constructor(){super(...arguments),this.name="create_timeline_item",this.type=o.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return On}async execute(e){const p={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(p.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(Gt,p);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}}const Ln={};class Cn extends r{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=o.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Ln}async execute(e){const p=await this.mondayApi.request(qt);if(!p.custom_activity||0===p.custom_activity.length)return{content:"No custom activities found"};const a=p.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}}const Fn=[Jt,Kt,Wt,ei,ai,ti,oi,si,cn,fn,yn,Tn,En,In,An,Vn,Cn];export{Tn as AllMondayApiTool,oi as ChangeItemColumnValuesTool,cn as CreateBoardTool,fn as CreateColumnTool,An as CreateCustomActivityTool,Wt as CreateItemTool,Vn as CreateTimelineItemTool,ei as CreateUpdateTool,yn as DeleteColumnTool,Jt as DeleteItemTool,Cn as FetchCustomActivityTool,Kt as GetBoardItemsTool,ai as GetBoardSchemaTool,En as GetGraphQLSchemaTool,In as GetTypeDetailsTool,ti as GetUsersTool,si as MoveItemToGroupTool,o as ToolType,Nn as allMondayApiToolSchema,Fn as allTools,ni as changeItemColumnValuesInBoardToolSchema,ii as changeItemColumnValuesToolSchema,un as createBoardToolSchema,hn as createColumnInBoardToolSchema,vn as createColumnToolSchema,Sn as createCustomActivityToolSchema,Xt as createItemInBoardToolSchema,Ht as createItemToolSchema,On as createTimelineItemToolSchema,Zt as createUpdateToolSchema,wn as deleteColumnInBoardToolSchema,_n as deleteColumnToolSchema,Yt as deleteItemToolSchema,Ln as fetchCustomActivityToolSchema,pi as getBoardSchemaToolSchema,gn as getGraphQLSchemaToolSchema,Qt as getItemsInBoardToolSchema,zt as getItemsToolSchema,bn as getTypeDetailsToolSchema,di as getUsersToolSchema,ri as moveItemToGroupToolSchema};
|
|
396
396
|
//# sourceMappingURL=index.js.map
|