{"version":3,"file":"copilot-response.type.mjs","names":[],"sources":["../../../src/graphql/types/copilot-response.type.ts"],"sourcesContent":["import { Field, InterfaceType, ObjectType } from \"type-graphql\";\nimport { MessageRole } from \"./enums\";\nimport { MessageStatusUnion } from \"./message-status.type\";\nimport { ResponseStatusUnion } from \"./response-status.type\";\nimport { ExtensionsResponse } from \"./extensions-response.type\";\nimport { BaseMetaEvent } from \"./meta-events.type\";\n\n@InterfaceType({\n  resolveType(value) {\n    if (value.hasOwnProperty(\"content\")) {\n      return TextMessageOutput;\n    } else if (value.hasOwnProperty(\"name\")) {\n      return ActionExecutionMessageOutput;\n    } else if (value.hasOwnProperty(\"result\")) {\n      return ResultMessageOutput;\n    } else if (value.hasOwnProperty(\"state\")) {\n      return AgentStateMessageOutput;\n    } else if (\n      value.hasOwnProperty(\"format\") &&\n      value.hasOwnProperty(\"bytes\")\n    ) {\n      return ImageMessageOutput;\n    }\n    return undefined;\n  },\n})\nexport abstract class BaseMessageOutput {\n  @Field(() => String)\n  id: string;\n\n  @Field(() => Date)\n  createdAt: Date;\n\n  @Field(() => MessageStatusUnion)\n  status: typeof MessageStatusUnion;\n}\n\n@ObjectType({ implements: BaseMessageOutput })\nexport class TextMessageOutput {\n  @Field(() => MessageRole)\n  role: MessageRole;\n\n  @Field(() => [String])\n  content: string[];\n\n  @Field(() => String, { nullable: true })\n  parentMessageId?: string;\n}\n\n@ObjectType({ implements: BaseMessageOutput })\nexport class ActionExecutionMessageOutput {\n  @Field(() => String)\n  name: string;\n\n  @Field(() => String, {\n    nullable: true,\n    deprecationReason: \"This field will be removed in a future version\",\n  })\n  scope?: string;\n\n  @Field(() => [String])\n  arguments: string[];\n\n  @Field(() => String, { nullable: true })\n  parentMessageId?: string;\n}\n\n@ObjectType({ implements: BaseMessageOutput })\nexport class ResultMessageOutput {\n  @Field(() => String)\n  actionExecutionId: string;\n\n  @Field(() => String)\n  actionName: string;\n\n  @Field(() => String)\n  result: string;\n}\n\n@ObjectType({ implements: BaseMessageOutput })\nexport class AgentStateMessageOutput {\n  @Field(() => String)\n  threadId: string;\n\n  @Field(() => String)\n  agentName: string;\n\n  @Field(() => String)\n  nodeName: string;\n\n  @Field(() => String)\n  runId: string;\n\n  @Field(() => Boolean)\n  active: boolean;\n\n  @Field(() => MessageRole)\n  role: MessageRole;\n\n  @Field(() => String)\n  state: string;\n\n  @Field(() => Boolean)\n  running: boolean;\n}\n\n@ObjectType({ implements: BaseMessageOutput })\nexport class ImageMessageOutput {\n  @Field(() => String)\n  format: string;\n\n  @Field(() => String)\n  bytes: string;\n\n  @Field(() => MessageRole)\n  role: MessageRole;\n\n  @Field(() => String, { nullable: true })\n  parentMessageId?: string;\n}\n\n@ObjectType()\nexport class CopilotResponse {\n  @Field(() => String)\n  threadId!: string;\n\n  @Field(() => ResponseStatusUnion)\n  status: typeof ResponseStatusUnion;\n\n  @Field({ nullable: true })\n  runId?: string;\n\n  @Field(() => [BaseMessageOutput])\n  messages: (typeof BaseMessageOutput)[];\n\n  @Field(() => ExtensionsResponse, { nullable: true })\n  extensions?: ExtensionsResponse;\n\n  @Field(() => [BaseMetaEvent], { nullable: true })\n  metaEvents?: (typeof BaseMetaEvent)[];\n}\n"],"mappings":";;;;;;;;;;;;AA0BO,8BAAe,kBAAkB;YACrC,YAAY,OAAO;YAGnB,YAAY,KAAK;YAGjB,YAAY,mBAAmB;gCA1BjC,cAAc,EACb,YAAY,OAAO;AACjB,KAAI,MAAM,eAAe,UAAU,CACjC,QAAO;UACE,MAAM,eAAe,OAAO,CACrC,QAAO;UACE,MAAM,eAAe,SAAS,CACvC,QAAO;UACE,MAAM,eAAe,QAAQ,CACtC,QAAO;UAEP,MAAM,eAAe,SAAS,IAC9B,MAAM,eAAe,QAAQ,CAE7B,QAAO;GAIZ,CAAC;AAaK,8BAAM,kBAAkB;YAC5B,YAAY,YAAY;YAGxB,YAAY,CAAC,OAAO,CAAC;YAGrB,YAAY,QAAQ,EAAE,UAAU,MAAM,CAAC;gCARzC,WAAW,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