@mondaydotcomorg/agent-toolkit 2.0.7 → 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 +2 -2
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +2 -2
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +2 -2
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.d.ts +3 -0
- package/dist/esm/core/index.js +2 -2
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +2 -2
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +2 -2
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/mcp/index.js
CHANGED
|
@@ -304,7 +304,7 @@ import{z as e,ZodType as a}from"zod";import{zodToJsonSchema as p}from"zod-to-jso
|
|
|
304
304
|
type
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
`,On={itemId:e.number()};const Vn={term:e.string()},Cn={boardId:e.number(),...Vn};const xn={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\\"}"')},Rn={boardId:e.number().describe("The id of the board to which the new item will be added"),...xn};const Ln={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")};const kn={boardId:e.number().describe("The id of the board to get the schema of")};const Fn={name:e.string().optional().describe("The name or partial name of the user to get")};const $n={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\\"}"')},Un={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...$n};const Pn={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")};var Bn,jn,Mn,qn,Gn,Hn,Yn,zn,Jn,Qn,Kn,Xn,Wn,Zn,er,ar,pr,tr,dr,ir,nr,rr,sr,or,lr,mr,ur,cr,hr,vr,fr,_r,wr,yr,gr,Tr,Nr,br,Er,Ir,Sr,Dr,Ar,Or,Vr,Cr,xr,Rr,Lr,kr,Fr,$r,Ur,Pr,Br;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Bn||(Bn={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(jn||(jn={})),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"}(Mn||(Mn={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(qn||(qn={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(Gn||(Gn={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(Hn||(Hn={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(Yn||(Yn={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(zn||(zn={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Jn||(Jn={})),function(e){e.Description="description",e.Title="title"}(Qn||(Qn={})),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"}(Kn||(Kn={})),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"}(Xn||(Xn={})),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"}(Wn||(Wn={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Zn||(Zn={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(er||(er={})),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"}(ar||(ar={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(pr||(pr={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(tr||(tr={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(dr||(dr={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(ir||(ir={})),function(e){e.Monday="monday",e.Sunday="sunday"}(nr||(nr={})),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"}(rr||(rr={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(sr||(sr={})),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"}(or||(or={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(lr||(lr={})),function(e){e.Error="ERROR"}(mr||(mr={})),function(e){e.Asc="asc",e.Desc="desc"}(ur||(ur={})),function(e){e.And="and",e.Or="or"}(cr||(cr={})),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"}(hr||(hr={})),function(e){e.Person="person",e.Team="team"}(vr||(vr={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(fr||(fr={})),function(e){e.Dropdown="dropdown",e.Status="status"}(_r||(_r={})),function(e){e.Post="Post",e.Project="Project"}(wr||(wr={})),function(e){e.Left="left",e.Right="right"}(yr||(yr={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(gr||(gr={})),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"}(Tr||(Tr={})),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"}(Nr||(Nr={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(br||(br={})),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"}(Er||(Er={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Ir||(Ir={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(Sr||(Sr={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Dr||(Dr={})),function(e){e.Active="active",e.Inactive="inactive"}(Ar||(Ar={})),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"}(Or||(Or={})),function(e){e.InvalidField="INVALID_FIELD"}(Vr||(Vr={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Cr||(Cr={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(xr||(xr={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(Rr||(Rr={})),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"}(Lr||(Lr={})),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"}(kr||(kr={})),function(e){e.Closed="closed",e.Open="open"}(Fr||(Fr={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}($r||($r={})),function(e){e.CreatedAt="created_at"}(Ur||(Ur={})),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"}(Pr||(Pr={})),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"}(Br||(Br={}));const jr={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(Hn).default(Hn.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")};const Mr={columnType:e.nativeEnum(Kn).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")},qr={boardId:e.number().describe("The id of the board to which the new column will be added"),...Mr};const Gr={columnId:e.string().describe("The id of the column to be deleted")},Hr={boardId:e.number().describe("The id of the board to which the new column will be added"),...Gr};const Yr={};let zr=null;async function Jr(e,a){const p=await async function(e){if(Yr[e])return Yr[e];try{if(zr){const a=await zr.rawRequest(In),{data:p}=a,t=zd(p);return Yr[e]=t,t}throw new Error("Monday API client is not available")}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}(a);var t;return Yd(p,new ja(e,t).parseDocument()).map((e=>e.message))}const Qr={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")};const Kr={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional()};const Xr={typeName:e.string().describe("The name of the GraphQL type to get details for")};function Wr(e){return e?"NON_NULL"===e.kind?`${Wr(e.ofType)}!`:"LIST"===e.kind?`[${Wr(e.ofType)}]`:e.name||"unknown":"unknown"}const Zr={color:e.nativeEnum(Xn).describe("The color of the custom activity"),icon_id:e.nativeEnum(Wn).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const es={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")};const as={};const ps=[class extends He{constructor(){super(...arguments),this.name="delete_item",this.type=Ge.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return On}async execute(e){const a={id:e.itemId.toString()},p=await this.mondayApi.request(cn,a);return{content:`Item ${p.delete_item?.id} successfully deleted`}}},class extends He{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=Ge.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?Vn:Cn}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},p=await this.mondayApi.request(hn,a);return{content:`Items ${p.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}},class extends He{constructor(){super(...arguments),this.name="create_item",this.type=Ge.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?xn:Rn}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},p=await this.mondayApi.request(vn,a);return{content:`Item ${p.create_item?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_update",this.type=Ge.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Ln}async execute(e){const a={itemId:e.itemId.toString(),body:e.body},p=await this.mondayApi.request(fn,a);return{content:`Update ${p.create_update?.id} successfully created on item ${e.itemId}`}}},class extends He{constructor(){super(...arguments),this.name="get_board_schema",this.type=Ge.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return kn}async execute(e){const a=this.context?.boardId??e.boardId,p={boardId:a.toString()},t=await this.mondayApi.request(_n,p);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${t.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${t.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends He{constructor(){super(...arguments),this.name="get_users_by_name",this.type=Ge.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return Fn}async execute(e){const a={name:e.name},p=await this.mondayApi.request(wn,a);return{content:`Relevant users:\n ${p.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends He{constructor(){super(...arguments),this.name="change_item_column_values",this.type=Ge.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?$n:Un}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},p=await this.mondayApi.request(yn,a);return{content:`Item ${p.change_multiple_column_values?.id} successfully updated with the new column values`}}},class extends He{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Ge.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return Pn}async execute(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},p=await this.mondayApi.request(gn,a);return{content:`Item ${p.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends He{constructor(){super(...arguments),this.name="create_board",this.type=Ge.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return jr}async execute(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},p=await this.mondayApi.request(Tn,a);return{content:`Board ${p.create_board?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_column",this.type=Ge.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?Mr:qr}async execute(e){const a=this.context?.boardId??e.boardId;let p;e.columnSettings&&e.columnType===Kn.Status?p=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,a)=>[String(a+1),e])))}):e.columnSettings&&e.columnType===Kn.Dropdown&&(p=JSON.stringify({settings:{labels:e.columnSettings.map(((e,a)=>({id:a+1,name:e})))}}));const t={boardId:a.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:p},d=await this.mondayApi.request(Nn,t);return{content:`Column ${d.create_column?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="delete_column",this.type=Ge.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?Gr:Hr}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},p=await this.mondayApi.request(bn,a);return{content:`Column ${p.delete_column?.id} successfully deleted`}}},class extends He{constructor(e,a){super(e,a),this.name="all_monday_api",this.type=Ge.ALL_API,zr=e}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically"}getInputSchema(){return Qr}async execute(e){const{query:a,variables:p}=e;try{let e={};try{e=JSON.parse(p)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const t=this.mondayApi.apiVersion,d=await Jr(a,t);if(d.length>0)return{content:d.join(", ")};const i=await this.mondayApi.request(a,e);return{content:JSON.stringify(i)}}catch(e){const a=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const a=e;if(a.response?.errors)return{content:a.response.errors.map((e=>e.message)).join(", ")}}return{content:a}}}},class extends He{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Ge.ALL_API}getDescription(){return"Fetch the Monday.com GraphQL schema structure including query and mutation definitions"}getInputSchema(){return Kr}async execute(){try{const e=await this.mondayApi.request(En),a=e.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",p=e.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",t=e.__schema,d=t?.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${a}\n\n## Mutation Fields\n${p}\n\n## Available Types\n${d}\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"}`}}}},class extends He{constructor(){super(...arguments),this.name="get_type_details",this.type=Ge.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return Xr}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const p=(a=e.typeName,un`
|
|
307
|
+
`,On={itemId:e.number()};const Vn={term:e.string()},Cn={boardId:e.number(),...Vn};const xn={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\\"}"')},Rn={boardId:e.number().describe("The id of the board to which the new item will be added"),...xn};const Ln={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")};const kn={boardId:e.number().describe("The id of the board to get the schema of")};const Fn={name:e.string().optional().describe("The name or partial name of the user to get")};const $n={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\\"}"')},Un={boardId:e.number().describe("The ID of the board that contains the item to be updated"),...$n};const Pn={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")};var Bn,jn,Mn,qn,Gn,Hn,Yn,zn,Jn,Qn,Kn,Xn,Wn,Zn,er,ar,pr,tr,dr,ir,nr,rr,sr,or,lr,mr,ur,cr,hr,vr,fr,_r,wr,yr,gr,Tr,Nr,br,Er,Ir,Sr,Dr,Ar,Or,Vr,Cr,xr,Rr,Lr,kr,Fr,$r,Ur,Pr,Br;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Bn||(Bn={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(jn||(jn={})),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"}(Mn||(Mn={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(qn||(qn={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(Gn||(Gn={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(Hn||(Hn={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(Yn||(Yn={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(zn||(zn={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Jn||(Jn={})),function(e){e.Description="description",e.Title="title"}(Qn||(Qn={})),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"}(Kn||(Kn={})),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"}(Xn||(Xn={})),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"}(Wn||(Wn={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Zn||(Zn={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(er||(er={})),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"}(ar||(ar={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(pr||(pr={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(tr||(tr={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(dr||(dr={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(ir||(ir={})),function(e){e.Monday="monday",e.Sunday="sunday"}(nr||(nr={})),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"}(rr||(rr={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(sr||(sr={})),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"}(or||(or={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(lr||(lr={})),function(e){e.Error="ERROR"}(mr||(mr={})),function(e){e.Asc="asc",e.Desc="desc"}(ur||(ur={})),function(e){e.And="and",e.Or="or"}(cr||(cr={})),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"}(hr||(hr={})),function(e){e.Person="person",e.Team="team"}(vr||(vr={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(fr||(fr={})),function(e){e.Dropdown="dropdown",e.Status="status"}(_r||(_r={})),function(e){e.Post="Post",e.Project="Project"}(wr||(wr={})),function(e){e.Left="left",e.Right="right"}(yr||(yr={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(gr||(gr={})),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"}(Tr||(Tr={})),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"}(Nr||(Nr={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(br||(br={})),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"}(Er||(Er={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Ir||(Ir={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(Sr||(Sr={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Dr||(Dr={})),function(e){e.Active="active",e.Inactive="inactive"}(Ar||(Ar={})),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"}(Or||(Or={})),function(e){e.InvalidField="INVALID_FIELD"}(Vr||(Vr={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Cr||(Cr={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(xr||(xr={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(Rr||(Rr={})),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"}(Lr||(Lr={})),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"}(kr||(kr={})),function(e){e.Closed="closed",e.Open="open"}(Fr||(Fr={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}($r||($r={})),function(e){e.CreatedAt="created_at"}(Ur||(Ur={})),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"}(Pr||(Pr={})),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"}(Br||(Br={}));const jr={boardName:e.string().describe("The name of the board to create"),boardKind:e.nativeEnum(Hn).default(Hn.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")};const Mr={columnType:e.nativeEnum(Kn).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")},qr={boardId:e.number().describe("The id of the board to which the new column will be added"),...Mr};const Gr={columnId:e.string().describe("The id of the column to be deleted")},Hr={boardId:e.number().describe("The id of the board to which the new column will be added"),...Gr};const Yr={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 zr extends He{constructor(e,a){super(e,a),this.name="all_monday_api",this.type=Ge.ALL_API}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically"}getInputSchema(){return Yr}async loadSchema(e){if(zr.schemaCache[e])return zr.schemaCache[e];try{const a=await this.mondayApi.rawRequest(In),{data:p}=a,t=zd(p);return zr.schemaCache[e]=t,t}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,a){var p;return Yd(await this.loadSchema(a),new ja(e,p).parseDocument()).map((e=>e.message))}async execute(e){const{query:a,variables:p}=e;try{let e={};try{e=JSON.parse(p)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const t=this.mondayApi.apiVersion,d=await this.validateOperation(a,t);if(d.length>0)return{content:d.join(", ")};const i=await this.mondayApi.request(a,e);return{content:JSON.stringify(i)}}catch(e){const a=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const a=e;if(a.response?.errors)return{content:a.response.errors.map((e=>e.message)).join(", ")}}return{content:a}}}}zr.schemaCache={};const Jr={random_string:e.string().describe("Dummy parameter for no-parameter tools").optional()};const Qr={typeName:e.string().describe("The name of the GraphQL type to get details for")};function Kr(e){return e?"NON_NULL"===e.kind?`${Kr(e.ofType)}!`:"LIST"===e.kind?`[${Kr(e.ofType)}]`:e.name||"unknown":"unknown"}const Xr={color:e.nativeEnum(Xn).describe("The color of the custom activity"),icon_id:e.nativeEnum(Wn).describe("The icon ID of the custom activity"),name:e.string().describe("The name of the custom activity")};const Wr={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")};const Zr={};const es=[class extends He{constructor(){super(...arguments),this.name="delete_item",this.type=Ge.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return On}async execute(e){const a={id:e.itemId.toString()},p=await this.mondayApi.request(cn,a);return{content:`Item ${p.delete_item?.id} successfully deleted`}}},class extends He{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=Ge.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?Vn:Cn}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},p=await this.mondayApi.request(hn,a);return{content:`Items ${p.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}},class extends He{constructor(){super(...arguments),this.name="create_item",this.type=Ge.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?xn:Rn}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},p=await this.mondayApi.request(vn,a);return{content:`Item ${p.create_item?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_update",this.type=Ge.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Ln}async execute(e){const a={itemId:e.itemId.toString(),body:e.body},p=await this.mondayApi.request(fn,a);return{content:`Update ${p.create_update?.id} successfully created on item ${e.itemId}`}}},class extends He{constructor(){super(...arguments),this.name="get_board_schema",this.type=Ge.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return kn}async execute(e){const a=this.context?.boardId??e.boardId,p={boardId:a.toString()},t=await this.mondayApi.request(_n,p);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${t.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${t.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends He{constructor(){super(...arguments),this.name="get_users_by_name",this.type=Ge.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return Fn}async execute(e){const a={name:e.name},p=await this.mondayApi.request(wn,a);return{content:`Relevant users:\n ${p.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends He{constructor(){super(...arguments),this.name="change_item_column_values",this.type=Ge.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?$n:Un}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},p=await this.mondayApi.request(yn,a);return{content:`Item ${p.change_multiple_column_values?.id} successfully updated with the new column values`}}},class extends He{constructor(){super(...arguments),this.name="move_item_to_group",this.type=Ge.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return Pn}async execute(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},p=await this.mondayApi.request(gn,a);return{content:`Item ${p.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends He{constructor(){super(...arguments),this.name="create_board",this.type=Ge.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return jr}async execute(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},p=await this.mondayApi.request(Tn,a);return{content:`Board ${p.create_board?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_column",this.type=Ge.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?Mr:qr}async execute(e){const a=this.context?.boardId??e.boardId;let p;e.columnSettings&&e.columnType===Kn.Status?p=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,a)=>[String(a+1),e])))}):e.columnSettings&&e.columnType===Kn.Dropdown&&(p=JSON.stringify({settings:{labels:e.columnSettings.map(((e,a)=>({id:a+1,name:e})))}}));const t={boardId:a.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:p},d=await this.mondayApi.request(Nn,t);return{content:`Column ${d.create_column?.id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="delete_column",this.type=Ge.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?Gr:Hr}async execute(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},p=await this.mondayApi.request(bn,a);return{content:`Column ${p.delete_column?.id} successfully deleted`}}},zr,class extends He{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=Ge.ALL_API}getDescription(){return"Fetch the Monday.com GraphQL schema structure including query and mutation definitions"}getInputSchema(){return Jr}async execute(){try{const e=await this.mondayApi.request(En),a=e.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",p=e.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",t=e.__schema,d=t?.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${a}\n\n## Mutation Fields\n${p}\n\n## Available Types\n${d}\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"}`}}}},class extends He{constructor(){super(...arguments),this.name="get_type_details",this.type=Ge.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return Qr}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const p=(a=e.typeName,un`
|
|
308
308
|
query getTypeDetails {
|
|
309
309
|
__type(name: "${a}") {
|
|
310
310
|
name
|
|
@@ -392,5 +392,5 @@ import{z as e,ZodType as a}from"zod";import{zodToJsonSchema as p}from"zod-to-jso
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`),t=await this.mondayApi.request(p);if(!t.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let d=`## Type: ${t.__type.name||"Unnamed"} ${e.typeName===t.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${t.__type.kind}\n${t.__type.description?`Description: ${t.__type.description}`:""}\n\n`;return t.__type.fields&&t.__type.fields.length>0&&(d+="## Fields\n",t.__type.fields.forEach((e=>{const a=
|
|
395
|
+
`),t=await this.mondayApi.request(p);if(!t.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let d=`## Type: ${t.__type.name||"Unnamed"} ${e.typeName===t.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${t.__type.kind}\n${t.__type.description?`Description: ${t.__type.description}`:""}\n\n`;return t.__type.fields&&t.__type.fields.length>0&&(d+="## Fields\n",t.__type.fields.forEach((e=>{const a=Kr(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(d+=" Arguments:\n",e.args.forEach((e=>{const a=Kr(e.type);d+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),d+="\n"),t.__type.inputFields&&t.__type.inputFields.length>0&&(d+="## Input Fields\n",t.__type.inputFields.forEach((e=>{const a=Kr(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),d+="\n"),t.__type.interfaces&&t.__type.interfaces.length>0&&(d+="## Implements\n",t.__type.interfaces.forEach((e=>{d+=`- ${e.name}\n`})),d+="\n"),t.__type.enumValues&&t.__type.enumValues.length>0&&(d+="## Enum Values\n",t.__type.enumValues.forEach((e=>{d+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),d+="\n"),t.__type.possibleTypes&&t.__type.possibleTypes.length>0&&(d+="## Possible Types\n",t.__type.possibleTypes.forEach((e=>{d+=`- ${e.name}\n`}))),d+=`\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\\": \\"${t.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:d}}catch(e){const a=e instanceof Error?e.message:"Unknown error",p=a.includes("JSON");return{content:`Error fetching type details: ${a}${p?"\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 a}},class extends He{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Ge.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Xr}async execute(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Sn,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Ge.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Wr}async execute(e){const a={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&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const p=await this.mondayApi.request(Dn,a);return{content:`Timeline item '${e.title}' with ID ${p.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends He{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Ge.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Zr}async execute(e){const a=await this.mondayApi.request(An);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const p=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${p.length} custom activities: ${JSON.stringify(p,null,2)}`}}}];class as extends Be{constructor(a){super({name:"monday.com",version:"1.0.0"}),this.mondayApiClient=new t({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:{...a.mondayApiRequestConfig,headers:{...a.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}});const p=function(e,a,p){if(!p)return e;let t=e;return p.enableDynamicApiTools&&!p.readOnlyMode||(t=t.filter((e=>new e(a).type!==Ge.ALL_API)),p.include?t=e.filter((e=>{const t=new e(a);return p.include?.includes(t.name)})):p.exclude&&(t=e.filter((e=>{const t=new e(a);return!p.exclude?.includes(t.name)}))),p.readOnlyMode&&(t=t.filter((e=>new e(a).type===Ge.QUERY)))),t}(es,this.mondayApiClient,a.toolsConfiguration);p.map((e=>new e(this.mondayApiClient))).forEach((a=>{const p=a.getInputSchema();p?this.tool(a.name,a.getDescription(),p,(async(t,d)=>{const i=e.object(p).safeParse(t);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return{content:[{type:"text",text:(await a.execute(i.data)).content}]}})):this.tool(a.name,a.getDescription(),(async e=>({content:[{type:"text",text:(await a.execute()).content}]})))}))}getServer(){return this}}export{as as MondayAgentToolkit};
|
|
396
396
|
//# sourceMappingURL=index.js.map
|