diff --git a/packages/agent-toolkit/package.json b/packages/agent-toolkit/package.json index c798cd95..062d98d7 100644 --- a/packages/agent-toolkit/package.json +++ b/packages/agent-toolkit/package.json @@ -1,8 +1,6 @@ { "name": "@mondaydotcomorg/agent-toolkit", - "version": "5.12.0", - - + "version": "5.12.1", "description": "monday.com agent toolkit", "exports": { "./mcp": { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts index 53010eea..2c7f4064 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.graphql.ts @@ -18,8 +18,8 @@ export const getItemBoard = gql` // Create a new monday doc (works for both workspace and board/item locations via CreateDocInput) export const createDoc = gql` - mutation createDoc($location: CreateDocInput!) { - create_doc(location: $location) { + mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) { + create_doc(location: $location, doc_owner_ids: $docOwnerIds) { id object_id url diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts index 7c08e8c4..0b088d09 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.test.ts @@ -190,6 +190,75 @@ describe('CreateDocTool', () => { }); }); + describe('docOwnerIds', () => { + it('includes docOwnerIds in variables when provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_owners', object_id: 'obj_owners', url: 'https://monday.com/docs/obj_owners', name: 'Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'Owners Doc', + markdown: '# Test', + docOwnerIds: ['111', '222'], + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).toEqual(expect.objectContaining({ docOwnerIds: ['111', '222'] })); + }); + + it('does not include docOwnerIds in variables when not provided', async () => { + const createDocResponse = { + create_doc: { id: 'doc_no_owners', object_id: 'obj_no_owners', url: 'https://monday.com/docs/obj_no_owners', name: 'No Owners Doc' }, + }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'No Owners Doc', + markdown: '# Test', + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + }); + + it('rejects docOwnerIds as empty array (min 1 required)', async () => { + const args = { + location: 'workspace', + workspace_id: 12345, + doc_name: 'Empty Owners Doc', + markdown: '# Test', + docOwnerIds: [], + }; + + const result = await callToolByNameRawAsync('create_doc', args); + expect(result.content[0].text).toContain('Invalid arguments'); + expect(mocks.getMockRequest()).not.toHaveBeenCalled(); + }); + }); + describe('Validation Errors', () => { it('should return error when workspace_id is missing', async () => { const args: Partial = { @@ -583,6 +652,69 @@ describe('CreateDocTool', () => { }); }); + describe('docOwnerIds', () => { + it('includes docOwnerIds in item doc variables when provided', async () => { + const getItemBoardResponse = { + items: [{ id: 'item_99', board: { id: 'board_99', columns: [{ id: 'doc_col_99', type: NonDeprecatedColumnType.Doc }] } }], + }; + const createDocResponse = { create_doc: { id: 'doc_owners_item', object_id: 'obj_owners_item', url: 'https://monday.com/docs/obj_owners_item', name: null } }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('query getItemBoard')) return Promise.resolve(getItemBoardResponse); + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation updateDocName')) return Promise.resolve({ update_doc_name: true }); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'item', + item_id: 99, + column_id: 'doc_col_99', + doc_name: 'Owners Item Doc', + markdown: '# Test', + docOwnerIds: ['555', '666'], + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).toEqual(expect.objectContaining({ docOwnerIds: ['555', '666'] })); + }); + + it('does not include docOwnerIds in item doc variables when not provided', async () => { + const getItemBoardResponse = { + items: [{ id: 'item_77', board: { id: 'board_77', columns: [{ id: 'doc_col_77', type: NonDeprecatedColumnType.Doc }] } }], + }; + const createDocResponse = { create_doc: { id: 'doc_no_owners_item', object_id: 'obj_no_owners_item', url: 'https://monday.com/docs/obj_no_owners_item', name: null } }; + const addContentResponse = { add_content_to_doc_from_markdown: { success: true, block_ids: [] } }; + + jest.spyOn(mocks, 'mockRequest').mockImplementation((query: string) => { + if (query.includes('query getItemBoard')) return Promise.resolve(getItemBoardResponse); + if (query.includes('mutation createDoc')) return Promise.resolve(createDocResponse); + if (query.includes('mutation updateDocName')) return Promise.resolve({ update_doc_name: true }); + if (query.includes('mutation addContentToDocFromMarkdown')) return Promise.resolve(addContentResponse); + return Promise.resolve({}); + }); + + const args: inputType = { + location: 'item', + item_id: 77, + column_id: 'doc_col_77', + doc_name: 'No Owners Item Doc', + markdown: '# Test', + }; + + await callToolByNameRawAsync('create_doc', args); + + const createDocCall = mocks.getMockRequest().mock.calls.find((c) => c[0].includes('mutation createDoc')); + expect(createDocCall).toBeDefined(); + expect(createDocCall[1]).not.toHaveProperty('docOwnerIds'); + }); + }); + describe('Validation Errors', () => { it('should return error when item_id is missing', async () => { const args: Partial = { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts index 1469c2d7..51823738 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/create-doc-tool/create-doc-tool.ts @@ -54,7 +54,13 @@ export const createDocToolSchema = { location: z .enum(['workspace', 'item']) .describe('Location where the document should be created - either in a workspace or attached to an item'), - + docOwnerIds: z + .array(z.string()) + .min(1) + .optional() + .describe( + 'Optional list of user IDs to set as document owners at creation time. Use this to add the agent owner so they retain access to the document. Ownership is set inside the creation mutation itself, bypassing the permission checks that would block a subsequent add_subscribers_to_object call.', + ), workspace_id: z .number() .optional() @@ -98,13 +104,14 @@ export class CreateDocTool extends BaseMondayApiTool return `Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document. LOCATION TYPES: -- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id) -- item: Creates a document attached to an item (requires item_id, optional column_id) +- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id, optional docOwnerIds) +- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds) USAGE EXAMPLES: -- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." } -- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." } -- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }`; +- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." } +- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." } +- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." } +- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: [""] }`; } getInputSchema(): typeof createDocToolSchema { @@ -139,6 +146,7 @@ USAGE EXAMPLES: folder_id: parsedInput.folder_id?.toString(), }, }, + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, variables); @@ -190,6 +198,7 @@ USAGE EXAMPLES: column_id: columnId, }, }, + ...(input.docOwnerIds !== undefined ? { docOwnerIds: input.docOwnerIds } : {}), }; const res: CreateDocMutation = await this.mondayApi.request(createDocMutation, itemVariables); diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts index 56cb33f2..29ebf084 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts @@ -9146,6 +9146,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { + doc_owner_ids?: InputMaybe>; location: CreateDocInput; }; diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts index fd481db9..9780f321 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts @@ -22,7 +22,7 @@ type Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": typeof types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": typeof types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": typeof types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": typeof types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": typeof types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": typeof types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": typeof types.CreateGroupDocument, @@ -152,7 +152,7 @@ const documents: Documents = { "\n query getDocById($docId: [ID!]) {\n docs(ids: $docId) {\n id\n name\n url\n }\n }\n": types.GetDocByIdDocument, "\n query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {\n boards(ids: [$boardId]) {\n name\n url\n }\n aggregate(query: $query) {\n results {\n entries {\n alias\n value {\n ... on AggregateBasicAggregationResult {\n result\n }\n ... on AggregateGroupByResult {\n value\n }\n }\n }\n }\n }\n }\n": types.AggregateBoardInsightsDocument, "\n query getItemBoard($itemId: ID!) {\n items(ids: [$itemId]) {\n id\n board {\n id\n columns {\n id\n type\n }\n }\n }\n }\n": types.GetItemBoardDocument, - "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, + "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n": types.CreateDocDocument, "\n mutation updateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n": types.UpdateDocNameDocument, "\n mutation createFolder(\n $workspaceId: ID!\n $name: String!\n $color: FolderColor\n $fontWeight: FolderFontWeight\n $customIcon: FolderCustomIcon\n $parentFolderId: ID\n ) {\n create_folder(\n workspace_id: $workspaceId\n name: $name\n color: $color\n font_weight: $fontWeight\n custom_icon: $customIcon\n parent_folder_id: $parentFolderId\n ) {\n id\n name\n }\n }\n": types.CreateFolderDocument, "\n mutation createGroup(\n $boardId: ID!\n $groupName: String!\n $groupColor: String\n $relativeTo: String\n $positionRelativeMethod: PositionRelative\n ) {\n create_group(\n board_id: $boardId\n group_name: $groupName\n group_color: $groupColor\n relative_to: $relativeTo\n position_relative_method: $positionRelativeMethod\n ) {\n id\n title\n }\n }\n": types.CreateGroupDocument, @@ -323,7 +323,7 @@ export function graphql(source: "\n query getItemBoard($itemId: ID!) {\n ite /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!) {\n create_doc(location: $location) {\n id\n object_id\n url\n name\n }\n }\n"]; +export function graphql(source: "\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"): (typeof documents)["\n mutation createDoc($location: CreateDocInput!, $docOwnerIds: [ID!]) {\n create_doc(location: $location, doc_owner_ids: $docOwnerIds) {\n id\n object_id\n url\n name\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts index df9ccb53..714f8ac7 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -6176,6 +6176,7 @@ export type MutationCreate_DepartmentArgs = { /** Root mutation type for the Dependencies service */ export type MutationCreate_DocArgs = { + doc_owner_ids?: InputMaybe>; location: CreateDocInput; }; @@ -11540,6 +11541,7 @@ export type GetItemBoardQuery = { __typename?: 'Query', items?: Array<{ __typena export type CreateDocMutationVariables = Exact<{ location: CreateDocInput; + docOwnerIds?: InputMaybe | Scalars['ID']['input']>; }>; @@ -12535,7 +12537,7 @@ export const GetDocByObjectIdDocument = {"kind":"Document","definitions":[{"kind export const GetDocByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getDocById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"docs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const AggregateBoardInsightsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"aggregateBoardInsights"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateQueryInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"boards"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aggregate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alias"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateBasicAggregationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateGroupByResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetItemBoardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getItemBoard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"itemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"itemId"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"board"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"columns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const CreateDocDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createDoc"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"location"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_doc"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"location"},"value":{"kind":"Variable","name":{"kind":"Name","value":"location"}}},{"kind":"Argument","name":{"kind":"Name","value":"doc_owner_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docOwnerIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object_id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const UpdateDocNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateDocName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"docId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_doc_name"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"docId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"docId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}}]}]}}]} as unknown as DocumentNode; export const CreateFolderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createFolder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderColor"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderFontWeight"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"FolderCustomIcon"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_folder"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspace_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"font_weight"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fontWeight"}}},{"kind":"Argument","name":{"kind":"Name","value":"custom_icon"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customIcon"}}},{"kind":"Argument","name":{"kind":"Name","value":"parent_folder_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"parentFolderId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CreateGroupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createGroup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PositionRelative"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_group"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"board_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"boardId"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupName"}}},{"kind":"Argument","name":{"kind":"Name","value":"group_color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"groupColor"}}},{"kind":"Argument","name":{"kind":"Name","value":"relative_to"},"value":{"kind":"Variable","name":{"kind":"Name","value":"relativeTo"}}},{"kind":"Argument","name":{"kind":"Name","value":"position_relative_method"},"value":{"kind":"Variable","name":{"kind":"Name","value":"positionRelativeMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; diff --git a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql index 1dceb835..6023525c 100644 --- a/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql +++ b/packages/agent-toolkit/src/monday-graphql/schema.dev.graphql @@ -1508,7 +1508,8 @@ template_id: ID, "Optional workspace id" workspace_id: ID): Board "Create a new doc." create_doc( "new monday doc location" -location: CreateDocInput!): Document +location: CreateDocInput!, "Optional list of user IDs to set as document owners at creation time" +doc_owner_ids: [ID!]): Document "Create new document block" create_doc_block( "After which block to insert this one. If not provided, will be inserted first in the document" after_block_id: String, "The block's content." diff --git a/packages/agent-toolkit/src/monday-graphql/schema.graphql b/packages/agent-toolkit/src/monday-graphql/schema.graphql index 2b4f4834..7767ed8b 100644 --- a/packages/agent-toolkit/src/monday-graphql/schema.graphql +++ b/packages/agent-toolkit/src/monday-graphql/schema.graphql @@ -1769,7 +1769,9 @@ type Mutation { workspace_id: ID ): Board "Create a new doc." - create_doc("new monday doc location" location: CreateDocInput!): Document + create_doc( "new monday doc location" +location: CreateDocInput!, "Optional list of user IDs to set as document owners at creation time" +doc_owner_ids: [ID!]): Document "Create new document block" create_doc_block( "After which block to insert this one. If not provided, will be inserted first in the document"