diff --git a/docs/superpowers/plans/2026-05-13-agent-tools-expansion.md b/docs/superpowers/plans/2026-05-13-agent-tools-expansion.md new file mode 100644 index 00000000..b2e9540e --- /dev/null +++ b/docs/superpowers/plans/2026-05-13-agent-tools-expansion.md @@ -0,0 +1,2185 @@ +# Agent Tools Expansion Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add 6 new MCP tools to the agent-toolkit that cover the full agents subgraph surface — catalog discovery, trigger management, skill management, agent updates, state management, and knowledge/resource access. + +**Architecture:** Each tool lives in its own folder under `src/core/tools/platform-api-tools/agents-tools/`, co-located with a `.graphql.dev.ts` file containing its GraphQL operations. All tools extend `BaseMondayApiTool`, use `versionOverride: 'dev'`, and follow the Zod + `rethrowWithContext` pattern established by the existing agent tools. Tool descriptions encode the catalog-first workflows so agents know which tools to call before acting. + +**Tech Stack:** TypeScript, graphql-request (gql tag), Zod, Jest, graphql-codegen (`npm run fetch:generate dev` in `packages/agent-toolkit`) + +--- + +## File Map + +**Modify:** +- `src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts` — export `agentFieldsFragment` (currently unexported) +- `src/core/tools/platform-api-tools/agents-tools/index.ts` — add 6 new exports +- `src/core/tools/platform-api-tools/index.ts` — add 6 new imports + registrations + +**Create:** +- `src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.test.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts` +- `src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.test.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.test.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge.graphql.dev.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts` +- `src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts` + +--- + +## Task 1: Export agentFieldsFragment from shared + +The `update_agent` mutation returns a full `Agent` and needs the shared fragment. Currently `agentFieldsFragment` is a local `const` — make it `export const` so the update-agent graphql file can import it. + +**Files:** +- Modify: `src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts` + +- [ ] **Step 1: Change `const` to `export const` on the fragment** + +In `src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts`, change line 3: + +```typescript +// Before +const agentFieldsFragment = gql` +// After +export const agentFieldsFragment = gql` +``` + +- [ ] **Step 2: Verify nothing broke** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools --passWithNoTests 2>&1 | tail -5 +``` + +Expected: all existing agent tests pass (3 test suites). + +- [ ] **Step 3: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts +git commit -m "refactor(agent-toolkit): export agentFieldsFragment for reuse" +``` + +--- + +## Task 2: Write all GraphQL operation files + +Write all 6 `.graphql.dev.ts` files before running codegen so types are generated in a single pass. + +**Files:** All 6 new `*.graphql.dev.ts` files. + +- [ ] **Step 1: Create `get-agent-catalog.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog.graphql.dev.ts +import { gql } from 'graphql-request'; + +export const getAgentTriggersCatalogQuery = gql` + query getAgentTriggersCatalog($block_reference_ids: [ID!]) { + agent_triggers_catalog(block_reference_ids: $block_reference_ids) { + block_reference_id + name + description + field_schemas { + field_key + value_schema + } + required_fields { + field_key + depends_on + optional + } + } + } +`; + +export const getAgentSkillsCatalogQuery = gql` + query getAgentSkillsCatalog { + agent_skills_catalog { + id + name + description + } + } +`; +``` + +- [ ] **Step 2: Create `manage-agent-triggers.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers.graphql.dev.ts +import { gql } from 'graphql-request'; + +export const getAgentActiveTriggersQuery = gql` + query getAgentActiveTriggers($agent_id: ID!) { + agent_active_triggers(agent_id: $agent_id) { + node_id + block_reference_id + name + description + field_summary + } + } +`; + +export const addTriggerToAgentMutation = gql` + mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) { + add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) { + success + } + } +`; + +export const removeTriggerFromAgentMutation = gql` + mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) { + remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) { + success + } + } +`; +``` + +- [ ] **Step 3: Create `manage-agent-skills.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills.graphql.dev.ts +import { gql } from 'graphql-request'; + +export const addSkillToAgentMutation = gql` + mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!) { + add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) { + success + } + } +`; + +export const removeSkillFromAgentMutation = gql` + mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) { + remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) { + success + } + } +`; +``` + +- [ ] **Step 4: Create `update-agent.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent.graphql.dev.ts +import { gql } from 'graphql-request'; +import { agentFieldsFragment } from '../shared/agents.graphql.dev'; + +export const updateAgentMutation = gql` + ${agentFieldsFragment} + + mutation updateAgent($id: ID!, $input: UpdateAgentInput!) { + update_agent(id: $id, input: $input) { + ...AgentFields + } + } +`; +``` + +- [ ] **Step 5: Create `manage-agent-state.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state.graphql.dev.ts +import { gql } from 'graphql-request'; + +export const activateAgentMutation = gql` + mutation activateAgent($id: ID!) { + activate_agent(id: $id) { + success + } + } +`; + +export const deactivateAgentMutation = gql` + mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason) { + deactivate_agent(id: $id, inactive_reason: $inactive_reason) { + success + } + } +`; + +export const runAgentMutation = gql` + mutation runAgent($id: ID!) { + run_agent(id: $id) { + trigger_uuid + } + } +`; +``` + +- [ ] **Step 6: Create `manage-agent-knowledge.graphql.dev.ts`** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge.graphql.dev.ts +import { gql } from 'graphql-request'; + +export const getAgentKnowledgeQuery = gql` + query getAgentKnowledge($id: ID!) { + agent_knowledge(id: $id) { + resources { + resource_id + scope_type + permission_type + } + files { + id + file_name + file_type + } + } + } +`; + +export const addAgentResourceAccessMutation = gql` + mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) { + add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) { + success + } + } +`; + +export const removeAgentResourceAccessMutation = gql` + mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) { + remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) { + success + } + } +`; + +export const updateAgentResourceAccessMutation = gql` + mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) { + update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) { + success + } + } +`; +``` + +- [ ] **Step 7: Commit all GraphQL files** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git commit -m "feat(agent-toolkit): add GraphQL operations for 6 new agent tools" +``` + +--- + +## Task 3: Run codegen + +Generate TypeScript types from the new GraphQL operations. + +**Files:** Auto-generated — `src/monday-graphql/generated/graphql.dev/graphql.ts` + +- [ ] **Step 1: Run codegen for the dev schema** + +```bash +cd packages/agent-toolkit && npm run fetch:generate dev +``` + +Expected: exits 0, no errors. The file `src/monday-graphql/generated/graphql.dev/graphql.ts` will be updated with new types including `GetAgentTriggersCatalogQuery`, `GetAgentSkillsCatalogQuery`, `GetAgentActiveTriggersQuery`, `GetAgentActiveTriggersQueryVariables`, `AddTriggerToAgentMutation`, `AddTriggerToAgentMutationVariables`, `RemoveTriggerFromAgentMutation`, `RemoveTriggerFromAgentMutationVariables`, `AddSkillToAgentMutation`, `AddSkillToAgentMutationVariables`, `RemoveSkillFromAgentMutation`, `RemoveSkillFromAgentMutationVariables`, `UpdateAgentMutation`, `UpdateAgentMutationVariables`, `ActivateAgentMutation`, `ActivateAgentMutationVariables`, `DeactivateAgentMutation`, `DeactivateAgentMutationVariables`, `RunAgentMutation`, `RunAgentMutationVariables`, `GetAgentKnowledgeQuery`, `GetAgentKnowledgeQueryVariables`, `AddAgentResourceAccessMutation`, `AddAgentResourceAccessMutationVariables`, `RemoveAgentResourceAccessMutation`, `RemoveAgentResourceAccessMutationVariables`, `UpdateAgentResourceAccessMutation`, `UpdateAgentResourceAccessMutationVariables`. + +- [ ] **Step 2: Verify types exist** + +```bash +grep -c "GetAgentTriggersCatalogQuery\|GetAgentSkillsCatalogQuery\|AddTriggerToAgentMutation\|AddSkillToAgentMutation\|UpdateAgentMutation\|ActivateAgentMutation\|GetAgentKnowledgeQuery\|AddAgentResourceAccessMutation" src/monday-graphql/generated/graphql.dev/graphql.ts +``` + +Expected: a number greater than 0 for each type (at least 8 matches total). + +- [ ] **Step 3: Commit generated types** + +```bash +git add src/monday-graphql/generated/graphql.dev/graphql.ts src/monday-graphql/schema.dev.graphql +git commit -m "chore(agent-toolkit): regenerate dev graphql types for new agent operations" +``` + +--- + +## Task 4: `get_agent_catalog` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { GetAgentTriggersCatalogQuery, GetAgentSkillsCatalogQuery } from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('GetAgentCatalogTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + const mockTrigger = { + block_reference_id: 'status-change-ref', + name: 'Status Change', + description: 'Fires when a status column changes', + field_schemas: [{ field_key: 'board_id', value_schema: 'The ID of the board to watch' }], + required_fields: [{ field_key: 'board_id', depends_on: [], optional: false }], + }; + + const mockSkill = { + id: 'skill-1', + name: 'Board Manager', + description: 'Manages boards and items', + }; + + it('should return triggers catalog when type is triggers', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [mockTrigger] } as GetAgentTriggersCatalogQuery); + + const result = await callToolByNameRawAsync('get_agent_catalog', { type: 'triggers' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.triggers[0].block_reference_id).toBe('status-change-ref'); + }); + + it('should pass versionOverride dev when fetching triggers', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [] } as GetAgentTriggersCatalogQuery); + + await callToolByNameRawAsync('get_agent_catalog', { type: 'triggers' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentTriggersCatalog'), + expect.objectContaining({ block_reference_ids: undefined }), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should pass block_reference_ids when provided', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [mockTrigger] } as GetAgentTriggersCatalogQuery); + + await callToolByNameRawAsync('get_agent_catalog', { type: 'triggers', block_reference_ids: ['status-change-ref'] }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + { block_reference_ids: ['status-change-ref'] }, + expect.anything(), + ); + }); + + it('should return skills catalog when type is skills', async () => { + mocks.setResponseOnce({ agent_skills_catalog: [mockSkill] } as GetAgentSkillsCatalogQuery); + + const result = await callToolByNameRawAsync('get_agent_catalog', { type: 'skills' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.skills[0].id).toBe('skill-1'); + }); + + it('should pass versionOverride dev when fetching skills', async () => { + mocks.setResponseOnce({ agent_skills_catalog: [] } as GetAgentSkillsCatalogQuery); + + await callToolByNameRawAsync('get_agent_catalog', { type: 'skills' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentSkillsCatalog'), + expect.anything(), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should return empty list with count 0 when no triggers exist', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [] } as GetAgentTriggersCatalogQuery); + + const result = await callToolByNameRawAsync('get_agent_catalog', { type: 'triggers' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(0); + expect(parsed.triggers).toEqual([]); + }); + + it('should propagate errors when fetching triggers catalog', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('get_agent_catalog', { type: 'triggers' }); + + expect(result.content[0].text).toContain('Failed to fetch monday platform agent triggers catalog'); + }); + + it('should propagate errors when fetching skills catalog', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('get_agent_catalog', { type: 'skills' }); + + expect(result.content[0].text).toContain('Failed to fetch monday platform agent skills catalog'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/get-agent-catalog --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — `expect(toolNames).toContain('get_agent_catalog')` fails because the tool isn't registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/get-agent-catalog/get-agent-catalog-tool.ts +import { z } from 'zod'; +import { + GetAgentTriggersCatalogQuery, + GetAgentTriggersCatalogQueryVariables, + GetAgentSkillsCatalogQuery, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { getAgentTriggersCatalogQuery, getAgentSkillsCatalogQuery } from './get-agent-catalog.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const getAgentCatalogToolSchema = { + type: z + .enum(['triggers', 'skills']) + .describe( + 'Which catalog to fetch. "triggers" returns available trigger types with block_reference_id, field_schemas, and required_fields — use before calling manage_agent_triggers with action:add. "skills" returns available skills with id — use before calling manage_agent_skills.', + ), + block_reference_ids: z + .array(z.string()) + .optional() + .describe( + 'Only applies when type is "triggers". Fetch specific entries by block_reference_id instead of the full catalog. Omit to return all trigger types.', + ), +}; + +export class GetAgentCatalogTool extends BaseMondayApiTool { + name = 'get_agent_catalog'; + type = ToolType.READ; + annotations = createMondayApiAnnotations({ + title: 'Get monday Platform Agent Catalog', + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }); + + getDescription(): string { + return `Fetch the account-wide catalog of available trigger types or skills for monday platform agents. + +ALWAYS call this tool first before adding a trigger or skill to an agent: +- type:"triggers" — returns entries with block_reference_id (required for manage_agent_triggers action:add), name, description, field_schemas (describes the field_values shape to pass when adding — e.g. { board_id: "" }), and required_fields (fields the user must supply before you can call add). +- type:"skills" — returns entries with id (required for manage_agent_skills), name, description. + +Never guess or invent a block_reference_id or skill id — always look them up here first. + +USAGE EXAMPLES: +- List all trigger types: { "type": "triggers" } +- Fetch a specific trigger type: { "type": "triggers", "block_reference_ids": ["some-block-ref-id"] } +- List all skills: { "type": "skills" }`; + } + + getInputSchema() { + return getAgentCatalogToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + if (input.type === 'triggers') { + try { + const variables: GetAgentTriggersCatalogQueryVariables = { + block_reference_ids: input.block_reference_ids ?? undefined, + }; + const res = await this.mondayApi.request( + getAgentTriggersCatalogQuery, + variables, + { versionOverride: 'dev' }, + ); + const catalog = res.agent_triggers_catalog ?? []; + return { + content: { + message: + 'Available trigger types for monday platform agents. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers with action:add.', + count: catalog.length, + triggers: catalog, + }, + }; + } catch (error) { + rethrowWithContext(error, 'fetch monday platform agent triggers catalog'); + } + } + + try { + const res = await this.mondayApi.request( + getAgentSkillsCatalogQuery, + {}, + { versionOverride: 'dev' }, + ); + const catalog = res.agent_skills_catalog ?? []; + return { + content: { + message: 'Available skills for monday platform agents. Use id when calling manage_agent_skills.', + count: catalog.length, + skills: catalog, + }, + }; + } catch (error) { + rethrowWithContext(error, 'fetch monday platform agent skills catalog'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './get-agent-catalog/get-agent-catalog-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add the import after the existing agent imports (line ~70): +```typescript +import { GetAgentCatalogTool } from './agents-tools/get-agent-catalog/get-agent-catalog-tool'; +``` + +And add to `allGraphqlApiTools` array after `DeleteAgentTool` (line ~143): +```typescript + GetAgentCatalogTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/get-agent-catalog --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 8 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add get_agent_catalog tool" +``` + +--- + +## Task 5: `manage_agent_triggers` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + GetAgentActiveTriggersQuery, + AddTriggerToAgentMutation, + RemoveTriggerFromAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('ManageAgentTriggersTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + const mockActiveTrigger = { + node_id: 'node-abc', + block_reference_id: 'status-change-ref', + name: 'Status Change', + description: 'Fires when a status column changes', + field_summary: 'board_id=42', + }; + + it('should list active triggers for an agent', async () => { + mocks.setResponseOnce({ agent_active_triggers: [mockActiveTrigger] } as GetAgentActiveTriggersQuery); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.triggers[0].node_id).toBe('node-abc'); + }); + + it('should pass agent_id and versionOverride dev when listing', async () => { + mocks.setResponseOnce({ agent_active_triggers: [] } as GetAgentActiveTriggersQuery); + + await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentActiveTriggers'), + { agent_id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should add a trigger to an agent', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + field_values: { board_id: '42' }, + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass block_reference_id and field_values when adding trigger', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + field_values: { board_id: '42' }, + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('addTriggerToAgent'), + { agent_id: '7', block_reference_id: 'status-change-ref', field_values: { board_id: '42' } }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should add a trigger without field_values when omitted', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ field_values: undefined }), + expect.anything(), + ); + }); + + it('should remove a trigger from an agent', async () => { + mocks.setResponseOnce({ remove_trigger_from_agent: { success: true } } as RemoveTriggerFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'remove', + agent_id: '7', + node_id: 'node-abc', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass node_id and versionOverride dev when removing', async () => { + mocks.setResponseOnce({ remove_trigger_from_agent: { success: true } } as RemoveTriggerFromAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { action: 'remove', agent_id: '7', node_id: 'node-abc' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('removeTriggerFromAgent'), + { agent_id: '7', node_id: 'node-abc' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject add action without block_reference_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'add', agent_id: '7' }); + + expect(result.content[0].text).toContain('block_reference_id is required'); + }); + + it('should reject remove action without node_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'remove', agent_id: '7' }); + + expect(result.content[0].text).toContain('node_id is required'); + }); + + it('should propagate errors with operation context', async () => { + mocks.setError('Not found'); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '999' }); + + expect(result.content[0].text).toContain('Failed to list active triggers'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — tool not registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts +import { z } from 'zod'; +import { + GetAgentActiveTriggersQuery, + GetAgentActiveTriggersQueryVariables, + AddTriggerToAgentMutation, + AddTriggerToAgentMutationVariables, + RemoveTriggerFromAgentMutation, + RemoveTriggerFromAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { + getAgentActiveTriggersQuery, + addTriggerToAgentMutation, + removeTriggerFromAgentMutation, +} from './manage-agent-triggers.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentTriggersToolSchema = { + action: z + .enum(['list', 'add', 'remove']) + .describe( + '"list" — returns all triggers currently attached to the agent (includes node_id needed for remove). "add" — attaches a new trigger by block_reference_id. "remove" — detaches a trigger by node_id.', + ), + agent_id: z.string().trim().min(1, 'agent_id must be a non-empty string').describe('Unique identifier of the agent.'), + block_reference_id: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:add. The block_reference_id from get_agent_catalog (type:triggers) identifying the trigger type to attach. Never guess this value — look it up in the catalog first.', + ), + field_values: z + .record(z.unknown()) + .optional() + .describe( + 'Required for action:add when the trigger type has required_fields. A key/value object whose shape is described by field_schemas in the get_agent_catalog response. Example: { "board_id": "12345" }. For scheduler fields pass the structured config directly; for selection fields (e.g. board picker) pass { "value": "", "label": "" }.', + ), + node_id: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:remove. The node_id of the trigger instance to remove — get it from action:list. Each trigger instance has a unique node_id even if the same trigger type is attached multiple times.', + ), +}; + +export class ManageAgentTriggersTool extends BaseMondayApiTool { + name = 'manage_agent_triggers'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Triggers', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `List, add, or remove triggers on a monday platform agent. + +Triggers define when an agent runs automatically — for example, when a board status changes, when a date arrives, or on a schedule. + +WORKFLOW FOR ADD: +1. Call get_agent_catalog with type:"triggers" to find the right trigger type by name/description. Note its block_reference_id and inspect field_schemas (describes what field_values to pass) and required_fields (fields you must collect from the user — e.g. which board, which column). +2. Collect any required field values from the user. +3. Call this tool with action:"add", the block_reference_id, and the assembled field_values. + +WORKFLOW FOR REMOVE: +1. Call this tool with action:"list" to see active triggers by name and field_summary. Match the trigger the user described, note its node_id. +2. Call this tool with action:"remove" and that node_id. + +USAGE EXAMPLES: +- List triggers: { "action": "list", "agent_id": "7" } +- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } } +- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" }`; + } + + getInputSchema() { + return manageAgentTriggersToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + if (input.action === 'list') { + try { + const variables: GetAgentActiveTriggersQueryVariables = { agent_id: input.agent_id }; + const res = await this.mondayApi.request( + getAgentActiveTriggersQuery, + variables, + { versionOverride: 'dev' }, + ); + const triggers = res.agent_active_triggers ?? []; + return { + content: { + message: 'Active triggers on this agent. Use node_id with action:remove to detach a trigger.', + count: triggers.length, + triggers, + }, + }; + } catch (error) { + rethrowWithContext(error, 'list active triggers for monday platform agent'); + } + } + + if (input.action === 'add') { + if (!input.block_reference_id) { + throw new Error('block_reference_id is required for action:add. Call get_agent_catalog with type:triggers first.'); + } + try { + const variables: AddTriggerToAgentMutationVariables = { + agent_id: input.agent_id, + block_reference_id: input.block_reference_id, + field_values: input.field_values ?? undefined, + }; + const res = await this.mondayApi.request( + addTriggerToAgentMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: 'Trigger added to agent. Call manage_agent_triggers with action:list to verify.', + success: res.add_trigger_to_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'add trigger to monday platform agent'); + } + } + + if (!input.node_id) { + throw new Error('node_id is required for action:remove. Call manage_agent_triggers with action:list first to get node_id values.'); + } + try { + const variables: RemoveTriggerFromAgentMutationVariables = { + agent_id: input.agent_id, + node_id: input.node_id, + }; + const res = await this.mondayApi.request( + removeTriggerFromAgentMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: 'Trigger removed from agent.', + success: res.remove_trigger_from_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'remove trigger from monday platform agent'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './manage-agent-triggers/manage-agent-triggers-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add import: +```typescript +import { ManageAgentTriggersTool } from './agents-tools/manage-agent-triggers/manage-agent-triggers-tool'; +``` + +Add to `allGraphqlApiTools` array: +```typescript + ManageAgentTriggersTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 10 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add manage_agent_triggers tool" +``` + +--- + +## Task 6: `manage_agent_skills` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + AddSkillToAgentMutation, + RemoveSkillFromAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('ManageAgentSkillsTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + it('should add a skill to an agent', async () => { + mocks.setResponseOnce({ add_skill_to_agent: { success: true } } as AddSkillToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: 'skill-1', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass agent_id, skill_id and versionOverride dev when adding', async () => { + mocks.setResponseOnce({ add_skill_to_agent: { success: true } } as AddSkillToAgentMutation); + + await callToolByNameRawAsync('manage_agent_skills', { action: 'add', agent_id: '7', skill_id: 'skill-1' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('addSkillToAgent'), + { agent_id: '7', skill_id: 'skill-1' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should remove a skill from an agent', async () => { + mocks.setResponseOnce({ remove_skill_from_agent: { success: true } } as RemoveSkillFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'remove', + agent_id: '7', + skill_id: 'skill-1', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass agent_id, skill_id and versionOverride dev when removing', async () => { + mocks.setResponseOnce({ remove_skill_from_agent: { success: true } } as RemoveSkillFromAgentMutation); + + await callToolByNameRawAsync('manage_agent_skills', { action: 'remove', agent_id: '7', skill_id: 'skill-1' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('removeSkillFromAgent'), + { agent_id: '7', skill_id: 'skill-1' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should propagate errors with operation context on add', async () => { + mocks.setError('Skill not found'); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: 'bad-id', + }); + + expect(result.content[0].text).toContain('Failed to add skill to monday platform agent'); + }); + + it('should propagate errors with operation context on remove', async () => { + mocks.setError('Skill not found'); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'remove', + agent_id: '7', + skill_id: 'bad-id', + }); + + expect(result.content[0].text).toContain('Failed to remove skill from monday platform agent'); + }); + + it('should reject whitespace-only skill_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: ' ', + }); + + expect(result.content[0].text).toContain('skill_id must be a non-empty string'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-skills --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — tool not registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts +import { z } from 'zod'; +import { + AddSkillToAgentMutation, + AddSkillToAgentMutationVariables, + RemoveSkillFromAgentMutation, + RemoveSkillFromAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { addSkillToAgentMutation, removeSkillFromAgentMutation } from './manage-agent-skills.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentSkillsToolSchema = { + action: z.enum(['add', 'remove']).describe('"add" — attach a skill to the agent. "remove" — detach a skill from the agent.'), + agent_id: z.string().trim().min(1, 'agent_id must be a non-empty string').describe('Unique identifier of the agent.'), + skill_id: z + .string() + .trim() + .min(1, 'skill_id must be a non-empty string') + .describe( + 'The skill id from get_agent_catalog (type:skills). Never guess this value — look it up in the catalog first.', + ), +}; + +export class ManageAgentSkillsTool extends BaseMondayApiTool { + name = 'manage_agent_skills'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Skills', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `Attach or detach a skill from a monday platform agent. + +Skills extend what an agent can do — they grant access to specific monday.com capabilities. + +ALWAYS call get_agent_catalog with type:"skills" first to discover available skills and resolve the correct skill_id. Never guess or invent a skill_id. + +To see which skills are already attached to an agent, call get_agent and inspect the skill_ids array, then cross-reference with get_agent_catalog to get names and descriptions. + +USAGE EXAMPLES: +- Attach a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-1" } +- Detach a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-1" }`; + } + + getInputSchema() { + return manageAgentSkillsToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + if (input.action === 'add') { + try { + const variables: AddSkillToAgentMutationVariables = { + agent_id: input.agent_id, + skill_id: input.skill_id, + }; + const res = await this.mondayApi.request( + addSkillToAgentMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: `Skill ${input.skill_id} added to agent ${input.agent_id}.`, + success: res.add_skill_to_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'add skill to monday platform agent'); + } + } + + try { + const variables: RemoveSkillFromAgentMutationVariables = { + agent_id: input.agent_id, + skill_id: input.skill_id, + }; + const res = await this.mondayApi.request( + removeSkillFromAgentMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: `Skill ${input.skill_id} removed from agent ${input.agent_id}.`, + success: res.remove_skill_from_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'remove skill from monday platform agent'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './manage-agent-skills/manage-agent-skills-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add import: +```typescript +import { ManageAgentSkillsTool } from './agents-tools/manage-agent-skills/manage-agent-skills-tool'; +``` + +Add to `allGraphqlApiTools` array: +```typescript + ManageAgentSkillsTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-skills --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 7 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add manage_agent_skills tool" +``` + +--- + +## Task 7: `update_agent` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { UpdateAgentMutation } from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('UpdateAgentTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + const mockAgent = { + id: '7', + kind: 'PERSONAL', + state: 'INACTIVE', + profile: { + name: 'Updated Bot', + role: 'Analyst', + role_description: 'Analyses data', + avatar_url: 'https://example.com/a.png', + background_color: '#000000', + }, + goal: 'Analyse stuff', + plan: '# Updated Plan', + user_prompt: null, + version_id: '2', + created_at: '2026-04-29T00:00:00Z', + updated_at: '2026-05-01T00:00:00Z', + }; + + it('should return the updated agent', async () => { + mocks.setResponseOnce({ update_agent: mockAgent } as UpdateAgentMutation); + + const result = await callToolByNameRawAsync('update_agent', { id: '7', name: 'Updated Bot' }); + const parsed = parseToolResult(result); + + expect(parsed.agent.id).toBe('7'); + expect(parsed.agent.profile.name).toBe('Updated Bot'); + }); + + it('should pass id, input and versionOverride dev', async () => { + mocks.setResponseOnce({ update_agent: mockAgent } as UpdateAgentMutation); + + await callToolByNameRawAsync('update_agent', { id: '7', name: 'Updated Bot', plan: '# New Plan' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('updateAgent'), + { id: '7', input: { name: 'Updated Bot', plan: '# New Plan' } }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should only include provided fields in input', async () => { + mocks.setResponseOnce({ update_agent: mockAgent } as UpdateAgentMutation); + + await callToolByNameRawAsync('update_agent', { id: '7', plan: '# Plan only' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + { id: '7', input: { plan: '# Plan only' } }, + expect.anything(), + ); + }); + + it('should not include agent_model in input when omitted', async () => { + mocks.setResponseOnce({ update_agent: mockAgent } as UpdateAgentMutation); + + await callToolByNameRawAsync('update_agent', { id: '7', name: 'Bot' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + { id: '7', input: { name: 'Bot' } }, + expect.anything(), + ); + }); + + it('should propagate GraphQL errors with operation context', async () => { + mocks.setError('Agent not found'); + + const result = await callToolByNameRawAsync('update_agent', { id: '999', name: 'x' }); + + expect(result.content[0].text).toContain('Failed to update monday platform agent'); + }); + + it('should throw a "returned no id" error when update_agent returns null', async () => { + mocks.setResponseOnce({ update_agent: null } as UpdateAgentMutation); + + const result = await callToolByNameRawAsync('update_agent', { id: '7', name: 'x' }); + + expect(result.content[0].text).toContain('returned no id'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/update-agent --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — tool not registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/update-agent/update-agent-tool.ts +import { z } from 'zod'; +import { + UpdateAgentMutation, + UpdateAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { updateAgentMutation } from './update-agent.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const updateAgentToolSchema = { + id: z.string().trim().min(1, 'Agent id must be a non-empty string').describe('Unique identifier of the agent to update.'), + name: z.string().trim().min(1).optional().describe('New display name for the agent.'), + role: z.string().trim().min(1).optional().describe('New role for the agent.'), + role_description: z.string().trim().min(1).optional().describe('New role description for the agent.'), + plan: z + .string() + .trim() + .min(1) + .optional() + .describe('New execution plan for the agent, in markdown format. This is the agent\'s core instructions.'), + agent_model: z + .string() + .optional() + .describe( + 'STRONGLY DISCOURAGED — omit this field. Only set when the user explicitly names a monday-supported model. Do not invent or guess model identifiers. When omitted the existing model is kept.', + ), +}; + +export class UpdateAgentTool extends BaseMondayApiTool { + name = 'update_agent'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Update monday Platform Agent', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `Update a monday platform agent's profile or execution plan. Creates a new draft internally and publishes in one call. + +All fields are optional — only provided fields are changed. Omit fields you do not want to update. + +The plan field is the most impactful: it contains the agent's execution instructions in markdown format. Updating it changes how the agent behaves on every future run. + +If the user refers to the agent by name rather than id, call get_agent first to resolve the correct id. + +USAGE EXAMPLES: +- Update plan only: { "id": "7", "plan": "# New Plan\\n- Step 1\\n- Step 2" } +- Rename the agent: { "id": "7", "name": "Improved Standup Bot" }`; + } + + getInputSchema() { + return updateAgentToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + try { + const updateInput: UpdateAgentMutationVariables['input'] = {}; + if (input.name !== undefined) updateInput.name = input.name; + if (input.role !== undefined) updateInput.role = input.role; + if (input.role_description !== undefined) updateInput.role_description = input.role_description; + if (input.plan !== undefined) updateInput.plan = input.plan; + if (input.agent_model !== undefined) updateInput.agent_model = input.agent_model as any; + + const variables: UpdateAgentMutationVariables = { id: input.id, input: updateInput }; + const res = await this.mondayApi.request(updateAgentMutation, variables, { + versionOverride: 'dev', + }); + + if (!res.update_agent?.id) { + throw new Error('monday platform agent update returned no id'); + } + + return { + content: { + message: `monday platform agent ${res.update_agent.id} updated`, + agent: res.update_agent, + }, + }; + } catch (error) { + rethrowWithContext(error, 'update monday platform agent'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './update-agent/update-agent-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add import: +```typescript +import { UpdateAgentTool } from './agents-tools/update-agent/update-agent-tool'; +``` + +Add to `allGraphqlApiTools` array: +```typescript + UpdateAgentTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/update-agent --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 6 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add update_agent tool" +``` + +--- + +## Task 8: `manage_agent_state` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + ActivateAgentMutation, + DeactivateAgentMutation, + RunAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('ManageAgentStateTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + it('should activate an agent', async () => { + mocks.setResponseOnce({ activate_agent: { success: true } } as ActivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_state', { action: 'activate', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass id and versionOverride dev when activating', async () => { + mocks.setResponseOnce({ activate_agent: { success: true } } as ActivateAgentMutation); + + await callToolByNameRawAsync('manage_agent_state', { action: 'activate', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('activateAgent'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should deactivate an agent', async () => { + mocks.setResponseOnce({ deactivate_agent: { success: true } } as DeactivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_state', { action: 'deactivate', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass inactive_reason when deactivating', async () => { + mocks.setResponseOnce({ deactivate_agent: { success: true } } as DeactivateAgentMutation); + + await callToolByNameRawAsync('manage_agent_state', { + action: 'deactivate', + agent_id: '7', + inactive_reason: 'DEACTIVATED_BY_USER', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('deactivateAgent'), + { id: '7', inactive_reason: 'DEACTIVATED_BY_USER' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should pass undefined inactive_reason when omitted', async () => { + mocks.setResponseOnce({ deactivate_agent: { success: true } } as DeactivateAgentMutation); + + await callToolByNameRawAsync('manage_agent_state', { action: 'deactivate', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + { id: '7', inactive_reason: undefined }, + expect.anything(), + ); + }); + + it('should run an agent and return trigger_uuid', async () => { + mocks.setResponseOnce({ run_agent: { trigger_uuid: 'uuid-xyz' } } as RunAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_state', { action: 'run', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.trigger_uuid).toBe('uuid-xyz'); + }); + + it('should pass id and versionOverride dev when running', async () => { + mocks.setResponseOnce({ run_agent: { trigger_uuid: 'uuid-xyz' } } as RunAgentMutation); + + await callToolByNameRawAsync('manage_agent_state', { action: 'run', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('runAgent'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should propagate errors with operation context on activate', async () => { + mocks.setError('Agent not found'); + + const result = await callToolByNameRawAsync('manage_agent_state', { action: 'activate', agent_id: '999' }); + + expect(result.content[0].text).toContain('Failed to activate monday platform agent'); + }); + + it('should propagate errors with operation context on run', async () => { + mocks.setError('Agent not active'); + + const result = await callToolByNameRawAsync('manage_agent_state', { action: 'run', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to run monday platform agent'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-state --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — tool not registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-state/manage-agent-state-tool.ts +import { z } from 'zod'; +import { + ActivateAgentMutation, + ActivateAgentMutationVariables, + DeactivateAgentMutation, + DeactivateAgentMutationVariables, + RunAgentMutation, + RunAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { activateAgentMutation, deactivateAgentMutation, runAgentMutation } from './manage-agent-state.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentStateToolSchema = { + action: z + .enum(['activate', 'deactivate', 'run']) + .describe( + '"activate" — transitions the agent to ACTIVE state so it can be triggered. "deactivate" — transitions the agent to INACTIVE. "run" — manually enqueues a one-off agent run (fire-and-forget; returns trigger_uuid for tracking).', + ), + agent_id: z.string().trim().min(1, 'agent_id must be a non-empty string').describe('Unique identifier of the agent.'), + inactive_reason: z + .enum(['DEACTIVATED_BY_USER', 'ACCOUNT_LEVEL_BLOCKING']) + .optional() + .describe('Only applies to action:deactivate. Defaults to DEACTIVATED_BY_USER when omitted.'), +}; + +export class ManageAgentStateTool extends BaseMondayApiTool { + name = 'manage_agent_state'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent State', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `Activate, deactivate, or manually run a monday platform agent. + +Agents created by create_agent start in state INACTIVE and cannot be triggered until activated. + +action:"activate" — sets the agent to ACTIVE. The agent can now be triggered by its configured triggers or manually via action:"run". +action:"deactivate" — sets the agent to INACTIVE. Existing triggers stop firing. +action:"run" — fires a one-off manual run immediately. This is async (fire-and-forget): the response confirms the run was accepted and enqueued, not that it has completed. Use trigger_uuid to correlate the execution in logs or future status endpoints. The agent must be ACTIVE to run. + +USAGE EXAMPLES: +- Activate: { "action": "activate", "agent_id": "7" } +- Deactivate: { "action": "deactivate", "agent_id": "7" } +- Run manually: { "action": "run", "agent_id": "7" }`; + } + + getInputSchema() { + return manageAgentStateToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + if (input.action === 'activate') { + try { + const variables: ActivateAgentMutationVariables = { id: input.agent_id }; + const res = await this.mondayApi.request(activateAgentMutation, variables, { + versionOverride: 'dev', + }); + return { + content: { + message: `monday platform agent ${input.agent_id} activated`, + success: res.activate_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'activate monday platform agent'); + } + } + + if (input.action === 'deactivate') { + try { + const variables: DeactivateAgentMutationVariables = { + id: input.agent_id, + inactive_reason: input.inactive_reason ?? undefined, + }; + const res = await this.mondayApi.request(deactivateAgentMutation, variables, { + versionOverride: 'dev', + }); + return { + content: { + message: `monday platform agent ${input.agent_id} deactivated`, + success: res.deactivate_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'deactivate monday platform agent'); + } + } + + try { + const variables: RunAgentMutationVariables = { id: input.agent_id }; + const res = await this.mondayApi.request(runAgentMutation, variables, { + versionOverride: 'dev', + }); + return { + content: { + message: `monday platform agent ${input.agent_id} run enqueued — execution is async. Use trigger_uuid to track.`, + trigger_uuid: res.run_agent?.trigger_uuid, + }, + }; + } catch (error) { + rethrowWithContext(error, 'run monday platform agent'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './manage-agent-state/manage-agent-state-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add import: +```typescript +import { ManageAgentStateTool } from './agents-tools/manage-agent-state/manage-agent-state-tool'; +``` + +Add to `allGraphqlApiTools` array: +```typescript + ManageAgentStateTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-state --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 9 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add manage_agent_state tool" +``` + +--- + +## Task 9: `manage_agent_knowledge` tool + +**Files:** +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts` +- Create: `src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts` +- Modify: `src/core/tools/platform-api-tools/agents-tools/index.ts` +- Modify: `src/core/tools/platform-api-tools/index.ts` + +- [ ] **Step 1: Write the failing test** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + GetAgentKnowledgeQuery, + AddAgentResourceAccessMutation, + RemoveAgentResourceAccessMutation, + UpdateAgentResourceAccessMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('ManageAgentKnowledgeTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + const mockKnowledge = { + resources: [{ resource_id: '42', scope_type: 'BOARD', permission_type: 'READ' }], + files: [{ id: 'f1', file_name: 'spec.pdf', file_type: 'pdf' }], + }; + + it('should list agent knowledge', async () => { + mocks.setResponseOnce({ agent_knowledge: mockKnowledge } as GetAgentKnowledgeQuery); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { action: 'list', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.resources[0].resource_id).toBe('42'); + expect(parsed.files[0].file_name).toBe('spec.pdf'); + }); + + it('should pass id and versionOverride dev when listing', async () => { + mocks.setResponseOnce({ agent_knowledge: { resources: [], files: [] } } as GetAgentKnowledgeQuery); + + await callToolByNameRawAsync('manage_agent_knowledge', { action: 'list', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentKnowledge'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should add a resource access', async () => { + mocks.setResponseOnce({ add_agent_resource_access: { success: true } } as AddAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass all fields and versionOverride dev when adding', async () => { + mocks.setResponseOnce({ add_agent_resource_access: { success: true } } as AddAgentResourceAccessMutation); + + await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ_WRITE', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('addAgentResourceAccess'), + { id: '7', resource_id: '42', scope_type: 'BOARD', permission_type: 'READ_WRITE' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should update a resource permission', async () => { + mocks.setResponseOnce({ update_agent_resource_access: { success: true } } as UpdateAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'update', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ_WRITE', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should remove a resource access', async () => { + mocks.setResponseOnce({ remove_agent_resource_access: { success: true } } as RemoveAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'remove', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass id, resource_id, scope_type and versionOverride dev when removing', async () => { + mocks.setResponseOnce({ remove_agent_resource_access: { success: true } } as RemoveAgentResourceAccessMutation); + + await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'remove', + agent_id: '7', + resource_id: '42', + scope_type: 'DOC', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('removeAgentResourceAccess'), + { id: '7', resource_id: '42', scope_type: 'DOC' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject add action without resource_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(result.content[0].text).toContain('resource_id is required'); + }); + + it('should reject add action without permission_type', async () => { + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + }); + + expect(result.content[0].text).toContain('permission_type is required'); + }); + + it('should propagate errors with operation context', async () => { + mocks.setError('Board not found'); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '99', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(result.content[0].text).toContain('Failed to add resource access to monday platform agent'); + }); +}); +``` + +- [ ] **Step 2: Run test to verify it fails** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge --no-coverage 2>&1 | tail -10 +``` + +Expected: FAIL — tool not registered yet. + +- [ ] **Step 3: Implement the tool** + +```typescript +// src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts +import { z } from 'zod'; +import { + GetAgentKnowledgeQuery, + GetAgentKnowledgeQueryVariables, + AddAgentResourceAccessMutation, + AddAgentResourceAccessMutationVariables, + RemoveAgentResourceAccessMutation, + RemoveAgentResourceAccessMutationVariables, + UpdateAgentResourceAccessMutation, + UpdateAgentResourceAccessMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { + getAgentKnowledgeQuery, + addAgentResourceAccessMutation, + removeAgentResourceAccessMutation, + updateAgentResourceAccessMutation, +} from './manage-agent-knowledge.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentKnowledgeToolSchema = { + action: z + .enum(['list', 'add', 'update', 'remove']) + .describe( + '"list" — returns current resource access (boards/docs) and uploaded files. "add" — grants access to a board or doc. "update" — changes the permission level on an existing resource. "remove" — revokes access entirely.', + ), + agent_id: z.string().trim().min(1, 'agent_id must be a non-empty string').describe('Unique identifier of the agent.'), + resource_id: z + .string() + .trim() + .min(1) + .optional() + .describe('Required for action:add, update, and remove. The ID of the monday.com board or doc.'), + scope_type: z + .enum(['BOARD', 'DOC']) + .optional() + .describe('Required for action:add, update, and remove. Whether the resource is a board or a doc.'), + permission_type: z + .enum(['READ', 'READ_WRITE']) + .optional() + .describe( + 'Required for action:add and update. READ — agent can read the resource. READ_WRITE — agent can read and write.', + ), +}; + +export class ManageAgentKnowledgeTool extends BaseMondayApiTool { + name = 'manage_agent_knowledge'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Knowledge', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `List, grant, update, or revoke a monday platform agent's access to boards and docs. + +Agent knowledge determines which monday.com resources the agent can read or write when it runs. + +Call with action:"list" first to see what resources the agent already has access to before adding, updating, or removing. + +action:"add" — grants the agent access to a board or doc. Requires resource_id (the board or doc id), scope_type (BOARD or DOC), and permission_type (READ or READ_WRITE). +action:"update" — changes the permission level on an already-granted resource. +action:"remove" — revokes access to a resource entirely. + +USAGE EXAMPLES: +- List resources: { "action": "list", "agent_id": "7" } +- Grant board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" } +- Upgrade to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" } +- Revoke access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" }`; + } + + getInputSchema() { + return manageAgentKnowledgeToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + if (input.action === 'list') { + try { + const variables: GetAgentKnowledgeQueryVariables = { id: input.agent_id }; + const res = await this.mondayApi.request(getAgentKnowledgeQuery, variables, { + versionOverride: 'dev', + }); + return { + content: { + message: 'Current knowledge configuration for this agent.', + resources: res.agent_knowledge?.resources ?? [], + files: res.agent_knowledge?.files ?? [], + }, + }; + } catch (error) { + rethrowWithContext(error, 'list knowledge for monday platform agent'); + } + } + + if (!input.resource_id) { + throw new Error(`resource_id is required for action:${input.action}.`); + } + if (!input.scope_type) { + throw new Error(`scope_type is required for action:${input.action}.`); + } + + if (input.action === 'add') { + if (!input.permission_type) { + throw new Error('permission_type is required for action:add.'); + } + try { + const variables: AddAgentResourceAccessMutationVariables = { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as any, + permission_type: input.permission_type as any, + }; + const res = await this.mondayApi.request( + addAgentResourceAccessMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: `${input.scope_type} ${input.resource_id} granted to agent with ${input.permission_type} permission.`, + success: res.add_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'add resource access to monday platform agent'); + } + } + + if (input.action === 'update') { + if (!input.permission_type) { + throw new Error('permission_type is required for action:update.'); + } + try { + const variables: UpdateAgentResourceAccessMutationVariables = { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as any, + permission_type: input.permission_type as any, + }; + const res = await this.mondayApi.request( + updateAgentResourceAccessMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: `Permission on ${input.scope_type} ${input.resource_id} updated to ${input.permission_type}.`, + success: res.update_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'update resource access for monday platform agent'); + } + } + + try { + const variables: RemoveAgentResourceAccessMutationVariables = { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as any, + }; + const res = await this.mondayApi.request( + removeAgentResourceAccessMutation, + variables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: `Access to ${input.scope_type} ${input.resource_id} removed from agent.`, + success: res.remove_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'remove resource access from monday platform agent'); + } + } +} +``` + +- [ ] **Step 4: Register the tool** + +In `src/core/tools/platform-api-tools/agents-tools/index.ts`, add: +```typescript +export * from './manage-agent-knowledge/manage-agent-knowledge-tool'; +``` + +In `src/core/tools/platform-api-tools/index.ts`, add import: +```typescript +import { ManageAgentKnowledgeTool } from './agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool'; +``` + +Add to `allGraphqlApiTools` array: +```typescript + ManageAgentKnowledgeTool, +``` + +- [ ] **Step 5: Run tests to verify they pass** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge --no-coverage 2>&1 | tail -10 +``` + +Expected: PASS — all 10 tests green. + +- [ ] **Step 6: Commit** + +```bash +git add src/core/tools/platform-api-tools/agents-tools/ +git add src/core/tools/platform-api-tools/index.ts +git commit -m "feat(agent-toolkit): add manage_agent_knowledge tool" +``` + +--- + +## Task 10: Full test suite and build + +- [ ] **Step 1: Run all agents-tools tests** + +```bash +cd packages/agent-toolkit && npx jest src/core/tools/platform-api-tools/agents-tools --no-coverage 2>&1 | tail -20 +``` + +Expected: all 9 test suites pass (3 existing + 6 new). + +- [ ] **Step 2: Run full test suite** + +```bash +cd packages/agent-toolkit && npm test 2>&1 | tail -20 +``` + +Expected: all tests pass, no regressions. + +- [ ] **Step 3: Build** + +```bash +cd packages/agent-toolkit && npm run build 2>&1 | tail -10 +``` + +Expected: exits 0, `dist/` updated with no TypeScript errors. + +--- + +## Task 11: Bump version + +- [ ] **Step 1: Bump version in `package.json`** + +In `packages/agent-toolkit/package.json`, change: +```json +"version": "5.10.3" +``` +to: +```json +"version": "5.11.0" +``` + +(Minor bump — new tools are additive, non-breaking.) + +- [ ] **Step 2: Commit** + +```bash +git add packages/agent-toolkit/package.json +git commit -m "chore(agent-toolkit): bump version to 5.11.0" +``` diff --git a/docs/superpowers/specs/2026-05-13-agent-tools-expansion-design.md b/docs/superpowers/specs/2026-05-13-agent-tools-expansion-design.md new file mode 100644 index 00000000..43605d76 --- /dev/null +++ b/docs/superpowers/specs/2026-05-13-agent-tools-expansion-design.md @@ -0,0 +1,280 @@ +# Agent Tools Expansion — Design Spec + +**Date:** 2026-05-13 +**Package:** `packages/agent-toolkit` +**Location:** `src/core/tools/platform-api-tools/agents-tools/` + +--- + +## Problem + +The existing agent tools (`get_agent`, `create_agent`, `delete_agent`) cover only basic CRUD. The agents subgraph exposes a much richer surface — skills, triggers, state management, knowledge/resource access — that agents cannot yet use via the toolkit. + +The core challenge is discoverability: consumers never know available skill IDs, trigger `block_reference_id` values, or the required `field_values` shape for a given trigger type. The catalog queries exist precisely to solve this, and the tool descriptions must encode the lookup-first workflow so agents know to consult them before acting. + +--- + +## Scope + +6 new tools covering all remaining agents subgraph operations: + +| Tool | Type | Operations | +|------|------|-----------| +| `get_agent_catalog` | READ | `agent_skills_catalog`, `agent_triggers_catalog` | +| `manage_agent_triggers` | WRITE | `agent_active_triggers` (list), `add_trigger_to_agent`, `remove_trigger_from_agent` | +| `manage_agent_skills` | WRITE | `add_skill_to_agent`, `remove_skill_from_agent` | +| `update_agent` | WRITE | `update_agent` | +| `manage_agent_state` | WRITE | `activate_agent`, `deactivate_agent`, `run_agent` | +| `manage_agent_knowledge` | WRITE | `agent_knowledge` (list), `add_agent_resource_access`, `remove_agent_resource_access`, `update_agent_resource_access` | + +Out of scope: `get_agent` is unchanged — the subgraph will be enhanced in a future iteration to include more fields (active triggers, knowledge) directly on the Agent type. + +--- + +## File Structure + +Each tool is co-located with its own `.graphql.dev.ts` file. The `shared/` directory keeps only the `AgentFields` fragment (used by the existing get/create/delete tools). + +``` +agents-tools/ +├── shared/ +│ └── agents.graphql.dev.ts ← AgentFields fragment only (unchanged) +├── get-agent-catalog/ +│ ├── get-agent-catalog-tool.ts +│ └── get-agent-catalog.graphql.dev.ts +├── manage-agent-triggers/ +│ ├── manage-agent-triggers-tool.ts +│ └── manage-agent-triggers.graphql.dev.ts +├── manage-agent-skills/ +│ ├── manage-agent-skills-tool.ts +│ └── manage-agent-skills.graphql.dev.ts +├── update-agent/ +│ ├── update-agent-tool.ts +│ └── update-agent.graphql.dev.ts +├── manage-agent-state/ +│ ├── manage-agent-state-tool.ts +│ └── manage-agent-state.graphql.dev.ts +└── manage-agent-knowledge/ + ├── manage-agent-knowledge-tool.ts + └── manage-agent-knowledge.graphql.dev.ts +``` + +--- + +## Tool Designs + +### `get_agent_catalog` (READ) + +**Purpose:** Account-wide discovery of available trigger types and skills. Always call this before adding a trigger or skill to an agent. + +**Input schema:** +```typescript +{ + type: z.enum(['triggers', 'skills']), + // For triggers only — fetches specific entries much faster than full catalog + block_reference_ids: z.array(z.string()).optional() +} +``` + +**Behavior:** +- `type: 'triggers'` → calls `agent_triggers_catalog`. Returns entries with `block_reference_id`, `name`, `description`, `field_schemas`, `required_fields`. `field_schemas` describes the shape of `field_values` required when adding (e.g. `{ board_id: }`). `required_fields` lists fields the user must supply. +- `type: 'skills'` → calls `agent_skills_catalog`. Returns entries with `id`, `name`, `description`. + +**Description preamble:** +> Call this tool first before adding a trigger or skill to an agent. For triggers: inspect `field_schemas` and `required_fields` to know what to collect from the user (e.g. board_id, column_id) before calling `manage_agent_triggers`. For skills: use the returned `id` to call `manage_agent_skills`. + +--- + +### `manage_agent_triggers` (WRITE) + +**Purpose:** List, add, and remove triggers on a specific agent. + +**Input schema (discriminated by `action`):** +```typescript +{ + action: z.enum(['list', 'add', 'remove']), + agent_id: z.string(), + // add only + block_reference_id: z.string().optional(), + field_values: z.record(z.unknown()).optional(), + // remove only + node_id: z.string().optional() +} +``` + +**Behavior:** +- `list` → calls `agent_active_triggers(agent_id)`. Returns active triggers with `node_id`, `block_reference_id`, `name`, `description`, `field_summary`. +- `add` → calls `add_trigger_to_agent`. Requires `block_reference_id` (from catalog) and optional `field_values` (shape determined by `field_schemas` in the catalog entry). +- `remove` → calls `remove_trigger_from_agent`. Requires `node_id` (from `action: list`). + +**Description — add workflow:** +> To add: first call `get_agent_catalog` with `type: triggers` to find the right entry by name/description. Inspect `field_schemas` and `required_fields` to know what information to collect from the user (e.g. which board, which column). Only then call this tool with `action: add`. + +**Description — remove workflow:** +> To remove: first call this tool with `action: list` to see the active triggers by name and `field_summary`. Match the trigger the user described, get its `node_id`, then call this tool with `action: remove`. + +--- + +### `manage_agent_skills` (WRITE) + +**Purpose:** Attach and detach skills from an agent. + +**Input schema:** +```typescript +{ + action: z.enum(['add', 'remove']), + agent_id: z.string(), + skill_id: z.string() +} +``` + +**Behavior:** +- `add` → calls `add_skill_to_agent` +- `remove` → calls `remove_skill_from_agent` + +**Description preamble:** +> Always call `get_agent_catalog` with `type: skills` first to discover available skills and resolve the correct `skill_id` — never guess or invent a skill ID. + +--- + +### `update_agent` (WRITE) + +**Purpose:** Update an agent's profile or execution plan. Creates a new draft internally and publishes in one call. + +**Input schema:** +```typescript +{ + id: z.string(), + name: z.string().optional(), + role: z.string().optional(), + role_description: z.string().optional(), + plan: z.string().optional(), // markdown + agent_model: z.string().optional() // discourage unless user explicitly named a model +} +``` + +**Behavior:** Calls `update_agent`. All profile fields are optional — only provided fields are changed. Mirrors the same `agent_model` guidance as `create_agent` (strongly discourage setting it; omit unless user explicitly named a model). + +--- + +### `manage_agent_state` (WRITE) + +**Purpose:** Activate, deactivate, or manually trigger a run for an agent. + +**Input schema:** +```typescript +{ + action: z.enum(['activate', 'deactivate', 'run']), + agent_id: z.string(), + // deactivate only + inactive_reason: z.enum(['DEACTIVATED_BY_USER', 'ACCOUNT_LEVEL_BLOCKING']).optional() +} +``` + +**Behavior:** +- `activate` → calls `activate_agent`. Agent transitions to ACTIVE and can receive triggers. +- `deactivate` → calls `deactivate_agent`. `inactive_reason` defaults to `DEACTIVATED_BY_USER` if omitted. +- `run` → calls `run_agent`. Fire-and-forget async operation. Returns `trigger_uuid` for downstream correlation. Success means the run was enqueued, not that it completed. + +--- + +### `manage_agent_knowledge` (WRITE) + +**Purpose:** List, grant, update, and revoke an agent's access to monday.com boards and docs. + +**Input schema (discriminated by `action`):** +```typescript +{ + action: z.enum(['list', 'add', 'update', 'remove']), + agent_id: z.string(), + // add, update, remove + resource_id: z.string().optional(), + scope_type: z.enum(['BOARD', 'DOC']).optional(), + // add, update + permission_type: z.enum(['READ', 'READ_WRITE']).optional() +} +``` + +**Behavior:** +- `list` → calls `agent_knowledge(agent_id)`. Returns current resources (boards/docs) with `resource_id`, `scope_type`, `permission_type`, plus uploaded files. +- `add` → calls `add_agent_resource_access`. Grants agent access to a board or doc with the specified permission level. +- `update` → calls `update_agent_resource_access`. Changes the permission level on an already-granted resource. +- `remove` → calls `remove_agent_resource_access`. Revokes access entirely. + +**Description preamble:** +> Call with `action: list` first to see the agent's current resource access before adding, updating, or removing. For `add`/`update`, `permission_type: READ` allows the agent to read the resource; `READ_WRITE` also allows writing. + +--- + +## Key Design Decisions + +**Catalog-first descriptions:** Tool descriptions are the primary mechanism for guiding agent behavior. Every WRITE tool that requires an ID from a catalog or list operation explicitly names the prerequisite call. This is more reliable than trying to enforce it in code. + +**`field_values` as record:** `add_trigger_to_agent` takes `field_values: JSON` in the schema. The Zod type is `z.record(z.unknown())` — flexible enough to accommodate any trigger type's shape. The `field_schemas` from the catalog entry describes the expected shape at runtime. + +**`manage_agent_triggers` and `manage_agent_knowledge` are typed WRITE:** Both include a `list` action that is read-only in effect, but the tools are typed WRITE because their primary purpose is mutation and the list actions exist specifically to support the write workflow (get `node_id` before remove, inspect resources before update). In `readOnlyMode`, WRITE tools are filtered out — this means `list` is unavailable in read-only configurations, which is an accepted trade-off. If this becomes a problem in practice, the list operations can be split into `get_agent` in a future iteration when the subgraph enhances the Agent type to include active triggers and knowledge directly. + +--- + +## GraphQL Operations (per tool) + +### `get-agent-catalog.graphql.dev.ts` +- `query getAgentTriggersCatalog($block_reference_ids: [ID!])` +- `query getAgentSkillsCatalog` + +### `manage-agent-triggers.graphql.dev.ts` +- `query getAgentActiveTriggers($agent_id: ID!)` +- `mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON)` +- `mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!)` + +### `manage-agent-skills.graphql.dev.ts` +- `mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!)` +- `mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!)` + +### `update-agent.graphql.dev.ts` +- `mutation updateAgent($id: ID!, $input: UpdateAgentInput!)` + +### `manage-agent-state.graphql.dev.ts` +- `mutation activateAgent($id: ID!)` +- `mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason)` +- `mutation runAgent($id: ID!)` + +### `manage-agent-knowledge.graphql.dev.ts` +- `query getAgentKnowledge($agent_id: ID!)` +- `mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!)` +- `mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!)` +- `mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!)` + +--- + +## Registration + +In `src/core/tools/platform-api-tools/index.ts`: +- 6 new imports +- 6 additions to `allGraphqlApiTools` array (grouped under existing agents comment) +- 6 new `export *` lines + +--- + +## Error Handling + +All tools use `rethrowWithContext(error, '')` in a try/catch, consistent with existing agent tools. + +--- + +## Testing + +One `.test.ts` per tool, co-located, using `createMockApiClient()`. Each test file covers: +- Happy path for each action +- Validation errors (missing required fields for wrong action) +- API error propagation via `rethrowWithContext` + +--- + +## Post-Implementation + +After all tool files are written: +1. Run `npm run fetch:generate dev` to regenerate dev types from new GraphQL operations +2. Run `npm test` to verify all tests pass +3. Run `npm run build` to verify compilation +4. Bump version in `package.json` diff --git a/packages/agent-toolkit/CHANGELOG.md b/packages/agent-toolkit/CHANGELOG.md index e79adf84..653534de 100644 --- a/packages/agent-toolkit/CHANGELOG.md +++ b/packages/agent-toolkit/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 5.15.0 + +### Add agent management tools + +Five new tools enabling agents to create and manage monday.com platform agents end-to-end: + +- `manage_agent` — full lifecycle management: `create` (AI mode via prompt), `create_blank` (manual mode), `get`, `update`, `delete`, `activate`, `deactivate`, `run` +- `manage_agent_triggers` — manage per-agent triggers (when it runs): `list`, `add`, `remove` +- `manage_agent_skills` — full skill lifecycle: `create` a new skill in the catalog, `add` to agent, `remove` from agent +- `manage_agent_knowledge` — grant, update, or revoke an agent's access to boards and docs +- `agent_catalog` (READ) — browse the account-wide catalog of available trigger types and skills before wiring them to an agent + ## 5.11.0 ### Asset upload MCP tools diff --git a/packages/agent-toolkit/package.json b/packages/agent-toolkit/package.json index 7d29ebd8..9da9e2ca 100644 --- a/packages/agent-toolkit/package.json +++ b/packages/agent-toolkit/package.json @@ -1,6 +1,6 @@ { "name": "@mondaydotcomorg/agent-toolkit", - "version": "5.14.0", + "version": "5.15.0", "description": "monday.com agent toolkit", "exports": { "./mcp": { diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.test.ts new file mode 100644 index 00000000..a62f04f2 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.test.ts @@ -0,0 +1,123 @@ +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { GetAgentSkillsCatalogQuery, GetAgentTriggersCatalogQuery } from 'src/monday-graphql/generated/graphql.dev/graphql'; + +const mockTrigger = { + block_reference_id: 'status-change-ref', + name: 'Status Change', + description: 'Fires when a status column changes', + field_schemas: [{ field_key: 'board_id', value_schema: 'The ID of the board to watch' }], + required_fields: [{ field_key: 'board_id', depends_on: [], optional: false }], +}; + +const mockSkill = { id: 'skill-1', name: 'Board Manager', description: 'Manages boards and items' }; + +describe('AgentCatalogTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + // ─── list_triggers ───────────────────────────────────────────────────────── + + describe('action: list_triggers', () => { + it('should return the triggers catalog', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [mockTrigger] } as GetAgentTriggersCatalogQuery); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_triggers' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.triggers[0].block_reference_id).toBe('status-change-ref'); + }); + + it('should pass versionOverride dev when listing triggers', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [] } as GetAgentTriggersCatalogQuery); + + await callToolByNameRawAsync('agent_catalog', { action: 'list_triggers' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentTriggersCatalog'), + expect.objectContaining({ block_reference_ids: undefined }), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should pass block_reference_ids when provided', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [mockTrigger] } as GetAgentTriggersCatalogQuery); + + await callToolByNameRawAsync('agent_catalog', { action: 'list_triggers', block_reference_ids: ['status-change-ref'] }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ block_reference_ids: ['status-change-ref'] }), + expect.anything(), + ); + }); + + it('should return count 0 when no triggers exist', async () => { + mocks.setResponseOnce({ agent_triggers_catalog: [] } as GetAgentTriggersCatalogQuery); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_triggers' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(0); + expect(parsed.triggers).toEqual([]); + }); + + it('should propagate API errors for list_triggers', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_triggers' }); + + expect(result.content[0].text).toContain('Failed to fetch monday platform agent triggers catalog'); + }); + }); + + // ─── list_skills ─────────────────────────────────────────────────────────── + + describe('action: list_skills', () => { + it('should return the skills catalog', async () => { + mocks.setResponseOnce({ agent_skills_catalog: [mockSkill] } as GetAgentSkillsCatalogQuery); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_skills' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.skills[0].id).toBe('skill-1'); + }); + + it('should pass versionOverride dev when listing skills', async () => { + mocks.setResponseOnce({ agent_skills_catalog: [] } as GetAgentSkillsCatalogQuery); + + await callToolByNameRawAsync('agent_catalog', { action: 'list_skills' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentSkillsCatalog'), + expect.anything(), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should return count 0 when no skills exist', async () => { + mocks.setResponseOnce({ agent_skills_catalog: [] } as GetAgentSkillsCatalogQuery); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_skills' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(0); + expect(parsed.skills).toEqual([]); + }); + + it('should propagate API errors for list_skills', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('agent_catalog', { action: 'list_skills' }); + + expect(result.content[0].text).toContain('Failed to fetch monday platform agent skills catalog'); + }); + }); + +}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.ts new file mode 100644 index 00000000..b9d6d2a4 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/agent-catalog/agent-catalog-tool.ts @@ -0,0 +1,106 @@ +import { z } from 'zod'; +import { + GetAgentSkillsCatalogQuery, + GetAgentTriggersCatalogQuery, + GetAgentTriggersCatalogQueryVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { getAgentSkillsCatalogQuery, getAgentTriggersCatalogQuery } from '../shared/agents.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const agentCatalogToolSchema = { + action: z + .enum(['list_triggers', 'list_skills']) + .describe( + '"list_triggers" — fetch available trigger types with block_reference_id, field_schemas, and required_fields. Call before using manage_agent_triggers action:"add". "list_skills" — fetch available skills with id, name, description. Call before using manage_agent_skills action:"add".', + ), + block_reference_ids: z + .array(z.string()) + .min(1) + .optional() + .describe('Used with action:"list_triggers". Fetch specific trigger types by block_reference_id. Omit to return all trigger types.'), +}; + +export class AgentCatalogTool extends BaseMondayApiTool { + name = 'agent_catalog'; + type = ToolType.READ; + annotations = createMondayApiAnnotations({ + title: 'monday Platform Agent Catalog', + readOnlyHint: true, + destructiveHint: false, + idempotentHint: true, + }); + + getDescription(): string { + return `Browse the account-wide catalog of available trigger types and skills for monday platform agents. READ-ONLY — no agent_id required. + +Use this tool to discover what's available BEFORE wiring anything to a specific agent. + +ACTIONS: +- list_triggers: { block_reference_ids? } — returns available trigger types. + Each entry has block_reference_id (required for manage_agent_triggers action:"add"), name, description, + field_schemas (describes field_values shape), and required_fields (fields to collect from the user). + Note: only triggers that can be added programmatically appear here. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.) + require user setup in the monday.com UI and will not appear here. + +- list_skills: {} — returns available skills with id, name, description. + Never guess or invent a skill id — always look it up here before calling manage_agent_skills action:"add". + +USAGE EXAMPLES: +- List all trigger types: { "action": "list_triggers" } +- Fetch specific trigger: { "action": "list_triggers", "block_reference_ids": ["some-block-ref-id"] } +- List all skills: { "action": "list_skills" } + +RELATED TOOLS: +- manage_agent_triggers — use block_reference_id from list_triggers to attach a trigger to a specific agent +- manage_agent_skills — use skill id from list_skills, or action:"create" to author a new skill, then attach to an agent +- manage_agent — manage the agent entity itself (create, update, delete, activate, etc.)`; + } + + getInputSchema() { + return agentCatalogToolSchema; + } + + protected async executeInternal(input: ToolInputType): Promise> { + switch (input.action) { + case 'list_triggers': + return this.handleListTriggers(input); + case 'list_skills': + return this.handleListSkills(); + } + } + + private async handleListTriggers(input: ToolInputType): Promise> { + try { + const variables: GetAgentTriggersCatalogQueryVariables = { block_reference_ids: input.block_reference_ids }; + const res = await this.mondayApi.request(getAgentTriggersCatalogQuery, variables, { versionOverride: 'dev' }); + const catalog = res.agent_triggers_catalog ?? []; + return { + content: { + message: 'Available trigger types. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers action:"add".', + count: catalog.length, + triggers: catalog, + }, + }; + } catch (error) { + rethrowWithContext(error, 'fetch monday platform agent triggers catalog'); + } + } + + private async handleListSkills(): Promise> { + try { + const res = await this.mondayApi.request(getAgentSkillsCatalogQuery, {}, { versionOverride: 'dev' }); + const catalog = res.agent_skills_catalog ?? []; + return { + content: { + message: 'Available skills. Use id when calling manage_agent_skills action:"add".', + count: catalog.length, + skills: catalog, + }, + }; + } catch (error) { + rethrowWithContext(error, 'fetch monday platform agent skills catalog'); + } + } +} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.test.ts deleted file mode 100644 index a36bd333..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.test.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { MondayAgentToolkit } from 'src/mcp/toolkit'; -import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; -import { CreateAgentMutation, CreateBlankAgentMutation } from 'src/monday-graphql/generated/graphql.dev/graphql'; - -describe('CreateAgentTool', () => { - let mocks: ReturnType; - - beforeEach(() => { - mocks = createMockApiClient(); - jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); - }); - - const mockAgent = { - id: '42', - kind: 'PERSONAL', - state: 'INACTIVE', - profile: { - name: 'Generated Agent', - role: 'Helper', - role_description: 'Helps with things', - avatar_url: 'https://example.com/g.png', - background_color: null, - }, - goal: 'Help', - plan: '# Plan', - user_prompt: 'Make a helper', - version_id: '1', - created_at: null, - updated_at: null, - }; - - const mockBlankAgent = { - id: '7', - kind: 'PERSONAL', - state: 'INACTIVE', - profile: { - name: 'Blank', - role: 'Helper', - role_description: null, - avatar_url: 'https://example.com/x.png', - background_color: null, - }, - goal: null, - plan: null, - user_prompt: null, - version_id: '1', - created_at: null, - updated_at: null, - }; - - it('should return the created agent', async () => { - mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); - - const result = await callToolByNameRawAsync('create_agent', { prompt: 'Make a helper' }); - const parsed = parseToolResult(result); - - expect(parsed.agent).toEqual(mockAgent); - }); - - it('should pass versionOverride dev', async () => { - mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); - - await callToolByNameRawAsync('create_agent', { prompt: 'Make a helper' }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('createAgent'), - expect.objectContaining({ input: expect.objectContaining({ prompt: 'Make a helper' }) }), - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should forward optional agent_model', async () => { - mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); - - await callToolByNameRawAsync('create_agent', { prompt: 'Make a helper', agent_model: 'claude-sonnet' }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.anything(), - { input: { prompt: 'Make a helper', agent_model: 'claude-sonnet' } }, - expect.anything(), - ); - }); - - it('should trim prompt before sending to API', async () => { - mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); - - await callToolByNameRawAsync('create_agent', { prompt: ' Make a helper ' }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.anything(), - { input: { prompt: 'Make a helper', agent_model: undefined } }, - expect.anything(), - ); - }); - - it('should create blank agent when prompt is omitted', async () => { - mocks.setResponseOnce({ create_blank_agent: mockBlankAgent } as CreateBlankAgentMutation); - - const result = await callToolByNameRawAsync('create_agent', {}); - const parsed = parseToolResult(result); - - expect(parsed.agent).toEqual(mockBlankAgent); - }); - - it('should call createBlankAgent with empty input when no fields are provided', async () => { - mocks.setResponseOnce({ create_blank_agent: mockBlankAgent } as CreateBlankAgentMutation); - - await callToolByNameRawAsync('create_agent', {}); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('createBlankAgent'), - { input: {} }, - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should forward manual profile fields in blank mode', async () => { - mocks.setResponseOnce({ create_blank_agent: mockBlankAgent } as CreateBlankAgentMutation); - - await callToolByNameRawAsync('create_agent', { - name: 'My Agent', - role: 'Tester', - gender: 'female', - background_color: '#000000', - }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('createBlankAgent'), - { input: { name: 'My Agent', role: 'Tester', gender: 'female', background_color: '#000000' } }, - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should reject mixed prompt and manual fields', async () => { - const result = await callToolByNameRawAsync('create_agent', { prompt: 'make agent', name: 'Manual Name' }); - - expect(result.content[0].text).toContain('either prompt mode or manual mode'); - }); - - it('should reject agent_model without prompt', async () => { - const result = await callToolByNameRawAsync('create_agent', { agent_model: 'claude-sonnet' }); - - expect(result.content[0].text).toContain('agent_model can only be used when prompt is provided'); - }); - - it('should reject whitespace-only prompt', async () => { - const result = await callToolByNameRawAsync('create_agent', { prompt: ' ' }); - - expect(result.content[0].text).toContain('Prompt must be a non-empty string'); - }); - - it('should propagate GraphQL errors with operation context', async () => { - mocks.setError('Quota exceeded'); - - const result = await callToolByNameRawAsync('create_agent', { prompt: 'x' }); - - expect(result.content[0].text).toContain('Failed to create monday platform agent'); - }); - - it('should throw a "returned no id" error when create_agent has no id', async () => { - mocks.setResponseOnce({ create_agent: null } as CreateAgentMutation); - - const result = await callToolByNameRawAsync('create_agent', { prompt: 'x' }); - - expect(result.content[0].text).toContain('returned no id'); - }); - - it('should include INACTIVE activation hint in the success message', async () => { - mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); - - const result = await callToolByNameRawAsync('create_agent', { prompt: 'Make a helper' }); - const parsed = parseToolResult(result); - - expect(parsed.message).toContain('INACTIVE'); - expect(parsed.message).toContain('activate'); - }); -}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.ts deleted file mode 100644 index e7bd6513..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/create-agent/create-agent-tool.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { z } from 'zod'; -import { - CreateAgentMutation, - CreateAgentMutationVariables, - CreateBlankAgentMutation, - CreateBlankAgentMutationVariables, -} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; -import { createAgentMutation, createBlankAgentMutation } from '../shared/agents.graphql.dev'; -import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; -import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; -import { rethrowWithContext } from '../../../../../utils'; - -export const createAgentToolSchema = { - prompt: z - .string() - .trim() - .min(1, 'Prompt must be a non-empty string') - .optional() - .describe( - 'Plain-language description of what the monday platform agent should do. When provided, the platform uses this prompt to generate the agent profile (name, role, avatar), goal, and execution plan via AI. Be specific about the domain and the tasks the agent should automate.', - ), - agent_model: z - .string() - .optional() - .describe( - 'STRONGLY DISCOURAGED — omit this field. Only set when the user explicitly names a monday-supported model. Do not invent or guess model identifiers (e.g. gpt-4o, claude-3-opus). Invalid values are rejected by the platform. When omitted the platform default is used, which is the right choice in almost every case.', - ), - name: z.string().trim().min(1, 'Name must be a non-empty string').optional().describe('Display name of the agent.'), - role: z.string().trim().min(1, 'Role must be a non-empty string').optional().describe('Role of the agent.'), - role_description: z - .string() - .trim() - .min(1, 'Role description must be a non-empty string') - .optional() - .describe('Description of the role.'), - avatar_url: z - .string() - .trim() - .min(1, 'Avatar URL must be a non-empty string') - .optional() - .describe( - 'HTTPS URL of the avatar image. Prefer dapulse-res.cloudinary.com or cdn.monday.com for full renderer compatibility.', - ), - gender: z - .enum(['male', 'female']) - .optional() - .describe('Hint for generated avatar/name when profile fields are omitted.'), - background_color: z - .string() - .trim() - .min(1, 'Background color must be a non-empty string') - .optional() - .describe('Background color string, usually lowercase hex like "#9450fd".'), - user_prompt: z - .string() - .trim() - .min(1, 'User prompt must be a non-empty string') - .optional() - .describe('Stored as metadata only. Not used for AI generation.'), -}; - -export class CreateAgentTool extends BaseMondayApiTool { - name = 'create_agent'; - type = ToolType.WRITE; - annotations = createMondayApiAnnotations({ - title: 'Create monday Platform Agent', - readOnlyHint: false, - destructiveHint: false, - idempotentHint: false, - }); - - getDescription(): string { - return `Create a personal/custom agent on the monday.com platform. See get_agent for what a monday platform agent is. - -Terminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents. - -Two modes: -- Prompt mode (recommended): pass prompt (and optional agent_model) and the platform generates profile + goal + plan via AI. -- Manual mode: omit prompt and pass any of name/role/role_description/user_prompt to create a blank agent profile quickly. - -Do not mix prompt with manual profile fields in one request. - -Created agents start in state INACTIVE and must be activated before they can be triggered. Instruct the user to activate from the monday.com agent settings UI. - -created_at and updated_at are null in the response — call get_agent with the returned id afterward to fetch them. - -USAGE EXAMPLES: -- AI-generated: { "prompt": "Run my daily standup — collect status updates, summarize blockers, and post recap every weekday at 9am." } -- Blank/manual: { "name": "Standup Bot", "role": "Project Manager", "gender": "female" } -- Blank/defaults: {}`; - } - - getInputSchema() { - return createAgentToolSchema; - } - - protected async executeInternal(input: ToolInputType): Promise> { - const hasPrompt = input.prompt !== undefined; - const hasManualFields = - input.name !== undefined || - input.role !== undefined || - input.role_description !== undefined || - input.avatar_url !== undefined || - input.gender !== undefined || - input.background_color !== undefined || - input.user_prompt !== undefined; - - if (hasPrompt && hasManualFields) { - throw new Error( - 'create_agent accepts either prompt mode or manual mode. Do not pass prompt together with manual profile fields.', - ); - } - - if (!hasPrompt && input.agent_model !== undefined) { - throw new Error('agent_model can only be used when prompt is provided.'); - } - - if (!hasPrompt) { - try { - const blankInput: NonNullable = {}; - if (input.name !== undefined) blankInput.name = input.name; - if (input.role !== undefined) blankInput.role = input.role; - if (input.role_description !== undefined) blankInput.role_description = input.role_description; - if (input.avatar_url !== undefined) blankInput.avatar_url = input.avatar_url; - if (input.gender !== undefined) blankInput.gender = input.gender; - if (input.background_color !== undefined) blankInput.background_color = input.background_color; - if (input.user_prompt !== undefined) blankInput.user_prompt = input.user_prompt; - - const variables: CreateBlankAgentMutationVariables = { input: blankInput }; - const res = await this.mondayApi.request(createBlankAgentMutation, variables, { - versionOverride: 'dev', - }); - - if (!res.create_blank_agent?.id) { - throw new Error('monday platform agent creation returned no id'); - } - - return { - content: { - message: `monday platform agent ${res.create_blank_agent.id} created in state INACTIVE — user must activate it from the monday.com UI before it can be triggered`, - agent: res.create_blank_agent, - }, - }; - } catch (error) { - rethrowWithContext(error, 'create blank monday platform agent'); - } - } - - try { - const prompt = input.prompt as string; - const variables: CreateAgentMutationVariables = { - input: { - prompt, - agent_model: input.agent_model, - }, - }; - - const res = await this.mondayApi.request(createAgentMutation, variables, { - versionOverride: 'dev', - }); - - if (!res.create_agent?.id) { - throw new Error('monday platform agent creation returned no id'); - } - - return { - content: { - message: `monday platform agent ${res.create_agent.id} created in state INACTIVE — user must activate it from the monday.com UI before it can be triggered`, - agent: res.create_agent, - }, - }; - } catch (error) { - rethrowWithContext(error, 'create monday platform agent'); - } - } -} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.test.ts deleted file mode 100644 index a6758dd3..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { MondayAgentToolkit } from 'src/mcp/toolkit'; -import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; -import { DeleteAgentMutation } from 'src/monday-graphql/generated/graphql.dev/graphql'; - -describe('DeleteAgentTool', () => { - let mocks: ReturnType; - - beforeEach(() => { - mocks = createMockApiClient(); - jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); - }); - - const mockDeletedAgent = { - id: '5', - kind: 'PERSONAL', - state: 'DELETED', - profile: { - name: 'Old Agent', - role: 'Retired', - role_description: null, - avatar_url: 'https://example.com/o.png', - background_color: null, - }, - goal: null, - plan: null, - user_prompt: null, - version_id: '1', - created_at: '2026-01-01T00:00:00Z', - updated_at: '2026-04-29T00:00:00Z', - }; - - it('should return the deleted agent', async () => { - mocks.setResponseOnce({ delete_agent: mockDeletedAgent } as DeleteAgentMutation); - - const result = await callToolByNameRawAsync('delete_agent', { id: '5' }); - const parsed = parseToolResult(result); - - expect(parsed.agent).toEqual(mockDeletedAgent); - }); - - it('should pass versionOverride dev', async () => { - mocks.setResponseOnce({ delete_agent: mockDeletedAgent } as DeleteAgentMutation); - - await callToolByNameRawAsync('delete_agent', { id: '5' }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('deleteAgent'), - { id: '5' }, - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should propagate GraphQL errors with operation context', async () => { - mocks.setError('Not authorized'); - - const result = await callToolByNameRawAsync('delete_agent', { id: '5' }); - - expect(result.content[0].text).toContain('Failed to delete monday platform agent'); - }); - - it('should throw a "returned no id" error when delete_agent has no id', async () => { - mocks.setResponseOnce({ delete_agent: null } as DeleteAgentMutation); - - const result = await callToolByNameRawAsync('delete_agent', { id: '5' }); - - expect(result.content[0].text).toContain('returned no id'); - }); - - it('should include the deleted-agent id in the success message', async () => { - mocks.setResponseOnce({ delete_agent: mockDeletedAgent } as DeleteAgentMutation); - - const result = await callToolByNameRawAsync('delete_agent', { id: '5' }); - const parsed = parseToolResult(result); - - expect(parsed.message).toContain('5'); - expect(parsed.message).toContain('deleted'); - }); - - it('should reject whitespace-only id', async () => { - const result = await callToolByNameRawAsync('delete_agent', { id: ' ' }); - - expect(result.content[0].text).toContain('Agent id must be a non-empty string'); - }); -}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.ts deleted file mode 100644 index 626ef567..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/delete-agent/delete-agent-tool.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { z } from 'zod'; -import { - DeleteAgentMutation, - DeleteAgentMutationVariables, -} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; -import { deleteAgentMutation } from '../shared/agents.graphql.dev'; -import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; -import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; -import { rethrowWithContext } from '../../../../../utils'; - -export const deleteAgentToolSchema = { - id: z - .string() - .trim() - .min(1, 'Agent id must be a non-empty string') - .describe('Unique identifier of the monday platform agent to delete.'), -}; - -export class DeleteAgentTool extends BaseMondayApiTool { - name = 'delete_agent'; - type = ToolType.WRITE; - annotations = createMondayApiAnnotations({ - title: 'Delete monday Platform Agent', - readOnlyHint: false, - destructiveHint: true, - idempotentHint: false, - }); - - getDescription(): string { - return `Permanently delete a personal/custom agent on the monday.com platform. Removes the agent and all of its versions. The agent stops appearing in get_agent results and can no longer be triggered. This action cannot be undone. Only the agent owner can delete it. - -Terminology note: users might ask for "agent" in natural language (for example: "delete my standup agent"), but in this API context this refers to monday personal/custom agents. - -VERIFY BEFORE DELETING: When the user refers to an agent by name or description (e.g. "delete my standup bot"), call get_agent (no id) first to list all the user's agents and confirm the correct id. Do not infer ids — pick the matching agent by inspecting profile.name / role / goal. - -USAGE EXAMPLE: -{ "id": "42" }`; - } - - getInputSchema() { - return deleteAgentToolSchema; - } - - protected async executeInternal(input: ToolInputType): Promise> { - try { - const variables: DeleteAgentMutationVariables = { id: input.id }; - - const res = await this.mondayApi.request(deleteAgentMutation, variables, { - versionOverride: 'dev', - }); - - if (!res.delete_agent?.id) { - throw new Error('monday platform agent delete returned no id'); - } - - return { - content: { - message: `monday platform agent ${res.delete_agent.id} deleted`, - agent: res.delete_agent, - }, - }; - } catch (error) { - rethrowWithContext(error, 'delete monday platform agent'); - } - } -} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.test.ts deleted file mode 100644 index 5fa1d764..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.test.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { MondayAgentToolkit } from 'src/mcp/toolkit'; -import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; -import { GetAgentsQuery } from 'src/monday-graphql/generated/graphql.dev/graphql'; - -describe('GetAgentTool', () => { - let mocks: ReturnType; - - beforeEach(() => { - mocks = createMockApiClient(); - jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); - }); - - const mockAgent = { - id: '1', - kind: 'PERSONAL', - state: 'INACTIVE', - profile: { - name: 'Daily Standup Bot', - role: 'Project Manager', - role_description: 'Runs the daily standup', - avatar_url: 'https://example.com/avatar.png', - background_color: '#ffffff', - }, - goal: 'Keep the team aligned', - plan: '# Plan\n- collect status', - user_prompt: 'Make a standup bot', - version_id: '100', - created_at: '2026-04-29T00:00:00Z', - updated_at: '2026-04-29T00:00:00Z', - }; - - it('should fetch a single agent when id is provided', async () => { - mocks.setResponseOnce({ agents: [mockAgent] } as GetAgentsQuery); - - const result = await callToolByNameRawAsync('get_agent', { id: '1' }); - const parsed = parseToolResult(result); - - expect(parsed.agent).toEqual(mockAgent); - }); - - it('should pass ids and versionOverride dev when fetching a single agent', async () => { - mocks.setResponseOnce({ agents: [mockAgent] } as GetAgentsQuery); - - await callToolByNameRawAsync('get_agent', { id: '1' }); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('getAgents'), - { ids: ['1'] }, - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should list agents when id is omitted', async () => { - const expectedAgents = [mockAgent, { ...mockAgent, id: '2' }]; - mocks.setResponseOnce({ agents: expectedAgents } as GetAgentsQuery); - - const result = await callToolByNameRawAsync('get_agent', {}); - const parsed = parseToolResult(result); - - expect(parsed.count).toBe(2); - expect(parsed.agents).toEqual(expectedAgents); - }); - - it('should pass limit 100 and versionOverride dev when listing agents', async () => { - mocks.setResponseOnce({ agents: [] } as GetAgentsQuery); - - await callToolByNameRawAsync('get_agent', {}); - - expect(mocks.getMockRequest()).toHaveBeenCalledWith( - expect.stringContaining('getAgents'), - { limit: 100 }, - expect.objectContaining({ versionOverride: 'dev' }), - ); - }); - - it('should return a not-found message when single fetch returns empty list', async () => { - mocks.setResponseOnce({ agents: [] } as GetAgentsQuery); - - const result = await callToolByNameRawAsync('get_agent', { id: '999' }); - - expect(result.content[0].text).toContain('not found'); - }); - - it('should return zero count when no agents exist', async () => { - mocks.setResponseOnce({ agents: [] } as GetAgentsQuery); - - const result = await callToolByNameRawAsync('get_agent', {}); - const parsed = parseToolResult(result); - - expect(parsed.count).toBe(0); - }); - - it('should propagate GraphQL errors with operation context', async () => { - mocks.setError('Unauthorized'); - - const result = await callToolByNameRawAsync('get_agent', {}); - - expect(result.content[0].text).toContain('Failed to list monday platform agents'); - }); - - it('should reject whitespace-only id', async () => { - const result = await callToolByNameRawAsync('get_agent', { id: ' ' }); - - expect(result.content[0].text).toContain('Agent id must be a non-empty string'); - }); -}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.ts deleted file mode 100644 index 89b6ebf7..00000000 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/get-agent/get-agent-tool.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { z } from 'zod'; -import { GetAgentsQuery } from '../../../../../monday-graphql/generated/graphql.dev/graphql'; -import { getAgentsQuery } from '../shared/agents.graphql.dev'; -import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; -import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; -import { rethrowWithContext } from '../../../../../utils'; - -export const getAgentToolSchema = { - id: z - .string() - .trim() - .min(1, 'Agent id must be a non-empty string') - .optional() - .describe( - 'Unique identifier of a monday platform agent. When provided, returns that single agent. When omitted, returns every non-deleted personal agent owned by the authenticated user.', - ), -}; - -export class GetAgentTool extends BaseMondayApiTool { - name = 'get_agent'; - type = ToolType.READ; - annotations = createMondayApiAnnotations({ - title: 'Get monday Platform Agent(s)', - readOnlyHint: true, - destructiveHint: false, - idempotentHint: true, - }); - - getDescription(): string { - return `Fetch one or more personal/custom agents on the monday.com platform. - -monday platform agents are user-built work orchestrators and executors that live on the monday.com platform — each has a profile (name, role, avatar), a goal, and an execution plan in markdown describing capabilities and operating principles. Agents in state ACTIVE can be triggered to perform automated work on monday boards. They are NOT local LangChain or MCP agents — they are managed entities on the monday.com platform owned by a specific user. - -Terminology note: users might ask for "agent" in natural language (for example: "create me an agent"), but in this API context this refers to monday personal/custom agents. - -Agent state in get_agent results is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED agents are filtered from these queries — DELETED only appears as the return value of delete_agent. Agent kind is one of PERSONAL, ACCOUNT_LEVEL, or EXTERNAL. - -Pass id to fetch one specific agent by its unique identifier. Omit id to list agents owned by the authenticated user (capped at 100 — ask the user for a higher limit if needed). An empty list means the user owns no agents, which is not an error. - -USAGE EXAMPLES: -- Fetch one agent: { "id": "42" } -- List my agents: {}`; - } - - getInputSchema() { - return getAgentToolSchema; - } - - protected async executeInternal(input: ToolInputType): Promise> { - if (input.id !== undefined) { - try { - const { agents } = await this.mondayApi.request( - getAgentsQuery, - { ids: [input.id] }, - { versionOverride: 'dev' }, - ); - - const agent = agents?.[0]; - if (!agent) { - return { - content: `monday platform agent ${input.id} not found, or the authenticated user does not have access to it.`, - }; - } - - return { content: { message: 'monday platform agent', agent } }; - } catch (error) { - rethrowWithContext(error, 'get monday platform agent'); - } - } - - try { - const { agents } = await this.mondayApi.request( - getAgentsQuery, - { limit: 100 }, - { versionOverride: 'dev' }, - ); - - const list = agents ?? []; - return { - content: { - message: 'monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)', - count: list.length, - agents: list, - }, - }; - } catch (error) { - rethrowWithContext(error, 'list monday platform agents'); - } - } -} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/index.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/index.ts index b07de30b..c6209db3 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/index.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/index.ts @@ -1,3 +1,5 @@ -export * from './get-agent/get-agent-tool'; -export * from './create-agent/create-agent-tool'; -export * from './delete-agent/delete-agent-tool'; +export * from './manage-agent/manage-agent-tool'; +export * from './manage-agent-triggers/manage-agent-triggers-tool'; +export * from './manage-agent-skills/manage-agent-skills-tool'; +export * from './manage-agent-knowledge/manage-agent-knowledge-tool'; +export * from './agent-catalog/agent-catalog-tool'; diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts new file mode 100644 index 00000000..c6b2dc96 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.test.ts @@ -0,0 +1,210 @@ +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + GetAgentKnowledgeQuery, + AddAgentResourceAccessMutation, + RemoveAgentResourceAccessMutation, + UpdateAgentResourceAccessMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +describe('ManageAgentKnowledgeTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + const mockKnowledge = { + resources: [{ resource_id: '42', scope_type: 'BOARD', permission_type: 'READ' }], + files: [], + }; + + // 1. Happy path list + it('should list agent knowledge resources', async () => { + mocks.setResponseOnce({ agent_knowledge: mockKnowledge } as GetAgentKnowledgeQuery); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { action: 'list', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.knowledge.resources[0].resource_id).toBe('42'); + }); + + // 2. Happy path add + it('should add resource access to agent', async () => { + mocks.setResponseOnce({ add_agent_resource_access: { success: true } } as AddAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + // 3. Happy path update + it('should update resource access permission', async () => { + mocks.setResponseOnce({ update_agent_resource_access: { success: true } } as UpdateAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'update', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ_WRITE', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + // 4. Happy path remove + it('should remove resource access from agent', async () => { + mocks.setResponseOnce({ remove_agent_resource_access: { success: true } } as RemoveAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'remove', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + // 5. list passes versionOverride dev + it('should pass versionOverride:dev when listing', async () => { + mocks.setResponseOnce({ agent_knowledge: mockKnowledge } as GetAgentKnowledgeQuery); + + await callToolByNameRawAsync('manage_agent_knowledge', { action: 'list', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.anything(), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + // 6. add maps agent_id to id + it('should map agent_id to id in add variables', async () => { + mocks.setResponseOnce({ add_agent_resource_access: { success: true } } as AddAgentResourceAccessMutation); + + await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ id: '7', resource_id: '42', scope_type: 'BOARD', permission_type: 'READ' }), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + // 7. Validation error — add missing resource_id + it('should reject add action without resource_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(result.content[0].text).toContain('resource_id, scope_type, and permission_type are required'); + }); + + // 8. Validation error — remove missing scope_type + it('should reject remove action without scope_type', async () => { + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'remove', + agent_id: '7', + resource_id: '42', + }); + + expect(result.content[0].text).toContain('resource_id and scope_type are required'); + }); + + // 9. API error propagation — list + it('should propagate errors with context for list', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { action: 'list', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to list agent knowledge'); + }); + + // 10. API error propagation — add + it('should propagate errors with context for add', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(result.content[0].text).toContain('Failed to add agent resource access'); + }); + + // 11. success:false fallback — add + it('should return success:false when add_agent_resource_access is null', async () => { + mocks.setResponseOnce({ add_agent_resource_access: null } as AddAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'add', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + // 12. success:false fallback — remove + it('should return success:false when remove_agent_resource_access is null', async () => { + mocks.setResponseOnce({ remove_agent_resource_access: null } as RemoveAgentResourceAccessMutation); + + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'remove', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should reject update action with missing permission_type', async () => { + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'update', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + // permission_type omitted + }); + expect(result.content[0].text).toContain('resource_id, scope_type, and permission_type are required for action:update'); + }); + + it('should return success:false when update_agent_resource_access is null', async () => { + mocks.setResponseOnce({ update_agent_resource_access: null } as UpdateAgentResourceAccessMutation); + const result = await callToolByNameRawAsync('manage_agent_knowledge', { + action: 'update', + agent_id: '7', + resource_id: '42', + scope_type: 'BOARD', + permission_type: 'READ_WRITE', + }); + expect(parseToolResult(result).success).toBe(false); + }); +}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts new file mode 100644 index 00000000..fc5b4db4 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool.ts @@ -0,0 +1,198 @@ +import { z } from 'zod'; +import { + GetAgentKnowledgeQuery, + GetAgentKnowledgeQueryVariables, + AddAgentResourceAccessMutation, + AddAgentResourceAccessMutationVariables, + RemoveAgentResourceAccessMutation, + RemoveAgentResourceAccessMutationVariables, + UpdateAgentResourceAccessMutation, + UpdateAgentResourceAccessMutationVariables, + KnowledgeScope, + KnowledgePermission, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { + getAgentKnowledgeQuery, + addAgentResourceAccessMutation, + removeAgentResourceAccessMutation, + updateAgentResourceAccessMutation, +} from './manage-agent-knowledge.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentKnowledgeToolSchema = { + action: z.enum(['list', 'add', 'update', 'remove']).describe( + '"list" — returns all resources the agent currently has access to. "add" — grants access to a board or doc. "update" — changes the permission level on an existing resource. "remove" — revokes the agent\'s access to a board or doc.', + ), + agent_id: z.string().trim().min(1).describe('Unique identifier of the agent.'), + resource_id: z + .string() + .trim() + .min(1) + .optional() + .describe('Required for action:add, action:update, action:remove. The ID of the board or doc to grant/update/revoke access to.'), + scope_type: z + .enum(['BOARD', 'DOC']) + .optional() + .describe('Required for action:add, action:update, action:remove. The type of resource: "BOARD" or "DOC".'), + permission_type: z + .enum(['READ', 'READ_WRITE']) + .optional() + .describe( + 'Required for action:add and action:update. The permission level: "READ" (agent can read the resource) or "READ_WRITE" (agent can read and write the resource).', + ), +}; + +export class ManageAgentKnowledgeTool extends BaseMondayApiTool { + name = 'manage_agent_knowledge'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Knowledge', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `List, grant, update, or revoke a monday platform agent's access to boards and docs. + +An agent's "knowledge" is the set of monday.com boards and docs it can read from or write to during a run. + +- list: Returns all resources the agent currently has access to, including permission level and resource type. +- add: Grants the agent access to a board or doc with the specified permission level. +- update: Changes the permission level on a resource the agent already has access to. Call action:"list" first to confirm the resource_id exists. +- remove: Revokes the agent's access to a board or doc entirely. Call action:"list" first to confirm the resource_id exists. + +Permission types: +- READ: Agent can read data from the resource. +- READ_WRITE: Agent can read and write data to the resource. + +USAGE EXAMPLES: +- List: { "action": "list", "agent_id": "7" } +- Add board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" } +- Update to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" } +- Remove access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" } + +RELATED TOOLS: +- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.) +- manage_agent_triggers — manage which triggers fire this agent automatically +- manage_agent_skills — manage which skills this agent can perform`; + } + + getInputSchema() { + return manageAgentKnowledgeToolSchema; + } + + protected async executeInternal( + input: ToolInputType, + ): Promise> { + switch (input.action) { + case 'list': + return this.handleList(input); + case 'add': + return this.handleAdd(input); + case 'update': + return this.handleUpdate(input); + case 'remove': + return this.handleRemove(input); + } + } + + private async handleList(input: ToolInputType): Promise> { + try { + const res = await this.mondayApi.request( + getAgentKnowledgeQuery, + { id: input.agent_id } satisfies GetAgentKnowledgeQueryVariables, + { versionOverride: 'dev' }, + ); + const knowledge = res.agent_knowledge ?? { resources: [], files: [] }; + return { + content: { + message: 'Current agent resource access.', + count: knowledge.resources?.length ?? 0, + knowledge, + }, + }; + } catch (error) { + rethrowWithContext(error, 'list agent knowledge for monday platform agent'); + } + } + + private async handleAdd(input: ToolInputType): Promise> { + if (!input.resource_id || !input.scope_type || !input.permission_type) { + throw new Error('resource_id, scope_type, and permission_type are required for action:add'); + } + try { + const res = await this.mondayApi.request( + addAgentResourceAccessMutation, + { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as KnowledgeScope, + permission_type: input.permission_type as KnowledgePermission, + } satisfies AddAgentResourceAccessMutationVariables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: 'Resource access granted to agent.', + success: res.add_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'add agent resource access for monday platform agent'); + } + } + + private async handleUpdate(input: ToolInputType): Promise> { + if (!input.resource_id || !input.scope_type || !input.permission_type) { + throw new Error('resource_id, scope_type, and permission_type are required for action:update'); + } + try { + const res = await this.mondayApi.request( + updateAgentResourceAccessMutation, + { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as KnowledgeScope, + permission_type: input.permission_type as KnowledgePermission, + } satisfies UpdateAgentResourceAccessMutationVariables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: 'Resource access updated.', + success: res.update_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'update agent resource access for monday platform agent'); + } + } + + private async handleRemove(input: ToolInputType): Promise> { + if (!input.resource_id || !input.scope_type) { + throw new Error('resource_id and scope_type are required for action:remove'); + } + try { + const res = await this.mondayApi.request( + removeAgentResourceAccessMutation, + { + id: input.agent_id, + resource_id: input.resource_id, + scope_type: input.scope_type as KnowledgeScope, + } satisfies RemoveAgentResourceAccessMutationVariables, + { versionOverride: 'dev' }, + ); + return { + content: { + message: 'Resource access removed from agent.', + success: res.remove_agent_resource_access?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'remove agent resource access for monday platform agent'); + } + } +} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge.graphql.dev.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge.graphql.dev.ts new file mode 100644 index 00000000..47e55644 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-knowledge/manage-agent-knowledge.graphql.dev.ts @@ -0,0 +1,42 @@ +import { gql } from 'graphql-request'; + +export const getAgentKnowledgeQuery = gql` + query getAgentKnowledge($id: ID!) { + agent_knowledge(id: $id) { + resources { + resource_id + scope_type + permission_type + } + files { + id + file_name + file_type + } + } + } +`; + +export const addAgentResourceAccessMutation = gql` + mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) { + add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) { + success + } + } +`; + +export const removeAgentResourceAccessMutation = gql` + mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) { + remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) { + success + } + } +`; + +export const updateAgentResourceAccessMutation = gql` + mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) { + update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) { + success + } + } +`; diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts new file mode 100644 index 00000000..e2616e14 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.test.ts @@ -0,0 +1,214 @@ +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + AddSkillToAgentMutation, + CreateAgentSkillMutation, + RemoveSkillFromAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +const mockSkill = { id: 'skill-123', name: 'Send Slack Message', description: 'Posts to Slack' }; + +describe('ManageAgentSkillsTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + // ─── create ──────────────────────────────────────────────────────────────── + + describe('action: create', () => { + it('should create a skill and return it', async () => { + mocks.setResponseOnce({ create_agent_skill: mockSkill } as CreateAgentSkillMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + name: 'Send Slack Message', + content: '## Instructions\nPost a message.', + }); + const parsed = parseToolResult(result); + + expect(parsed.skill.id).toBe('skill-123'); + }); + + it('should pass name, content, and description to the mutation', async () => { + mocks.setResponseOnce({ create_agent_skill: mockSkill } as CreateAgentSkillMutation); + + await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + name: 'Send Slack Message', + content: '## Instructions\nPost a message.', + description: 'Posts to Slack', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('createAgentSkill'), + { name: 'Send Slack Message', content: '## Instructions\nPost a message.', description: 'Posts to Slack' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject create without name', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + content: '## Instructions\nPost a message.', + }); + + expect(result.content[0].text).toContain('"name" and "content"'); + }); + + it('should reject create without content', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + name: 'Send Slack Message', + }); + + expect(result.content[0].text).toContain('"name" and "content"'); + }); + + it('should throw when create_agent_skill returns null', async () => { + mocks.setResponseOnce({ create_agent_skill: null } as CreateAgentSkillMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + name: 'Send Slack Message', + content: '## Instructions', + }); + + expect(result.content[0].text).toContain('create_agent_skill returned no data'); + }); + + it('should propagate API errors for create', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'create', + name: 'Send Slack Message', + content: '## Instructions', + }); + + expect(result.content[0].text).toContain('Failed to create monday platform agent skill'); + }); + }); + + // ─── add ─────────────────────────────────────────────────────────────────── + + describe('action: add', () => { + it('should add a skill to an agent', async () => { + mocks.setResponseOnce({ add_skill_to_agent: { success: true } } as AddSkillToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + expect(parsed.message).toContain('added'); + }); + + it('should pass agent_id and skill_id when adding skill', async () => { + mocks.setResponseOnce({ add_skill_to_agent: { success: true } } as AddSkillToAgentMutation); + + await callToolByNameRawAsync('manage_agent_skills', { action: 'add', agent_id: '7', skill_id: 'skill-abc-123' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('addSkillToAgent'), + { agent_id: '7', skill_id: 'skill-abc-123' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject add without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { action: 'add', skill_id: 'skill-abc-123' }); + + expect(result.content[0].text).toContain('agent_id is required'); + }); + + it('should reject add without skill_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { action: 'add', agent_id: '7' }); + + expect(result.content[0].text).toContain('skill_id is required'); + }); + + it('should return success:false when add_skill_to_agent is null', async () => { + mocks.setResponseOnce({ add_skill_to_agent: null } as AddSkillToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for add', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'add', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + + expect(result.content[0].text).toContain('Failed to add skill to monday platform agent'); + }); + }); + + // ─── remove ──────────────────────────────────────────────────────────────── + + describe('action: remove', () => { + it('should remove a skill from an agent', async () => { + mocks.setResponseOnce({ remove_skill_from_agent: { success: true } } as RemoveSkillFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'remove', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + expect(parsed.message).toContain('removed'); + }); + + it('should reject remove without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { action: 'remove', skill_id: 'skill-abc-123' }); + + expect(result.content[0].text).toContain('agent_id is required'); + }); + + it('should reject remove without skill_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_skills', { action: 'remove', agent_id: '7' }); + + expect(result.content[0].text).toContain('skill_id is required'); + }); + + it('should return success:false when remove_skill_from_agent is null', async () => { + mocks.setResponseOnce({ remove_skill_from_agent: null } as RemoveSkillFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'remove', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for remove', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_skills', { + action: 'remove', + agent_id: '7', + skill_id: 'skill-abc-123', + }); + + expect(result.content[0].text).toContain('Failed to remove skill from monday platform agent'); + }); + }); +}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts new file mode 100644 index 00000000..631fc445 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-skills/manage-agent-skills-tool.ts @@ -0,0 +1,161 @@ +import { z } from 'zod'; +import { + AddSkillToAgentMutation, + AddSkillToAgentMutationVariables, + CreateAgentSkillMutation, + CreateAgentSkillMutationVariables, + RemoveSkillFromAgentMutation, + RemoveSkillFromAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { addSkillToAgentMutation, createAgentSkillMutation, removeSkillFromAgentMutation } from '../shared/agents.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentSkillsToolSchema = { + action: z + .enum(['create', 'add', 'remove']) + .describe( + '"create" — author a new custom skill in the account-wide catalog (no agent_id needed). "add" — attach an existing skill to this agent by skill_id. "remove" — detach a skill from this agent.', + ), + agent_id: z + .string() + .trim() + .min(1) + .optional() + .describe('Required for action:"add" and action:"remove". Not used for action:"create" (account-level operation).'), + name: z.string().trim().min(1).optional().describe('Required for action:"create". Display name of the new skill.'), + content: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:"create". Markdown instructions defining what the skill does and how to execute it. Be specific and thorough — this is the skill\'s runtime behavior.', + ), + description: z.string().trim().min(1).optional().describe('Used with action:"create". Short description shown in the catalog.'), + skill_id: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:"add" and action:"remove". The skill id from agent_catalog action:"list_skills", or the id returned by action:"create" in this tool. Never guess or invent a skill id.', + ), +}; + +export class ManageAgentSkillsTool extends BaseMondayApiTool { + name = 'manage_agent_skills'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Skills', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `Manage the full skill lifecycle for monday platform agents — create new skills in the catalog, attach skills to an agent, or detach them. + +Skills extend what an agent can do (e.g. sending emails, querying databases, posting to Slack). + +ACTIONS: +- create: { name, content, description? } — creates a new custom skill in the account-wide catalog. + The skill becomes available to all agents in the account. +- add: { agent_id, skill_id } — attaches a skill to this agent. +- remove: { agent_id, skill_id } — detaches a skill from this agent. + +WORKFLOW — attach an existing skill: +1. Call agent_catalog action:"list_skills" — find the skill_id of the skill to attach. +2. Call this tool action:"add" with agent_id and that skill_id. + +WORKFLOW — create a new skill and attach it: +1. Call this tool action:"create" with name and content — note the returned id. +2. Call this tool action:"add" with agent_id and that id directly (no catalog lookup needed). + +NOTE: There is no action to list which skills are currently attached to a specific agent — the platform does not yet expose that query. +To browse all skills available in the account catalog, use agent_catalog action:"list_skills". + +USAGE EXAMPLES: +- Create a skill: { "action": "create", "name": "Send Slack Message", "content": "## Instructions\\nPost a message to a Slack channel.", "description": "Sends a message to Slack" } +- Add a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-abc-123" } +- Remove a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-abc-123" } + +RELATED TOOLS: +- agent_catalog action:"list_skills" — browse existing skills to find a skill_id before calling action:"add" +- manage_agent_triggers — manage which triggers fire this agent automatically +- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)`; + } + + getInputSchema() { + return manageAgentSkillsToolSchema; + } + + protected async executeInternal(input: ToolInputType): Promise> { + switch (input.action) { + case 'create': + return this.handleCreate(input); + case 'add': + return this.handleAdd(input); + case 'remove': + return this.handleRemove(input); + } + } + + private async handleCreate(input: ToolInputType): Promise> { + if (!input.name || !input.content) { + throw new Error('action:"create" requires both "name" and "content".'); + } + try { + const variables: CreateAgentSkillMutationVariables = { + name: input.name, + content: input.content, + description: input.description, + }; + const res = await this.mondayApi.request(createAgentSkillMutation, variables, { versionOverride: 'dev' }); + if (!res.create_agent_skill) { + throw new Error('create_agent_skill returned no data'); + } + return { + content: { + message: 'Skill created and added to the account catalog. Use the returned id with action:"add" to attach it to an agent.', + skill: res.create_agent_skill, + }, + }; + } catch (error) { + rethrowWithContext(error, 'create monday platform agent skill'); + } + } + + private async handleAdd(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('agent_id is required for action:"add".'); + } + if (!input.skill_id) { + throw new Error('skill_id is required for action:"add". Get it from agent_catalog action:"list_skills" or from action:"create" in this tool.'); + } + try { + const variables: AddSkillToAgentMutationVariables = { agent_id: input.agent_id, skill_id: input.skill_id }; + const res = await this.mondayApi.request(addSkillToAgentMutation, variables, { versionOverride: 'dev' }); + return { content: { message: 'Skill added to agent.', success: res.add_skill_to_agent?.success ?? false } }; + } catch (error) { + rethrowWithContext(error, 'add skill to monday platform agent'); + } + } + + private async handleRemove(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('agent_id is required for action:"remove".'); + } + if (!input.skill_id) { + throw new Error('skill_id is required for action:"remove".'); + } + try { + const variables: RemoveSkillFromAgentMutationVariables = { agent_id: input.agent_id, skill_id: input.skill_id }; + const res = await this.mondayApi.request(removeSkillFromAgentMutation, variables, { versionOverride: 'dev' }); + return { content: { message: 'Skill removed from agent.', success: res.remove_skill_from_agent?.success ?? false } }; + } catch (error) { + rethrowWithContext(error, 'remove skill from monday platform agent'); + } + } +} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts new file mode 100644 index 00000000..1ca2e613 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.test.ts @@ -0,0 +1,208 @@ +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + AddTriggerToAgentMutation, + GetAgentActiveTriggersQuery, + RemoveTriggerFromAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +const mockActiveTrigger = { + node_id: 'node-abc', + block_reference_id: 'status-change-ref', + name: 'Status Change', + description: 'Fires when a status column changes', + field_summary: 'board_id=42', +}; + +describe('ManageAgentTriggersTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + // ─── list ────────────────────────────────────────────────────────────────── + + describe('action: list', () => { + it('should list active triggers for an agent', async () => { + mocks.setResponseOnce({ agent_active_triggers: [mockActiveTrigger] } as GetAgentActiveTriggersQuery); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.triggers[0].node_id).toBe('node-abc'); + }); + + it('should pass agent_id and versionOverride dev when listing triggers', async () => { + mocks.setResponseOnce({ agent_active_triggers: [] } as GetAgentActiveTriggersQuery); + + await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgentActiveTriggers'), + { agent_id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should return empty list with count 0 when no triggers exist', async () => { + mocks.setResponseOnce({ agent_active_triggers: [] } as GetAgentActiveTriggersQuery); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(0); + expect(parsed.triggers).toEqual([]); + }); + + it('should propagate API errors for list', async () => { + mocks.setError('Not found'); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'list', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to list active triggers'); + }); + }); + + // ─── add ─────────────────────────────────────────────────────────────────── + + describe('action: add', () => { + it('should add a trigger to an agent', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + field_values: { board_id: '42' }, + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass block_reference_id, field_values, and versionOverride dev', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + field_values: { board_id: '42' }, + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('addTriggerToAgent'), + { agent_id: '7', block_reference_id: 'status-change-ref', field_values: { board_id: '42' } }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should add a trigger without field_values when omitted', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: { success: true } } as AddTriggerToAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ field_values: undefined }), + expect.anything(), + ); + }); + + it('should reject add without block_reference_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'add', agent_id: '7' }); + + expect(result.content[0].text).toContain('block_reference_id is required'); + }); + + it('should return success:false when add_trigger_to_agent is null', async () => { + mocks.setResponseOnce({ add_trigger_to_agent: null } as AddTriggerToAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for add', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'add', + agent_id: '7', + block_reference_id: 'status-change-ref', + }); + + expect(result.content[0].text).toContain('Failed to add trigger to monday platform agent'); + }); + }); + + // ─── remove ──────────────────────────────────────────────────────────────── + + describe('action: remove', () => { + it('should remove a trigger from an agent', async () => { + mocks.setResponseOnce({ remove_trigger_from_agent: { success: true } } as RemoveTriggerFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'remove', + agent_id: '7', + node_id: 'node-abc', + }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + }); + + it('should pass node_id and versionOverride dev when removing trigger', async () => { + mocks.setResponseOnce({ remove_trigger_from_agent: { success: true } } as RemoveTriggerFromAgentMutation); + + await callToolByNameRawAsync('manage_agent_triggers', { action: 'remove', agent_id: '7', node_id: 'node-abc' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('removeTriggerFromAgent'), + { agent_id: '7', node_id: 'node-abc' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject remove without node_id', async () => { + const result = await callToolByNameRawAsync('manage_agent_triggers', { action: 'remove', agent_id: '7' }); + + expect(result.content[0].text).toContain('node_id is required'); + }); + + it('should return success:false when remove_trigger_from_agent is null', async () => { + mocks.setResponseOnce({ remove_trigger_from_agent: null } as RemoveTriggerFromAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'remove', + agent_id: '7', + node_id: 'node-abc', + }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for remove', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent_triggers', { + action: 'remove', + agent_id: '7', + node_id: 'node-abc', + }); + + expect(result.content[0].text).toContain('Failed to remove trigger from monday platform agent'); + }); + }); +}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts new file mode 100644 index 00000000..836ad81c --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent-triggers/manage-agent-triggers-tool.ts @@ -0,0 +1,159 @@ +import { z } from 'zod'; +import { + AddTriggerToAgentMutation, + AddTriggerToAgentMutationVariables, + GetAgentActiveTriggersQuery, + GetAgentActiveTriggersQueryVariables, + RemoveTriggerFromAgentMutation, + RemoveTriggerFromAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { addTriggerToAgentMutation, getAgentActiveTriggersQuery, removeTriggerFromAgentMutation } from '../shared/agents.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentTriggersToolSchema = { + action: z + .enum(['list', 'add', 'remove']) + .describe( + '"list" — returns all triggers currently attached to this agent (includes node_id needed for remove). "add" — attaches a new trigger by block_reference_id. "remove" — detaches a trigger instance by node_id.', + ), + agent_id: z.string().trim().min(1, 'agent_id must be a non-empty string').describe('Unique identifier of the agent.'), + block_reference_id: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:"add". The block_reference_id from agent_catalog action:"list_triggers" identifying the trigger type to attach. Never guess this value — look it up in the catalog first.', + ), + field_values: z + .record(z.union([z.string(), z.number(), z.boolean(), z.object({ value: z.string(), label: z.string() }).passthrough()])) + .optional() + .describe( + 'Used with action:"add" when the trigger type has required_fields. Key/value object whose shape is described by field_schemas in the agent_catalog response. Scalar fields use string/number/boolean values. Selection fields use { "value": "", "label": "" }.', + ), + node_id: z + .string() + .trim() + .min(1) + .optional() + .describe( + 'Required for action:"remove". The node_id of the trigger instance — get it from action:"list". Each instance has a unique node_id even if the same trigger type is attached multiple times. Do NOT pass block_reference_id here.', + ), +}; + +export class ManageAgentTriggersTool extends BaseMondayApiTool { + name = 'manage_agent_triggers'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent Triggers', + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + }); + + getDescription(): string { + return `Manage the triggers attached to a monday platform agent — triggers define WHEN the agent runs automatically. + +ACTIONS: +- list: { agent_id } — returns active triggers with node_id, block_reference_id, name, field_summary. +- add: { agent_id, block_reference_id, field_values? } — attaches a trigger type to the agent. +- remove: { agent_id, node_id } — detaches a trigger instance by node_id (NOT block_reference_id). + +WORKFLOW — add a trigger: +1. Call agent_catalog action:"list_triggers" — note block_reference_id, field_schemas, and required_fields. +2. Collect required field values from the user (e.g. board_id, column_id). +3. Call this tool action:"add" with block_reference_id and field_values. +Note: add returns only { success } — no node_id for the new instance. Call action:"list" afterward if you need the node_id. + +WORKFLOW — remove a trigger: +1. Call action:"list" to see active triggers and note the node_id of the instance to remove. +2. Call action:"remove" with that node_id. + +NOTE: Only triggers that can be added programmatically appear in the catalog. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.) +require user setup in the monday.com UI — they will not appear in agent_catalog and cannot be managed here. + +USAGE EXAMPLES: +- List triggers: { "action": "list", "agent_id": "7" } +- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } } +- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" } + +RELATED TOOLS: +- agent_catalog action:"list_triggers" — discover available trigger types and their required field_values before calling action:"add" here +- manage_agent_skills — manage which skills this agent can perform +- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)`; + } + + getInputSchema() { + return manageAgentTriggersToolSchema; + } + + protected async executeInternal(input: ToolInputType): Promise> { + switch (input.action) { + case 'list': + return this.handleList(input); + case 'add': + return this.handleAdd(input); + case 'remove': + return this.handleRemove(input); + } + } + + private async handleList(input: ToolInputType): Promise> { + try { + const variables: GetAgentActiveTriggersQueryVariables = { agent_id: input.agent_id }; + const res = await this.mondayApi.request(getAgentActiveTriggersQuery, variables, { versionOverride: 'dev' }); + const triggers = res.agent_active_triggers ?? []; + return { + content: { + message: 'Active triggers on this agent. Use node_id with action:"remove" to detach a trigger.', + count: triggers.length, + triggers, + }, + }; + } catch (error) { + rethrowWithContext(error, 'list active triggers for monday platform agent'); + } + } + + private async handleAdd(input: ToolInputType): Promise> { + if (!input.block_reference_id) { + throw new Error('block_reference_id is required for action:"add". Call agent_catalog action:"list_triggers" first to find the block_reference_id.'); + } + try { + const variables: AddTriggerToAgentMutationVariables = { + agent_id: input.agent_id, + block_reference_id: input.block_reference_id, + field_values: input.field_values, + }; + const res = await this.mondayApi.request(addTriggerToAgentMutation, variables, { versionOverride: 'dev' }); + return { + content: { + message: 'Trigger added to agent. Call action:"list" to verify and retrieve the node_id.', + success: res.add_trigger_to_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'add trigger to monday platform agent'); + } + } + + private async handleRemove(input: ToolInputType): Promise> { + if (!input.node_id) { + throw new Error('node_id is required for action:"remove". Call action:"list" first to get node_id values.'); + } + try { + const variables: RemoveTriggerFromAgentMutationVariables = { agent_id: input.agent_id, node_id: input.node_id }; + const res = await this.mondayApi.request(removeTriggerFromAgentMutation, variables, { versionOverride: 'dev' }); + return { + content: { + message: 'Trigger removed from agent.', + success: res.remove_trigger_from_agent?.success ?? false, + }, + }; + } catch (error) { + rethrowWithContext(error, 'remove trigger from monday platform agent'); + } + } +} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.test.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.test.ts new file mode 100644 index 00000000..6cebf9a7 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.test.ts @@ -0,0 +1,441 @@ +import { MondayAgentToolkit } from 'src/mcp/toolkit'; +import { callToolByNameRawAsync, createMockApiClient, parseToolResult } from '../../test-utils/mock-api-client'; +import { + ActivateAgentMutation, + CreateAgentMutation, + CreateBlankAgentMutation, + DeactivateAgentMutation, + DeleteAgentMutation, + GetAgentsQuery, + RunAgentMutation, + UpdateAgentMutation, +} from 'src/monday-graphql/generated/graphql.dev/graphql'; + +const mockAgent = { + id: '7', + kind: 'PERSONAL', + state: 'INACTIVE', + profile: { name: 'Standup Bot', role: 'PM', role_description: 'Runs standups', avatar_url: null, background_color: null }, + goal: 'Keep team aligned', + plan: '# Plan\n1. collect status', + user_prompt: null, + version_id: 'v1', + created_at: '2026-01-01T00:00:00Z', + updated_at: '2026-01-01T00:00:00Z', +}; + +describe('ManageAgentTool', () => { + let mocks: ReturnType; + + beforeEach(() => { + mocks = createMockApiClient(); + jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient); + }); + + // ─── create (AI mode) ────────────────────────────────────────────────────── + + describe('action: create', () => { + it('should create an agent via AI mode and return it', async () => { + mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create', prompt: 'Run my daily standup' }); + const parsed = parseToolResult(result); + + expect(parsed.agent.id).toBe('7'); + expect(parsed.message).toContain('INACTIVE'); + }); + + it('should pass prompt and versionOverride dev for AI mode', async () => { + mocks.setResponseOnce({ create_agent: mockAgent } as CreateAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'create', prompt: 'Run my daily standup' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('createAgent'), + expect.objectContaining({ input: expect.objectContaining({ prompt: 'Run my daily standup' }) }), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject create without prompt', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'create' }); + + expect(result.content[0].text).toContain('"prompt"'); + }); + + it('should throw when AI create returns no id', async () => { + mocks.setResponseOnce({ create_agent: null } as CreateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create', prompt: 'Make an agent' }); + + expect(result.content[0].text).toContain('creation returned no id'); + }); + + it('should propagate API errors for AI create', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create', prompt: 'Make an agent' }); + + expect(result.content[0].text).toContain('Failed to create monday platform agent'); + }); + }); + + // ─── create_blank (manual mode) ──────────────────────────────────────────── + + describe('action: create_blank', () => { + it('should create an agent via manual mode and return it', async () => { + mocks.setResponseOnce({ create_blank_agent: mockAgent } as CreateBlankAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create_blank', name: 'Standup Bot', role: 'PM' }); + const parsed = parseToolResult(result); + + expect(parsed.agent.id).toBe('7'); + }); + + it('should pass name and role for manual mode', async () => { + mocks.setResponseOnce({ create_blank_agent: mockAgent } as CreateBlankAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'create_blank', name: 'Standup Bot', role: 'PM' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('createBlankAgent'), + expect.objectContaining({ input: expect.objectContaining({ name: 'Standup Bot', role: 'PM' }) }), + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should throw when manual create returns no id', async () => { + mocks.setResponseOnce({ create_blank_agent: null } as CreateBlankAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create_blank', name: 'Bot' }); + + expect(result.content[0].text).toContain('creation returned no id'); + }); + + it('should propagate API errors for manual create', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'create_blank', name: 'Bot' }); + + expect(result.content[0].text).toContain('Failed to create blank monday platform agent'); + }); + }); + + // ─── get ─────────────────────────────────────────────────────────────────── + + describe('action: get', () => { + it('should fetch a single agent when agent_id is provided', async () => { + mocks.setResponseOnce({ agents: [mockAgent] } as GetAgentsQuery); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'get', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.agent).toEqual(mockAgent); + }); + + it('should pass ids and versionOverride dev when fetching by agent_id', async () => { + mocks.setResponseOnce({ agents: [mockAgent] } as GetAgentsQuery); + + await callToolByNameRawAsync('manage_agent', { action: 'get', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgents'), + { ids: ['7'] }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should return not-found message when agent does not exist', async () => { + mocks.setResponseOnce({ agents: [] } as GetAgentsQuery); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'get', agent_id: '999' }); + + expect(result.content[0].text).toContain('not found'); + }); + + it('should list agents when agent_id is omitted', async () => { + mocks.setResponseOnce({ agents: [mockAgent] } as GetAgentsQuery); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'get' }); + const parsed = parseToolResult(result); + + expect(parsed.count).toBe(1); + expect(parsed.agents[0].id).toBe('7'); + }); + + it('should pass limit 100 when listing agents', async () => { + mocks.setResponseOnce({ agents: [] } as GetAgentsQuery); + + await callToolByNameRawAsync('manage_agent', { action: 'get' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('getAgents'), + { limit: 100 }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should propagate API errors with context for get', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'get', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to get monday platform agent'); + }); + + it('should propagate API errors with context for list', async () => { + mocks.setError('Unauthorized'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'get' }); + + expect(result.content[0].text).toContain('Failed to list monday platform agents'); + }); + }); + + // ─── update ──────────────────────────────────────────────────────────────── + + describe('action: update', () => { + it('should update an agent and return it', async () => { + mocks.setResponseOnce({ update_agent: { ...mockAgent, profile: { ...mockAgent.profile, name: 'New Name' } } } as UpdateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'update', agent_id: '7', name: 'New Name' }); + const parsed = parseToolResult(result); + + expect(parsed.agent.id).toBe('7'); + }); + + it('should only include provided fields in the input object', async () => { + mocks.setResponseOnce({ update_agent: mockAgent } as UpdateAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'update', agent_id: '7', name: 'X' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ input: { name: 'X' } }), + expect.anything(), + ); + }); + + it('should reject update without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'update', name: 'X' }); + + expect(result.content[0].text).toContain('requires "agent_id"'); + }); + + it('should reject update with no fields', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'update', agent_id: '7' }); + + expect(result.content[0].text).toContain('at least one of'); + }); + + it('should throw when update_agent returns null', async () => { + mocks.setResponseOnce({ update_agent: null } as UpdateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'update', agent_id: '7', name: 'X' }); + + expect(result.content[0].text).toContain('update_agent returned no data'); + }); + + it('should propagate API errors for update', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'update', agent_id: '7', name: 'X' }); + + expect(result.content[0].text).toContain('Failed to update monday platform agent'); + }); + }); + + // ─── delete ──────────────────────────────────────────────────────────────── + + describe('action: delete', () => { + const mockDeletedAgent = { ...mockAgent, state: 'DELETED' }; + + it('should delete an agent and return it', async () => { + mocks.setResponseOnce({ delete_agent: mockDeletedAgent } as DeleteAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'delete', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.agent.id).toBe('7'); + expect(parsed.message).toContain('deleted'); + }); + + it('should pass versionOverride dev for delete', async () => { + mocks.setResponseOnce({ delete_agent: mockDeletedAgent } as DeleteAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'delete', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('deleteAgent'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject delete without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'delete' }); + + expect(result.content[0].text).toContain('requires "agent_id"'); + }); + + it('should throw when delete_agent returns no id', async () => { + mocks.setResponseOnce({ delete_agent: null } as DeleteAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'delete', agent_id: '7' }); + + expect(result.content[0].text).toContain('returned no id'); + }); + + it('should propagate API errors for delete', async () => { + mocks.setError('Not authorized'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'delete', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to delete monday platform agent'); + }); + }); + + // ─── activate ────────────────────────────────────────────────────────────── + + describe('action: activate', () => { + it('should activate an agent', async () => { + mocks.setResponseOnce({ activate_agent: { success: true } } as ActivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'activate', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + expect(parsed.message).toContain('activated'); + }); + + it('should pass versionOverride dev for activate', async () => { + mocks.setResponseOnce({ activate_agent: { success: true } } as ActivateAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'activate', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('activateAgent'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject activate without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'activate' }); + + expect(result.content[0].text).toContain('requires "agent_id"'); + }); + + it('should return success:false when activate_agent is null', async () => { + mocks.setResponseOnce({ activate_agent: null } as ActivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'activate', agent_id: '7' }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for activate', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'activate', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to activate monday platform agent'); + }); + }); + + // ─── deactivate ──────────────────────────────────────────────────────────── + + describe('action: deactivate', () => { + it('should deactivate an agent', async () => { + mocks.setResponseOnce({ deactivate_agent: { success: true } } as DeactivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'deactivate', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.success).toBe(true); + expect(parsed.message).toContain('deactivated'); + }); + + it('should always pass DEACTIVATED_BY_USER as inactive_reason', async () => { + mocks.setResponseOnce({ deactivate_agent: { success: true } } as DeactivateAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'deactivate', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ inactive_reason: 'DEACTIVATED_BY_USER' }), + expect.anything(), + ); + }); + + it('should reject deactivate without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'deactivate' }); + + expect(result.content[0].text).toContain('requires "agent_id"'); + }); + + it('should return success:false when deactivate_agent is null', async () => { + mocks.setResponseOnce({ deactivate_agent: null } as DeactivateAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'deactivate', agent_id: '7' }); + + expect(parseToolResult(result).success).toBe(false); + }); + + it('should propagate API errors for deactivate', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'deactivate', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to deactivate monday platform agent'); + }); + }); + + // ─── run ─────────────────────────────────────────────────────────────────── + + describe('action: run', () => { + it('should enqueue an agent run and return trigger_uuid', async () => { + mocks.setResponseOnce({ run_agent: { trigger_uuid: 'uuid-123' } } as RunAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'run', agent_id: '7' }); + const parsed = parseToolResult(result); + + expect(parsed.trigger_uuid).toBe('uuid-123'); + expect(parsed.message).toContain('enqueued'); + }); + + it('should pass versionOverride dev for run', async () => { + mocks.setResponseOnce({ run_agent: { trigger_uuid: 'uuid-123' } } as RunAgentMutation); + + await callToolByNameRawAsync('manage_agent', { action: 'run', agent_id: '7' }); + + expect(mocks.getMockRequest()).toHaveBeenCalledWith( + expect.stringContaining('runAgent'), + { id: '7' }, + expect.objectContaining({ versionOverride: 'dev' }), + ); + }); + + it('should reject run without agent_id', async () => { + const result = await callToolByNameRawAsync('manage_agent', { action: 'run' }); + + expect(result.content[0].text).toContain('requires "agent_id"'); + }); + + it('should throw when run_agent returns null', async () => { + mocks.setResponseOnce({ run_agent: null } as RunAgentMutation); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'run', agent_id: '7' }); + + expect(result.content[0].text).toContain('run_agent returned no data'); + }); + + it('should propagate API errors for run', async () => { + mocks.setError('API error'); + + const result = await callToolByNameRawAsync('manage_agent', { action: 'run', agent_id: '7' }); + + expect(result.content[0].text).toContain('Failed to run monday platform agent'); + }); + }); +}); diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.ts new file mode 100644 index 00000000..464317c1 --- /dev/null +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/manage-agent/manage-agent-tool.ts @@ -0,0 +1,332 @@ +import { z } from 'zod'; +import { + ActivateAgentMutation, + ActivateAgentMutationVariables, + AgentModel, + CreateAgentMutation, + CreateAgentMutationVariables, + CreateBlankAgentMutation, + CreateBlankAgentMutationVariables, + DeactivateAgentMutation, + DeactivateAgentMutationVariables, + DeleteAgentMutation, + DeleteAgentMutationVariables, + GetAgentsQuery, + GetAgentsQueryVariables, + InactiveReason, + RunAgentMutation, + RunAgentMutationVariables, + UpdateAgentInput, + UpdateAgentMutation, + UpdateAgentMutationVariables, +} from '../../../../../monday-graphql/generated/graphql.dev/graphql'; +import { + activateAgentMutation, + createAgentMutation, + createBlankAgentMutation, + deactivateAgentMutation, + deleteAgentMutation, + getAgentsQuery, + runAgentMutation, + updateAgentMutation, +} from '../shared/agents.graphql.dev'; +import { ToolInputType, ToolOutputType, ToolType } from '../../../../tool'; +import { BaseMondayApiTool, createMondayApiAnnotations } from '../../base-monday-api-tool'; +import { rethrowWithContext } from '../../../../../utils'; + +export const manageAgentToolSchema = { + action: z + .enum(['create', 'create_blank', 'get', 'update', 'delete', 'activate', 'deactivate', 'run']) + .describe( + '"create" — create a new agent via AI (pass prompt). "create_blank" — create a new agent manually (pass name/role/etc). "get" — fetch one agent by agent_id or list owned agents. "update" — modify mutable fields on an existing agent. "delete" — permanently delete an agent (irreversible). "activate" — transition agent to ACTIVE. "deactivate" — transition agent to INACTIVE. "run" — manually enqueue an agent run (fire-and-forget).', + ), + agent_id: z + .string() + .trim() + .min(1, 'agent_id must be a non-empty string') + .optional() + .describe( + 'Used with action:"get" to fetch a specific agent. Required for action:"update", "delete", "activate", "deactivate", "run". Omit for action:"create", "create_blank", or action:"get" (to list owned agents).', + ), + // create (AI mode) + prompt: z + .string() + .trim() + .min(1) + .optional() + .describe('Required for action:"create". Plain-language description of what the agent should do. Platform generates profile, goal, and plan via AI.'), + agent_model: z + .nativeEnum(AgentModel) + .optional() + .describe('Used with action:"create" or action:"update". Omit unless the user explicitly names a valid monday-supported model.'), + // create_blank (manual mode) + name: z.string().trim().min(1).optional().describe('Used with action:"create_blank" or action:"update". Display name of the agent.'), + role: z.string().trim().min(1).optional().describe('Used with action:"create_blank" or action:"update". Short role title (e.g. "Customer Success Bot").'), + role_description: z.string().trim().min(1).optional().describe('Used with action:"create_blank" or action:"update". Detailed description of the agent role.'), + avatar_url: z + .string() + .trim() + .min(1) + .optional() + .describe('Used with action:"create_blank". HTTPS URL of the avatar. Prefer dapulse-res.cloudinary.com or cdn.monday.com.'), + gender: z.enum(['male', 'female']).optional().describe('Used with action:"create_blank". Hint for generated avatar/name when profile fields are omitted.'), + background_color: z.string().trim().min(1).optional().describe('Used with action:"create_blank". Lowercase hex, e.g. "#9450fd".'), + user_prompt: z.string().trim().min(1).optional().describe('Used with action:"create_blank". Stored as metadata. Not used for AI generation.'), + // update + plan: z.string().trim().min(1).optional().describe('Used with action:"update". New step-by-step execution plan in markdown.'), +}; + +export class ManageAgentTool extends BaseMondayApiTool { + name = 'manage_agent'; + type = ToolType.WRITE; + annotations = createMondayApiAnnotations({ + title: 'Manage monday Platform Agent', + readOnlyHint: false, + destructiveHint: true, + idempotentHint: false, + }); + + getDescription(): string { + return `Full lifecycle management for monday platform agents — create, read, update, delete, change state, and run. + +monday platform agents are user-built work orchestrators on monday.com — each has a profile (name, role, avatar), a goal, and a markdown execution plan. Agents in state ACTIVE can be triggered automatically. They are NOT local LangChain or MCP agents. + +ACTIONS (only pass fields that apply to the chosen action): +- create: { action:"create", prompt, agent_model? } — AI-generated agent. Platform creates profile, goal, and plan from the prompt. +- create_blank: { action:"create_blank", name?, role?, role_description?, avatar_url?, gender?, background_color?, user_prompt? } — manually defined agent. +- get one: { action:"get", agent_id } +- list owned: { action:"get" } +- update: { action:"update", agent_id, name?, role?, role_description?, plan?, agent_model? } +- delete: { action:"delete", agent_id } +- activate: { action:"activate", agent_id } +- deactivate: { action:"deactivate", agent_id } +- run: { action:"run", agent_id } + +RULES: +- "create_blank" with no fields creates a nameless blank agent — only do this intentionally. +- "update" requires at least one of name/role/role_description/plan/agent_model. +- "update", "delete", "activate", "deactivate", "run" all require "agent_id". +- Created agents start INACTIVE. Follow with action:"activate" using the returned agent_id before they can be triggered. +- ⚠️ DESTRUCTIVE — "delete" is permanent and irreversible. When the user refers to an agent by name, ALWAYS call action:"get" first to confirm the correct agent_id before deleting. +- "run" is fire-and-forget. Returns trigger_uuid — no run-status query exists, treat successful enqueue as the only signal. +- Agent state is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED only appears as the return value of action:"delete". + +USAGE EXAMPLES: +- AI create: { "action": "create", "prompt": "Run my daily standup every weekday at 9am." } +- Manual create:{ "action": "create_blank", "name": "Standup Bot", "role": "Project Manager", "gender": "female" } +- Fetch one: { "action": "get", "agent_id": "42" } +- List mine: { "action": "get" } +- Rename: { "action": "update", "agent_id": "7", "name": "New Name" } +- Activate: { "action": "activate", "agent_id": "7" } +- Deactivate: { "action": "deactivate", "agent_id": "7" } +- Run: { "action": "run", "agent_id": "7" } +- Delete: { "action": "delete", "agent_id": "7" } + +RELATED TOOLS: +- agent_catalog — browse available trigger types and skills before wiring them to an agent +- manage_agent_triggers — manage which triggers fire this agent automatically +- manage_agent_skills — manage which skills this agent can perform +- manage_agent_knowledge — manage which boards/docs this agent has access to`; + } + + getInputSchema() { + return manageAgentToolSchema; + } + + protected async executeInternal(input: ToolInputType): Promise> { + switch (input.action) { + case 'create': + return this.handleCreate(input); + case 'create_blank': + return this.handleCreateBlank(input); + case 'get': + return this.handleGet(input); + case 'update': + return this.handleUpdate(input); + case 'delete': + return this.handleDelete(input); + case 'activate': + return this.handleActivate(input); + case 'deactivate': + return this.handleDeactivate(input); + case 'run': + return this.handleRun(input); + } + } + + private async handleCreate(input: ToolInputType): Promise> { + if (!input.prompt) { + throw new Error('manage_agent action:"create" requires "prompt". For a manually configured agent, use action:"create_blank".'); + } + try { + const variables: CreateAgentMutationVariables = { input: { prompt: input.prompt, agent_model: input.agent_model } }; + const res = await this.mondayApi.request(createAgentMutation, variables, { versionOverride: 'dev' }); + if (!res.create_agent?.id) { + throw new Error('monday platform agent creation returned no id'); + } + return { + content: { + message: `monday platform agent ${res.create_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${res.create_agent.id}" to activate it`, + agent: res.create_agent, + }, + }; + } catch (error) { + rethrowWithContext(error, 'create monday platform agent'); + } + } + + private async handleCreateBlank(input: ToolInputType): Promise> { + try { + const blankInput: NonNullable = {}; + if (input.name !== undefined) blankInput.name = input.name; + if (input.role !== undefined) blankInput.role = input.role; + if (input.role_description !== undefined) blankInput.role_description = input.role_description; + if (input.avatar_url !== undefined) blankInput.avatar_url = input.avatar_url; + if (input.gender !== undefined) blankInput.gender = input.gender; + if (input.background_color !== undefined) blankInput.background_color = input.background_color; + if (input.user_prompt !== undefined) blankInput.user_prompt = input.user_prompt; + + const variables: CreateBlankAgentMutationVariables = { input: blankInput }; + const res = await this.mondayApi.request(createBlankAgentMutation, variables, { versionOverride: 'dev' }); + if (!res.create_blank_agent?.id) { + throw new Error('monday platform agent creation returned no id'); + } + return { + content: { + message: `monday platform agent ${res.create_blank_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${res.create_blank_agent.id}" to activate it`, + agent: res.create_blank_agent, + }, + }; + } catch (error) { + rethrowWithContext(error, 'create blank monday platform agent'); + } + } + + private async handleGet(input: ToolInputType): Promise> { + if (input.agent_id !== undefined) { + try { + const { agents } = await this.mondayApi.request( + getAgentsQuery, + { ids: [input.agent_id] } satisfies GetAgentsQueryVariables, + { versionOverride: 'dev' }, + ); + const agent = agents?.[0]; + if (!agent) { + return { content: `monday platform agent ${input.agent_id} not found, or the authenticated user does not have access to it.` }; + } + return { content: { message: 'monday platform agent', agent } }; + } catch (error) { + rethrowWithContext(error, 'get monday platform agent'); + } + } + + try { + const { agents } = await this.mondayApi.request( + getAgentsQuery, + { limit: 100 } satisfies GetAgentsQueryVariables, + { versionOverride: 'dev' }, + ); + const list = agents ?? []; + return { + content: { + message: 'monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)', + count: list.length, + agents: list, + }, + }; + } catch (error) { + rethrowWithContext(error, 'list monday platform agents'); + } + } + + private async handleUpdate(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('manage_agent action:"update" requires "agent_id".'); + } + try { + const agentInput: UpdateAgentInput = {}; + if (input.name !== undefined) agentInput.name = input.name; + if (input.role !== undefined) agentInput.role = input.role; + if (input.role_description !== undefined) agentInput.role_description = input.role_description; + if (input.plan !== undefined) agentInput.plan = input.plan; + if (input.agent_model !== undefined) agentInput.agent_model = input.agent_model; + + if (Object.keys(agentInput).length === 0) { + throw new Error('manage_agent action:"update" requires at least one of: name, role, role_description, plan, agent_model.'); + } + + const variables: UpdateAgentMutationVariables = { id: input.agent_id, input: agentInput }; + const res = await this.mondayApi.request(updateAgentMutation, variables, { versionOverride: 'dev' }); + if (!res.update_agent) { + throw new Error('update_agent returned no data — the agent may not exist'); + } + return { content: { message: 'monday platform agent updated', agent: res.update_agent } }; + } catch (error) { + rethrowWithContext(error, 'update monday platform agent'); + } + } + + private async handleDelete(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('manage_agent action:"delete" requires "agent_id".'); + } + try { + const variables: DeleteAgentMutationVariables = { id: input.agent_id }; + const res = await this.mondayApi.request(deleteAgentMutation, variables, { versionOverride: 'dev' }); + if (!res.delete_agent?.id) { + throw new Error('monday platform agent delete returned no id'); + } + return { content: { message: `monday platform agent ${res.delete_agent.id} deleted`, agent: res.delete_agent } }; + } catch (error) { + rethrowWithContext(error, 'delete monday platform agent'); + } + } + + private async handleActivate(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('manage_agent action:"activate" requires "agent_id".'); + } + try { + const res = await this.mondayApi.request( + activateAgentMutation, + { id: input.agent_id } satisfies ActivateAgentMutationVariables, + { versionOverride: 'dev' }, + ); + return { content: { message: 'Agent activated.', success: res.activate_agent?.success ?? false } }; + } catch (error) { + rethrowWithContext(error, 'activate monday platform agent'); + } + } + + private async handleDeactivate(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('manage_agent action:"deactivate" requires "agent_id".'); + } + try { + const variables: DeactivateAgentMutationVariables = { id: input.agent_id, inactive_reason: InactiveReason.DeactivatedByUser }; + const res = await this.mondayApi.request(deactivateAgentMutation, variables, { versionOverride: 'dev' }); + return { content: { message: 'Agent deactivated.', success: res.deactivate_agent?.success ?? false } }; + } catch (error) { + rethrowWithContext(error, 'deactivate monday platform agent'); + } + } + + private async handleRun(input: ToolInputType): Promise> { + if (!input.agent_id) { + throw new Error('manage_agent action:"run" requires "agent_id".'); + } + try { + const res = await this.mondayApi.request( + runAgentMutation, + { id: input.agent_id } satisfies RunAgentMutationVariables, + { versionOverride: 'dev' }, + ); + if (!res.run_agent) { + throw new Error('run_agent returned no data — the agent run may not have been enqueued'); + } + return { content: { message: 'Agent run enqueued.', trigger_uuid: res.run_agent.trigger_uuid } }; + } catch (error) { + rethrowWithContext(error, 'run monday platform agent'); + } + } +} diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts index 2c335206..b9bcdd02 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/agents-tools/shared/agents.graphql.dev.ts @@ -1,6 +1,8 @@ import { gql } from 'graphql-request'; -const agentFieldsFragment = gql` +// ─── Shared fragment ────────────────────────────────────────────────────────── + +export const agentFieldsFragment = gql` fragment AgentFields on Agent { id kind @@ -21,6 +23,8 @@ const agentFieldsFragment = gql` } `; +// ─── Agent CRUD ─────────────────────────────────────────────────────────────── + export const getAgentsQuery = gql` ${agentFieldsFragment} @@ -51,6 +55,16 @@ export const createBlankAgentMutation = gql` } `; +export const updateAgentMutation = gql` + ${agentFieldsFragment} + + mutation updateAgent($id: ID!, $input: UpdateAgentInput!) { + update_agent(id: $id, input: $input) { + ...AgentFields + } + } +`; + export const deleteAgentMutation = gql` ${agentFieldsFragment} @@ -60,3 +74,118 @@ export const deleteAgentMutation = gql` } } `; + +// ─── State mutations ────────────────────────────────────────────────────────── + +export const activateAgentMutation = gql` + mutation activateAgent($id: ID!) { + activate_agent(id: $id) { + success + } + } +`; + +export const deactivateAgentMutation = gql` + mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason) { + deactivate_agent(id: $id, inactive_reason: $inactive_reason) { + success + } + } +`; + +export const runAgentMutation = gql` + mutation runAgent($id: ID!) { + run_agent(id: $id) { + trigger_uuid + } + } +`; + +// ─── Capabilities — triggers ────────────────────────────────────────────────── + +export const getAgentActiveTriggersQuery = gql` + query getAgentActiveTriggers($agent_id: ID!) { + agent_active_triggers(agent_id: $agent_id) { + node_id + block_reference_id + name + description + field_summary + } + } +`; + +export const addTriggerToAgentMutation = gql` + mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) { + add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) { + success + } + } +`; + +export const removeTriggerFromAgentMutation = gql` + mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) { + remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) { + success + } + } +`; + +// ─── Capabilities — skills ──────────────────────────────────────────────────── + +export const addSkillToAgentMutation = gql` + mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!) { + add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) { + success + } + } +`; + +export const removeSkillFromAgentMutation = gql` + mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) { + remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) { + success + } + } +`; + +// ─── Catalog ────────────────────────────────────────────────────────────────── + +export const getAgentTriggersCatalogQuery = gql` + query getAgentTriggersCatalog($block_reference_ids: [ID!]) { + agent_triggers_catalog(block_reference_ids: $block_reference_ids) { + block_reference_id + name + description + field_schemas { + field_key + value_schema + } + required_fields { + field_key + depends_on + optional + } + } + } +`; + +export const getAgentSkillsCatalogQuery = gql` + query getAgentSkillsCatalog { + agent_skills_catalog { + id + name + description + } + } +`; + +export const createAgentSkillMutation = gql` + mutation createAgentSkill($name: String!, $content: String!, $description: String) { + create_agent_skill(name: $name, content: $content, description: $description) { + id + name + description + } + } +`; diff --git a/packages/agent-toolkit/src/core/tools/platform-api-tools/index.ts b/packages/agent-toolkit/src/core/tools/platform-api-tools/index.ts index 645d58d4..df663878 100644 --- a/packages/agent-toolkit/src/core/tools/platform-api-tools/index.ts +++ b/packages/agent-toolkit/src/core/tools/platform-api-tools/index.ts @@ -67,9 +67,11 @@ import { GetAssetUploadUrlTool } from './get-asset-upload-url-tool/get-asset-upl import { FinalizeAssetUploadTool } from './finalize-asset-upload-tool/finalize-asset-upload-tool'; import { LinkBoardItemsWorkflowTool } from './link-board-items-workflow-tool/link-board-items-workflow-tool'; import { FetchFileContentTool } from './fetch-file-content-tool/fetch-file-content-tool'; -import { GetAgentTool } from './agents-tools/get-agent/get-agent-tool'; -import { CreateAgentTool } from './agents-tools/create-agent/create-agent-tool'; -import { DeleteAgentTool } from './agents-tools/delete-agent/delete-agent-tool'; +import { ManageAgentTool } from './agents-tools/manage-agent/manage-agent-tool'; +import { ManageAgentTriggersTool } from './agents-tools/manage-agent-triggers/manage-agent-triggers-tool'; +import { ManageAgentSkillsTool } from './agents-tools/manage-agent-skills/manage-agent-skills-tool'; +import { ManageAgentKnowledgeTool } from './agents-tools/manage-agent-knowledge/manage-agent-knowledge-tool'; +import { AgentCatalogTool } from './agents-tools/agent-catalog/agent-catalog-tool'; import { ListAutomationsTool } from './workflows-tools/list-workflows/list-workflows-tool'; import { ManageWorkflowsTool } from './workflows-tools/manage-workflows/manage-workflows-tool'; import { CreateAutomationTool } from './workflows-tools/create-automation/create-automation-tool'; @@ -145,9 +147,11 @@ export const allGraphqlApiTools: BaseMondayApiToolConstructor[] = [ LinkBoardItemsWorkflowTool, FetchFileContentTool, // monday Platform Agents (subgraph still on dev API version) - GetAgentTool, - CreateAgentTool, - DeleteAgentTool, + ManageAgentTool, + ManageAgentTriggersTool, + ManageAgentSkillsTool, + ManageAgentKnowledgeTool, + AgentCatalogTool, // Workflows (subgraph still on dev API version) ListAutomationsTool, ManageWorkflowsTool, diff --git a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/gql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/gql.ts index 8d990ba1..06ceb3f5 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/gql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/gql.ts @@ -14,11 +14,27 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size */ type Documents = { + "\n query getAgentKnowledge($id: ID!) {\n agent_knowledge(id: $id) {\n resources {\n resource_id\n scope_type\n permission_type\n }\n files {\n id\n file_name\n file_type\n }\n }\n }\n": typeof types.GetAgentKnowledgeDocument, + "\n mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n": typeof types.AddAgentResourceAccessDocument, + "\n mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) {\n remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) {\n success\n }\n }\n": typeof types.RemoveAgentResourceAccessDocument, + "\n mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n": typeof types.UpdateAgentResourceAccessDocument, "\n fragment AgentFields on Agent {\n id\n kind\n state\n profile {\n name\n role\n role_description\n avatar_url\n background_color\n }\n goal\n plan\n user_prompt\n version_id\n created_at\n updated_at\n }\n": typeof types.AgentFieldsFragmentDoc, "\n \n\n query getAgents($ids: [ID!], $limit: Int) {\n agents(ids: $ids, limit: $limit) {\n ...AgentFields\n }\n }\n": typeof types.GetAgentsDocument, "\n \n\n mutation createAgent($input: CreateAgentInput!) {\n create_agent(input: $input) {\n ...AgentFields\n }\n }\n": typeof types.CreateAgentDocument, "\n \n\n mutation createBlankAgent($input: CreateBlankAgentInput) {\n create_blank_agent(input: $input) {\n ...AgentFields\n }\n }\n": typeof types.CreateBlankAgentDocument, + "\n \n\n mutation updateAgent($id: ID!, $input: UpdateAgentInput!) {\n update_agent(id: $id, input: $input) {\n ...AgentFields\n }\n }\n": typeof types.UpdateAgentDocument, "\n \n\n mutation deleteAgent($id: ID!) {\n delete_agent(id: $id) {\n ...AgentFields\n }\n }\n": typeof types.DeleteAgentDocument, + "\n mutation activateAgent($id: ID!) {\n activate_agent(id: $id) {\n success\n }\n }\n": typeof types.ActivateAgentDocument, + "\n mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason) {\n deactivate_agent(id: $id, inactive_reason: $inactive_reason) {\n success\n }\n }\n": typeof types.DeactivateAgentDocument, + "\n mutation runAgent($id: ID!) {\n run_agent(id: $id) {\n trigger_uuid\n }\n }\n": typeof types.RunAgentDocument, + "\n query getAgentActiveTriggers($agent_id: ID!) {\n agent_active_triggers(agent_id: $agent_id) {\n node_id\n block_reference_id\n name\n description\n field_summary\n }\n }\n": typeof types.GetAgentActiveTriggersDocument, + "\n mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) {\n add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) {\n success\n }\n }\n": typeof types.AddTriggerToAgentDocument, + "\n mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) {\n remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) {\n success\n }\n }\n": typeof types.RemoveTriggerFromAgentDocument, + "\n mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!) {\n add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n": typeof types.AddSkillToAgentDocument, + "\n mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) {\n remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n": typeof types.RemoveSkillFromAgentDocument, + "\n query getAgentTriggersCatalog($block_reference_ids: [ID!]) {\n agent_triggers_catalog(block_reference_ids: $block_reference_ids) {\n block_reference_id\n name\n description\n field_schemas {\n field_key\n value_schema\n }\n required_fields {\n field_key\n depends_on\n optional\n }\n }\n }\n": typeof types.GetAgentTriggersCatalogDocument, + "\n query getAgentSkillsCatalog {\n agent_skills_catalog {\n id\n name\n description\n }\n }\n": typeof types.GetAgentSkillsCatalogDocument, + "\n mutation createAgentSkill($name: String!, $content: String!, $description: String) {\n create_agent_skill(name: $name, content: $content, description: $description) {\n id\n name\n description\n }\n }\n": typeof types.CreateAgentSkillDocument, "\n mutation DeleteObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columnIds: [ID!]!) {\n delete_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_ids: $columnIds) {\n id\n name\n description\n parent_id\n revision\n }\n }\n": typeof types.DeleteObjectSchemaColumnsDocument, "\n mutation CompleteUpload($input: CompleteUploadInput!) {\n complete_upload(input: $input) {\n id\n filename\n content_type\n file_size\n url\n created_at\n filelink\n }\n }\n": typeof types.CompleteUploadDocument, "\n mutation CreateUpload($input: CreateUploadInput!) {\n create_upload(input: $input) {\n upload_id\n parts {\n part_number\n url\n size_range_start\n size_range_end\n }\n part_size\n expires_at\n }\n }\n": typeof types.CreateUploadDocument, @@ -33,11 +49,27 @@ type Documents = { "\n mutation CreateFormSubmission(\n $form_token: String!\n $answers: [FormAnswerInput!]!\n $form_timezone_offset: Int!\n $password: String\n $tags: [TagInput!]\n ) {\n create_form_submission(\n form_token: $form_token\n answers: $answers\n form_timezone_offset: $form_timezone_offset\n password: $password\n tags: $tags\n ) {\n id\n }\n }\n": typeof types.CreateFormSubmissionDocument, }; const documents: Documents = { + "\n query getAgentKnowledge($id: ID!) {\n agent_knowledge(id: $id) {\n resources {\n resource_id\n scope_type\n permission_type\n }\n files {\n id\n file_name\n file_type\n }\n }\n }\n": types.GetAgentKnowledgeDocument, + "\n mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n": types.AddAgentResourceAccessDocument, + "\n mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) {\n remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) {\n success\n }\n }\n": types.RemoveAgentResourceAccessDocument, + "\n mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n": types.UpdateAgentResourceAccessDocument, "\n fragment AgentFields on Agent {\n id\n kind\n state\n profile {\n name\n role\n role_description\n avatar_url\n background_color\n }\n goal\n plan\n user_prompt\n version_id\n created_at\n updated_at\n }\n": types.AgentFieldsFragmentDoc, "\n \n\n query getAgents($ids: [ID!], $limit: Int) {\n agents(ids: $ids, limit: $limit) {\n ...AgentFields\n }\n }\n": types.GetAgentsDocument, "\n \n\n mutation createAgent($input: CreateAgentInput!) {\n create_agent(input: $input) {\n ...AgentFields\n }\n }\n": types.CreateAgentDocument, "\n \n\n mutation createBlankAgent($input: CreateBlankAgentInput) {\n create_blank_agent(input: $input) {\n ...AgentFields\n }\n }\n": types.CreateBlankAgentDocument, + "\n \n\n mutation updateAgent($id: ID!, $input: UpdateAgentInput!) {\n update_agent(id: $id, input: $input) {\n ...AgentFields\n }\n }\n": types.UpdateAgentDocument, "\n \n\n mutation deleteAgent($id: ID!) {\n delete_agent(id: $id) {\n ...AgentFields\n }\n }\n": types.DeleteAgentDocument, + "\n mutation activateAgent($id: ID!) {\n activate_agent(id: $id) {\n success\n }\n }\n": types.ActivateAgentDocument, + "\n mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason) {\n deactivate_agent(id: $id, inactive_reason: $inactive_reason) {\n success\n }\n }\n": types.DeactivateAgentDocument, + "\n mutation runAgent($id: ID!) {\n run_agent(id: $id) {\n trigger_uuid\n }\n }\n": types.RunAgentDocument, + "\n query getAgentActiveTriggers($agent_id: ID!) {\n agent_active_triggers(agent_id: $agent_id) {\n node_id\n block_reference_id\n name\n description\n field_summary\n }\n }\n": types.GetAgentActiveTriggersDocument, + "\n mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) {\n add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) {\n success\n }\n }\n": types.AddTriggerToAgentDocument, + "\n mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) {\n remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) {\n success\n }\n }\n": types.RemoveTriggerFromAgentDocument, + "\n mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!) {\n add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n": types.AddSkillToAgentDocument, + "\n mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) {\n remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n": types.RemoveSkillFromAgentDocument, + "\n query getAgentTriggersCatalog($block_reference_ids: [ID!]) {\n agent_triggers_catalog(block_reference_ids: $block_reference_ids) {\n block_reference_id\n name\n description\n field_schemas {\n field_key\n value_schema\n }\n required_fields {\n field_key\n depends_on\n optional\n }\n }\n }\n": types.GetAgentTriggersCatalogDocument, + "\n query getAgentSkillsCatalog {\n agent_skills_catalog {\n id\n name\n description\n }\n }\n": types.GetAgentSkillsCatalogDocument, + "\n mutation createAgentSkill($name: String!, $content: String!, $description: String) {\n create_agent_skill(name: $name, content: $content, description: $description) {\n id\n name\n description\n }\n }\n": types.CreateAgentSkillDocument, "\n mutation DeleteObjectSchemaColumns($objectSchemaId: ID, $objectSchemaName: String, $columnIds: [ID!]!) {\n delete_object_schema_columns(object_schema_id: $objectSchemaId, object_schema_name: $objectSchemaName, column_ids: $columnIds) {\n id\n name\n description\n parent_id\n revision\n }\n }\n": types.DeleteObjectSchemaColumnsDocument, "\n mutation CompleteUpload($input: CompleteUploadInput!) {\n complete_upload(input: $input) {\n id\n filename\n content_type\n file_size\n url\n created_at\n filelink\n }\n }\n": types.CompleteUploadDocument, "\n mutation CreateUpload($input: CreateUploadInput!) {\n create_upload(input: $input) {\n upload_id\n parts {\n part_number\n url\n size_range_start\n size_range_end\n }\n part_size\n expires_at\n }\n }\n": types.CreateUploadDocument, @@ -66,6 +98,22 @@ const documents: Documents = { */ export function graphql(source: string): unknown; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query getAgentKnowledge($id: ID!) {\n agent_knowledge(id: $id) {\n resources {\n resource_id\n scope_type\n permission_type\n }\n files {\n id\n file_name\n file_type\n }\n }\n }\n"): (typeof documents)["\n query getAgentKnowledge($id: ID!) {\n agent_knowledge(id: $id) {\n resources {\n resource_id\n scope_type\n permission_type\n }\n files {\n id\n file_name\n file_type\n }\n }\n }\n"]; +/** + * 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 addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n"): (typeof documents)["\n mutation addAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n add_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n"]; +/** + * 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 removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) {\n remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) {\n success\n }\n }\n"): (typeof documents)["\n mutation removeAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!) {\n remove_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type) {\n success\n }\n }\n"]; +/** + * 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 updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n"): (typeof documents)["\n mutation updateAgentResourceAccess($id: ID!, $resource_id: ID!, $scope_type: KnowledgeScope!, $permission_type: KnowledgePermission!) {\n update_agent_resource_access(id: $id, resource_id: $resource_id, scope_type: $scope_type, permission_type: $permission_type) {\n success\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -82,10 +130,58 @@ export function graphql(source: "\n \n\n mutation createAgent($input: CreateAg * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n \n\n mutation createBlankAgent($input: CreateBlankAgentInput) {\n create_blank_agent(input: $input) {\n ...AgentFields\n }\n }\n"): (typeof documents)["\n \n\n mutation createBlankAgent($input: CreateBlankAgentInput) {\n create_blank_agent(input: $input) {\n ...AgentFields\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n \n\n mutation updateAgent($id: ID!, $input: UpdateAgentInput!) {\n update_agent(id: $id, input: $input) {\n ...AgentFields\n }\n }\n"): (typeof documents)["\n \n\n mutation updateAgent($id: ID!, $input: UpdateAgentInput!) {\n update_agent(id: $id, input: $input) {\n ...AgentFields\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n \n\n mutation deleteAgent($id: ID!) {\n delete_agent(id: $id) {\n ...AgentFields\n }\n }\n"): (typeof documents)["\n \n\n mutation deleteAgent($id: ID!) {\n delete_agent(id: $id) {\n ...AgentFields\n }\n }\n"]; +/** + * 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 activateAgent($id: ID!) {\n activate_agent(id: $id) {\n success\n }\n }\n"): (typeof documents)["\n mutation activateAgent($id: ID!) {\n activate_agent(id: $id) {\n success\n }\n }\n"]; +/** + * 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 deactivateAgent($id: ID!, $inactive_reason: InactiveReason) {\n deactivate_agent(id: $id, inactive_reason: $inactive_reason) {\n success\n }\n }\n"): (typeof documents)["\n mutation deactivateAgent($id: ID!, $inactive_reason: InactiveReason) {\n deactivate_agent(id: $id, inactive_reason: $inactive_reason) {\n success\n }\n }\n"]; +/** + * 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 runAgent($id: ID!) {\n run_agent(id: $id) {\n trigger_uuid\n }\n }\n"): (typeof documents)["\n mutation runAgent($id: ID!) {\n run_agent(id: $id) {\n trigger_uuid\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query getAgentActiveTriggers($agent_id: ID!) {\n agent_active_triggers(agent_id: $agent_id) {\n node_id\n block_reference_id\n name\n description\n field_summary\n }\n }\n"): (typeof documents)["\n query getAgentActiveTriggers($agent_id: ID!) {\n agent_active_triggers(agent_id: $agent_id) {\n node_id\n block_reference_id\n name\n description\n field_summary\n }\n }\n"]; +/** + * 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 addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) {\n add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) {\n success\n }\n }\n"): (typeof documents)["\n mutation addTriggerToAgent($agent_id: ID!, $block_reference_id: ID!, $field_values: JSON) {\n add_trigger_to_agent(agent_id: $agent_id, block_reference_id: $block_reference_id, field_values: $field_values) {\n success\n }\n }\n"]; +/** + * 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 removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) {\n remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) {\n success\n }\n }\n"): (typeof documents)["\n mutation removeTriggerFromAgent($agent_id: ID!, $node_id: ID!) {\n remove_trigger_from_agent(agent_id: $agent_id, node_id: $node_id) {\n success\n }\n }\n"]; +/** + * 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 addSkillToAgent($agent_id: ID!, $skill_id: ID!) {\n add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n"): (typeof documents)["\n mutation addSkillToAgent($agent_id: ID!, $skill_id: ID!) {\n add_skill_to_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n"]; +/** + * 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 removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) {\n remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n"): (typeof documents)["\n mutation removeSkillFromAgent($agent_id: ID!, $skill_id: ID!) {\n remove_skill_from_agent(agent_id: $agent_id, skill_id: $skill_id) {\n success\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query getAgentTriggersCatalog($block_reference_ids: [ID!]) {\n agent_triggers_catalog(block_reference_ids: $block_reference_ids) {\n block_reference_id\n name\n description\n field_schemas {\n field_key\n value_schema\n }\n required_fields {\n field_key\n depends_on\n optional\n }\n }\n }\n"): (typeof documents)["\n query getAgentTriggersCatalog($block_reference_ids: [ID!]) {\n agent_triggers_catalog(block_reference_ids: $block_reference_ids) {\n block_reference_id\n name\n description\n field_schemas {\n field_key\n value_schema\n }\n required_fields {\n field_key\n depends_on\n optional\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query getAgentSkillsCatalog {\n agent_skills_catalog {\n id\n name\n description\n }\n }\n"): (typeof documents)["\n query getAgentSkillsCatalog {\n agent_skills_catalog {\n id\n name\n description\n }\n }\n"]; +/** + * 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 createAgentSkill($name: String!, $content: String!, $description: String) {\n create_agent_skill(name: $name, content: $content, description: $description) {\n id\n name\n description\n }\n }\n"): (typeof documents)["\n mutation createAgentSkill($name: String!, $content: String!, $description: String) {\n create_agent_skill(name: $name, content: $content, description: $description) {\n id\n name\n description\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.dev/graphql.ts b/packages/agent-toolkit/src/monday-graphql/generated/graphql.dev/graphql.ts index 3acb01c0..4ba267cc 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 @@ -62,6 +62,15 @@ export type Account = { tier?: Maybe; }; +/** The account-level default work schedule and time off schedule */ +export type AccountAvailabilityDefaults = { + __typename?: 'AccountAvailabilityDefaults'; + /** The account-level default time off schedule */ + time_off: TimeOff; + /** The account-level default work schedule */ + work_schedule: WorkSchedule; +}; + /** Account context information. */ export type AccountContext = { __typename?: 'AccountContext'; @@ -254,6 +263,8 @@ export type AddedAllocatedResource = { /** An AI agent on the monday.com platform */ export type Agent = { __typename?: 'Agent'; + /** The LLM model the agent uses */ + agent_model?: Maybe; /** The timestamp when the agent was created. Null on create mutation responses — use the agent query to fetch it. */ created_at?: Maybe; /** The goal or objective of the agent */ @@ -262,10 +273,14 @@ export type Agent = { id: Scalars['ID']['output']; /** The kind of agent (personal, account-level, or external) */ kind?: Maybe; + /** Knowledge files attached to the agent. Only populated on create mutation responses. */ + knowledge?: Maybe>; /** The execution plan in markdown format, describing the agent capabilities and operating principles */ plan?: Maybe; /** The agent profile with name, role, and avatar */ profile?: Maybe; + /** Reference IDs of skills attached to this agent. Use agent_skills_catalog to resolve full name and description. */ + skill_ids: Array; /** The current state of the agent */ state?: Maybe; /** The timestamp when the agent was last updated. Null on create mutation responses — use the agent query to fetch it. */ @@ -276,6 +291,21 @@ export type Agent = { version_id: Scalars['ID']['output']; }; +/** A trigger currently attached to an agent */ +export type AgentActiveTrigger = { + __typename?: 'AgentActiveTrigger'; + /** The trigger type, matching block_reference_id in the catalog */ + block_reference_id: Scalars['ID']['output']; + /** Description of the trigger type */ + description?: Maybe; + /** Human-readable summary of how this trigger is configured (e.g. "type=Weekly, hour=9, days=3/4") */ + field_summary?: Maybe; + /** Display name of the trigger type */ + name: Scalars['String']['output']; + /** Stable identifier of this trigger instance — use this as node_id when calling remove_trigger_from_agent */ + node_id: Scalars['ID']['output']; +}; + /** The kind of AI agent */ export enum AgentKind { /** An account-level agent available to the entire account */ @@ -286,6 +316,75 @@ export enum AgentKind { Personal = 'PERSONAL' } +/** The full knowledge configuration of an agent — resources (boards/docs) and uploaded files */ +export type AgentKnowledge = { + __typename?: 'AgentKnowledge'; + /** Files uploaded as agent knowledge */ + files?: Maybe>; + /** Boards and docs the agent has access to */ + resources?: Maybe>; +}; + +/** A knowledge entry attached to an agent */ +export type AgentKnowledgeEntry = { + __typename?: 'AgentKnowledgeEntry'; + /** The unique identifier of the knowledge entry */ + id: Scalars['ID']['output']; + /** Reference ID for the knowledge entry */ + knowledge_reference_id?: Maybe; + /** File metadata for this knowledge entry */ + metadata?: Maybe; + /** The source type of this knowledge entry */ + source_type?: Maybe; + /** The current state of this knowledge entry */ + state?: Maybe; +}; + +/** A file uploaded as agent knowledge */ +export type AgentKnowledgeFile = { + __typename?: 'AgentKnowledgeFile'; + /** Original file name */ + file_name?: Maybe; + /** File extension (e.g. pdf, docx, csv) */ + file_type?: Maybe; + /** Unique identifier of the knowledge file */ + id?: Maybe; +}; + +/** Metadata about a knowledge file attachment */ +export type AgentKnowledgeMetadata = { + __typename?: 'AgentKnowledgeMetadata'; + /** Cloudinary asset ID for image files */ + asset_id?: Maybe; + /** Original name of the uploaded file */ + file_name?: Maybe; + /** MIME type of the file */ + file_type?: Maybe; +}; + +/** A monday.com board or doc the agent has been granted access to */ +export type AgentKnowledgeResource = { + __typename?: 'AgentKnowledgeResource'; + /** The permission level the agent has on this resource */ + permission_type?: Maybe; + /** The ID of the board or doc */ + resource_id?: Maybe; + /** Whether this resource is a board or a doc */ + scope_type?: Maybe; +}; + +/** Supported LLM models for an agent */ +export enum AgentModel { + /** Claude Opus 4.7 (claude-opus-4-7) */ + ClaudeOpus_4_7 = 'CLAUDE_OPUS_4_7', + /** Claude Sonnet 4.6 (claude-sonnet-4-6) */ + ClaudeSonnet_4_6 = 'CLAUDE_SONNET_4_6', + /** Gemini 2.5 Flash */ + Gemini_2_5Flash = 'GEMINI_2_5_FLASH', + /** GPT 5.2 */ + Gpt_5_2 = 'GPT_5_2' +} + /** Visual and role identity of an agent. */ export type AgentProfile = { __typename?: 'AgentProfile'; @@ -301,6 +400,17 @@ export type AgentProfile = { role_description?: Maybe; }; +/** A skill available for agents to use — browse the catalog, then attach by id. */ +export type AgentSkillCatalogEntry = { + __typename?: 'AgentSkillCatalogEntry'; + /** What this skill does */ + description?: Maybe; + /** Stable reference ID — pass this to add_skill_to_agent / remove_skill_from_agent */ + id?: Maybe; + /** Display name of the skill */ + name?: Maybe; +}; + /** The current state of an agent */ export enum AgentState { /** The agent is active and can be triggered and executed */ @@ -315,6 +425,28 @@ export enum AgentState { Inactive = 'INACTIVE' } +/** Result of an agent state change operation */ +export type AgentStateResult = { + __typename?: 'AgentStateResult'; + /** Whether the operation succeeded */ + success?: Maybe; +}; + +/** An available trigger type that can be attached to an agent */ +export type AgentTriggerCatalogEntry = { + __typename?: 'AgentTriggerCatalogEntry'; + /** Pass this value as block_reference_id when calling add_trigger_to_agent */ + block_reference_id: Scalars['ID']['output']; + /** What this trigger does */ + description?: Maybe; + /** Structured value schemas for fields you can populate directly in field_values */ + field_schemas: Array; + /** Display name of the trigger */ + name: Scalars['String']['output']; + /** Selection fields (e.g. board picker) that must be provided in field_values as { value, label } pairs */ + required_fields: Array; +}; + export type AggregateBasicAggregationResult = { __typename?: 'AggregateBasicAggregationResult'; result?: Maybe; @@ -430,6 +562,16 @@ export enum AggregateHistoryFunction { CountDistinct = 'COUNT_DISTINCT', /** Count items. */ CountItems = 'COUNT_ITEMS', + /** Truncate a date or datetime value to the day. */ + DateTruncDay = 'DATE_TRUNC_DAY', + /** Truncate a date or datetime value to the month. */ + DateTruncMonth = 'DATE_TRUNC_MONTH', + /** Truncate a date or datetime value to the quarter. */ + DateTruncQuarter = 'DATE_TRUNC_QUARTER', + /** Truncate a date or datetime value to the week. */ + DateTruncWeek = 'DATE_TRUNC_WEEK', + /** Truncate a date or datetime value to the year. */ + DateTruncYear = 'DATE_TRUNC_YEAR', /** Get the first value. */ First = 'FIRST', /** Get the ID. */ @@ -1272,6 +1414,8 @@ export type AppType = { updated_at?: Maybe; /** The latest version type */ version_type?: Maybe; + /** All versions of this app with their current status. Use this to poll promotion progress. */ + versions?: Maybe>; /** The webhook endpoint URL */ webhook_url?: Maybe; }; @@ -1298,6 +1442,18 @@ export type AppVersion = { type?: Maybe; }; +/** The lifecycle status of an app version */ +export enum AppVersionStatus { + /** Version has been superseded by a newer version */ + Deprecated = 'DEPRECATED', + /** Version is in development and not yet live */ + Draft = 'DRAFT', + /** Version is live and available to users */ + Live = 'LIVE', + /** Version is in the process of being promoted */ + Promoting = 'PROMOTING' +} + /** The app monetization information for the current account */ export type AppsMonetizationInfo = { __typename?: 'AppsMonetizationInfo'; @@ -1402,6 +1558,8 @@ export enum AssetHolder { Item = 'ITEM', /** An update/post entity. */ Post = 'POST', + /** A vibe application entity. */ + VibeApp = 'VIBE_APP', /** A workspace entity. */ Workspace = 'WORKSPACE' } @@ -1482,6 +1640,16 @@ export type AssignTeamOwnersResult = { team?: Maybe; }; +/** Input for assigning a work schedule and/or time off schedule to multiple users */ +export type AssignUserAvailabilityInput = { + /** ID of the time off schedule to assign; omit to leave unchanged */ + time_off_id?: InputMaybe; + /** IDs of the users to assign schedules to */ + user_ids: Array; + /** ID of the work schedule to assign; omit to leave unchanged */ + work_schedule_id?: InputMaybe; +}; + /** A board where the user has item assignments. */ export type AssignedBoard = { __typename?: 'AssignedBoard'; @@ -1493,6 +1661,36 @@ export type AssignedBoard = { board_id?: Maybe; }; +/** Structured result data for a completed or partially-completed operation */ +export type AsyncJobResult = { + __typename?: 'AsyncJobResult'; + /** Operation-specific details (failed item IDs, report URLs, etc.) */ + details?: Maybe; + /** Items that failed */ + failed?: Maybe; + /** Successfully processed items */ + succeeded?: Maybe; + /** Total items in the operation */ + total?: Maybe; +}; + +/** Status information for an async job */ +export type AsyncJobStatus = { + __typename?: 'AsyncJobStatus'; + /** When the job was created (ISO 8601) */ + created_at?: Maybe; + /** Error description if the job failed */ + error?: Maybe; + /** Unique job identifier */ + id?: Maybe; + /** Structured result data for completed or partially-completed operations */ + result?: Maybe; + /** Current job status */ + status?: Maybe; + /** When the job was last updated (ISO 8601) */ + updated_at?: Maybe; +}; + /** Represents a single attribute type option for a resource */ export type Attribute = { __typename?: 'Attribute'; @@ -1628,6 +1826,15 @@ export type AutomationData = { recipe?: Maybe; }; +/** A page of automations with cursor for pagination */ +export type AutomationsPage = { + __typename?: 'AutomationsPage'; + /** Opaque cursor for fetching the next page. Null if no more results. */ + cursor?: Maybe; + /** The automations in this page */ + items?: Maybe>; +}; + /** Base field type implementation */ export type BaseFieldType = FieldType & { __typename?: 'BaseFieldType'; @@ -1847,6 +2054,8 @@ export type Board = { access_level: BoardAccessLevel; /** The board log events. */ activity_logs?: Maybe>>; + /** Automations for this board */ + automations: AutomationsPage; /** The board's folder unique identifier. */ board_folder_id?: Maybe; /** The board's kind (public / private / share). */ @@ -1944,6 +2153,13 @@ export type BoardActivity_LogsArgs = { }; +/** A monday.com board. */ +export type BoardAutomationsArgs = { + cursor?: InputMaybe; + limit?: InputMaybe; +}; + + /** A monday.com board. */ export type BoardColumnsArgs = { capabilities?: InputMaybe>>; @@ -2025,6 +2241,69 @@ export enum BoardAttributes { Name = 'name' } +/** A board automation */ +export type BoardAutomation = { + __typename?: 'BoardAutomation'; + /** Whether the automation is active */ + active?: Maybe; + /** Creation timestamp */ + created_at?: Maybe; + /** Automation description */ + description?: Maybe; + /** Automation ID */ + id?: Maybe; + /** Automation importance level */ + importance?: Maybe; + /** Notice message for the automation */ + notice_message?: Maybe; + /** Template reference ID if created from template */ + template_reference_id?: Maybe; + /** Automation title */ + title?: Maybe; + /** Last update timestamp */ + updated_at?: Maybe; + /** Creator user ID */ + user_id?: Maybe; + /** Workflow block definitions */ + workflow_blocks?: Maybe; + /** Host data (board ID and type) */ + workflow_host_data?: Maybe; + /** Workflow variable definitions */ + workflow_variables?: Maybe; +}; + +/** Input for creating a board automation. Provide template_reference_id to create from a template, or workflow_blocks and workflow_variables for a direct creation. */ +export type BoardAutomationCreateInput = { + /** Board ID to host the automation */ + board_id: Scalars['String']['input']; + /** Automation description */ + description?: InputMaybe; + /** Template reference ID (for template-based creation) */ + template_reference_id?: InputMaybe; + /** Automation title */ + title: Scalars['String']['input']; + /** Automation block definitions (for direct creation) */ + workflow_blocks?: InputMaybe; + /** Automation variable definitions (for direct creation) */ + workflow_variables?: InputMaybe; + /** Template variable values (for template-based creation) */ + workflow_variables_values?: InputMaybe; +}; + +/** Result of creating a board automation */ +export type BoardAutomationCreateResult = { + __typename?: 'BoardAutomationCreateResult'; + /** The ID of the created automation */ + workflow_id?: Maybe; +}; + +/** Result of deleting a board automation */ +export type BoardAutomationDeleteResult = { + __typename?: 'BoardAutomationDeleteResult'; + /** Whether the deletion was successful */ + is_success?: Maybe; +}; + /** Basic role names for board permissions. Each role grants different levels of access to the board. */ export enum BoardBasicRoleName { /** @@ -2443,6 +2722,437 @@ export enum CalculatedFunction { Sum = 'SUM' } +/** Additional quota allocated beyond the base plan limit */ +export type CampaignsAdditionalQuota = { + __typename?: 'CampaignsAdditionalQuota'; + /** Amount of additional quota consumed */ + consumed?: Maybe; + /** Timestamp when additional quota expires */ + expired_at?: Maybe; + /** Additional quota limit */ + limit?: Maybe; +}; + +/** A campaign analytics event */ +export type CampaignsAnalyticsEvent = { + __typename?: 'CampaignsAnalyticsEvent'; + /** ID of the associated campaign */ + campaign_id?: Maybe; + /** Timestamp when the event was created */ + created_at?: Maybe; + /** Unique event identifier */ + id?: Maybe; + /** Unique identifier for this event */ + identifier?: Maybe; + /** Parsed reason for bounced emails */ + parsed_reason?: Maybe; + /** Type of analytics event */ + type?: Maybe; + /** ID of the associated variant */ + variant_id?: Maybe; +}; + +/** Types of analytics events for campaigns */ +export enum CampaignsAnalyticsEventKind { + /** Email was bounced back */ + EmailBounced = 'EMAIL_BOUNCED', + /** Link in email was clicked by recipient */ + EmailClicked = 'EMAIL_CLICKED', + /** Email was successfully delivered */ + EmailDelivered = 'EMAIL_DELIVERED', + /** Email was dropped before sending */ + EmailDropped = 'EMAIL_DROPPED', + /** Email was opened by recipient */ + EmailOpened = 'EMAIL_OPENED', + /** Recipient marked email as spam */ + EmailRecipientComplaint = 'EMAIL_RECIPIENT_COMPLAINT', + /** Recipient unsubscribed */ + EmailRecipientUnsubscribed = 'EMAIL_RECIPIENT_UNSUBSCRIBED', + /** Email was sent */ + EmailSent = 'EMAIL_SENT' +} + +/** Paginated analytics events response */ +export type CampaignsAnalyticsEventsResponse = { + __typename?: 'CampaignsAnalyticsEventsResponse'; + /** List of analytics events */ + data?: Maybe>; + /** Token for pagination to retrieve next batch */ + next_token?: Maybe; +}; + +/** Aggregated analytics summary for an email campaign */ +export type CampaignsAnalyticsSummary = { + __typename?: 'CampaignsAnalyticsSummary'; + /** Total number of link clicks */ + total_clicks?: Maybe; + /** Total emails delivered */ + total_delivered?: Maybe; + /** Total number of email opens */ + total_opens?: Maybe; + /** Total emails sent */ + total_sent?: Maybe; + /** Total spam complaints */ + total_spam_reports?: Maybe; + /** Total emails not delivered */ + total_undelivered?: Maybe; + /** Total unsubscribes */ + total_unsubscribes?: Maybe; + /** Number of unique clicks */ + unique_clicks?: Maybe; + /** Number of unique opens */ + unique_opens?: Maybe; + /** Number of unique spam reports */ + unique_spam_reports?: Maybe; + /** Number of unique undelivered */ + unique_undelivered?: Maybe; + /** Number of unique unsubscribes */ + unique_unsubscribes?: Maybe; +}; + +/** A brand color in a brand kit */ +export type CampaignsBrandColor = { + __typename?: 'CampaignsBrandColor'; + /** Hex color code */ + hex_code?: Maybe; + /** Unique color identifier */ + id?: Maybe; + /** Category of the brand color */ + kind?: Maybe; +}; + +/** Types of brand colors */ +export enum CampaignsBrandColorKind { + /** Accent brand color */ + Accent = 'ACCENT', + /** Other brand color */ + Other = 'OTHER', + /** Primary brand color */ + Primary = 'PRIMARY', + /** Secondary brand color */ + Secondary = 'SECONDARY', + /** Text color */ + Text = 'TEXT' +} + +/** A brand image in a brand kit */ +export type CampaignsBrandImage = { + __typename?: 'CampaignsBrandImage'; + /** Alternative text for the image */ + alt_text?: Maybe; + /** Height of the image in pixels */ + height?: Maybe; + /** Unique image identifier */ + id?: Maybe; + /** Category of the brand image */ + kind?: Maybe; + /** MIME type of the image */ + mime_type?: Maybe; + /** Name of the image */ + name?: Maybe; + /** URL to access the image */ + remote_url?: Maybe; + /** Size of the image in bytes */ + size_bytes?: Maybe; + /** Current status of the image */ + status?: Maybe; + /** Width of the image in pixels */ + width?: Maybe; +}; + +/** Types of brand images */ +export enum CampaignsBrandImageKind { + /** Image attachment */ + Attachment = 'ATTACHMENT', + /** Primary brand logo */ + PrimaryLogo = 'PRIMARY_LOGO', + /** Secondary brand logo */ + SecondaryLogo = 'SECONDARY_LOGO' +} + +/** Status of a brand image */ +export enum CampaignsBrandImageStatus { + /** Image confirmed */ + Confirmed = 'CONFIRMED', + /** Image pending confirmation */ + Pending = 'PENDING' +} + +/** A brand kit containing colors and images for an account */ +export type CampaignsBrandKit = { + __typename?: 'CampaignsBrandKit'; + /** Colors in this brand kit */ + brand_colors?: Maybe>; + /** Images in this brand kit */ + brand_images?: Maybe>; + /** Timestamp when the brand kit was created */ + created_at?: Maybe; + /** Unique brand kit identifier */ + id?: Maybe; + /** Name of the brand kit */ + name?: Maybe; + /** Status of the brand kit */ + status?: Maybe; + /** Timestamp when the brand kit was last updated */ + updated_at?: Maybe; +}; + +/** Company information for email campaigns */ +export type CampaignsCompanyInformation = { + __typename?: 'CampaignsCompanyInformation'; + /** Company name */ + company_name?: Maybe; + /** Company website URL */ + company_website_url?: Maybe; + /** Physical mailing address */ + physical_address?: Maybe; + /** Whether physical address was AI generated */ + physical_address_is_ai_generated?: Maybe; +}; + +/** Marketing contacts board configuration */ +export type CampaignsContactsBoard = { + __typename?: 'CampaignsContactsBoard'; + /** ID of the board */ + board_id?: Maybe; + /** ID of the email column */ + email_column_id?: Maybe; + /** ID of the email subscription column */ + email_subscription_column_id?: Maybe; +}; + +/** An email campaign */ +export type CampaignsEmailCampaign = { + __typename?: 'CampaignsEmailCampaign'; + /** Timestamp when the campaign was created */ + created_at?: Maybe; + /** User who created the campaign */ + created_by?: Maybe; + /** Unique campaign identifier */ + id?: Maybe; + /** Name of the campaign */ + name?: Maybe; + /** Preview text shown in email clients */ + preview_text?: Maybe; + /** When the campaign should be sent */ + schedule_type?: Maybe; + /** Scheduled time for sending */ + scheduled_time?: Maybe; + /** IDs of segments targeted by this campaign */ + segment_ids?: Maybe>; + /** Timestamp when the campaign was sent */ + sent_on?: Maybe; + /** Current status of the campaign */ + status?: Maybe; + /** Email subject line */ + subject?: Maybe; + /** Analytics summary for the campaign */ + summary?: Maybe; + /** HTML content of the email template */ + template_html?: Maybe; + /** Timestamp when the campaign was last updated */ + updated_at?: Maybe; +}; + +/** A market insight */ +export type CampaignsInsight = { + __typename?: 'CampaignsInsight'; + /** Rationale for the target audience */ + audience_rationale?: Maybe; + /** Assessment of campaign worthiness */ + campaign_worthiness?: Maybe; + /** Timestamp when the insight was created */ + created_at?: Maybe; + /** Unique insight identifier */ + id?: Maybe; + /** Raw context data for the insight */ + raw_context?: Maybe; + /** Source of the insight */ + source?: Maybe; + /** Current status of the insight */ + status?: Maybe; + /** Summary of the insight */ + summary?: Maybe; + /** Target audience for the insight */ + target_audience?: Maybe; + /** Timestamp of the insight */ + timestamp?: Maybe; + /** Title of the insight */ + title?: Maybe; + /** Classification type of the insight */ + type?: Maybe; + /** Timestamp when the insight was last updated */ + updated_at?: Maybe; +}; + +/** Classification type of an insight */ +export enum CampaignsInsightClassificationKind { + /** Competitor move insight */ + CompetitorMove = 'COMPETITOR_MOVE', + /** Crisis or event insight */ + CrisisEvent = 'CRISIS_EVENT', + /** Customer behavior insight */ + CustomerBehavior = 'CUSTOMER_BEHAVIOR', + /** Emerging technology insight */ + EmergingTechnology = 'EMERGING_TECHNOLOGY', + /** Market trend insight */ + MarketTrend = 'MARKET_TREND', + /** Other type of insight */ + Other = 'OTHER', + /** Product launch insight */ + ProductLaunch = 'PRODUCT_LAUNCH', + /** Regulatory change insight */ + RegulatoryChange = 'REGULATORY_CHANGE' +} + +/** Status of an insight */ +export enum CampaignsInsightStatusKind { + /** active */ + Active = 'ACTIVE', + /** consumed */ + Consumed = 'CONSUMED', + /** dismissed */ + Dismissed = 'DISMISSED' +} + +/** A physical mailing address */ +export type CampaignsPhysicalAddress = { + __typename?: 'CampaignsPhysicalAddress'; + /** City name */ + city?: Maybe; + /** Country name */ + country?: Maybe; + /** State or province */ + state?: Maybe; + /** Street address */ + street_address?: Maybe; + /** ZIP code */ + zip_code?: Maybe; +}; + +/** When the campaign should be sent */ +export enum CampaignsScheduleKind { + /** Send at scheduled time */ + Later = 'LATER', + /** Send immediately */ + Now = 'NOW' +} + +/** An audience segment */ +export type CampaignsSegment = { + __typename?: 'CampaignsSegment'; + /** Timestamp when the segment was created */ + created_at?: Maybe; + /** User who created the segment */ + created_by?: Maybe; + /** Entity ID from the data source */ + data_source_entity_id?: Maybe; + /** Entity type from the data source */ + data_source_entity_type?: Maybe; + /** ID of the data source */ + data_source_id?: Maybe; + /** Unique segment identifier */ + id?: Maybe; + /** Name of the segment */ + name?: Maybe; + /** Type of the segment */ + type?: Maybe; + /** Timestamp when the segment was last updated */ + updated_at?: Maybe; +}; + +/** Marketing channels settings for the current account */ +export type CampaignsSettings = { + __typename?: 'CampaignsSettings'; + /** Company information settings */ + company_information?: Maybe; + /** Marketing contacts board configuration */ + contacts_board?: Maybe; + /** Unsubscribe footer configuration */ + unsubscribe_footer?: Maybe; + /** Unsubscribe page configuration */ + unsubscribe_page?: Maybe; +}; + +/** Status of a campaign */ +export enum CampaignsStatusKind { + /** Campaign is blocked */ + Blocked = 'BLOCKED', + /** Campaign is in draft state */ + Draft = 'DRAFT', + /** Campaign failed */ + Failed = 'FAILED', + /** Campaign is being generated */ + Generating = 'GENERATING', + /** Campaign is ongoing */ + Ongoing = 'ONGOING', + /** Campaign is on hold */ + OnHold = 'ON_HOLD', + /** Campaign is processing */ + Processing = 'PROCESSING', + /** Campaign is ready to send */ + ReadyToSend = 'READY_TO_SEND', + /** Campaign is scheduled for later */ + Scheduled = 'SCHEDULED', + /** Campaign is currently sending */ + Sending = 'SENDING', + /** Campaign has been sent */ + Sent = 'SENT' +} + +/** Unsubscribe footer configuration */ +export type CampaignsUnsubscribeFooter = { + __typename?: 'CampaignsUnsubscribeFooter'; + /** Whether removal is allowed */ + allow_removal?: Maybe; +}; + +/** Unsubscribe page configuration */ +export type CampaignsUnsubscribePage = { + __typename?: 'CampaignsUnsubscribePage'; + /** Page body content */ + body?: Maybe; + /** Page title */ + title?: Maybe; +}; + +/** Account-level usage metrics across all resource domains */ +export type CampaignsUsage = { + __typename?: 'CampaignsUsage'; + /** Email sends usage metrics */ + email_sends?: Maybe; + /** Whether this is a touch account */ + is_touch_account?: Maybe; + /** Marketing contacts usage metrics */ + marketing_contacts?: Maybe; +}; + +/** Usage metrics for a single resource domain */ +export type CampaignsUsageForDomain = { + __typename?: 'CampaignsUsageForDomain'; + /** Additional quota allocation */ + additional_quota?: Maybe; + /** Whether usage is blocked due to limit exceeded */ + blocked?: Maybe; + /** Amount of resources consumed */ + consumed?: Maybe; + /** End date of the billing period */ + end_date?: Maybe; + /** Metering bucket and service identifier */ + key?: Maybe; + /** Resource usage limit */ + limit?: Maybe; +}; + +/** Identifies the metering bucket and service */ +export type CampaignsUsageKey = { + __typename?: 'CampaignsUsageKey'; + /** Metering bucket name */ + bucket_name?: Maybe; + /** Service name */ + service?: Maybe; +}; + /** Fields that can be overridden in a column policy */ export enum CanOverrideField { /** Allow overriding column description */ @@ -2941,6 +3651,8 @@ export type CountryValue = ColumnValue & { export type CreateAgentInput = { /** The LLM model the agent should use */ agent_model?: InputMaybe; + /** IDs of previously uploaded pending files to attach as knowledge during creation */ + pending_file_ids?: InputMaybe>; /** A description of what the agent should do — used to generate profile, goal, and plan via AI */ prompt: Scalars['String']['input']; }; @@ -3231,6 +3943,15 @@ export type CreateQuestionInput = { visible?: InputMaybe; }; +/** The result of creating a service user. */ +export type CreateServiceUserResult = { + __typename?: 'CreateServiceUserResult'; + /** The API token for the created service user. Null if token generation failed. */ + token?: Maybe; + /** The created service user. */ + user?: Maybe; +}; + export type CreateStatusColumnSettingsInput = { labels: Array; }; @@ -3287,6 +4008,26 @@ export type CreateTeamOptionsInput = { allow_empty_team?: InputMaybe; }; +/** Input for adding a non-working date entry to a time off schedule */ +export type CreateTimeOffEntryInput = { + /** End date of the non-working period in YYYY-MM-DD format */ + end: Scalars['String']['input']; + /** Optional display name for this time off entry */ + name?: InputMaybe; + /** Start date of the non-working period in YYYY-MM-DD format */ + start: Scalars['String']['input']; + /** ID of the time off schedule to add this entry to */ + time_off_id: Scalars['ID']['input']; +}; + +/** Input for creating a new time off schedule */ +export type CreateTimeOffInput = { + /** Non-working date entries to create alongside the schedule. Subsequent additions/updates use the dedicated time off entry mutations. */ + entries?: InputMaybe>; + /** Display name for the new time off schedule */ + name: Scalars['String']['input']; +}; + /** Input for initiating a file upload. */ export type CreateUploadInput = { /** The MIME content type of the file. */ @@ -3314,6 +4055,14 @@ export type CreateUploadResult = { upload_id?: Maybe; }; +/** Input for creating a new work schedule */ +export type CreateWorkScheduleInput = { + /** Per-weekday working hours; if omitted, all seven days are created as inactive */ + days?: InputMaybe>; + /** Display name for the new work schedule */ + name: Scalars['String']['input']; +}; + /** Input for creating a workflow from a template */ export type CreateWorkflowFromTemplateInput = { /** Reference ID of the creator app feature */ @@ -3585,6 +4334,15 @@ export type Dashboard = { workspace_id?: Maybe; }; +/** Aggregated result of synchronously loading all widget data for a dashboard. */ +export type DashboardDataResult = { + __typename?: 'DashboardDataResult'; + /** Identifier of the dashboard whose widgets were loaded. */ + dashboard_id?: Maybe; + /** Per-widget results for the dashboard, one entry per supported widget. */ + widgets?: Maybe>; +}; + /** Dashboard visibility. `PUBLIC` dashboards are visible to all workspace members; `PRIVATE` dashboards are only visible to invited users. */ export enum DashboardKind { Private = 'PRIVATE', @@ -3755,6 +4513,13 @@ export type DeleteWorkflowResult = { is_success: Scalars['Boolean']['output']; }; +/** Represents a document block that was successfully deleted. */ +export type DeletedDocBlock = { + __typename?: 'DeletedDocBlock'; + /** The deleted block's unique identifier. */ + id: Scalars['ID']['output']; +}; + /** A department in the account. */ export type Department = { __typename?: 'Department'; @@ -3935,9 +4700,20 @@ export type DependencyValueInput = { removed_pulse?: InputMaybe>; }; +/** An app version */ +export type DeveloperAppVersion = { + __typename?: 'DeveloperAppVersion'; + /** The unique identifier of the app version */ + id?: Maybe; + /** The current lifecycle status of this app version */ + status?: Maybe; +}; + /** A document block that was changed between two versions, including its content and what type of change occurred. */ export type DiffBlock = { __typename?: 'DiffBlock'; + /** The ID of the AI agent that made the change to this block, or null if the change was made by a user. */ + agent_id?: Maybe; /** The changes that occurred to this block (added, deleted, or changed). */ changes?: Maybe; /** The block content as a JSON string. */ @@ -3950,6 +4726,8 @@ export type DiffBlock = { summary?: Maybe; /** The type of block (e.g., text, image, list). */ type?: Maybe; + /** The ID of the user who made the change to this block, or null if not available. */ + user_id?: Maybe; }; export type DirectDocValue = ColumnValue & { @@ -3983,6 +4761,8 @@ export type DirectoryResource = { location?: Maybe; /** The name of the directory resource. */ name: Scalars['String']['output']; + /** The type of the resource (user, viewer, or guest). */ + resource_type?: Maybe; /** The skills of the directory resource. */ skills?: Maybe>; }; @@ -3997,6 +4777,16 @@ export enum DirectoryResourceAttribute { Skills = 'SKILLS' } +/** The type of a directory resource */ +export enum DirectoryResourceKind { + /** A guest user */ + Guest = 'GUEST', + /** A member or admin user */ + User = 'USER', + /** A view-only user */ + Viewer = 'VIEWER' +} + /** Paginated response containing directory resources and cursor for next page */ export type DirectoryResourcesResponse = { __typename?: 'DirectoryResourcesResponse'; @@ -4582,6 +5372,8 @@ export type ExportMarkdownResult = { export type ExportOptionsInput = { /** Header row format for CSV exports. Ignored for other formats. */ header_row?: InputMaybe; + /** Include item_id (and parent_item_id when subitems are enabled) columns at the end of CSV exports. */ + include_item_identifiers?: InputMaybe; /** Include subitems in the export */ include_subitems?: InputMaybe; /** Include updates/comments in the export */ @@ -4625,35 +5417,6 @@ export enum ExternalWidget { Table = 'TABLE' } -/** A theme produced by extracting brand identity from a URL. Extends VibeTheme with extraction metadata. */ -export type ExtractedVibeTheme = { - __typename?: 'ExtractedVibeTheme'; - /** Three representative HSL colors for the picker swatch: [primary, accent (= brand secondary), chart-3 (= primary +60° hue)]. Differs from VibeTheme.colors which uses [primary, accent, secondary]: extracted themes leave the scaffold "secondary" slot neutral, so chart-3 is substituted to give three distinct brand-related hues. */ - colors?: Maybe>; - /** Dark mode CSS token values (HSL strings keyed by CSS variable name) */ - dark?: Maybe; - /** Pass-through warnings from brand-extraction */ - extraction_notes?: Maybe>; - /** Primary font family name */ - font_family?: Maybe; - /** Secondary font family name */ - font_family_secondary?: Maybe; - /** The theme identifier (e.g. extracted_<8-char-hash>) */ - id?: Maybe; - /** User-friendly display name */ - label?: Maybe; - /** Light mode CSS token values (HSL strings keyed by CSS variable name) */ - light?: Maybe; - /** Primary logo URL for FE preview hint */ - logo_url?: Maybe; - /** Theme display name (derived from extracted brand) */ - name?: Maybe; - /** Base border radius value */ - radius?: Maybe; - /** URL the theme was extracted from */ - source_url?: Maybe; -}; - /** Information about a failed user board role update, including the user ID and the error encountered. */ export type FailedUserBoardRoleUpdate = { __typename?: 'FailedUserBoardRoleUpdate'; @@ -4696,15 +5459,11 @@ export type FieldType = { uniqueKey?: Maybe; }; -/** Implementation of a field type */ +/** An interface (app feature) that a field type implements */ export type FieldTypeImplementation = { __typename?: 'FieldTypeImplementation'; - /** Unique identifier for the implementation */ - id?: Maybe; - /** Name of the implementation */ - name?: Maybe; - /** Unique key of the app feature */ - uniqueKey?: Maybe; + /** Reference id of the app feature interface this field type implements */ + app_feature_reference_id?: Maybe; }; /** The type of relation between a field and its type */ @@ -6079,6 +6838,16 @@ export type ImportDocFromHtmlResult = { success: Scalars['Boolean']['output']; }; +/** The reason an agent is inactive */ +export enum InactiveReason { + /** The agent was deactivated due to an account-level block */ + AccountLevelBlocking = 'ACCOUNT_LEVEL_BLOCKING', + /** The agent was manually deactivated by a user */ + DeactivatedByUser = 'DEACTIVATED_BY_USER', + /** The agent was deactivated automatically because it exceeded the runs rate limit */ + RunsRateLimitExceeded = 'RUNS_RATE_LIMIT_EXCEEDED' +} + /** Interface for input field configuration */ export type InputFieldConfig = { /** Detailed description of the field */ @@ -6260,6 +7029,8 @@ export enum InvitationMethod { ServicePortalUserInvitation = 'SERVICE_PORTAL_USER_INVITATION', /** Added via single sign-on. */ Sso = 'SSO', + /** Created via system creation flow. */ + SystemCreation = 'SYSTEM_CREATION', /** Unknown invitation method. */ Unknown = 'UNKNOWN', /** Invited by another user. */ @@ -7522,6 +8293,22 @@ export type ItemsResponse = { items: Array; }; +/** Status of an async job */ +export enum JobState { + /** Job was cancelled */ + Cancelled = 'CANCELLED', + /** Job completed successfully */ + Completed = 'COMPLETED', + /** Job expired before completion */ + Expired = 'EXPIRED', + /** Job failed */ + Failed = 'FAILED', + /** Job is queued but not yet started */ + Pending = 'PENDING', + /** Job is actively executing */ + Running = 'RUNNING' +} + /** Status of a job operation. Currently supports items job status for backfill and ingest operations. */ export type JobStatus = ItemsJobStatus; @@ -7544,6 +8331,38 @@ export type KnowledgeBaseAnswer = { raw_snippets?: Maybe>; }; +/** The permission level the agent has on a resource */ +export enum KnowledgePermission { + /** Agent can read the resource */ + Read = 'READ', + /** Agent can read and write the resource */ + ReadWrite = 'READ_WRITE' +} + +/** The type of monday.com resource granted to an agent */ +export enum KnowledgeScope { + /** A monday.com board */ + Board = 'BOARD', + /** A monday.com doc */ + Doc = 'DOC' +} + +/** The source type of a knowledge entry */ +export enum KnowledgeSource { + /** Knowledge sourced from an uploaded file */ + File = 'FILE' +} + +/** The state of a knowledge entry */ +export enum KnowledgeState { + /** Knowledge is active and available for retrieval */ + Active = 'ACTIVE', + /** Knowledge has been deleted */ + Deleted = 'DELETED', + /** Knowledge is being processed */ + Pending = 'PENDING' +} + export type LastUpdatedValue = ColumnValue & { __typename?: 'LastUpdatedValue'; /** The column that this value belongs to. */ @@ -7722,6 +8541,33 @@ export type LiteBuilderContextData = { source_config?: Maybe; }; +/** A page of live workflow automations with cursor-based pagination metadata */ +export type LiveWorkflowAutomationsPage = { + __typename?: 'LiveWorkflowAutomationsPage'; + /** List of live workflow automations in this page */ + data?: Maybe>; + /** Cursor-based pagination metadata */ + page_info?: Maybe; +}; + +/** A page of live workflows with pagination metadata */ +export type LiveWorkflowsPage = { + __typename?: 'LiveWorkflowsPage'; + /** List of live workflows in this page */ + data: Array; + /** Cursor-based pagination metadata for fetching subsequent pages */ + page_info: LiveWorkflowsPageInfo; +}; + +/** Cursor-based pagination metadata for live workflows */ +export type LiveWorkflowsPageInfo = { + __typename?: 'LiveWorkflowsPageInfo'; + /** Cursor of the last item in the current page; pass as `lastId` to fetch the next page */ + end_cursor?: Maybe; + /** Whether there are more results beyond the current page */ + has_next_page: Scalars['Boolean']['output']; +}; + /** Answer for a location question. */ export type LocationAnswerInput = { /** Full formatted address. */ @@ -7980,6 +8826,8 @@ export type Meeting = { action_items?: Maybe>; /** The end time of the meeting. */ end_time: Scalars['Date']['output']; + /** A concise AI-generated gist of the meeting. */ + gist?: Maybe; /** The unique identifier of the meeting. */ id: Scalars['ID']['output']; /** The URL to view the meeting in the notetaker. */ @@ -8192,6 +9040,8 @@ export type MondayAssetDocumentSourceInput = { /** Root mutation type for the Dependencies service */ export type Mutation = { __typename?: 'Mutation'; + /** Activate an existing agent */ + activate_agent?: Maybe; /** Activate a form to make it visible to users and accept new submissions. */ activate_form?: Maybe; /** Activate a live workflow */ @@ -8200,6 +9050,8 @@ export type Mutation = { activate_managed_column?: Maybe; /** Activates the specified users. */ activate_users?: Maybe; + /** Grant an agent access to a monday.com board or doc. Creates a draft version, applies the change, and promotes to live. */ + add_agent_resource_access?: Maybe; /** Add resources to the planner without allocations */ add_allocated_resources?: Maybe>; /** Add allocations to resources that already exist on the Resource Planner */ @@ -8214,6 +9066,8 @@ export type Mutation = { add_file_to_update?: Maybe; /** Add a required column to a board */ add_required_column?: Maybe; + /** Attach a skill to an agent by its catalog id. Use agent_skills_catalog to discover available ids. */ + add_skill_to_agent?: Maybe; /** * Add subscribers to a board. * @deprecated use add_users_to_board instead @@ -8225,6 +9079,8 @@ export type Mutation = { add_teams_to_board?: Maybe>>; /** Add teams to a workspace. */ add_teams_to_workspace?: Maybe>>; + /** Adds a trigger to an agent. Creates a draft if needed, applies the change, and promotes to live in one call. Returns { success: true } on success. Use agent_active_triggers to read the updated trigger list. Get available trigger types and field schemas from agent_triggers_catalog. */ + add_trigger_to_agent?: Maybe; /** Add subscribers to a board. */ add_users_to_board?: Maybe>>; /** Add users to team. */ @@ -8245,6 +9101,8 @@ export type Mutation = { assign_department_owner?: Maybe; /** Assigns the specified users as owners of the specified team. */ assign_team_owners?: Maybe; + /** Assign the same work schedule and time off schedule to multiple users; maximum 100 user IDs per call. Returns one result per user, allowing partial success. */ + assign_user_availability?: Maybe>; /** Creates a new dropdown column in a board that is linked to a managed column. The column data and settings are controlled by the managed column. Title, description, and dropdown-specific settings (limit_select, label_limit_count) can be overridden locally. */ attach_dropdown_managed_column?: Maybe; /** Creates a new status column in a board that is linked to a managed column. The column data and settings are controlled by the managed column. Only title and description can be overridden locally. */ @@ -8297,6 +9155,8 @@ export type Mutation = { convert_board_to_project?: Maybe; /** Create an agent from a prompt. AI generates the profile, goal, and plan — expect ~20s for completion. created_at and updated_at are null in the response; use the agent query to fetch them. */ create_agent?: Maybe; + /** Create a new skill for the account. The skill will appear in agent_skills_catalog and can be attached to any agent via add_skill_to_agent. */ + create_agent_skill?: Maybe; /** Creates a new app with the specified configuration. */ create_app?: Maybe; /** Create a new app feature. */ @@ -8307,6 +9167,8 @@ export type Mutation = { create_blank_agent?: Maybe; /** Create a new board. */ create_board?: Maybe; + /** Create a board automation. Provide template_reference_id to create from a template, or workflow_blocks and workflow_variables for a direct creation. */ + create_board_automation: BoardAutomationCreateResult; /** Creates a board relation column. */ create_board_relation_column?: Maybe; /** Generic mutation for creating any column type with validation. Supports creating column with properties like title, description, and type-specific defaults/settings. The mutation validates input against the column type's schema before applying changes. Use get_column_type_schema query to understand available properties for each column type. */ @@ -8370,6 +9232,8 @@ export type Mutation = { create_portfolio?: Maybe; /** Create a new project in monday.com from scratch. This mutation initiates asynchronous project creation with comprehensive customization options including: privacy settings (private/public - share is currently not supported), optional companions like Resource Planner for enhanced project management capabilities, workspace assignment for organizational structure, folder placement for better organization, and template selection for predefined project structures. Since project creation is asynchronous, you can optionally provide a callback_url where the project ID will be sent via POST request once creation completes. The callback will receive: { is_success: boolean, process_id: string, project_id?: number }. Returns a process_id for tracking the creation request. */ create_project?: Maybe; + /** Creates a new service user with a read-only API token. */ + create_service_user?: Maybe; /** Creates a new status column with strongly typed settings. Status columns allow users to track item progress through customizable labels (e.g., "Working on it", "Done", "Stuck"). This mutation is specifically for status/color columns and provides type-safe creation with label configuration. */ create_status_column?: Maybe; /** Create managed column of type status mutation. */ @@ -8380,6 +9244,10 @@ export type Mutation = { create_task?: Maybe; /** Creates a new team. */ create_team?: Maybe; + /** Create one or more named time off schedules for the account; maximum 100 inputs per call */ + create_time_off?: Maybe>; + /** Add one or more non-working date entries to a time off schedule; maximum 100 inputs per call */ + create_time_off_entry?: Maybe>; create_timeline_item?: Maybe; create_update?: Maybe; /** Initiate a file upload. Returns presigned upload URLs and an upload_id. */ @@ -8394,8 +9262,14 @@ export type Mutation = { create_webhook?: Maybe; /** Create a new widget. */ create_widget?: Maybe; + /** Create one or more named work schedules for the account; maximum 100 inputs per call */ + create_work_schedule?: Maybe>; + /** Create a new empty workflow in the given workspace and return its identifiers. */ + create_workflow: WorkflowBuilderCreateResult; /** Create a new workspace. */ create_workspace?: Maybe; + /** Deactivate an existing agent */ + deactivate_agent?: Maybe; /** Deactivate a form to hide it from users and stop accepting submissions. Form data is preserved. */ deactivate_form?: Maybe; /** Deactivate a live workflow */ @@ -8414,6 +9288,8 @@ export type Mutation = { delete_article?: Maybe; /** Delete a board. */ delete_board?: Maybe; + /** Delete a board automation by ID. */ + delete_board_automation: BoardAutomationDeleteResult; /** Deletes a column from a board. Cannot delete mandatory columns (e.g., name column). */ delete_column?: Maybe; delete_custom_activity?: Maybe; @@ -8425,6 +9301,8 @@ export type Mutation = { delete_doc?: Maybe; /** Delete a document block */ delete_doc_block?: Maybe; + /** Deletes multiple document blocks in a single operation. Maximum 100 blocks per request. */ + delete_doc_blocks?: Maybe>; /** Delete entity ID mappings by old IDs for a migration job. */ delete_entity_id_mappings?: Maybe; /** Remove an object from favorites */ @@ -8462,6 +9340,10 @@ export type Mutation = { delete_teams_from_board?: Maybe>>; /** Delete teams from a workspace. */ delete_teams_from_workspace?: Maybe>>; + /** Soft-delete one or more time off schedules; maximum 100 IDs per call */ + delete_time_off?: Maybe>; + /** Soft-delete one or more time off entries; maximum 100 IDs per call */ + delete_time_off_entry?: Maybe>; delete_timeline_item?: Maybe; delete_update?: Maybe; /** Delete users from a workspace. */ @@ -8474,6 +9356,8 @@ export type Mutation = { delete_webhook?: Maybe; /** Delete an existing widget. */ delete_widget?: Maybe; + /** Soft-delete one or more work schedules; maximum 100 IDs per call */ + delete_work_schedule?: Maybe>; /** Delete workspace. */ delete_workspace?: Maybe; /** Detach boards from their object schemas. */ @@ -8512,28 +9396,42 @@ export type Mutation = { pin_to_top: Update; /** Process an event through the task engine AI. Returns true when accepted. */ process_events?: Maybe; + /** Promotes the latest draft app version of an app to live. Promotion is asynchronous — poll the returned version's status field (via the app query) until it transitions to LIVE. Only app collaborators can perform this action. */ + promote_app?: Maybe; /** Publishes an article with the specified object ID. Allows setting privacy level, target folder, and managing subscribers (users and teams). Returns the updated article metadata. */ publish_article?: Maybe; /** Publishes object out of draft state. Returns {success: true} on success, {success: false} on failure. */ publish_object?: Maybe; /** Reconcile the current user tasks board with latest source item changes. */ reconcile_with_items?: Maybe; + /** Revokes all existing tokens and generates a new API token for a service user. */ + regenerate_service_user_token?: Maybe; + /** Remove a board or doc from an agent. Creates a draft, removes the access, and promotes to live. */ + remove_agent_resource_access?: Maybe; /** Removes connected boards from a board relation column. */ remove_board_relation_connected_boards?: Maybe>; /** Remove mock app subscription for the current account */ remove_mock_app_subscription?: Maybe; /** Remove a required column from a board */ remove_required_column?: Maybe; + /** Detach a skill from an agent by its catalog id. */ + remove_skill_from_agent?: Maybe; /** Removes the specified users as owners of the specified team. */ remove_team_owners?: Maybe; + /** Removes a trigger from an agent by its node_id. Creates a draft if needed, applies the change, and promotes to live in one call. Returns { success: true } on success. Use agent_active_triggers to verify the trigger is gone. Get node_id values from the agent_active_triggers query. */ + remove_trigger_from_agent?: Maybe; /** Remove users from team. */ remove_users_from_team?: Maybe; /** Restore an entity from a migration job */ restore_entity?: Maybe; + /** Revokes all API tokens for a service user. */ + revoke_service_user_tokens?: Maybe; /** Rollback a restore to undo the workspace creation in the target account */ rollback_restore?: Maybe; /** Rollback a snapshot to allow creating a new one for the same entity */ rollback_snapshot?: Maybe; + /** Trigger a manual run for an existing agent. This is an async fire-and-forget operation — a successful response means the run was accepted and enqueued, not that it has completed or succeeded. Use trigger_uuid to correlate the execution in downstream events or future status endpoints. */ + run_agent?: Maybe; /** Create a workflow template for an account */ save_workflow_as_template?: Maybe; /** @@ -8553,6 +9451,8 @@ export type Mutation = { shorten_form_url?: Maybe; /** Unassigns owners from a department. */ unassign_department_owners?: Maybe; + /** Remove explicit work schedule and/or time off assignments from multiple users; maximum 100 user IDs per call. Returns one result per user, allowing partial success. */ + unassign_user_availability?: Maybe>; /** Undo a previously completed action, or cancel one still in flight */ undo_action?: Maybe; /** Uninstalls an app from the current account. Requires account admin permission. */ @@ -8561,6 +9461,10 @@ export type Mutation = { unpin_from_top: Update; /** Unpublishes object from public state back to draft state. Returns {success: true} on success, {success: false} on failure. */ unpublish_object?: Maybe; + /** Update an agent — creates a new draft if needed, applies the changes, and publishes to live in one call */ + update_agent?: Maybe; + /** Change the permission level an agent has on an existing board or doc. Creates a draft, updates the permission, and promotes to live. */ + update_agent_resource_access?: Maybe; /** Update multiple allocations in a single batch operation. Returns per-item results. */ update_allocations?: Maybe>; /** Updates an existing app. If the app latest version is live, a new draft version is automatically created and updated. */ @@ -8643,6 +9547,10 @@ export type Mutation = { update_status_managed_column?: Maybe; /** Update an existing task by ID. */ update_task?: Maybe; + /** Update the name of a time off schedule */ + update_time_off?: Maybe; + /** Update the name or date range of one or more existing time off entries; maximum 100 inputs per call */ + update_time_off_entry?: Maybe>; /** Update board roles for multiple users. */ update_users_board_role?: Maybe; /** Updates the role of the specified users. */ @@ -8653,6 +9561,8 @@ export type Mutation = { update_view?: Maybe; /** Update an existing board table view */ update_view_table?: Maybe; + /** Update the name and/or working hours of an existing work schedule */ + update_work_schedule?: Maybe; /** Update an existing workspace. */ update_workspace?: Maybe; /** Upsert entity ID mappings for a migration job. */ @@ -8664,6 +9574,12 @@ export type Mutation = { }; +/** Root mutation type for the Dependencies service */ +export type MutationActivate_AgentArgs = { + id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationActivate_FormArgs = { formToken: Scalars['String']['input']; @@ -8688,6 +9604,15 @@ export type MutationActivate_UsersArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationAdd_Agent_Resource_AccessArgs = { + id: Scalars['ID']['input']; + permission_type: KnowledgePermission; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; +}; + + /** Root mutation type for the Dependencies service */ export type MutationAdd_Allocated_ResourcesArgs = { planner_id: Scalars['ID']['input']; @@ -8741,6 +9666,13 @@ export type MutationAdd_Required_ColumnArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationAdd_Skill_To_AgentArgs = { + agent_id: Scalars['ID']['input']; + skill_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationAdd_Subscribers_To_BoardArgs = { board_id: Scalars['ID']['input']; @@ -8773,6 +9705,14 @@ export type MutationAdd_Teams_To_WorkspaceArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationAdd_Trigger_To_AgentArgs = { + agent_id: Scalars['ID']['input']; + block_reference_id: Scalars['ID']['input']; + field_values?: InputMaybe; +}; + + /** Root mutation type for the Dependencies service */ export type MutationAdd_Users_To_BoardArgs = { board_id: Scalars['ID']['input']; @@ -8842,6 +9782,12 @@ export type MutationAssign_Team_OwnersArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationAssign_User_AvailabilityArgs = { + input: AssignUserAvailabilityInput; +}; + + /** Root mutation type for the Dependencies service */ export type MutationAttach_Dropdown_Managed_ColumnArgs = { after_column_id?: InputMaybe; @@ -9044,13 +9990,21 @@ export type MutationCreate_AgentArgs = { /** Root mutation type for the Dependencies service */ -export type MutationCreate_AppArgs = { - input: CreateAppInput; +export type MutationCreate_Agent_SkillArgs = { + content: Scalars['String']['input']; + description?: InputMaybe; + name: Scalars['String']['input']; }; /** Root mutation type for the Dependencies service */ -export type MutationCreate_App_FeatureArgs = { +export type MutationCreate_AppArgs = { + input: CreateAppInput; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationCreate_App_FeatureArgs = { app_id: Scalars['ID']['input']; app_version_id?: InputMaybe; data?: InputMaybe; @@ -9094,6 +10048,12 @@ export type MutationCreate_BoardArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Board_AutomationArgs = { + input: BoardAutomationCreateInput; +}; + + /** Root mutation type for the Dependencies service */ export type MutationCreate_Board_Relation_ColumnArgs = { after_column_id?: InputMaybe; @@ -9384,6 +10344,13 @@ export type MutationCreate_ProjectArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Service_UserArgs = { + name: Scalars['String']['input']; + title?: InputMaybe; +}; + + /** Root mutation type for the Dependencies service */ export type MutationCreate_Status_ColumnArgs = { after_column_id?: InputMaybe; @@ -9426,6 +10393,18 @@ export type MutationCreate_TeamArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Time_OffArgs = { + inputs: Array; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Time_Off_EntryArgs = { + inputs: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationCreate_Timeline_ItemArgs = { content?: InputMaybe; @@ -9515,6 +10494,23 @@ export type MutationCreate_WidgetArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Work_ScheduleArgs = { + inputs: Array; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationCreate_WorkflowArgs = { + description?: InputMaybe; + folder_id?: InputMaybe; + owner_ids?: InputMaybe>; + privacy_kind?: InputMaybe; + title?: InputMaybe; + workspace_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationCreate_WorkspaceArgs = { account_product_id?: InputMaybe; @@ -9524,6 +10520,13 @@ export type MutationCreate_WorkspaceArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDeactivate_AgentArgs = { + id: Scalars['ID']['input']; + inactive_reason?: InputMaybe; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDeactivate_FormArgs = { formToken: Scalars['String']['input']; @@ -9579,6 +10582,13 @@ export type MutationDelete_BoardArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Board_AutomationArgs = { + board_id: Scalars['ID']['input']; + id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDelete_ColumnArgs = { board_id: Scalars['ID']['input']; @@ -9616,6 +10626,12 @@ export type MutationDelete_Doc_BlockArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Doc_BlocksArgs = { + block_ids: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDelete_Entity_Id_MappingsArgs = { entityType: Scalars['String']['input']; @@ -9745,6 +10761,18 @@ export type MutationDelete_Teams_From_WorkspaceArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Time_OffArgs = { + ids: Array; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Time_Off_EntryArgs = { + ids: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDelete_Timeline_ItemArgs = { id: Scalars['String']['input']; @@ -9791,6 +10819,12 @@ export type MutationDelete_WidgetArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Work_ScheduleArgs = { + ids: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDelete_WorkspaceArgs = { workspace_id: Scalars['ID']['input']; @@ -9952,6 +10986,13 @@ export type MutationProcess_EventsArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationPromote_AppArgs = { + app_id: Scalars['ID']['input']; + app_version_id?: InputMaybe; +}; + + /** Root mutation type for the Dependencies service */ export type MutationPublish_ArticleArgs = { add_subscriber_ids?: InputMaybe>; @@ -9970,6 +11011,20 @@ export type MutationPublish_ObjectArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRegenerate_Service_User_TokenArgs = { + service_user_id: Scalars['ID']['input']; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationRemove_Agent_Resource_AccessArgs = { + id: Scalars['ID']['input']; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; +}; + + /** Root mutation type for the Dependencies service */ export type MutationRemove_Board_Relation_Connected_BoardsArgs = { board_id: Scalars['ID']['input']; @@ -9993,6 +11048,13 @@ export type MutationRemove_Required_ColumnArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRemove_Skill_From_AgentArgs = { + agent_id: Scalars['ID']['input']; + skill_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationRemove_Team_OwnersArgs = { team_id: Scalars['ID']['input']; @@ -10000,6 +11062,13 @@ export type MutationRemove_Team_OwnersArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRemove_Trigger_From_AgentArgs = { + agent_id: Scalars['ID']['input']; + node_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationRemove_Users_From_TeamArgs = { team_id: Scalars['ID']['input']; @@ -10015,11 +11084,17 @@ export type MutationRestore_EntityArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRevoke_Service_User_TokensArgs = { + service_user_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationRollback_RestoreArgs = { + force?: InputMaybe; migration_job_id: Scalars['ID']['input']; restore_id: Scalars['ID']['input']; - target_account_api_token: Scalars['String']['input']; }; @@ -10030,6 +11105,12 @@ export type MutationRollback_SnapshotArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRun_AgentArgs = { + id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationSave_Workflow_As_TemplateArgs = { workflow_template_data: WorkflowTemplateInput; @@ -10093,6 +11174,12 @@ export type MutationUnassign_Department_OwnersArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationUnassign_User_AvailabilityArgs = { + input: UnassignUserAvailabilityInput; +}; + + /** Root mutation type for the Dependencies service */ export type MutationUndo_ActionArgs = { job_id: Scalars['ID']['input']; @@ -10124,6 +11211,22 @@ export type MutationUnpublish_ObjectArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationUpdate_AgentArgs = { + id: Scalars['ID']['input']; + input: UpdateAgentInput; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationUpdate_Agent_Resource_AccessArgs = { + id: Scalars['ID']['input']; + permission_type: KnowledgePermission; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; +}; + + /** Root mutation type for the Dependencies service */ export type MutationUpdate_AllocationsArgs = { planner_id: Scalars['ID']['input']; @@ -10469,6 +11572,19 @@ export type MutationUpdate_TaskArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationUpdate_Time_OffArgs = { + id: Scalars['ID']['input']; + input: UpdateTimeOffInput; +}; + + +/** Root mutation type for the Dependencies service */ +export type MutationUpdate_Time_Off_EntryArgs = { + inputs: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationUpdate_Users_Board_RoleArgs = { board_id: Scalars['ID']['input']; @@ -10525,6 +11641,13 @@ export type MutationUpdate_View_TableArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationUpdate_Work_ScheduleArgs = { + id: Scalars['ID']['input']; + input: UpdateWorkScheduleInput; +}; + + /** Root mutation type for the Dependencies service */ export type MutationUpdate_WorkspaceArgs = { attributes: UpdateWorkspaceAttributesInput; @@ -10557,6 +11680,13 @@ export type MutationUse_TemplateArgs = { template_id: Scalars['Int']['input']; }; +/** Result of a write operation that does not need to return entity data. */ +export type MutationResult = { + __typename?: 'MutationResult'; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; +}; + /** Response containing the current user's task board id */ export type MyTaskBoardResponse = { __typename?: 'MyTaskBoardResponse'; @@ -10992,6 +12122,8 @@ export type OperationInput = { /** A single option in a remote options list */ export type Option = { __typename?: 'Option'; + /** Optional icon to display alongside the option (e.g. { vibe, tooltip }) */ + icon?: Maybe; /** The display title of the option */ title?: Maybe; /** The value of the option */ @@ -11576,6 +12708,8 @@ export type Query = { __typename?: 'Query'; /** Get the connected account's information. */ account?: Maybe; + /** Returns the account-level default work schedule and time off schedule */ + account_availability_defaults?: Maybe; /** Returns all connections for the account. Requires admin privileges. */ account_connections?: Maybe>; /** Get all roles for the account */ @@ -11584,8 +12718,14 @@ export type Query = { account_trigger_statistics?: Maybe; /** Get aggregated automation runs statistics grouped by entity Ids */ account_triggers_statistics_by_entity_id?: Maybe; - /** Get an agent by its ID. Returns null if the agent does not exist or the user does not have access. */ - agent?: Maybe; + /** Returns the triggers currently attached to an agent. Use node_id from each result to remove a trigger. */ + agent_active_triggers?: Maybe>; + /** Returns the knowledge configuration of an agent — boards/docs it has access to and uploaded files. Board and doc names are not included; use the board/doc subgraph queries to resolve them. */ + agent_knowledge?: Maybe; + /** List all skills available to attach to an agent. Use the returned id to call add_skill_to_agent. */ + agent_skills_catalog?: Maybe>; + /** Returns trigger types that can be attached to an agent via add_trigger_to_agent. Pass block_reference_ids to fetch only specific entries (much faster). Only includes auto-addable triggers — 3rd-party triggers requiring OAuth or credentials are excluded. */ + agent_triggers_catalog?: Maybe>; /** List personal agents for the authenticated user. At least one filter (ids or limit) is required. */ agents?: Maybe>; /** Performs aggregation operations on board data */ @@ -11596,6 +12736,8 @@ export type Query = { all_widgets_schema?: Maybe>; /** Get sequences that the current user is allowed to enroll items to, that are connected to the provided board. Returns sequences owned by the user or sequences where the user has access to the sender connection. */ allowed_sequences_to_enroll?: Maybe>; + /** Search analytics events by identifier */ + analytics_events?: Maybe; /** Get an app by ID or slug. */ app?: Maybe; /** Get a collection of installs of an app. */ @@ -11689,20 +12831,28 @@ export type Query = { * • The `kind` field tells you whether the block is a TRIGGER, ACTION or CONDITION, which helps decide its placement in the workflow. */ blocks?: Maybe; + /** Get board automations. Filter by ids (specific automation IDs) or board_ids (up to 1 board). Omit all filters to get all account automations. */ + board_automations: AutomationsPage; /** Get board candidates based on workspace and usage type */ board_candidates?: Maybe>; /** Get all dependency predecessors for every item on a board, paginated. Each item includes its predecessor edges with dependency type and lag. */ board_dependencies?: Maybe; /** Get a collection of boards. */ boards?: Maybe>>; + /** Get the brand kit for the current account */ + brand_kit?: Maybe; /** Get the status of a bulk import items process */ bulk_import_items_status: BulkImportStatus; + /** Get a single email campaign by ID */ + campaign?: Maybe; + /** List email campaigns for the current account */ + campaigns?: Maybe>; /** Get the complexity data of your queries. */ complexity?: Maybe; /** Fetch a single connection by its unique ID. */ connection?: Maybe; /** Get board IDs that are linked to a specific connection. */ - connection_board_ids?: Maybe>; + connection_board_ids: Array; /** Returns connections for the authenticated user. Supports filtering, pagination, ordering, and partial-scope options. */ connections?: Maybe>; /** Count active workflows for a given host instance */ @@ -11762,16 +12912,25 @@ export type Query = { get_entity_snapshots?: Maybe>; /** Get workflow by ID */ get_live_workflow?: Maybe; - /** Get list of live workflows with pagination */ + /** + * Get list of live workflows with pagination + * @deprecated Use `get_live_workflows_page` for cursor-based pagination metadata (`has_next_page`, `end_cursor`). + */ get_live_workflows: Array; + /** Get a page of live workflows with cursor-based pagination metadata */ + get_live_workflows_page: LiveWorkflowsPage; /** Retrieve active account object schemas by their IDs or names. Only returns account-level object schemas (not global). Object schemas define the structure and columns of boards. If no parameters are provided, all account object schemas are returned. Pass exclude_created_by_monday: true to omit the schemas seeded by monday.com and return only schemas created by users in this account. Results are paginated using page and limit parameters. */ get_object_schemas?: Maybe>; /** Retrieve available resource attribute types with descriptions */ get_resource_attribute_types?: Maybe>; /** Fetch available attribute options for a resource attribute type */ get_resource_attributes?: Maybe; + /** Get the status history timeline for a restore entity */ + get_restore_history?: Maybe>; /** Get the entity restores */ get_restores?: Maybe>; + /** Get the status history timeline for a snapshot entity */ + get_snapshot_history?: Maybe>; /** Get the changelog of decisions that were made for a task by the My Tasks agent. */ get_task_changelog?: Maybe>; /** @@ -11786,6 +12945,10 @@ export type Query = { get_workflow_data?: Maybe; /** List of all supported workflow variable kinds with their json schemas */ get_workflow_variable_schemas: Array; + /** Get a single market insight by ID */ + insight?: Maybe; + /** List market insights for the current account */ + insights?: Maybe>; /** Intelligence data. */ intelligence?: Maybe; /** Get all dependency predecessors for a specific item, including dependency type and lag per edge */ @@ -11798,8 +12961,14 @@ export type Query = { items_page?: Maybe; /** Search items by multiple columns and values. */ items_page_by_column_values: ItemsResponse; + /** Get the status of an async job by its external ID */ + job_status: AsyncJobStatus; /** Search knowledge base snippets. */ knowledge_base_search?: Maybe; + /** Fetch a page of live workflows for the requesting account, with cursor-based pagination */ + live_workflows_page: LiveWorkflowAutomationsPage; + /** Synchronously runs the full dashboard data-fetching flow and returns the results in a single blocking call. POC: reporting (aggregated_data) widgets only. Gated by the LoadDashboardDataSync flow feature. */ + load_dashboard_data?: Maybe; /** Lookup API. Each field looks up a single entity type by name (lexical, name-only). */ lookup: LookupNamespace; /** Get managed column data. */ @@ -11824,6 +12993,14 @@ export type Query = { my_tasks?: Maybe; /** Get next pages of board's items (rows) by cursor. */ next_items_page: ItemsResponse; + /** Fetches the next page of entries for a time off schedule using a cursor from entries_page or next_time_off_entries_page */ + next_time_off_entries_page?: Maybe; + /** Fetches the next page of time off schedules using a cursor from a previous time_offs or next_time_offs_page call */ + next_time_offs_page?: Maybe; + /** Fetches the next page of user availabilities using a cursor from a previous user_availabilities or next_user_availabilities_page call */ + next_user_availabilities_page?: Maybe; + /** Fetches the next page of work schedules using a cursor from a previous work_schedules or next_work_schedules_page call */ + next_work_schedules_page?: Maybe; /** Namespace for all notetaker-related queries. */ notetaker?: Maybe; notifications?: Maybe>; @@ -11863,6 +13040,16 @@ export type Query = { search_benchmark?: Maybe; /** A query to search across all boards in the account. Returns raw json results. */ search_cross_board?: Maybe; + /** Get a single audience segment by ID */ + segment?: Maybe; + /** List audience segments for the current account */ + segments?: Maybe>; + /** Retrieves API tokens for the given service users. */ + service_user_tokens?: Maybe>; + /** Retrieves all service users in the account with their token last activity. */ + service_users?: Maybe>; + /** Get marketing channels settings for the current account */ + settings?: Maybe; /** Look up a single board with its metadata and relations for snapshot planning. */ snapshottable_board?: Maybe; /** Look up a workspace with paginated boards and overviews for snapshot planning. */ @@ -11881,6 +13068,8 @@ export type Query = { task?: Maybe; /** Get a collection of teams. */ teams?: Maybe>>; + /** Returns active time off schedules for the caller's account */ + time_offs?: Maybe; /** Fetches timeline items for a given item */ timeline?: Maybe; timeline_item?: Maybe; @@ -11891,6 +13080,10 @@ export type Query = { /** List trigger events with optional filters */ trigger_events?: Maybe; updates?: Maybe>; + /** Usage metrics for the current account */ + usage?: Maybe; + /** Returns user schedule assignments for the caller's account */ + user_availabilities?: Maybe; /** Get all user configs for the account. */ user_configs?: Maybe>; /** Returns connections that belong to the authenticated user. */ @@ -11909,6 +13102,10 @@ export type Query = { versions?: Maybe>; /** Get a collection of webhooks for the board */ webhooks?: Maybe>>; + /** Returns active work schedules for the caller's account */ + work_schedules?: Maybe; + /** Fetch workflows by IDs (max 50 per request) */ + workflows: Array; /** Get a collection of workspaces. */ workspaces?: Maybe>>; }; @@ -11939,11 +13136,23 @@ export type QueryAccount_Triggers_Statistics_By_Entity_IdArgs = { /** Root query type for the Dependencies service */ -export type QueryAgentArgs = { +export type QueryAgent_Active_TriggersArgs = { + agent_id: Scalars['ID']['input']; +}; + + +/** Root query type for the Dependencies service */ +export type QueryAgent_KnowledgeArgs = { id: Scalars['ID']['input']; }; +/** Root query type for the Dependencies service */ +export type QueryAgent_Triggers_CatalogArgs = { + block_reference_ids?: InputMaybe>; +}; + + /** Root query type for the Dependencies service */ export type QueryAgentsArgs = { ids?: InputMaybe>; @@ -11969,6 +13178,16 @@ export type QueryAllowed_Sequences_To_EnrollArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryAnalytics_EventsArgs = { + campaign_id?: InputMaybe; + event_type?: InputMaybe; + identifier: Scalars['String']['input']; + limit: Scalars['Int']['input']; + next_token?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryAppArgs = { id: Scalars['ID']['input']; @@ -12054,6 +13273,15 @@ export type QueryBlocksArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryBoard_AutomationsArgs = { + board_ids?: InputMaybe>; + cursor?: InputMaybe; + ids?: InputMaybe>; + limit?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryBoard_CandidatesArgs = { usageType: BoardUsage; @@ -12091,6 +13319,18 @@ export type QueryBulk_Import_Items_StatusArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryCampaignArgs = { + id: Scalars['ID']['input']; +}; + + +/** Root query type for the Dependencies service */ +export type QueryCampaignsArgs = { + limit?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryConnectionArgs = { id: Scalars['Int']['input']; @@ -12099,7 +13339,7 @@ export type QueryConnectionArgs = { /** Root query type for the Dependencies service */ export type QueryConnection_Board_IdsArgs = { - connectionId: Scalars['Int']['input']; + connection_id: Scalars['ID']['input']; }; @@ -12331,6 +13571,15 @@ export type QueryGet_Live_WorkflowsArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryGet_Live_Workflows_PageArgs = { + creator_app_ids?: InputMaybe>; + host_instance_id?: InputMaybe; + host_type?: InputMaybe; + pagination?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryGet_Object_SchemasArgs = { exclude_created_by_monday?: InputMaybe; @@ -12347,6 +13596,13 @@ export type QueryGet_Resource_AttributesArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryGet_Restore_HistoryArgs = { + entity_id: Scalars['ID']['input']; + migration_job_id: Scalars['ID']['input']; +}; + + /** Root query type for the Dependencies service */ export type QueryGet_RestoresArgs = { entityIds: Array; @@ -12355,6 +13611,13 @@ export type QueryGet_RestoresArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryGet_Snapshot_HistoryArgs = { + entity_id: Scalars['ID']['input']; + migration_job_id: Scalars['ID']['input']; +}; + + /** Root query type for the Dependencies service */ export type QueryGet_Task_ChangelogArgs = { task_id: Scalars['ID']['input']; @@ -12376,6 +13639,18 @@ export type QueryGet_Workflow_DataArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryInsightArgs = { + id: Scalars['ID']['input']; +}; + + +/** Root query type for the Dependencies service */ +export type QueryInsightsArgs = { + limit?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryItem_DependencyArgs = { board_id: Scalars['ID']['input']; @@ -12417,6 +13692,12 @@ export type QueryItems_Page_By_Column_ValuesArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryJob_StatusArgs = { + job_id: Scalars['ID']['input']; +}; + + /** Root query type for the Dependencies service */ export type QueryKnowledge_Base_SearchArgs = { limit?: InputMaybe; @@ -12424,6 +13705,18 @@ export type QueryKnowledge_Base_SearchArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryLive_Workflows_PageArgs = { + pagination?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryLoad_Dashboard_DataArgs = { + dashboard_id: Scalars['ID']['input']; +}; + + /** Root query type for the Dependencies service */ export type QueryManaged_ColumnArgs = { id?: InputMaybe>; @@ -12483,6 +13776,34 @@ export type QueryNext_Items_PageArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryNext_Time_Off_Entries_PageArgs = { + cursor: Scalars['String']['input']; + limit?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryNext_Time_Offs_PageArgs = { + cursor: Scalars['String']['input']; + limit?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryNext_User_Availabilities_PageArgs = { + cursor: Scalars['String']['input']; + limit?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryNext_Work_Schedules_PageArgs = { + cursor: Scalars['String']['input']; + limit?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryNotificationsArgs = { cursor?: InputMaybe; @@ -12563,6 +13884,24 @@ export type QuerySearch_Cross_BoardArgs = { }; +/** Root query type for the Dependencies service */ +export type QuerySegmentArgs = { + id: Scalars['ID']['input']; +}; + + +/** Root query type for the Dependencies service */ +export type QuerySegmentsArgs = { + limit?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryService_User_TokensArgs = { + service_user_ids: Array; +}; + + /** Root query type for the Dependencies service */ export type QuerySnapshottable_BoardArgs = { id: Scalars['ID']['input']; @@ -12619,6 +13958,14 @@ export type QueryTeamsArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryTime_OffsArgs = { + ids?: InputMaybe>; + limit?: InputMaybe; + name?: InputMaybe; +}; + + /** Root query type for the Dependencies service */ export type QueryTimelineArgs = { id: Scalars['ID']['input']; @@ -12662,6 +14009,13 @@ export type QueryUpdatesArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryUser_AvailabilitiesArgs = { + limit?: InputMaybe; + user_ids?: InputMaybe>; +}; + + /** Root query type for the Dependencies service */ export type QueryUser_ConfigsArgs = { behaviors?: InputMaybe>; @@ -12685,8 +14039,11 @@ export type QueryUser_ConnectionsArgs = { export type QueryUsersArgs = { emails?: InputMaybe>; ids?: InputMaybe>; + kind?: InputMaybe; limit?: InputMaybe; name?: InputMaybe; + newest_first?: InputMaybe; + non_active?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; status?: InputMaybe>; @@ -12722,6 +14079,20 @@ export type QueryWebhooksArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryWork_SchedulesArgs = { + ids?: InputMaybe>; + limit?: InputMaybe; + name?: InputMaybe; +}; + + +/** Root query type for the Dependencies service */ +export type QueryWorkflowsArgs = { + ids: Array; +}; + + /** Root query type for the Dependencies service */ export type QueryWorkspacesArgs = { ids?: InputMaybe>; @@ -13009,6 +14380,19 @@ export type RestoreEntityResult = { accepted?: Maybe; }; +/** A point-in-time record of a restore status change. */ +export type RestoreHistoryEntry = { + __typename?: 'RestoreHistoryEntry'; + /** The entity id (package id) of the restore. */ + entity_id: Scalars['ID']['output']; + /** The date and time this history entry was recorded. */ + recorded_at: Scalars['String']['output']; + /** The restore ID at the time this history entry was recorded. */ + restore_id: Scalars['ID']['output']; + /** The status of the restore at the time this history entry was recorded. */ + status: RestoreStatus; +}; + /** The possible statuses of a restore operation. */ export enum RestoreStatus { /** The restore failed to complete. */ @@ -13096,6 +14480,13 @@ export enum RuleOperator { StartsWithText = 'STARTS_WITH_TEXT' } +/** Confirmation that a manual agent run was accepted and enqueued. This does not reflect the outcome of the run itself — the execution happens asynchronously. In the future, trigger_uuid can be used to query run status via a dedicated endpoint. */ +export type RunAgentResult = { + __typename?: 'RunAgentResult'; + /** Correlation ID for the triggered run. Use this to track or look up the execution in downstream events or future run-status endpoints. */ + trigger_uuid?: Maybe; +}; + /** Result of saving a workflow as a template */ export type SaveWorkflowAsTemplateResult = { __typename?: 'SaveWorkflowAsTemplateResult'; @@ -13160,6 +14551,8 @@ export type SearchDocResults = { /** Board data stored in the search index. */ export type SearchIndexedBoard = { __typename?: 'SearchIndexedBoard'; + /** ID of the user who created this board. */ + creator_id?: Maybe; /** Board description. */ description?: Maybe; /** Board ID. */ @@ -13230,6 +14623,7 @@ export type SearchNamespace = { /** Per-entity search namespace. Each field searches a single entity type. */ export type SearchNamespaceBoardsArgs = { + board_ids?: InputMaybe>; date_range?: InputMaybe; limit?: InputMaybe; query: Scalars['String']['input']; @@ -13311,6 +14705,34 @@ export enum SequenceStatus { MissingConfig = 'MISSING_CONFIG' } +/** A service user in the account. */ +export type ServiceUser = { + __typename?: 'ServiceUser'; + /** When the service user was created. */ + created_at?: Maybe; + /** Whether the service user is active. */ + enabled?: Maybe; + /** The ID of the service user. */ + id?: Maybe; + /** The ID of the user who created this service user. */ + invited_by_id?: Maybe; + /** The last time the service user token was used for an API request. */ + last_token_activity?: Maybe; + /** The display name of the service user. */ + name?: Maybe; + /** The title/description of the service user. */ + title?: Maybe; +}; + +/** A service user token result. */ +export type ServiceUserToken = { + __typename?: 'ServiceUserToken'; + /** The ID of the service user. */ + service_user_id?: Maybe; + /** The API token. */ + token?: Maybe; +}; + /** Response type for detailed board permissions. Contains information about the permissions that were set. */ export type SetBoardPermissionResponse = { __typename?: 'SetBoardPermissionResponse'; @@ -13354,6 +14776,19 @@ export type ShowIfRulesInput = { rules: Array; }; +/** A point-in-time record of a snapshot status change. */ +export type SnapshotHistoryEntry = { + __typename?: 'SnapshotHistoryEntry'; + /** The entity id (package id) of the snapshot. */ + entity_id: Scalars['ID']['output']; + /** The date and time this history entry was recorded. */ + recorded_at: Scalars['String']['output']; + /** The snapshot ID at the time this history entry was recorded. */ + snapshot_id: Scalars['ID']['output']; + /** The status of the snapshot at the time this history entry was recorded. */ + status: SnapshotStatus; +}; + /** The possible statuses of a snapshot operation. */ export enum SnapshotStatus { /** The snapshot failed to complete. */ @@ -14175,6 +15610,125 @@ export enum TimeGranularity { Years = 'YEARS' } +/** A named time off schedule with non-working date entries */ +export type TimeOff = { + __typename?: 'TimeOff'; + /** ISO 8601 timestamp when this record was created */ + created_at: Scalars['Date']['output']; + /** ID of the user who created this time off schedule, null if system-generated */ + created_by?: Maybe; + /** Paginated non-working date entries in this time off schedule. Use next_time_off_entries_page as the top-level continuation query. */ + entries_page: TimeOffEntryPage; + /** Unique identifier of the time off schedule */ + id: Scalars['ID']['output']; + /** Whether this is the account-level default time off schedule */ + is_default: Scalars['Boolean']['output']; + /** Display name of the time off schedule */ + name: Scalars['String']['output']; + /** ISO 8601 timestamp when this record was last updated */ + updated_at: Scalars['Date']['output']; +}; + + +/** A named time off schedule with non-working date entries */ +export type TimeOffEntries_PageArgs = { + cursor?: InputMaybe; + limit?: InputMaybe; +}; + +/** Result of a time off schedule delete operation */ +export type TimeOffDeleteResult = { + __typename?: 'TimeOffDeleteResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** ID of the deleted time off schedule, null if the operation failed */ + id?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; +}; + +/** A non-working date entry within a time off schedule */ +export type TimeOffEntry = { + __typename?: 'TimeOffEntry'; + /** ISO 8601 timestamp when this record was created */ + created_at: Scalars['Date']['output']; + /** ID of the user who created this entry */ + created_by: Scalars['ID']['output']; + /** End date of the non-working period in YYYY-MM-DD format */ + end: Scalars['String']['output']; + /** Unique identifier of the time off entry */ + id: Scalars['ID']['output']; + /** Optional display name for this time off entry */ + name?: Maybe; + /** Start date of the non-working period in YYYY-MM-DD format */ + start: Scalars['String']['output']; + /** ID of the time off schedule this entry belongs to */ + time_off_id: Scalars['ID']['output']; + /** ISO 8601 timestamp when this record was last updated */ + updated_at: Scalars['Date']['output']; +}; + +/** Result of a time off entry delete operation */ +export type TimeOffEntryDeleteResult = { + __typename?: 'TimeOffEntryDeleteResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** ID of the deleted time off entry, null if the operation failed */ + id?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; +}; + +/** A non-working date entry to create inline with a time off schedule */ +export type TimeOffEntryInput = { + /** End date of the non-working period in YYYY-MM-DD format */ + end: Scalars['String']['input']; + /** Optional display name for this time off entry */ + name?: InputMaybe; + /** Start date of the non-working period in YYYY-MM-DD format */ + start: Scalars['String']['input']; +}; + +/** Paginated list of time off entries */ +export type TimeOffEntryPage = { + __typename?: 'TimeOffEntryPage'; + /** Opaque cursor for fetching the next page, null when no more pages exist */ + cursor?: Maybe; + /** Time off entries in this page */ + entries: Array; +}; + +/** Result of a time off entry create or update operation */ +export type TimeOffEntryResult = { + __typename?: 'TimeOffEntryResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; + /** The created or updated time off entry, null if the operation failed */ + time_off_entry?: Maybe; +}; + +/** Paginated list of time off schedules */ +export type TimeOffPage = { + __typename?: 'TimeOffPage'; + /** Opaque cursor for fetching the next page, null when no more pages exist */ + cursor?: Maybe; + /** Time off schedules in this page */ + time_offs: Array; +}; + +/** Result of a time off schedule create or update operation */ +export type TimeOffResult = { + __typename?: 'TimeOffResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; + /** The created or updated time off schedule, null if the operation failed */ + time_off?: Maybe; +}; + /** Header for a time period (label and date range). */ export type TimePeriodHeader = { __typename?: 'TimePeriodHeader'; @@ -14493,6 +16047,26 @@ export type TriggerEventsPage = { triggerEvents?: Maybe>; }; +/** Schema description for a trigger field that accepts a structured JSON value */ +export type TriggerFieldSchema = { + __typename?: 'TriggerFieldSchema'; + /** The key to use in field_values when calling add_trigger_to_agent */ + field_key: Scalars['String']['output']; + /** Human-readable description of the expected JSON shape for this field */ + value_schema: Scalars['String']['output']; +}; + +/** A selection field (e.g. board picker) required when adding this trigger */ +export type TriggerRequiredField = { + __typename?: 'TriggerRequiredField'; + /** Field keys that must be provided before this field — resolve them in order */ + depends_on: Array; + /** The key to use in field_values */ + field_key: Scalars['String']['output']; + /** Whether this field can be omitted */ + optional: Scalars['Boolean']['output']; +}; + /** Result of unassigning owners from a department. */ export type UnassignDepartmentOwnerResult = { __typename?: 'UnassignDepartmentOwnerResult'; @@ -14500,6 +16074,16 @@ export type UnassignDepartmentOwnerResult = { unassigned_users?: Maybe>; }; +/** Input for removing work schedule and/or time off assignments from multiple users */ +export type UnassignUserAvailabilityInput = { + /** Whether to remove the explicit time off schedule assignment */ + unassign_time_off?: InputMaybe; + /** Whether to remove the explicit work schedule assignment */ + unassign_work_schedule?: InputMaybe; + /** IDs of the users to remove assignments from */ + user_ids: Array; +}; + /** Result of an undo operation */ export type UndoResult = { __typename?: 'UndoResult'; @@ -14564,6 +16148,20 @@ export type UpdateViewersArgs = { page?: InputMaybe; }; +/** Input for updating an AI agent — all fields are optional; only provided fields are changed */ +export type UpdateAgentInput = { + /** The LLM model the agent should use */ + agent_model?: InputMaybe; + /** The display name of the agent */ + name?: InputMaybe; + /** The execution plan (instructions) for the agent, in markdown format */ + plan?: InputMaybe; + /** The role of the agent */ + role?: InputMaybe; + /** A description of the agent role */ + role_description?: InputMaybe; +}; + /** Result of a single allocation update operation */ export type UpdateAllocationResult = { __typename?: 'UpdateAllocationResult'; @@ -14867,6 +16465,24 @@ export type UpdateTaskInput = { title?: InputMaybe; }; +/** Input for updating an existing time off entry */ +export type UpdateTimeOffEntryInput = { + /** New end date in YYYY-MM-DD format */ + end?: InputMaybe; + /** ID of the time off entry to update */ + id: Scalars['ID']['input']; + /** New display name for the time off entry */ + name?: InputMaybe; + /** New start date in YYYY-MM-DD format */ + start?: InputMaybe; +}; + +/** Input for updating an existing time off schedule. Entries are managed via the dedicated time off entry mutations (create_time_off_entry, update_time_off_entry, delete_time_off_entry). */ +export type UpdateTimeOffInput = { + /** New display name for the time off schedule */ + name?: InputMaybe; +}; + /** Error that occurred while updating users attributes. */ export type UpdateUserAttributesError = { __typename?: 'UpdateUserAttributesError'; @@ -14933,6 +16549,14 @@ export type UpdateUsersRoleResult = { updated_users?: Maybe>; }; +/** Input for updating an existing work schedule */ +export type UpdateWorkScheduleInput = { + /** Updated per-weekday working hours */ + days?: InputMaybe>; + /** New display name for the work schedule */ + name?: InputMaybe; +}; + /** Input for updating a workflow created from a template */ export type UpdateWorkflowFromTemplateInput = { /** Detailed description of the workflow */ @@ -15158,6 +16782,37 @@ export type UserAttributesInput = { title?: InputMaybe; }; +/** A user's assigned work schedule and time off schedule */ +export type UserAvailability = { + __typename?: 'UserAvailability'; + /** The time off schedule assigned to this user, null if using account default */ + time_off?: Maybe; + /** ID of the user */ + user_id: Scalars['ID']['output']; + /** The work schedule assigned to this user, null if using account default */ + work_schedule?: Maybe; +}; + +/** Paginated list of user availability assignments */ +export type UserAvailabilityPage = { + __typename?: 'UserAvailabilityPage'; + /** Opaque cursor for fetching the next page, null when no more pages exist */ + cursor?: Maybe; + /** User availability assignments in this page */ + user_availabilities: Array; +}; + +/** Result of a single user availability assignment. Batch assign/unassign mutations return one of these per requested user, allowing partial success — successful entries have user_availability populated and success=true; failed entries have user_availability=null, success=false, and a populated error. */ +export type UserAvailabilityResult = { + __typename?: 'UserAvailabilityResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; + /** The updated user availability, null if the operation failed for this user */ + user_availability?: Maybe; +}; + /** User config of a user kind within the account. */ export type UserConfig = { __typename?: 'UserConfig'; @@ -15263,6 +16918,8 @@ export enum UserKindFilter { ProjectsApiUser = 'PROJECTS_API_USER', /** A resource directory api user user. */ ResourceDirectoryApiUser = 'RESOURCE_DIRECTORY_API_USER', + /** A service user user. */ + ServiceUser = 'SERVICE_USER', /** A sprint management api user user. */ SprintManagementApiUser = 'SPRINT_MANAGEMENT_API_USER', /** A view only user. */ @@ -15511,8 +17168,6 @@ export type VibeMutations = { document_ai_action: AiDocumentActionResponse; /** Enhance a user prompt to include AI capabilities */ enhance_prompt: EnhancedPromptResult; - /** Extract brand identity from a URL and produce a ThemeDefinition plug-compatible with presets. */ - extract_brand_theme: ExtractedVibeTheme; /** Get a presigned URL to upload a file to S3 */ file_upload_url?: Maybe; /** Rollback an AI app to an older specific version */ @@ -15547,12 +17202,6 @@ export type VibeMutationsEnhance_PromptArgs = { }; -/** Namespace for all vibe-related mutations */ -export type VibeMutationsExtract_Brand_ThemeArgs = { - url: Scalars['String']['input']; -}; - - /** Namespace for all vibe-related mutations */ export type VibeMutationsFile_Upload_UrlArgs = { file_name: Scalars['String']['input']; @@ -15658,9 +17307,9 @@ export type WebSearchConfigInput = { /** Configuration options for web search functionality */ export type WebSearchOptionsInput = { - /** Limit search results to content from the last N days */ + /** Hint to prioritize content from the last N days. Interpreted as guidance — not a hard filter. */ recencyDays?: InputMaybe; - /** Maximum number of search results to retrieve (default: 5) */ + /** Hint for max number of sources to consider (default: 5). Interpreted as guidance — the model decides retrieval breadth. */ topK?: InputMaybe; }; @@ -15723,6 +17372,24 @@ export enum WebhookEventType { SubitemDeleted = 'subitem_deleted' } +/** Day of the week */ +export enum WeekDay { + /** Friday */ + Friday = 'FRIDAY', + /** Monday */ + Monday = 'MONDAY', + /** Saturday */ + Saturday = 'SATURDAY', + /** Sunday */ + Sunday = 'SUNDAY', + /** Thursday */ + Thursday = 'THURSDAY', + /** Tuesday */ + Tuesday = 'TUESDAY', + /** Wednesday */ + Wednesday = 'WEDNESDAY' +} + export type WeekValue = ColumnValue & { __typename?: 'WeekValue'; /** The column that this value belongs to. */ @@ -15781,6 +17448,19 @@ export type WidgetParentOutput = { kind?: Maybe; }; +/** Result of loading a single widget within a dashboard data load. */ +export type WidgetResult = { + __typename?: 'WidgetResult'; + /** Loaded widget data payload; null when status is ERROR or no data is available. */ + data?: Maybe; + /** Error message describing why the widget failed to load; null on success. */ + error?: Maybe; + /** Whether the widget data loaded successfully or failed. */ + status?: Maybe; + /** Identifier of the widget this result belongs to. */ + widget_id?: Maybe; +}; + /** Information about a widget type and its JSON schema */ export type WidgetSchemaInfo = { __typename?: 'WidgetSchemaInfo'; @@ -15790,6 +17470,93 @@ export type WidgetSchemaInfo = { widget_type?: Maybe; }; +/** Outcome of loading a single widget within loadDashboardData. */ +export enum WidgetStatus { + /** Widget failed to load; see error field for details. */ + Error = 'ERROR', + /** Widget data was loaded successfully. */ + Ok = 'OK' +} + +/** A named work schedule with per-weekday working hours */ +export type WorkSchedule = { + __typename?: 'WorkSchedule'; + /** ISO 8601 timestamp when this record was created */ + created_at: Scalars['Date']['output']; + /** ID of the user who created this work schedule, null if system-generated */ + created_by?: Maybe; + /** Per-weekday working hours for this schedule */ + days: Array; + /** Unique identifier of the work schedule */ + id: Scalars['ID']['output']; + /** Whether this is the account-level default work schedule */ + is_default: Scalars['Boolean']['output']; + /** Display name of the work schedule */ + name: Scalars['String']['output']; + /** ISO 8601 timestamp when this record was last updated */ + updated_at: Scalars['Date']['output']; +}; + +/** Per-weekday working hours for a work schedule */ +export type WorkScheduleDay = { + __typename?: 'WorkScheduleDay'; + /** ISO 8601 timestamp when this record was created */ + created_at: Scalars['Date']['output']; + /** End of the working day in HH:MM format, null when is_active is false */ + end_time?: Maybe; + /** Whether this day is a working day */ + is_active: Scalars['Boolean']['output']; + /** Start of the working day in HH:MM format, null when is_active is false */ + start_time?: Maybe; + /** ISO 8601 timestamp when this record was last updated */ + updated_at: Scalars['Date']['output']; + /** Day of the week this entry applies to */ + week_day: WeekDay; +}; + +/** Working hours for a specific day of the week */ +export type WorkScheduleDayInput = { + /** End of the working day in HH:MM format. Required when is_active is true; ignored otherwise. */ + end_time?: InputMaybe; + /** Whether this day is a working day */ + is_active: Scalars['Boolean']['input']; + /** Start of the working day in HH:MM format. Required when is_active is true; ignored otherwise. */ + start_time?: InputMaybe; + /** Day of the week this entry applies to */ + week_day: WeekDay; +}; + +/** Result of a work schedule delete operation */ +export type WorkScheduleDeleteResult = { + __typename?: 'WorkScheduleDeleteResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** ID of the deleted work schedule, null if the operation failed */ + id?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; +}; + +/** Paginated list of work schedules */ +export type WorkSchedulePage = { + __typename?: 'WorkSchedulePage'; + /** Opaque cursor for fetching the next page, null when no more pages exist */ + cursor?: Maybe; + /** Work schedules in this page */ + work_schedules: Array; +}; + +/** Result of a work schedule create or update operation */ +export type WorkScheduleResult = { + __typename?: 'WorkScheduleResult'; + /** Structured error details, null if the operation succeeded */ + error?: Maybe; + /** Whether the operation succeeded */ + success: Scalars['Boolean']['output']; + /** The created or updated work schedule, null if the operation failed */ + work_schedule?: Maybe; +}; + export type Workflow = { __typename?: 'Workflow'; /** Automation ID associated with the workflow */ @@ -15824,6 +17591,42 @@ export type Workflow = { workflow_variables: Scalars['JSON']['output']; }; +/** A workflow and its steps */ +export type WorkflowAutomation = { + __typename?: 'WorkflowAutomation'; + /** Whether the workflow is currently active */ + active?: Maybe; + /** Creation timestamp */ + created_at?: Maybe; + /** Workflow description */ + description?: Maybe; + /** Workflow entity ID */ + id?: Maybe; + /** The steps that make up this workflow */ + steps?: Maybe>; + /** Workflow title */ + title?: Maybe; + /** Last update timestamp */ + updated_at?: Maybe; +}; + +/** Cursor-based pagination metadata for live workflow automation queries */ +export type WorkflowAutomationsPageInfo = { + __typename?: 'WorkflowAutomationsPageInfo'; + /** Cursor of the last item in this page; pass as last_id to fetch the next page */ + end_cursor?: Maybe; + /** Whether there are more results beyond the current page */ + has_next_page?: Maybe; +}; + +/** Cursor-based pagination parameters for workflow automation queries */ +export type WorkflowAutomationsPaginationInput = { + /** Cursor of the last item from the previous page; pass page_info.end_cursor from the previous response */ + last_id?: InputMaybe; + /** Maximum number of results to return (default 50, max 100) */ + limit?: InputMaybe; +}; + export type WorkflowBlock = { __typename?: 'WorkflowBlock'; /** Reference ID of the block */ @@ -15911,6 +17714,25 @@ export type WorkflowBuilderContextData = { hidden_input_fields_keys?: Maybe>; }; +/** Identifiers for a newly created workflow */ +export type WorkflowBuilderCreateResult = { + __typename?: 'WorkflowBuilderCreateResult'; + /** Draft workflow ID */ + workflow_draft_id?: Maybe; + /** Stable workflow entity ID */ + workflow_object_id?: Maybe; +}; + +/** Privacy level for a workflow */ +export enum WorkflowBuilderPrivacyKind { + /** Workflow is private and restricted */ + Private = 'PRIVATE', + /** Workflow is publicly accessible (Main) */ + Public = 'PUBLIC', + /** Workflow is shareable with guests outside the account */ + Shareable = 'SHAREABLE' +} + /** Customization settings for the workflow */ export type WorkflowCustomizationInput = { /** The access level for CRUD operations on an account-level workflow. Only applicable for ACCOUNT_LEVEL host type. Defaults to USER (only the creator can modify). */ @@ -15988,6 +17810,17 @@ export type WorkflowIteratorInput = { post_iterator_node_id?: InputMaybe; }; +/** A step instance within a workflow */ +export type WorkflowStep = { + __typename?: 'WorkflowStep'; + /** ID of the block type this step uses */ + block_reference_id?: Maybe; + /** Unique node ID within the workflow */ + node_id?: Maybe; + /** Display title of the step */ + title?: Maybe; +}; + /** The context where a workflow template can be accessed */ export enum WorkflowTemplateContext { /** Using this context will make the template accessible in the Lite Builder */ @@ -16054,6 +17887,14 @@ export enum WorkflowVariableSourceKind { UserConfig = 'user_config' } +/** Cursor-based pagination parameters for live workflows queries */ +export type WorkflowsPaginationInput = { + /** Cursor of the last item from the previous page; pass `page_info.end_cursor` from the previous response */ + last_id?: InputMaybe; + /** Maximum number of results to return */ + limit?: InputMaybe; +}; + /** A monday.com workspace. */ export type Workspace = { __typename?: 'Workspace'; @@ -16213,6 +18054,42 @@ export type WorldClockValue = ColumnValue & { value?: Maybe; }; +export type GetAgentKnowledgeQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type GetAgentKnowledgeQuery = { __typename?: 'Query', agent_knowledge?: { __typename?: 'AgentKnowledge', resources?: Array<{ __typename?: 'AgentKnowledgeResource', resource_id?: string | null, scope_type?: KnowledgeScope | null, permission_type?: KnowledgePermission | null }> | null, files?: Array<{ __typename?: 'AgentKnowledgeFile', id?: string | null, file_name?: string | null, file_type?: string | null }> | null } | null }; + +export type AddAgentResourceAccessMutationVariables = Exact<{ + id: Scalars['ID']['input']; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; + permission_type: KnowledgePermission; +}>; + + +export type AddAgentResourceAccessMutation = { __typename?: 'Mutation', add_agent_resource_access?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type RemoveAgentResourceAccessMutationVariables = Exact<{ + id: Scalars['ID']['input']; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; +}>; + + +export type RemoveAgentResourceAccessMutation = { __typename?: 'Mutation', remove_agent_resource_access?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type UpdateAgentResourceAccessMutationVariables = Exact<{ + id: Scalars['ID']['input']; + resource_id: Scalars['ID']['input']; + scope_type: KnowledgeScope; + permission_type: KnowledgePermission; +}>; + + +export type UpdateAgentResourceAccessMutation = { __typename?: 'Mutation', update_agent_resource_access?: { __typename?: 'MutationResult', success: boolean } | null }; + export type AgentFieldsFragment = { __typename?: 'Agent', id: string, kind?: AgentKind | null, state?: AgentState | null, goal?: string | null, plan?: string | null, user_prompt?: string | null, version_id: string, created_at?: any | null, updated_at?: any | null, profile?: { __typename?: 'AgentProfile', name?: string | null, role?: string | null, role_description?: string | null, avatar_url?: string | null, background_color?: string | null } | null }; export type GetAgentsQueryVariables = Exact<{ @@ -16237,6 +18114,14 @@ export type CreateBlankAgentMutationVariables = Exact<{ export type CreateBlankAgentMutation = { __typename?: 'Mutation', create_blank_agent?: { __typename?: 'Agent', id: string, kind?: AgentKind | null, state?: AgentState | null, goal?: string | null, plan?: string | null, user_prompt?: string | null, version_id: string, created_at?: any | null, updated_at?: any | null, profile?: { __typename?: 'AgentProfile', name?: string | null, role?: string | null, role_description?: string | null, avatar_url?: string | null, background_color?: string | null } | null } | null }; +export type UpdateAgentMutationVariables = Exact<{ + id: Scalars['ID']['input']; + input: UpdateAgentInput; +}>; + + +export type UpdateAgentMutation = { __typename?: 'Mutation', update_agent?: { __typename?: 'Agent', id: string, kind?: AgentKind | null, state?: AgentState | null, goal?: string | null, plan?: string | null, user_prompt?: string | null, version_id: string, created_at?: any | null, updated_at?: any | null, profile?: { __typename?: 'AgentProfile', name?: string | null, role?: string | null, role_description?: string | null, avatar_url?: string | null, background_color?: string | null } | null } | null }; + export type DeleteAgentMutationVariables = Exact<{ id: Scalars['ID']['input']; }>; @@ -16244,6 +18129,89 @@ export type DeleteAgentMutationVariables = Exact<{ export type DeleteAgentMutation = { __typename?: 'Mutation', delete_agent?: { __typename?: 'Agent', id: string, kind?: AgentKind | null, state?: AgentState | null, goal?: string | null, plan?: string | null, user_prompt?: string | null, version_id: string, created_at?: any | null, updated_at?: any | null, profile?: { __typename?: 'AgentProfile', name?: string | null, role?: string | null, role_description?: string | null, avatar_url?: string | null, background_color?: string | null } | null } | null }; +export type ActivateAgentMutationVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type ActivateAgentMutation = { __typename?: 'Mutation', activate_agent?: { __typename?: 'AgentStateResult', success?: boolean | null } | null }; + +export type DeactivateAgentMutationVariables = Exact<{ + id: Scalars['ID']['input']; + inactive_reason?: InputMaybe; +}>; + + +export type DeactivateAgentMutation = { __typename?: 'Mutation', deactivate_agent?: { __typename?: 'AgentStateResult', success?: boolean | null } | null }; + +export type RunAgentMutationVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type RunAgentMutation = { __typename?: 'Mutation', run_agent?: { __typename?: 'RunAgentResult', trigger_uuid?: string | null } | null }; + +export type GetAgentActiveTriggersQueryVariables = Exact<{ + agent_id: Scalars['ID']['input']; +}>; + + +export type GetAgentActiveTriggersQuery = { __typename?: 'Query', agent_active_triggers?: Array<{ __typename?: 'AgentActiveTrigger', node_id: string, block_reference_id: string, name: string, description?: string | null, field_summary?: string | null }> | null }; + +export type AddTriggerToAgentMutationVariables = Exact<{ + agent_id: Scalars['ID']['input']; + block_reference_id: Scalars['ID']['input']; + field_values?: InputMaybe; +}>; + + +export type AddTriggerToAgentMutation = { __typename?: 'Mutation', add_trigger_to_agent?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type RemoveTriggerFromAgentMutationVariables = Exact<{ + agent_id: Scalars['ID']['input']; + node_id: Scalars['ID']['input']; +}>; + + +export type RemoveTriggerFromAgentMutation = { __typename?: 'Mutation', remove_trigger_from_agent?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type AddSkillToAgentMutationVariables = Exact<{ + agent_id: Scalars['ID']['input']; + skill_id: Scalars['ID']['input']; +}>; + + +export type AddSkillToAgentMutation = { __typename?: 'Mutation', add_skill_to_agent?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type RemoveSkillFromAgentMutationVariables = Exact<{ + agent_id: Scalars['ID']['input']; + skill_id: Scalars['ID']['input']; +}>; + + +export type RemoveSkillFromAgentMutation = { __typename?: 'Mutation', remove_skill_from_agent?: { __typename?: 'MutationResult', success: boolean } | null }; + +export type GetAgentTriggersCatalogQueryVariables = Exact<{ + block_reference_ids?: InputMaybe | Scalars['ID']['input']>; +}>; + + +export type GetAgentTriggersCatalogQuery = { __typename?: 'Query', agent_triggers_catalog?: Array<{ __typename?: 'AgentTriggerCatalogEntry', block_reference_id: string, name: string, description?: string | null, field_schemas: Array<{ __typename?: 'TriggerFieldSchema', field_key: string, value_schema: string }>, required_fields: Array<{ __typename?: 'TriggerRequiredField', field_key: string, depends_on: Array, optional: boolean }> }> | null }; + +export type GetAgentSkillsCatalogQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetAgentSkillsCatalogQuery = { __typename?: 'Query', agent_skills_catalog?: Array<{ __typename?: 'AgentSkillCatalogEntry', id?: string | null, name?: string | null, description?: string | null }> | null }; + +export type CreateAgentSkillMutationVariables = Exact<{ + name: Scalars['String']['input']; + content: Scalars['String']['input']; + description?: InputMaybe; +}>; + + +export type CreateAgentSkillMutation = { __typename?: 'Mutation', create_agent_skill?: { __typename?: 'AgentSkillCatalogEntry', id?: string | null, name?: string | null, description?: string | null } | null }; + export type DeleteObjectSchemaColumnsMutationVariables = Exact<{ objectSchemaId?: InputMaybe; objectSchemaName?: InputMaybe; @@ -16340,10 +18308,26 @@ export type CreateFormSubmissionMutationVariables = Exact<{ export type CreateFormSubmissionMutation = { __typename?: 'Mutation', create_form_submission?: { __typename?: 'FormSubmissionResult', id: string } | null }; export const AgentFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; +export const GetAgentKnowledgeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getAgentKnowledge"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agent_knowledge"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resource_id"}},{"kind":"Field","name":{"kind":"Name","value":"scope_type"}},{"kind":"Field","name":{"kind":"Name","value":"permission_type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"files"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"file_name"}},{"kind":"Field","name":{"kind":"Name","value":"file_type"}}]}}]}}]}}]} as unknown as DocumentNode; +export const AddAgentResourceAccessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"addAgentResourceAccess"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"KnowledgeScope"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"permission_type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"KnowledgePermission"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"add_agent_resource_access"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"resource_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"scope_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"permission_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"permission_type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const RemoveAgentResourceAccessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"removeAgentResourceAccess"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"KnowledgeScope"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"remove_agent_resource_access"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"resource_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"scope_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const UpdateAgentResourceAccessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateAgentResourceAccess"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"KnowledgeScope"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"permission_type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"KnowledgePermission"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_agent_resource_access"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"resource_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"resource_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"scope_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scope_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"permission_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"permission_type"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; export const GetAgentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getAgents"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agents"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; export const CreateAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateAgentInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; export const CreateBlankAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createBlankAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateBlankAgentInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_blank_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; +export const UpdateAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"updateAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateAgentInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; export const DeleteAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"deleteAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"delete_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"profile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"role_description"}},{"kind":"Field","name":{"kind":"Name","value":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"background_color"}}]}},{"kind":"Field","name":{"kind":"Name","value":"goal"}},{"kind":"Field","name":{"kind":"Name","value":"plan"}},{"kind":"Field","name":{"kind":"Name","value":"user_prompt"}},{"kind":"Field","name":{"kind":"Name","value":"version_id"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"updated_at"}}]}}]} as unknown as DocumentNode; +export const ActivateAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"activateAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activate_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const DeactivateAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"deactivateAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inactive_reason"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"InactiveReason"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deactivate_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"inactive_reason"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inactive_reason"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const RunAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"runAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"run_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trigger_uuid"}}]}}]}}]} as unknown as DocumentNode; +export const GetAgentActiveTriggersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getAgentActiveTriggers"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agent_active_triggers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agent_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node_id"}},{"kind":"Field","name":{"kind":"Name","value":"block_reference_id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"field_summary"}}]}}]}}]} as unknown as DocumentNode; +export const AddTriggerToAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"addTriggerToAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"block_reference_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"field_values"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"add_trigger_to_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agent_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"block_reference_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"block_reference_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"field_values"},"value":{"kind":"Variable","name":{"kind":"Name","value":"field_values"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const RemoveTriggerFromAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"removeTriggerFromAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"node_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"remove_trigger_from_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agent_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"node_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"node_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const AddSkillToAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"addSkillToAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skill_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"add_skill_to_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agent_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"skill_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skill_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const RemoveSkillFromAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"removeSkillFromAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skill_id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"remove_skill_from_agent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agent_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agent_id"}}},{"kind":"Argument","name":{"kind":"Name","value":"skill_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skill_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; +export const GetAgentTriggersCatalogDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getAgentTriggersCatalog"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"block_reference_ids"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agent_triggers_catalog"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"block_reference_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"block_reference_ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"block_reference_id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"field_schemas"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"field_key"}},{"kind":"Field","name":{"kind":"Name","value":"value_schema"}}]}},{"kind":"Field","name":{"kind":"Name","value":"required_fields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"field_key"}},{"kind":"Field","name":{"kind":"Name","value":"depends_on"}},{"kind":"Field","name":{"kind":"Name","value":"optional"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetAgentSkillsCatalogDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getAgentSkillsCatalog"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agent_skills_catalog"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]} as unknown as DocumentNode; +export const CreateAgentSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createAgentSkill"},"variableDefinitions":[{"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":"content"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"description"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_agent_skill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"content"},"value":{"kind":"Variable","name":{"kind":"Name","value":"content"}}},{"kind":"Argument","name":{"kind":"Name","value":"description"},"value":{"kind":"Variable","name":{"kind":"Name","value":"description"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]} as unknown as DocumentNode; export const DeleteObjectSchemaColumnsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteObjectSchemaColumns"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectSchemaId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectSchemaName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"columnIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"delete_object_schema_columns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"object_schema_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectSchemaId"}}},{"kind":"Argument","name":{"kind":"Name","value":"object_schema_name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectSchemaName"}}},{"kind":"Argument","name":{"kind":"Name","value":"column_ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"columnIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"parent_id"}},{"kind":"Field","name":{"kind":"Name","value":"revision"}}]}}]}}]} as unknown as DocumentNode; export const CompleteUploadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CompleteUpload"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CompleteUploadInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"complete_upload"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"file_size"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"created_at"}},{"kind":"Field","name":{"kind":"Name","value":"filelink"}}]}}]}}]} as unknown as DocumentNode; export const CreateUploadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateUpload"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateUploadInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"create_upload"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upload_id"}},{"kind":"Field","name":{"kind":"Name","value":"parts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"part_number"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"size_range_start"}},{"kind":"Field","name":{"kind":"Name","value":"size_range_end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"part_size"}},{"kind":"Field","name":{"kind":"Name","value":"expires_at"}}]}}]}}]} as unknown as DocumentNode; 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 714f8ac7..8c271aa0 100644 --- a/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts +++ b/packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts @@ -946,6 +946,36 @@ export type AssignTeamOwnersResult = { team?: Maybe; }; +/** Structured result data for a completed or partially-completed operation */ +export type AsyncJobResult = { + __typename?: 'AsyncJobResult'; + /** Operation-specific details (failed item IDs, report URLs, etc.) */ + details?: Maybe; + /** Items that failed */ + failed?: Maybe; + /** Successfully processed items */ + succeeded?: Maybe; + /** Total items in the operation */ + total?: Maybe; +}; + +/** Status information for an async job */ +export type AsyncJobStatus = { + __typename?: 'AsyncJobStatus'; + /** When the job was created (ISO 8601) */ + created_at?: Maybe; + /** Error description if the job failed */ + error?: Maybe; + /** Unique job identifier */ + id?: Maybe; + /** Structured result data for completed or partially-completed operations */ + result?: Maybe; + /** Current job status */ + status?: Maybe; + /** When the job was last updated (ISO 8601) */ + updated_at?: Maybe; +}; + /** Text formatting attributes (bold, italic, links, colors, etc.) */ export type Attributes = { __typename?: 'Attributes'; @@ -2343,6 +2373,15 @@ export type CreateQuestionInput = { visible?: InputMaybe; }; +/** The result of creating a service user. */ +export type CreateServiceUserResult = { + __typename?: 'CreateServiceUserResult'; + /** The API token for the created service user. Null if token generation failed. */ + token?: Maybe; + /** The created service user. */ + user?: Maybe; +}; + export type CreateStatusColumnSettingsInput = { labels: Array; }; @@ -2643,6 +2682,13 @@ export type DeleteObjectSchemaColumnsActionInput = { column_ids: Array; }; +/** Represents a document block that was successfully deleted. */ +export type DeletedDocBlock = { + __typename?: 'DeletedDocBlock'; + /** The deleted block's unique identifier. */ + id: Scalars['ID']['output']; +}; + /** A department in the account. */ export type Department = { __typename?: 'Department'; @@ -2743,6 +2789,8 @@ export type DependencyValueInput = { /** A document block that was changed between two versions, including its content and what type of change occurred. */ export type DiffBlock = { __typename?: 'DiffBlock'; + /** The ID of the AI agent that made the change to this block, or null if the change was made by a user. */ + agent_id?: Maybe; /** The changes that occurred to this block (added, deleted, or changed). */ changes?: Maybe; /** The block content as a JSON string. */ @@ -2755,6 +2803,8 @@ export type DiffBlock = { summary?: Maybe; /** The type of block (e.g., text, image, list). */ type?: Maybe; + /** The ID of the user who made the change to this block, or null if not available. */ + user_id?: Maybe; }; export type DirectDocValue = ColumnValue & { @@ -2788,6 +2838,8 @@ export type DirectoryResource = { location?: Maybe; /** The name of the directory resource. */ name: Scalars['String']['output']; + /** The type of the resource (user, viewer, or guest). */ + resource_type?: Maybe; /** The skills of the directory resource. */ skills?: Maybe>; }; @@ -2802,6 +2854,16 @@ export enum DirectoryResourceAttribute { Skills = 'SKILLS' } +/** The type of a directory resource */ +export enum DirectoryResourceKind { + /** A guest user */ + Guest = 'GUEST', + /** A member or admin user */ + User = 'USER', + /** A view-only user */ + Viewer = 'VIEWER' +} + /** Paginated response containing directory resources and cursor for next page */ export type DirectoryResourcesResponse = { __typename?: 'DirectoryResourcesResponse'; @@ -4587,6 +4649,8 @@ export enum InvitationMethod { ServicePortalUserInvitation = 'SERVICE_PORTAL_USER_INVITATION', /** Added via single sign-on. */ Sso = 'SSO', + /** Created via system creation flow. */ + SystemCreation = 'SYSTEM_CREATION', /** Unknown invitation method. */ Unknown = 'UNKNOWN', /** Invited by another user. */ @@ -4892,6 +4956,22 @@ export type ItemsResponse = { items: Array; }; +/** Status of an async job */ +export enum JobState { + /** Job was cancelled */ + Cancelled = 'CANCELLED', + /** Job completed successfully */ + Completed = 'COMPLETED', + /** Job expired before completion */ + Expired = 'EXPIRED', + /** Job failed */ + Failed = 'FAILED', + /** Job is queued but not yet started */ + Pending = 'PENDING', + /** Job is actively executing */ + Running = 'RUNNING' +} + /** Status of a job operation. Currently supports items job status for backfill and ingest operations. */ export type JobStatus = ItemsJobStatus; @@ -5268,6 +5348,8 @@ export type Meeting = { action_items?: Maybe>; /** The end time of the meeting. */ end_time: Scalars['Date']['output']; + /** A concise AI-generated gist of the meeting. */ + gist?: Maybe; /** The unique identifier of the meeting. */ id: Scalars['ID']['output']; /** The URL to view the meeting in the notetaker. */ @@ -5546,6 +5628,8 @@ export type Mutation = { create_portfolio?: Maybe; /** Create a new project in monday.com from scratch. This mutation initiates asynchronous project creation with comprehensive customization options including: privacy settings (private/public - share is currently not supported), optional companions like Resource Planner for enhanced project management capabilities, workspace assignment for organizational structure, folder placement for better organization, and template selection for predefined project structures. Since project creation is asynchronous, you can optionally provide a callback_url where the project ID will be sent via POST request once creation completes. The callback will receive: { is_success: boolean, process_id: string, project_id?: number }. Returns a process_id for tracking the creation request. */ create_project?: Maybe; + /** Creates a new service user with a read-only API token. */ + create_service_user?: Maybe; /** Creates a new status column with strongly typed settings. Status columns allow users to track item progress through customizable labels (e.g., "Working on it", "Done", "Stuck"). This mutation is specifically for status/color columns and provides type-safe creation with label configuration. */ create_status_column?: Maybe; /** Create managed column of type status mutation. */ @@ -5591,6 +5675,8 @@ export type Mutation = { delete_doc?: Maybe; /** Delete a document block */ delete_doc_block?: Maybe; + /** Deletes multiple document blocks in a single operation. Maximum 100 blocks per request. */ + delete_doc_blocks?: Maybe>; /** Remove an object from favorites */ delete_favorite?: Maybe; /** Deletes a folder in a specific workspace. */ @@ -5670,6 +5756,8 @@ export type Mutation = { publish_article?: Maybe; /** Publishes object out of draft state. Returns {success: true} on success, {success: false} on failure. */ publish_object?: Maybe; + /** Revokes all existing tokens and generates a new API token for a service user. */ + regenerate_service_user_token?: Maybe; /** Remove mock app subscription for the current account */ remove_mock_app_subscription?: Maybe; /** Remove a required column from a board */ @@ -5678,6 +5766,8 @@ export type Mutation = { remove_team_owners?: Maybe; /** Remove users from team. */ remove_users_from_team?: Maybe; + /** Revokes all API tokens for a service user. */ + revoke_service_user_tokens?: Maybe; /** * Set or update the board's permission to specified role. This concept is also * known as default board role, general access or board permission set. @@ -6364,6 +6454,13 @@ export type MutationCreate_ProjectArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationCreate_Service_UserArgs = { + name: Scalars['String']['input']; + title?: InputMaybe; +}; + + /** Root mutation type for the Dependencies service */ export type MutationCreate_Status_ColumnArgs = { after_column_id?: InputMaybe; @@ -6564,6 +6661,12 @@ export type MutationDelete_Doc_BlockArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationDelete_Doc_BlocksArgs = { + block_ids: Array; +}; + + /** Root mutation type for the Dependencies service */ export type MutationDelete_FavoriteArgs = { input: DeleteFavoriteInput; @@ -6873,6 +6976,12 @@ export type MutationPublish_ObjectArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRegenerate_Service_User_TokenArgs = { + service_user_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationRemove_Mock_App_SubscriptionArgs = { app_id: Scalars['ID']['input']; @@ -6902,6 +7011,12 @@ export type MutationRemove_Users_From_TeamArgs = { }; +/** Root mutation type for the Dependencies service */ +export type MutationRevoke_Service_User_TokensArgs = { + service_user_id: Scalars['ID']['input']; +}; + + /** Root mutation type for the Dependencies service */ export type MutationSet_Board_PermissionArgs = { basic_role_name?: InputMaybe; @@ -8164,7 +8279,7 @@ export type Query = { /** Fetch a single connection by its unique ID. */ connection?: Maybe; /** Get board IDs that are linked to a specific connection. */ - connection_board_ids?: Maybe>; + connection_board_ids: Array; /** Returns connections for the authenticated user. Supports filtering, pagination, ordering, and partial-scope options. */ connections?: Maybe>; custom_activity?: Maybe>; @@ -8215,6 +8330,8 @@ export type Query = { items?: Maybe>>; /** Search items by multiple columns and values. */ items_page_by_column_values: ItemsResponse; + /** Get the status of an async job by its external ID */ + job_status: AsyncJobStatus; /** Search knowledge base snippets. */ knowledge_base_search?: Maybe; /** Get managed column data. */ @@ -8251,6 +8368,10 @@ export type Query = { replies?: Maybe>; /** Search API. Each field searches a single entity type with tailored filters. */ search: SearchNamespace; + /** Retrieves API tokens for the given service users. */ + service_user_tokens?: Maybe>; + /** Retrieves all service users in the account with their token last activity. */ + service_users?: Maybe>; /** Get a collection of monday dev sprints */ sprints?: Maybe>; /** Get a collection of tags. */ @@ -8430,7 +8551,7 @@ export type QueryConnectionArgs = { /** Root query type for the Dependencies service */ export type QueryConnection_Board_IdsArgs = { - connectionId: Scalars['Int']['input']; + connection_id: Scalars['ID']['input']; }; @@ -8603,6 +8724,12 @@ export type QueryItems_Page_By_Column_ValuesArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryJob_StatusArgs = { + job_id: Scalars['ID']['input']; +}; + + /** Root query type for the Dependencies service */ export type QueryKnowledge_Base_SearchArgs = { limit?: InputMaybe; @@ -8708,6 +8835,12 @@ export type QueryRepliesArgs = { }; +/** Root query type for the Dependencies service */ +export type QueryService_User_TokensArgs = { + service_user_ids: Array; +}; + + /** Root query type for the Dependencies service */ export type QuerySprintsArgs = { ids: Array; @@ -8792,8 +8925,11 @@ export type QueryUser_ConnectionsArgs = { export type QueryUsersArgs = { emails?: InputMaybe>; ids?: InputMaybe>; + kind?: InputMaybe; limit?: InputMaybe; name?: InputMaybe; + newest_first?: InputMaybe; + non_active?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; status?: InputMaybe>; @@ -9082,6 +9218,8 @@ export type SearchDocResults = { /** Board data stored in the search index. */ export type SearchIndexedBoard = { __typename?: 'SearchIndexedBoard'; + /** ID of the user who created this board. */ + creator_id?: Maybe; /** Board description. */ description?: Maybe; /** Board ID. */ @@ -9152,6 +9290,7 @@ export type SearchNamespace = { /** Per-entity search namespace. Each field searches a single entity type. */ export type SearchNamespaceBoardsArgs = { + board_ids?: InputMaybe>; date_range?: InputMaybe; limit?: InputMaybe; query: Scalars['String']['input']; @@ -9233,6 +9372,34 @@ export enum SequenceStatus { MissingConfig = 'MISSING_CONFIG' } +/** A service user in the account. */ +export type ServiceUser = { + __typename?: 'ServiceUser'; + /** When the service user was created. */ + created_at?: Maybe; + /** Whether the service user is active. */ + enabled?: Maybe; + /** The ID of the service user. */ + id?: Maybe; + /** The ID of the user who created this service user. */ + invited_by_id?: Maybe; + /** The last time the service user token was used for an API request. */ + last_token_activity?: Maybe; + /** The display name of the service user. */ + name?: Maybe; + /** The title/description of the service user. */ + title?: Maybe; +}; + +/** A service user token result. */ +export type ServiceUserToken = { + __typename?: 'ServiceUserToken'; + /** The ID of the service user. */ + service_user_id?: Maybe; + /** The API token. */ + token?: Maybe; +}; + /** Response type for detailed board permissions. Contains information about the permissions that were set. */ export type SetBoardPermissionResponse = { __typename?: 'SetBoardPermissionResponse'; @@ -10346,7 +10513,10 @@ export type UpdateFormSettingsInput = { is_anonymous?: InputMaybe; }; -export type UpdateFormTagInput = {}; +export type UpdateFormTagInput = { + /** The value of the tag */ + value?: InputMaybe; +}; /** Input for updating lifecycle subscriptions for an entity */ export type UpdateLifecycleSubscriptionsInput = { @@ -10810,6 +10980,8 @@ export enum UserKindFilter { ProjectsApiUser = 'PROJECTS_API_USER', /** A resource directory api user user. */ ResourceDirectoryApiUser = 'RESOURCE_DIRECTORY_API_USER', + /** A service user user. */ + ServiceUser = 'SERVICE_USER', /** A sprint management api user user. */ SprintManagementApiUser = 'SPRINT_MANAGEMENT_API_USER', /** A view only user. */