import { agentQueries } from "./agents/index.js";
import { coreQueries } from "./core/index.js";
import { teamQueries } from "./teams/index.js";
import { threadQueries } from "./threads/index.js";
import { inboxQueries } from "./inbox/index.js";
import { triggerQueries } from "./triggers/index.js";
import { costQueries } from "./costs/index.js";
import { knowledgeQueries } from "./knowledge/index.js";
import { artifactQueries } from "./artifacts/index.js";
import { appletQueries, appletMutations } from "./applets/index.js";
import { orchestrationQueries } from "./orchestration/index.js";
import { messageQueries } from "./messages/index.js";
import { webhookQueries } from "./webhooks/index.js";
import { memoryQueries, memoryMutations } from "./memory/index.js";
import { recipeQueries, recipeMutations } from "./recipes/index.js";
import { agentMutations } from "./agents/index.js";
import { coreMutations } from "./core/index.js";
import { messageMutations } from "./messages/index.js";
import {
  messageMentionTypeResolvers,
  messageTypeResolvers,
} from "./messages/types.js";
import { teamMutations } from "./teams/index.js";
import { triggerMutations } from "./triggers/index.js";
import { threadMutations } from "./threads/index.js";
import { inboxMutations } from "./inbox/index.js";
import { costMutations } from "./costs/index.js";
import { knowledgeMutations } from "./knowledge/index.js";
import { artifactMutations } from "./artifacts/index.js";
import { orchestrationMutations } from "./orchestration/index.js";
import { webhookMutations } from "./webhooks/index.js";
import {
  evaluationsQueries,
  evaluationsMutations,
} from "./evaluations/index.js";
import { wikiQueries, wikiMutations } from "./wiki/index.js";
import { skillRunsQueries, skillRunsMutations } from "./skill-runs/index.js";
import { runtimeQueries } from "./runtime/index.js";
import { workspaceQueries, workspaceMutations } from "./workspace/index.js";
import { brainQueries, brainMutations } from "./brain/index.js";
import { routineMutations, routineQueries } from "./routines/index.js";
import {
  tenantCredentialMutations,
  tenantCredentialQueries,
} from "./tenant-credentials/index.js";
import {
  quickActionQueries,
  quickActionMutations,
} from "./quick-actions/index.js";
import {
  computerAssignmentTypeResolvers,
  computerQueries,
  computerMutations,
  computerTypeResolvers,
} from "./computers/index.js";
import { runbookQueries, runbookMutations } from "./runbooks/index.js";
import { customizeQueries, customizeMutations } from "./customize/index.js";
import { complianceQueries, complianceMutations } from "./compliance/index.js";
import { slackQueries, slackMutations } from "./slack/index.js";
import { ontologyQueries, ontologyMutations } from "./ontology/index.js";
import {
  linkedTaskQueries,
  linkedTaskTypeResolvers,
} from "./linked-tasks/index.js";
import {
  spaceAgentAssignmentTypeResolvers,
  spaceChecklistTemplateTypeResolvers,
  spaceMemberTypeResolvers,
  spaceMcpServerTypeResolvers,
  spaceMutations,
  spaceQueries,
  spaceTypeResolvers,
} from "./spaces/index.js";

export const queryResolvers: Record<string, any> = {
  _empty: () => null,
  ...agentQueries,
  ...coreQueries,
  ...teamQueries,
  ...threadQueries,
  ...inboxQueries,
  ...triggerQueries,
  ...costQueries,
  ...knowledgeQueries,
  ...artifactQueries,
  ...appletQueries,
  ...orchestrationQueries,
  ...messageQueries,
  ...webhookQueries,
  ...memoryQueries,
  ...recipeQueries,
  ...evaluationsQueries,
  ...wikiQueries,
  ...skillRunsQueries,
  ...runtimeQueries,
  ...workspaceQueries,
  ...brainQueries,
  ...routineQueries,
  ...tenantCredentialQueries,
  ...quickActionQueries,
  ...computerQueries,
  ...runbookQueries,
  ...customizeQueries,
  ...complianceQueries,
  ...slackQueries,
  ...ontologyQueries,
  ...spaceQueries,
  ...linkedTaskQueries,
};

export const mutationResolvers: Record<string, any> = {
  _empty: () => null,
  ...agentMutations,
  ...coreMutations,
  ...messageMutations,
  ...teamMutations,
  ...triggerMutations,
  ...threadMutations,
  ...inboxMutations,
  ...costMutations,
  ...knowledgeMutations,
  ...artifactMutations,
  ...appletMutations,
  ...orchestrationMutations,
  ...webhookMutations,
  ...memoryMutations,
  ...recipeMutations,
  ...evaluationsMutations,
  ...wikiMutations,
  ...skillRunsMutations,
  ...workspaceMutations,
  ...brainMutations,
  ...routineMutations,
  ...tenantCredentialMutations,
  ...quickActionMutations,
  ...computerMutations,
  ...runbookMutations,
  ...customizeMutations,
  ...complianceMutations,
  ...slackMutations,
  ...ontologyMutations,
  ...spaceMutations,
};

import { agentTypeResolvers } from "./agents/types.js";
import {
  threadParticipantTypeResolvers,
  threadTypeResolvers,
} from "./threads/types.js";
import { memoryRecordTypeResolvers } from "./memory/types.js";
import { wikiPageTypeResolvers } from "./wiki/index.js";
import { routineExecutionTypeResolvers } from "./routines/types.js";
import { tenantTypeResolvers } from "./core/types.js";

export const typeResolvers: Record<string, Record<string, any>> = {
  Tenant: tenantTypeResolvers,
  Agent: agentTypeResolvers,
  Thread: threadTypeResolvers,
  ThreadParticipant: threadParticipantTypeResolvers,
  Message: messageTypeResolvers,
  MessageMention: messageMentionTypeResolvers,
  MemoryRecord: memoryRecordTypeResolvers,
  WikiPage: wikiPageTypeResolvers,
  RoutineExecution: routineExecutionTypeResolvers,
  Computer: computerTypeResolvers,
  ComputerAssignment: computerAssignmentTypeResolvers,
  Space: spaceTypeResolvers,
  SpaceMember: spaceMemberTypeResolvers,
  SpaceAgentAssignment: spaceAgentAssignmentTypeResolvers,
  SpaceChecklistTemplate: spaceChecklistTemplateTypeResolvers,
  SpaceMcpServer: spaceMcpServerTypeResolvers,
  LinkedTask: linkedTaskTypeResolvers,
};
