@copilotkit/runtime
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
1 lines • 4.66 kB
Source Map (JSON)
{"version":3,"file":"copilot-response.type.cjs","names":["MessageStatusUnion","MessageRole","ResponseStatusUnion","ExtensionsResponse","BaseMetaEvent"],"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;2DACzB,OAAO;2DAGP,KAAK;2DAGLA,+CAAmB;iFA1BnB,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;2DAChBC,0BAAY;2DAGZ,CAAC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