@copilotkit/runtime-client-gql 1.5.1-next.2 → 1.5.1-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{chunk-WK75ISB2.mjs → chunk-6AYEPQA6.mjs} +3 -5
  3. package/dist/chunk-6AYEPQA6.mjs.map +1 -0
  4. package/dist/{chunk-AOS57GRG.mjs → chunk-ET5D6GZX.mjs} +10 -5
  5. package/dist/chunk-ET5D6GZX.mjs.map +1 -0
  6. package/dist/{chunk-EJ6UGR3B.mjs → chunk-J3B45FEM.mjs} +8 -26
  7. package/dist/chunk-J3B45FEM.mjs.map +1 -0
  8. package/dist/{chunk-IZDC2R6Y.mjs → chunk-K6FVPY4T.mjs} +2 -2
  9. package/dist/chunk-K6FVPY4T.mjs.map +1 -0
  10. package/dist/{chunk-AXHVBZ73.mjs → chunk-OVSA5AEZ.mjs} +6 -64
  11. package/dist/chunk-OVSA5AEZ.mjs.map +1 -0
  12. package/dist/{chunk-3BOGJG6W.mjs → chunk-RVARJFWJ.mjs} +3 -4
  13. package/dist/{chunk-3BOGJG6W.mjs.map → chunk-RVARJFWJ.mjs.map} +1 -1
  14. package/dist/chunk-XZPL6QVK.mjs +24 -0
  15. package/dist/chunk-XZPL6QVK.mjs.map +1 -0
  16. package/dist/client/CopilotRuntimeClient.d.ts +2 -4
  17. package/dist/client/CopilotRuntimeClient.js +9 -43
  18. package/dist/client/CopilotRuntimeClient.js.map +1 -1
  19. package/dist/client/CopilotRuntimeClient.mjs +4 -5
  20. package/dist/client/conversion.d.ts +2 -3
  21. package/dist/client/conversion.js +5 -64
  22. package/dist/client/conversion.js.map +1 -1
  23. package/dist/client/conversion.mjs +5 -7
  24. package/dist/client/index.d.ts +3 -3
  25. package/dist/client/index.js +14 -107
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/index.mjs +8 -11
  28. package/dist/client/types.d.ts +3 -4
  29. package/dist/client/types.js.map +1 -1
  30. package/dist/client/types.mjs +2 -2
  31. package/dist/graphql/@generated/fragment-masking.d.ts +22 -0
  32. package/dist/graphql/@generated/fragment-masking.js +50 -0
  33. package/dist/graphql/@generated/fragment-masking.js.map +1 -0
  34. package/dist/graphql/@generated/fragment-masking.mjs +11 -0
  35. package/dist/graphql/@generated/gql.d.ts +39 -0
  36. package/dist/graphql/@generated/gql.js +41 -0
  37. package/dist/graphql/@generated/gql.js.map +1 -0
  38. package/dist/graphql/@generated/gql.mjs +8 -0
  39. package/dist/graphql/@generated/gql.mjs.map +1 -0
  40. package/dist/{graphql-21970cc1.d.ts → graphql/@generated/graphql.d.ts} +10 -40
  41. package/dist/graphql/@generated/graphql.js +90 -0
  42. package/dist/graphql/@generated/graphql.js.map +1 -0
  43. package/dist/graphql/@generated/graphql.mjs +21 -0
  44. package/dist/graphql/@generated/graphql.mjs.map +1 -0
  45. package/dist/graphql/@generated/index.d.ts +4 -0
  46. package/dist/graphql/{definitions/queries.js → @generated/index.js} +33 -27
  47. package/dist/graphql/@generated/index.js.map +1 -0
  48. package/dist/graphql/@generated/index.mjs +16 -0
  49. package/dist/graphql/@generated/index.mjs.map +1 -0
  50. package/dist/graphql/definitions/mutations.d.ts +1 -1
  51. package/dist/graphql/definitions/mutations.js +3 -6
  52. package/dist/graphql/definitions/mutations.js.map +1 -1
  53. package/dist/graphql/definitions/mutations.mjs +3 -3
  54. package/dist/index.d.ts +3 -3
  55. package/dist/index.js +22 -109
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.mjs +10 -13
  58. package/package.json +3 -3
  59. package/src/graphql/@generated/gql.ts +2 -7
  60. package/src/graphql/@generated/graphql.ts +11 -31
  61. package/dist/chunk-256E264G.mjs +0 -24
  62. package/dist/chunk-256E264G.mjs.map +0 -1
  63. package/dist/chunk-AOS57GRG.mjs.map +0 -1
  64. package/dist/chunk-AXHVBZ73.mjs.map +0 -1
  65. package/dist/chunk-EJ6UGR3B.mjs.map +0 -1
  66. package/dist/chunk-IZDC2R6Y.mjs.map +0 -1
  67. package/dist/chunk-WK75ISB2.mjs.map +0 -1
  68. package/dist/graphql/definitions/queries.d.ts +0 -8
  69. package/dist/graphql/definitions/queries.js.map +0 -1
  70. package/dist/graphql/definitions/queries.mjs +0 -9
  71. /package/dist/graphql/{definitions/queries.mjs.map → @generated/fragment-masking.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @copilotkit/runtime-client-gql
2
2
 
3
+ ## 1.5.1-next.3
4
+
5
+ ### Patch Changes
6
+
7
+ - test prerelease #3
8
+ - Updated dependencies
9
+ - @copilotkit/shared@1.5.1-next.3
10
+
3
11
  ## 1.5.1-next.2
4
12
 
5
13
  ### Patch Changes
@@ -1,12 +1,10 @@
1
1
  import {
2
- AvailableAgentsDocument,
3
2
  GenerateCopilotResponseDocument
4
- } from "./chunk-AOS57GRG.mjs";
3
+ } from "./chunk-ET5D6GZX.mjs";
5
4
 
6
5
  // src/graphql/@generated/gql.ts
7
6
  var documents = {
8
- "\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments @stream\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n }\n }\n": GenerateCopilotResponseDocument,
9
- "\n query availableAgents {\n availableAgents {\n agents {\n name\n id\n description\n }\n }\n }\n": AvailableAgentsDocument
7
+ "\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n }\n ... on ActionExecutionMessageOutput {\n name\n scope\n arguments @stream\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n }\n }\n": GenerateCopilotResponseDocument
10
8
  };
11
9
  function graphql(source) {
12
10
  return documents[source] ?? {};
@@ -15,4 +13,4 @@ function graphql(source) {
15
13
  export {
16
14
  graphql
17
15
  };
18
- //# sourceMappingURL=chunk-WK75ISB2.mjs.map
16
+ //# sourceMappingURL=chunk-6AYEPQA6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphql/@generated/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n \"\\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\\n generateCopilotResponse(data: $data, properties: $properties) {\\n threadId\\n runId\\n ... on CopilotResponse @defer {\\n status {\\n ... on BaseResponseStatus {\\n code\\n }\\n ... on FailedResponseStatus {\\n reason\\n details\\n }\\n }\\n }\\n messages @stream {\\n __typename\\n ... on BaseMessageOutput {\\n id\\n createdAt\\n }\\n ... on BaseMessageOutput @defer {\\n status {\\n ... on SuccessMessageStatus {\\n code\\n }\\n ... on FailedMessageStatus {\\n code\\n reason\\n }\\n ... on PendingMessageStatus {\\n code\\n }\\n }\\n }\\n ... on TextMessageOutput {\\n content @stream\\n role\\n }\\n ... on ActionExecutionMessageOutput {\\n name\\n scope\\n arguments @stream\\n }\\n ... on ResultMessageOutput {\\n result\\n actionExecutionId\\n actionName\\n }\\n ... on AgentStateMessageOutput {\\n threadId\\n state\\n running\\n agentName\\n nodeName\\n runId\\n active\\n role\\n }\\n }\\n }\\n }\\n\": types.GenerateCopilotResponseDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\\n generateCopilotResponse(data: $data, properties: $properties) {\\n threadId\\n runId\\n ... on CopilotResponse @defer {\\n status {\\n ... on BaseResponseStatus {\\n code\\n }\\n ... on FailedResponseStatus {\\n reason\\n details\\n }\\n }\\n }\\n messages @stream {\\n __typename\\n ... on BaseMessageOutput {\\n id\\n createdAt\\n }\\n ... on BaseMessageOutput @defer {\\n status {\\n ... on SuccessMessageStatus {\\n code\\n }\\n ... on FailedMessageStatus {\\n code\\n reason\\n }\\n ... on PendingMessageStatus {\\n code\\n }\\n }\\n }\\n ... on TextMessageOutput {\\n content @stream\\n role\\n }\\n ... on ActionExecutionMessageOutput {\\n name\\n scope\\n arguments @stream\\n }\\n ... on ResultMessageOutput {\\n result\\n actionExecutionId\\n actionName\\n }\\n ... on AgentStateMessageOutput {\\n threadId\\n state\\n running\\n agentName\\n nodeName\\n runId\\n active\\n role\\n }\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\\n generateCopilotResponse(data: $data, properties: $properties) {\\n threadId\\n runId\\n ... on CopilotResponse @defer {\\n status {\\n ... on BaseResponseStatus {\\n code\\n }\\n ... on FailedResponseStatus {\\n reason\\n details\\n }\\n }\\n }\\n messages @stream {\\n __typename\\n ... on BaseMessageOutput {\\n id\\n createdAt\\n }\\n ... on BaseMessageOutput @defer {\\n status {\\n ... on SuccessMessageStatus {\\n code\\n }\\n ... on FailedMessageStatus {\\n code\\n reason\\n }\\n ... on PendingMessageStatus {\\n code\\n }\\n }\\n }\\n ... on TextMessageOutput {\\n content @stream\\n role\\n }\\n ... on ActionExecutionMessageOutput {\\n name\\n scope\\n arguments @stream\\n }\\n ... on ResultMessageOutput {\\n result\\n actionExecutionId\\n actionName\\n }\\n ... on AgentStateMessageOutput {\\n threadId\\n state\\n running\\n agentName\\n nodeName\\n runId\\n active\\n role\\n }\\n }\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"mappings":";;;;;AAcA,IAAM,YAAY;AAAA,EACd,27CAAi8C;AACr8C;AAqBO,SAAS,QAAQ,QAAgB;AACtC,SAAQ,UAAkB,MAAM,KAAK,CAAC;AACxC;","names":[]}
@@ -1,4 +1,10 @@
1
1
  // src/graphql/@generated/graphql.ts
2
+ var ActionExecutionScope = /* @__PURE__ */ ((ActionExecutionScope2) => {
3
+ ActionExecutionScope2["Client"] = "client";
4
+ ActionExecutionScope2["PassThrough"] = "passThrough";
5
+ ActionExecutionScope2["Server"] = "server";
6
+ return ActionExecutionScope2;
7
+ })(ActionExecutionScope || {});
2
8
  var ActionInputAvailability = /* @__PURE__ */ ((ActionInputAvailability2) => {
3
9
  ActionInputAvailability2["Disabled"] = "disabled";
4
10
  ActionInputAvailability2["Enabled"] = "enabled";
@@ -38,17 +44,16 @@ var ResponseStatusCode = /* @__PURE__ */ ((ResponseStatusCode2) => {
38
44
  ResponseStatusCode2["Success"] = "Success";
39
45
  return ResponseStatusCode2;
40
46
  })(ResponseStatusCode || {});
41
- var GenerateCopilotResponseDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "generateCopilotResponse" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "GenerateCopilotResponseInput" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "properties" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSONObject" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "generateCopilotResponse" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "data" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "properties" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "properties" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threadId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "runId" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "CopilotResponse" } }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "defer" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseResponseStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "FailedResponseStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "details" } }] } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "messages" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseMessageOutput" } }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "defer" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "SuccessMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "FailedMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PendingMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }] } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TextMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "content" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }] }, { "kind": "Field", "name": { "kind": "Name", "value": "role" } }, { "kind": "Field", "name": { "kind": "Name", "value": "parentMessageId" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ActionExecutionMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "arguments" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }] }, { "kind": "Field", "name": { "kind": "Name", "value": "parentMessageId" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ResultMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "result" } }, { "kind": "Field", "name": { "kind": "Name", "value": "actionExecutionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "actionName" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "AgentStateMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threadId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "running" } }, { "kind": "Field", "name": { "kind": "Name", "value": "agentName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "nodeName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "runId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "active" } }, { "kind": "Field", "name": { "kind": "Name", "value": "role" } }] } }] } }] } }] } }] };
42
- var AvailableAgentsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "availableAgents" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "availableAgents" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "agents" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }] } }] } }] } }] };
47
+ var GenerateCopilotResponseDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "generateCopilotResponse" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "GenerateCopilotResponseInput" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "properties" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSONObject" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "generateCopilotResponse" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "data" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "properties" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "properties" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threadId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "runId" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "CopilotResponse" } }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "defer" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseResponseStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "FailedResponseStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "reason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "details" } }] } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "messages" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "BaseMessageOutput" } }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "defer" } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "SuccessMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "FailedMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PendingMessageStatus" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }] } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TextMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "content" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }] }, { "kind": "Field", "name": { "kind": "Name", "value": "role" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ActionExecutionMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "scope" } }, { "kind": "Field", "name": { "kind": "Name", "value": "arguments" }, "directives": [{ "kind": "Directive", "name": { "kind": "Name", "value": "stream" } }] }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ResultMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "result" } }, { "kind": "Field", "name": { "kind": "Name", "value": "actionExecutionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "actionName" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "AgentStateMessageOutput" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "threadId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "state" } }, { "kind": "Field", "name": { "kind": "Name", "value": "running" } }, { "kind": "Field", "name": { "kind": "Name", "value": "agentName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "nodeName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "runId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "active" } }, { "kind": "Field", "name": { "kind": "Name", "value": "role" } }] } }] } }] } }] } }] };
43
48
 
44
49
  export {
50
+ ActionExecutionScope,
45
51
  ActionInputAvailability,
46
52
  CopilotRequestType,
47
53
  FailedResponseStatusReason,
48
54
  MessageRole,
49
55
  MessageStatusCode,
50
56
  ResponseStatusCode,
51
- GenerateCopilotResponseDocument,
52
- AvailableAgentsDocument
57
+ GenerateCopilotResponseDocument
53
58
  };
54
- //# sourceMappingURL=chunk-AOS57GRG.mjs.map
59
+ //# sourceMappingURL=chunk-ET5D6GZX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphql/@generated/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format. */\n DateTimeISO: { input: any; output: any; }\n /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */\n JSON: { input: any; output: any; }\n /** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */\n JSONObject: { input: any; output: any; }\n};\n\nexport type ActionExecutionMessageInput = {\n arguments: Scalars['String']['input'];\n name: Scalars['String']['input'];\n scope: ActionExecutionScope;\n};\n\nexport type ActionExecutionMessageOutput = BaseMessageOutput & {\n __typename?: 'ActionExecutionMessageOutput';\n arguments: Array<Scalars['String']['output']>;\n createdAt: Scalars['DateTimeISO']['output'];\n id: Scalars['String']['output'];\n name: Scalars['String']['output'];\n scope: ActionExecutionScope;\n status: MessageStatus;\n};\n\n/** The scope of the action */\nexport enum ActionExecutionScope {\n Client = 'client',\n PassThrough = 'passThrough',\n Server = 'server'\n}\n\nexport type ActionInput = {\n available?: InputMaybe<ActionInputAvailability>;\n description: Scalars['String']['input'];\n jsonSchema: Scalars['String']['input'];\n name: Scalars['String']['input'];\n};\n\n/** The availability of the frontend action */\nexport enum ActionInputAvailability {\n Disabled = 'disabled',\n Enabled = 'enabled',\n Remote = 'remote'\n}\n\nexport type AgentSessionInput = {\n agentName: Scalars['String']['input'];\n nodeName?: InputMaybe<Scalars['String']['input']>;\n threadId?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type AgentStateInput = {\n agentName: Scalars['String']['input'];\n state: Scalars['String']['input'];\n};\n\nexport type AgentStateMessageInput = {\n active: Scalars['Boolean']['input'];\n agentName: Scalars['String']['input'];\n nodeName: Scalars['String']['input'];\n role: MessageRole;\n runId: Scalars['String']['input'];\n running: Scalars['Boolean']['input'];\n state: Scalars['String']['input'];\n threadId: Scalars['String']['input'];\n};\n\nexport type AgentStateMessageOutput = BaseMessageOutput & {\n __typename?: 'AgentStateMessageOutput';\n active: Scalars['Boolean']['output'];\n agentName: Scalars['String']['output'];\n createdAt: Scalars['DateTimeISO']['output'];\n id: Scalars['String']['output'];\n nodeName: Scalars['String']['output'];\n role: MessageRole;\n runId: Scalars['String']['output'];\n running: Scalars['Boolean']['output'];\n state: Scalars['String']['output'];\n status: MessageStatus;\n threadId: Scalars['String']['output'];\n};\n\nexport type BaseMessageOutput = {\n createdAt: Scalars['DateTimeISO']['output'];\n id: Scalars['String']['output'];\n status: MessageStatus;\n};\n\nexport type BaseResponseStatus = {\n code: ResponseStatusCode;\n};\n\nexport type CloudInput = {\n guardrails?: InputMaybe<GuardrailsInput>;\n};\n\n/** The type of Copilot request */\nexport enum CopilotRequestType {\n Chat = 'Chat',\n Suggestion = 'Suggestion',\n Task = 'Task',\n TextareaCompletion = 'TextareaCompletion',\n TextareaPopover = 'TextareaPopover'\n}\n\nexport type CopilotResponse = {\n __typename?: 'CopilotResponse';\n messages: Array<BaseMessageOutput>;\n runId?: Maybe<Scalars['String']['output']>;\n status: ResponseStatus;\n threadId: Scalars['String']['output'];\n};\n\nexport type FailedMessageStatus = {\n __typename?: 'FailedMessageStatus';\n code: MessageStatusCode;\n reason: Scalars['String']['output'];\n};\n\nexport type FailedResponseStatus = BaseResponseStatus & {\n __typename?: 'FailedResponseStatus';\n code: ResponseStatusCode;\n details?: Maybe<Scalars['JSON']['output']>;\n reason: FailedResponseStatusReason;\n};\n\nexport enum FailedResponseStatusReason {\n GuardrailsValidationFailed = 'GUARDRAILS_VALIDATION_FAILED',\n MessageStreamInterrupted = 'MESSAGE_STREAM_INTERRUPTED',\n UnknownError = 'UNKNOWN_ERROR'\n}\n\nexport type ForwardedParametersInput = {\n maxTokens?: InputMaybe<Scalars['Float']['input']>;\n model?: InputMaybe<Scalars['String']['input']>;\n stop?: InputMaybe<Array<Scalars['String']['input']>>;\n toolChoice?: InputMaybe<Scalars['String']['input']>;\n toolChoiceFunctionName?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type FrontendInput = {\n actions: Array<ActionInput>;\n toDeprecate_fullContext?: InputMaybe<Scalars['String']['input']>;\n url?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type GenerateCopilotResponseInput = {\n agentSession?: InputMaybe<AgentSessionInput>;\n agentState?: InputMaybe<AgentStateInput>;\n agentStates?: InputMaybe<Array<AgentStateInput>>;\n cloud?: InputMaybe<CloudInput>;\n forwardedParameters?: InputMaybe<ForwardedParametersInput>;\n frontend: FrontendInput;\n messages: Array<MessageInput>;\n metadata: GenerateCopilotResponseMetadataInput;\n runId?: InputMaybe<Scalars['String']['input']>;\n threadId?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type GenerateCopilotResponseMetadataInput = {\n requestType?: InputMaybe<CopilotRequestType>;\n};\n\nexport type GuardrailsInput = {\n inputValidationRules: GuardrailsRuleInput;\n};\n\nexport type GuardrailsRuleInput = {\n allowList?: InputMaybe<Array<Scalars['String']['input']>>;\n denyList?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\nexport type MessageInput = {\n actionExecutionMessage?: InputMaybe<ActionExecutionMessageInput>;\n agentStateMessage?: InputMaybe<AgentStateMessageInput>;\n createdAt: Scalars['DateTimeISO']['input'];\n id: Scalars['String']['input'];\n resultMessage?: InputMaybe<ResultMessageInput>;\n textMessage?: InputMaybe<TextMessageInput>;\n};\n\n/** The role of the message */\nexport enum MessageRole {\n Assistant = 'assistant',\n System = 'system',\n Tool = 'tool',\n User = 'user'\n}\n\nexport type MessageStatus = FailedMessageStatus | PendingMessageStatus | SuccessMessageStatus;\n\nexport enum MessageStatusCode {\n Failed = 'Failed',\n Pending = 'Pending',\n Success = 'Success'\n}\n\nexport type Mutation = {\n __typename?: 'Mutation';\n generateCopilotResponse: CopilotResponse;\n};\n\n\nexport type MutationGenerateCopilotResponseArgs = {\n data: GenerateCopilotResponseInput;\n properties?: InputMaybe<Scalars['JSONObject']['input']>;\n};\n\nexport type PendingMessageStatus = {\n __typename?: 'PendingMessageStatus';\n code: MessageStatusCode;\n};\n\nexport type PendingResponseStatus = BaseResponseStatus & {\n __typename?: 'PendingResponseStatus';\n code: ResponseStatusCode;\n};\n\nexport type Query = {\n __typename?: 'Query';\n hello: Scalars['String']['output'];\n};\n\nexport type ResponseStatus = FailedResponseStatus | PendingResponseStatus | SuccessResponseStatus;\n\nexport enum ResponseStatusCode {\n Failed = 'Failed',\n Pending = 'Pending',\n Success = 'Success'\n}\n\nexport type ResultMessageInput = {\n actionExecutionId: Scalars['String']['input'];\n actionName: Scalars['String']['input'];\n result: Scalars['String']['input'];\n};\n\nexport type ResultMessageOutput = BaseMessageOutput & {\n __typename?: 'ResultMessageOutput';\n actionExecutionId: Scalars['String']['output'];\n actionName: Scalars['String']['output'];\n createdAt: Scalars['DateTimeISO']['output'];\n id: Scalars['String']['output'];\n result: Scalars['String']['output'];\n status: MessageStatus;\n};\n\nexport type SuccessMessageStatus = {\n __typename?: 'SuccessMessageStatus';\n code: MessageStatusCode;\n};\n\nexport type SuccessResponseStatus = BaseResponseStatus & {\n __typename?: 'SuccessResponseStatus';\n code: ResponseStatusCode;\n};\n\nexport type TextMessageInput = {\n content: Scalars['String']['input'];\n role: MessageRole;\n};\n\nexport type TextMessageOutput = BaseMessageOutput & {\n __typename?: 'TextMessageOutput';\n content: Array<Scalars['String']['output']>;\n createdAt: Scalars['DateTimeISO']['output'];\n id: Scalars['String']['output'];\n role: MessageRole;\n status: MessageStatus;\n};\n\nexport type GenerateCopilotResponseMutationVariables = Exact<{\n data: GenerateCopilotResponseInput;\n properties?: InputMaybe<Scalars['JSONObject']['input']>;\n}>;\n\n\nexport type GenerateCopilotResponseMutation = { __typename?: 'Mutation', generateCopilotResponse: { __typename?: 'CopilotResponse', threadId: string, runId?: string | null, messages: Array<{ __typename: 'ActionExecutionMessageOutput', id: string, createdAt: any, name: string, scope: ActionExecutionScope, arguments: Array<string>, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'AgentStateMessageOutput', id: string, createdAt: any, threadId: string, state: string, running: boolean, agentName: string, nodeName: string, runId: string, active: boolean, role: MessageRole, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'ResultMessageOutput', id: string, createdAt: any, result: string, actionExecutionId: string, actionName: string, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } } | { __typename: 'TextMessageOutput', id: string, createdAt: any, content: Array<string>, role: MessageRole, status: { __typename?: 'FailedMessageStatus', code: MessageStatusCode, reason: string } | { __typename?: 'PendingMessageStatus', code: MessageStatusCode } | { __typename?: 'SuccessMessageStatus', code: MessageStatusCode } }> } & ({ __typename?: 'CopilotResponse', status: { __typename?: 'FailedResponseStatus', code: ResponseStatusCode, reason: FailedResponseStatusReason, details?: any | null } | { __typename?: 'PendingResponseStatus', code: ResponseStatusCode } | { __typename?: 'SuccessResponseStatus', code: ResponseStatusCode } } | { __typename?: 'CopilotResponse', status?: never }) };\n\n\nexport const GenerateCopilotResponseDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"mutation\",\"name\":{\"kind\":\"Name\",\"value\":\"generateCopilotResponse\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"data\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"GenerateCopilotResponseInput\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"properties\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"JSONObject\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"generateCopilotResponse\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"data\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"data\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"properties\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"properties\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"threadId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"runId\"}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"CopilotResponse\"}},\"directives\":[{\"kind\":\"Directive\",\"name\":{\"kind\":\"Name\",\"value\":\"defer\"}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"status\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"BaseResponseStatus\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"FailedResponseStatus\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reason\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"details\"}}]}}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"messages\"},\"directives\":[{\"kind\":\"Directive\",\"name\":{\"kind\":\"Name\",\"value\":\"stream\"}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"__typename\"}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"BaseMessageOutput\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"BaseMessageOutput\"}},\"directives\":[{\"kind\":\"Directive\",\"name\":{\"kind\":\"Name\",\"value\":\"defer\"}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"status\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SuccessMessageStatus\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"FailedMessageStatus\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reason\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"PendingMessageStatus\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}}]}}]}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"TextMessageOutput\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"content\"},\"directives\":[{\"kind\":\"Directive\",\"name\":{\"kind\":\"Name\",\"value\":\"stream\"}}]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"role\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ActionExecutionMessageOutput\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"scope\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"arguments\"},\"directives\":[{\"kind\":\"Directive\",\"name\":{\"kind\":\"Name\",\"value\":\"stream\"}}]}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ResultMessageOutput\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"result\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"actionExecutionId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"actionName\"}}]}},{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"AgentStateMessageOutput\"}},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"threadId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"state\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"running\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"agentName\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodeName\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"runId\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"active\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"role\"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GenerateCopilotResponseMutation, GenerateCopilotResponseMutationVariables>;"],"mappings":";AAyCO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,YAAS;AACT,EAAAA,sBAAA,iBAAc;AACd,EAAAA,sBAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;AAcL,IAAK,0BAAL,kBAAKC,6BAAL;AACL,EAAAA,yBAAA,cAAW;AACX,EAAAA,yBAAA,aAAU;AACV,EAAAA,yBAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;AA0DL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,oBAAA,UAAO;AACP,EAAAA,oBAAA,gBAAa;AACb,EAAAA,oBAAA,UAAO;AACP,EAAAA,oBAAA,wBAAqB;AACrB,EAAAA,oBAAA,qBAAkB;AALR,SAAAA;AAAA,GAAA;AA6BL,IAAK,6BAAL,kBAAKC,gCAAL;AACL,EAAAA,4BAAA,gCAA6B;AAC7B,EAAAA,4BAAA,8BAA2B;AAC3B,EAAAA,4BAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;A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ation
3
- } from "./chunk-3BOGJG6W.mjs";
4
- import {
5
- getAvailableAgentsQuery
6
- } from "./chunk-256E264G.mjs";
3
+ } from "./chunk-RVARJFWJ.mjs";
7
4
 
8
5
  // src/client/CopilotRuntimeClient.ts
9
6
  import { Client, cacheExchange, fetchExchange } from "@urql/core";
10
7
 
11
8
  // package.json
12
- var version = "1.5.1-next.2";
9
+ var version = "1.4.1-pre.6";
13
10
 
14
11
  // src/client/CopilotRuntimeClient.ts
15
- var createFetchFn = (signal) => async (...args) => {
16
- const result = await fetch(args[0], { ...args[1] ?? {}, signal });
17
- if (result.status !== 200) {
18
- switch (result.status) {
19
- case 404:
20
- throw new Error(
21
- "Runtime URL seems to be invalid - got 404 response. Please check the runtimeUrl passed to CopilotKit"
22
- );
23
- default:
24
- throw new Error("Could not fetch copilot response");
25
- }
26
- }
27
- return result;
28
- };
29
12
  var CopilotRuntimeClient = class {
30
13
  constructor(options) {
31
14
  const headers = {};
@@ -53,8 +36,11 @@ var CopilotRuntimeClient = class {
53
36
  properties,
54
37
  signal
55
38
  }) {
56
- const fetchFn = createFetchFn(signal);
57
- const result = this.client.mutation(generateCopilotResponseMutation, { data, properties }, { fetch: fetchFn });
39
+ const result = this.client.mutation(
40
+ generateCopilotResponseMutation,
41
+ { data, properties },
42
+ { fetch: (url, opts) => fetch(url, { ...opts, signal }) }
43
+ );
58
44
  return result;
59
45
  }
60
46
  asStream(source) {
@@ -77,13 +63,9 @@ var CopilotRuntimeClient = class {
77
63
  }
78
64
  });
79
65
  }
80
- availableAgents() {
81
- const fetchFn = createFetchFn();
82
- return this.client.query(getAvailableAgentsQuery, {}, { fetch: fetchFn });
83
- }
84
66
  };
85
67
 
86
68
  export {
87
69
  CopilotRuntimeClient
88
70
  };
89
- //# sourceMappingURL=chunk-EJ6UGR3B.mjs.map
71
+ //# sourceMappingURL=chunk-J3B45FEM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/CopilotRuntimeClient.ts","../package.json"],"sourcesContent":["import { Client, cacheExchange, fetchExchange } from \"@urql/core\";\nimport * as packageJson from \"../../package.json\";\n\nimport {\n GenerateCopilotResponseMutation,\n GenerateCopilotResponseMutationVariables,\n} from \"../graphql/@generated/graphql\";\nimport { generateCopilotResponseMutation } from \"../graphql/definitions/mutations\";\nimport { OperationResultSource, OperationResult } from \"urql\";\n\nexport interface CopilotRuntimeClientOptions {\n url: string;\n publicApiKey?: string;\n headers?: Record<string, string>;\n credentials?: RequestCredentials;\n handleGQLErrors?: (error: Error) => void;\n}\n\nexport class CopilotRuntimeClient {\n client: Client;\n public handleGQLErrors?: (error: Error) => void;\n\n constructor(options: CopilotRuntimeClientOptions) {\n const headers: Record<string, string> = {};\n\n this.handleGQLErrors = options.handleGQLErrors;\n\n if (options.headers) {\n Object.assign(headers, options.headers);\n }\n\n if (options.publicApiKey) {\n headers[\"x-copilotcloud-public-api-key\"] = options.publicApiKey;\n }\n\n this.client = new Client({\n url: options.url,\n exchanges: [cacheExchange, fetchExchange],\n fetchOptions: {\n headers: {\n ...headers,\n \"X-CopilotKit-Runtime-Client-GQL-Version\": packageJson.version,\n },\n ...(options.credentials ? { credentials: options.credentials } : {}),\n },\n });\n }\n\n generateCopilotResponse({\n data,\n properties,\n signal,\n }: {\n data: GenerateCopilotResponseMutationVariables[\"data\"];\n properties?: GenerateCopilotResponseMutationVariables[\"properties\"];\n signal?: AbortSignal;\n }) {\n const result = this.client.mutation<\n GenerateCopilotResponseMutation,\n GenerateCopilotResponseMutationVariables\n >(\n generateCopilotResponseMutation,\n { data, properties },\n { fetch: (url, opts) => fetch(url, { ...opts, signal }) },\n );\n\n return result;\n }\n\n public asStream<S, T>(source: OperationResultSource<OperationResult<S, { data: T }>>) {\n const handleGQLErrors = this.handleGQLErrors;\n return new ReadableStream<S>({\n start(controller) {\n source.subscribe(({ data, hasNext, error }) => {\n if (error) {\n controller.error(error);\n if (handleGQLErrors) {\n handleGQLErrors(error);\n }\n } else {\n controller.enqueue(data);\n if (!hasNext) {\n controller.close();\n }\n }\n });\n },\n });\n }\n}\n","{\n \"name\": \"@copilotkit/runtime-client-gql\",\n \"private\": false,\n \"homepage\": \"https://github.com/CopilotKit/CopilotKit\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/CopilotKit/CopilotKit.git\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"version\": \"1.4.1-pre.6\",\n \"sideEffects\": false,\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n }\n },\n \"types\": \"./dist/index.d.ts\",\n \"license\": \"MIT\",\n \"scripts\": {\n \"build\": \"tsup --clean\",\n \"dev\": \"tsup --watch --no-splitting\",\n \"test\": \"jest --passWithNoTests\",\n \"check-types\": \"tsc --noEmit\",\n \"clean\": \"rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next\",\n \"graphql-codegen\": \"graphql-codegen\",\n \"graphql-codegen:watch\": \"graphql-codegen --watch\",\n \"link:global\": \"pnpm link --global\",\n \"unlink:global\": \"pnpm unlink --global\"\n },\n \"peerDependencies\": {\n \"react\": \"^18 || ^19 || ^19.0.0-rc\"\n },\n \"devDependencies\": {\n \"@graphql-codegen/cli\": \"^5.0.2\",\n \"@graphql-codegen/client-preset\": \"^4.2.6\",\n \"@graphql-codegen/introspection\": \"^4.0.3\",\n \"@graphql-codegen/typescript\": \"^4.0.7\",\n \"@graphql-codegen/typescript-operations\": \"^4.2.1\",\n \"@graphql-codegen/typescript-urql\": \"^4.0.0\",\n \"@graphql-codegen/urql-introspection\": \"^3.0.0\",\n \"@graphql-typed-document-node/core\": \"^3.2.0\",\n \"@parcel/watcher\": \"^2.4.1\",\n \"@types/node\": \"^20.12.12\",\n \"esbuild\": \"^0.23.0\",\n \"jest\": \"^29.6.4\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.2\",\n \"tsup\": \"^6.7.0\",\n \"typescript\": \"^5.4.5\",\n \"@copilotkit/runtime\": \"workspace:*\",\n \"graphql\": \"^16.8.1\"\n },\n \"dependencies\": {\n \"@copilotkit/shared\": \"workspace:*\",\n \"@urql/core\": \"^5.0.3\",\n \"untruncate-json\": \"^0.0.1\",\n \"urql\": \"^4.1.0\"\n },\n \"keywords\": [\n \"copilotkit\",\n \"copilot\",\n \"react\",\n \"nextjs\",\n \"nodejs\",\n \"ai\",\n \"assistant\",\n \"javascript\",\n \"automation\",\n \"textarea\"\n ]\n}\n"],"mappings":";;;;;AAAA,SAAS,QAAQ,eAAe,qBAAqB;;;ACWnD,cAAW;;;ADON,IAAM,uBAAN,MAA2B;AAAA,EAIhC,YAAY,SAAsC;AAChD,UAAM,UAAkC,CAAC;AAEzC,SAAK,kBAAkB,QAAQ;AAE/B,QAAI,QAAQ,SAAS;AACnB,aAAO,OAAO,SAAS,QAAQ,OAAO;AAAA,IACxC;AAEA,QAAI,QAAQ,cAAc;AACxB,cAAQ,+BAA+B,IAAI,QAAQ;AAAA,IACrD;AAEA,SAAK,SAAS,IAAI,OAAO;AAAA,MACvB,KAAK,QAAQ;AAAA,MACb,WAAW,CAAC,eAAe,aAAa;AAAA,MACxC,cAAc;AAAA,QACZ,SAAS;AAAA,UACP,GAAG;AAAA,UACH,2CAAuD;AAAA,QACzD;AAAA,QACA,GAAI,QAAQ,cAAc,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;AAAA,MACpE;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,wBAAwB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAIG;AACD,UAAM,SAAS,KAAK,OAAO;AAAA,MAIzB;AAAA,MACA,EAAE,MAAM,WAAW;AAAA,MACnB,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,EAAE,GAAG,MAAM,OAAO,CAAC,EAAE;AAAA,IAC1D;AAEA,WAAO;AAAA,EACT;AAAA,EAEO,SAAe,QAAgE;AACpF,UAAM,kBAAkB,KAAK;AAC7B,WAAO,IAAI,eAAkB;AAAA,MAC3B,MAAM,YAAY;AAChB,eAAO,UAAU,CAAC,EAAE,MAAM,SAAS,MAAM,MAAM;AAC7C,cAAI,OAAO;AACT,uBAAW,MAAM,KAAK;AACtB,gBAAI,iBAAiB;AACnB,8BAAgB,KAAK;AAAA,YACvB;AAAA,UACF,OAAO;AACL,uBAAW,QAAQ,IAAI;AACvB,gBAAI,CAAC,SAAS;AACZ,yBAAW,MAAM;AAAA,YACnB;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MessageRole
3
- } from "./chunk-AOS57GRG.mjs";
3
+ } from "./chunk-ET5D6GZX.mjs";
4
4
 
5
5
  // src/client/types.ts
6
6
  import { randomId } from "@copilotkit/shared";
@@ -74,4 +74,4 @@ export {
74
74
  ResultMessage,
75
75
  AgentStateMessage
76
76
  };
77
- //# sourceMappingURL=chunk-IZDC2R6Y.mjs.map
77
+ //# sourceMappingURL=chunk-K6FVPY4T.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/types.ts"],"sourcesContent":["import { randomId } from \"@copilotkit/shared\";\nimport {\n ActionExecutionMessageInput,\n MessageRole,\n MessageStatus,\n ResultMessageInput,\n TextMessageInput,\n BaseMessageOutput,\n AgentStateMessageInput,\n MessageStatusCode,\n} from \"../graphql/@generated/graphql\";\n\ntype MessageType = \"TextMessage\" | \"ActionExecutionMessage\" | \"ResultMessage\" | \"AgentStateMessage\";\n\nexport class Message {\n type: MessageType;\n id: BaseMessageOutput[\"id\"];\n createdAt: BaseMessageOutput[\"createdAt\"];\n status: MessageStatus;\n\n constructor(props: any) {\n props.id ??= randomId();\n props.status ??= { code: MessageStatusCode.Success };\n props.createdAt ??= new Date();\n Object.assign(this, props);\n }\n\n isTextMessage(): this is TextMessage {\n return this.type === \"TextMessage\";\n }\n\n isActionExecutionMessage(): this is ActionExecutionMessage {\n return this.type === \"ActionExecutionMessage\";\n }\n\n isResultMessage(): this is ResultMessage {\n return this.type === \"ResultMessage\";\n }\n\n isAgentStateMessage(): this is AgentStateMessage {\n return this.type === \"AgentStateMessage\";\n }\n}\n\n// alias Role to MessageRole\nexport const Role = MessageRole;\n\n// when constructing any message, the base fields are optional\ntype MessageConstructorOptions = Partial<Message>;\n\ntype TextMessageConstructorOptions = MessageConstructorOptions & TextMessageInput;\n\nexport class TextMessage extends Message implements TextMessageConstructorOptions {\n role: TextMessageInput[\"role\"];\n content: TextMessageInput[\"content\"];\n\n constructor(props: TextMessageConstructorOptions) {\n super(props);\n this.type = \"TextMessage\";\n }\n}\n\ntype ActionExecutionMessageConstructorOptions = MessageConstructorOptions &\n Omit<ActionExecutionMessageInput, \"arguments\"> & {\n arguments: Record<string, any>;\n };\n\nexport class ActionExecutionMessage\n extends Message\n implements Omit<ActionExecutionMessageInput, \"arguments\">\n{\n name: ActionExecutionMessageInput[\"name\"];\n arguments: Record<string, any>;\n scope: ActionExecutionMessageInput[\"scope\"];\n\n constructor(props: ActionExecutionMessageConstructorOptions) {\n super(props);\n this.type = \"ActionExecutionMessage\";\n }\n}\n\ntype ResultMessageConstructorOptions = MessageConstructorOptions & ResultMessageInput;\n\nexport class ResultMessage extends Message implements ResultMessageConstructorOptions {\n actionExecutionId: ResultMessageInput[\"actionExecutionId\"];\n actionName: ResultMessageInput[\"actionName\"];\n result: ResultMessageInput[\"result\"];\n\n constructor(props: ResultMessageConstructorOptions) {\n super(props);\n this.type = \"ResultMessage\";\n }\n\n static decodeResult(result: string): any {\n try {\n return JSON.parse(result);\n } catch (e) {\n return result;\n }\n }\n\n static encodeResult(result: any): string {\n if (result === undefined) {\n return \"\";\n } else if (typeof result === \"string\") {\n return result;\n } else {\n return JSON.stringify(result);\n }\n }\n}\n\nexport class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, \"state\"> {\n agentName: AgentStateMessageInput[\"agentName\"];\n state: any;\n running: AgentStateMessageInput[\"running\"];\n threadId: AgentStateMessageInput[\"threadId\"];\n role: AgentStateMessageInput[\"role\"];\n nodeName: AgentStateMessageInput[\"nodeName\"];\n runId: AgentStateMessageInput[\"runId\"];\n active: AgentStateMessageInput[\"active\"];\n\n constructor(props: any) {\n super(props);\n this.type = \"AgentStateMessage\";\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,gBAAgB;AAclB,IAAM,UAAN,MAAc;AAAA,EAMnB,YAAY,OAAY;AACtB,UAAM,OAAN,MAAM,KAAO,SAAS;AACtB,UAAM,WAAN,MAAM,SAAW,EAAE,8BAAgC;AACnD,UAAM,cAAN,MAAM,YAAc,oBAAI,KAAK;AAC7B,WAAO,OAAO,MAAM,KAAK;AAAA,EAC3B;AAAA,EAEA,gBAAqC;AACnC,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,2BAA2D;AACzD,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,kBAAyC;AACvC,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,sBAAiD;AAC/C,WAAO,KAAK,SAAS;AAAA,EACvB;AACF;AAGO,IAAM,OAAO;AAOb,IAAM,cAAN,cAA0B,QAAiD;AAAA,EAIhF,YAAY,OAAsC;AAChD,UAAM,KAAK;AACX,SAAK,OAAO;AAAA,EACd;AACF;AAOO,IAAM,yBAAN,cACG,QAEV;AAAA,EAKE,YAAY,OAAiD;AAC3D,UAAM,KAAK;AACX,SAAK,OAAO;AAAA,EACd;AACF;AAIO,IAAM,gBAAN,cAA4B,QAAmD;AAAA,EAKpF,YAAY,OAAwC;AAClD,UAAM,KAAK;AACX,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,OAAO,aAAa,QAAqB;AACvC,QAAI;AACF,aAAO,KAAK,MAAM,MAAM;AAAA,IAC1B,SAAS,GAAP;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO,aAAa,QAAqB;AACvC,QAAI,WAAW,QAAW;AACxB,aAAO;AAAA,IACT,WAAW,OAAO,WAAW,UAAU;AACrC,aAAO;AAAA,IACT,OAAO;AACL,aAAO,KAAK,UAAU,MAAM;AAAA,IAC9B;AAAA,EACF;AACF;AAEO,IAAM,oBAAN,cAAgC,QAAyD;AAAA,EAU9F,YAAY,OAAY;AACtB,UAAM,KAAK;AACX,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  AgentStateMessage,
4
4
  ResultMessage,
5
5
  TextMessage
6
- } from "./chunk-IZDC2R6Y.mjs";
6
+ } from "./chunk-K6FVPY4T.mjs";
7
7
 
8
8
  // src/client/conversion.ts
9
9
  import untruncateJson from "untruncate-json";
@@ -18,8 +18,7 @@ function convertMessagesToGqlInput(messages) {
18
18
  createdAt: message.createdAt,
19
19
  textMessage: {
20
20
  content: message.content,
21
- role: message.role,
22
- parentMessageId: message.parentMessageId
21
+ role: message.role
23
22
  }
24
23
  };
25
24
  } else if (message.isActionExecutionMessage()) {
@@ -29,7 +28,7 @@ function convertMessagesToGqlInput(messages) {
29
28
  actionExecutionMessage: {
30
29
  name: message.name,
31
30
  arguments: JSON.stringify(message.arguments),
32
- parentMessageId: message.parentMessageId
31
+ scope: message.scope
33
32
  }
34
33
  };
35
34
  } else if (message.isResultMessage()) {
@@ -88,7 +87,6 @@ function convertGqlOutputToMessages(messages) {
88
87
  id: message.id,
89
88
  role: message.role,
90
89
  content: message.content.join(""),
91
- parentMessageId: message.parentMessageId,
92
90
  createdAt: /* @__PURE__ */ new Date(),
93
91
  status: message.status || { code: "Pending" /* Pending */ }
94
92
  });
@@ -97,7 +95,7 @@ function convertGqlOutputToMessages(messages) {
97
95
  id: message.id,
98
96
  name: message.name,
99
97
  arguments: getPartialArguments(message.arguments),
100
- parentMessageId: message.parentMessageId,
98
+ scope: message.scope,
101
99
  createdAt: /* @__PURE__ */ new Date(),
102
100
  status: message.status || { code: "Pending" /* Pending */ }
103
101
  });
@@ -127,61 +125,6 @@ function convertGqlOutputToMessages(messages) {
127
125
  throw new Error("Unknown message type");
128
126
  });
129
127
  }
130
- function loadMessagesFromJsonRepresentation(json) {
131
- const result = [];
132
- for (const item of json) {
133
- if ("content" in item) {
134
- result.push(
135
- new TextMessage({
136
- id: item.id,
137
- role: item.role,
138
- content: item.content,
139
- parentMessageId: item.parentMessageId,
140
- createdAt: item.createdAt || /* @__PURE__ */ new Date(),
141
- status: item.status || { code: "Success" /* Success */ }
142
- })
143
- );
144
- } else if ("arguments" in item) {
145
- result.push(
146
- new ActionExecutionMessage({
147
- id: item.id,
148
- name: item.name,
149
- arguments: item.arguments,
150
- parentMessageId: item.parentMessageId,
151
- createdAt: item.createdAt || /* @__PURE__ */ new Date(),
152
- status: item.status || { code: "Success" /* Success */ }
153
- })
154
- );
155
- } else if ("result" in item) {
156
- result.push(
157
- new ResultMessage({
158
- id: item.id,
159
- result: item.result,
160
- actionExecutionId: item.actionExecutionId,
161
- actionName: item.actionName,
162
- createdAt: item.createdAt || /* @__PURE__ */ new Date(),
163
- status: item.status || { code: "Success" /* Success */ }
164
- })
165
- );
166
- } else if ("state" in item) {
167
- result.push(
168
- new AgentStateMessage({
169
- id: item.id,
170
- threadId: item.threadId,
171
- role: item.role,
172
- agentName: item.agentName,
173
- nodeName: item.nodeName,
174
- runId: item.runId,
175
- active: item.active,
176
- running: item.running,
177
- state: item.state,
178
- createdAt: item.createdAt || /* @__PURE__ */ new Date()
179
- })
180
- );
181
- }
182
- }
183
- return result;
184
- }
185
128
  function getPartialArguments(args) {
186
129
  try {
187
130
  return JSON.parse(untruncateJson(args.join("")));
@@ -194,7 +137,6 @@ export {
194
137
  filterAgentStateMessages,
195
138
  convertMessagesToGqlInput,
196
139
  filterAdjacentAgentStateMessages,
197
- convertGqlOutputToMessages,
198
- loadMessagesFromJsonRepresentation
140
+ convertGqlOutputToMessages
199
141
  };
200
- //# sourceMappingURL=chunk-AXHVBZ73.mjs.map
142
+ //# sourceMappingURL=chunk-OVSA5AEZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/conversion.ts"],"sourcesContent":["import {\n GenerateCopilotResponseMutation,\n MessageInput,\n MessageStatusCode,\n} from \"../graphql/@generated/graphql\";\nimport {\n ActionExecutionMessage,\n AgentStateMessage,\n Message,\n ResultMessage,\n TextMessage,\n} from \"./types\";\n\nimport untruncateJson from \"untruncate-json\";\n\nexport function filterAgentStateMessages(messages: Message[]): Message[] {\n return messages.filter((message) => !message.isAgentStateMessage());\n}\n\nexport function convertMessagesToGqlInput(messages: Message[]): MessageInput[] {\n return messages.map((message) => {\n if (message.isTextMessage()) {\n return {\n id: message.id,\n createdAt: message.createdAt,\n textMessage: {\n content: message.content,\n role: message.role as any,\n },\n };\n } else if (message.isActionExecutionMessage()) {\n return {\n id: message.id,\n createdAt: message.createdAt,\n actionExecutionMessage: {\n name: message.name,\n arguments: JSON.stringify(message.arguments),\n scope: message.scope as any,\n },\n };\n } else if (message.isResultMessage()) {\n return {\n id: message.id,\n createdAt: message.createdAt,\n resultMessage: {\n result: message.result,\n actionExecutionId: message.actionExecutionId,\n actionName: message.actionName,\n },\n };\n } else if (message.isAgentStateMessage()) {\n return {\n id: message.id,\n createdAt: message.createdAt,\n agentStateMessage: {\n threadId: message.threadId,\n role: message.role,\n agentName: message.agentName,\n nodeName: message.nodeName,\n runId: message.runId,\n active: message.active,\n running: message.running,\n state: JSON.stringify(message.state),\n },\n };\n } else {\n throw new Error(\"Unknown message type\");\n }\n });\n}\n\nexport function filterAdjacentAgentStateMessages(\n messages: GenerateCopilotResponseMutation[\"generateCopilotResponse\"][\"messages\"],\n): GenerateCopilotResponseMutation[\"generateCopilotResponse\"][\"messages\"] {\n const filteredMessages: GenerateCopilotResponseMutation[\"generateCopilotResponse\"][\"messages\"] =\n [];\n\n messages.forEach((message, i) => {\n // keep all other message types\n if (message.__typename !== \"AgentStateMessageOutput\") {\n filteredMessages.push(message);\n } else {\n const prevAgentStateMessageIndex = filteredMessages.findIndex(\n // TODO: also check runId\n (m) => m.__typename === \"AgentStateMessageOutput\" && m.agentName === message.agentName,\n );\n if (prevAgentStateMessageIndex === -1) {\n filteredMessages.push(message);\n } else {\n filteredMessages[prevAgentStateMessageIndex] = message;\n }\n }\n });\n\n return filteredMessages;\n}\n\nexport function convertGqlOutputToMessages(\n messages: GenerateCopilotResponseMutation[\"generateCopilotResponse\"][\"messages\"],\n): Message[] {\n return messages.map((message) => {\n if (message.__typename === \"TextMessageOutput\") {\n return new TextMessage({\n id: message.id,\n role: message.role,\n content: message.content.join(\"\"),\n createdAt: new Date(),\n status: message.status || { code: MessageStatusCode.Pending },\n });\n } else if (message.__typename === \"ActionExecutionMessageOutput\") {\n return new ActionExecutionMessage({\n id: message.id,\n name: message.name,\n arguments: getPartialArguments(message.arguments),\n scope: message.scope,\n createdAt: new Date(),\n status: message.status || { code: MessageStatusCode.Pending },\n });\n } else if (message.__typename === \"ResultMessageOutput\") {\n return new ResultMessage({\n id: message.id,\n result: message.result,\n actionExecutionId: message.actionExecutionId,\n actionName: message.actionName,\n createdAt: new Date(),\n status: message.status || { code: MessageStatusCode.Pending },\n });\n } else if (message.__typename === \"AgentStateMessageOutput\") {\n return new AgentStateMessage({\n id: message.id,\n threadId: message.threadId,\n role: message.role,\n agentName: message.agentName,\n nodeName: message.nodeName,\n runId: message.runId,\n active: message.active,\n running: message.running,\n state: JSON.parse(message.state),\n createdAt: new Date(),\n });\n }\n\n throw new Error(\"Unknown message type\");\n });\n}\n\nfunction getPartialArguments(args: string[]) {\n try {\n return JSON.parse(untruncateJson(args.join(\"\")));\n } catch (e) {\n return {};\n }\n}\n"],"mappings":";;;;;;;;AAaA,OAAO,oBAAoB;AAEpB,SAAS,yBAAyB,UAAgC;AACvE,SAAO,SAAS,OAAO,CAAC,YAAY,CAAC,QAAQ,oBAAoB,CAAC;AACpE;AAEO,SAAS,0BAA0B,UAAqC;AAC7E,SAAO,SAAS,IAAI,C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I,QAAQ;AAAA,QACZ,UAAU,QAAQ;AAAA,QAClB,MAAM,QAAQ;AAAA,QACd,WAAW,QAAQ;AAAA,QACnB,UAAU,QAAQ;AAAA,QAClB,OAAO,QAAQ;AAAA,QACf,QAAQ,QAAQ;AAAA,QAChB,SAAS,QAAQ;AAAA,QACjB,OAAO,KAAK,MAAM,QAAQ,KAAK;AAAA,QAC/B,WAAW,oBAAI,KAAK;AAAA,MACtB,CAAC;AAAA,IACH;AAEA,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC,CAAC;AACH;AAEA,SAAS,oBAAoB,MAAgB;AAC3C,MAAI;AACF,WAAO,KAAK,MAAM,eAAe,KAAK,KAAK,EAAE,CAAC,CAAC;AAAA,EACjD,SAAS,GAAP;AACA,WAAO,CAAC;AAAA,EACV;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  graphql
3
- } from "./chunk-WK75ISB2.mjs";
3
+ } from "./chunk-6AYEPQA6.mjs";
4
4
 
5
5
  // src/graphql/definitions/mutations.ts
6
6
  var generateCopilotResponseMutation = graphql(
@@ -44,12 +44,11 @@ var generateCopilotResponseMutation = graphql(
44
44
  ... on TextMessageOutput {
45
45
  content @stream
46
46
  role
47
- parentMessageId
48
47
  }
49
48
  ... on ActionExecutionMessageOutput {
50
49
  name
50
+ scope
51
51
  arguments @stream
52
- parentMessageId
53
52
  }
54
53
  ... on ResultMessageOutput {
55
54
  result
@@ -75,4 +74,4 @@ var generateCopilotResponseMutation = graphql(
75
74
  export {
76
75
  generateCopilotResponseMutation
77
76
  };
78
- //# sourceMappingURL=chunk-3BOGJG6W.mjs.map
77
+ //# sourceMappingURL=chunk-RVARJFWJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphql/definitions/mutations.ts"],"sourcesContent":["import { graphql } from \"../@generated/gql\";\n\nexport const generateCopilotResponseMutation = graphql(/** GraphQL **/ `\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments @stream\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n }\n }\n`);\n"],"mappings":";;;;;AAEO,IAAM,kCAAkC;AAAA;AAAA,EAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgEtE;","names":[]}
1
+ {"version":3,"sources":["../src/graphql/definitions/mutations.ts"],"sourcesContent":["import { graphql } from \"../@generated/gql\";\n\nexport const generateCopilotResponseMutation = graphql(/** GraphQL **/ `\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n }\n ... on ActionExecutionMessageOutput {\n name\n scope\n arguments @stream\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n }\n }\n`);\n"],"mappings":";;;;;AAEO,IAAM,kCAAkC;AAAA;AAAA,EAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+DtE;","names":[]}
@@ -0,0 +1,24 @@
1
+ // src/graphql/@generated/fragment-masking.ts
2
+ function useFragment(_documentNode, fragmentType) {
3
+ return fragmentType;
4
+ }
5
+ function makeFragmentData(data, _fragment) {
6
+ return data;
7
+ }
8
+ function isFragmentReady(queryNode, fragmentNode, data) {
9
+ var _a, _b;
10
+ const deferredFields = (_a = queryNode.__meta__) == null ? void 0 : _a.deferredFields;
11
+ if (!deferredFields)
12
+ return true;
13
+ const fragDef = fragmentNode.definitions[0];
14
+ const fragName = (_b = fragDef == null ? void 0 : fragDef.name) == null ? void 0 : _b.value;
15
+ const fields = fragName && deferredFields[fragName] || [];
16
+ return fields.length > 0 && fields.every((field) => data && field in data);
17
+ }
18
+
19
+ export {
20
+ useFragment,
21
+ makeFragmentData,
22
+ isFragmentReady
23
+ };
24
+ //# sourceMappingURL=chunk-XZPL6QVK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphql/@generated/fragment-masking.ts"],"sourcesContent":["/* eslint-disable */\nimport type { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport type { FragmentDefinitionNode } from 'graphql';\nimport type { Incremental } from './graphql';\n\n\nexport type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<\n infer TType,\n any\n>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is undefined\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined\n): TType | undefined;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null\n): TType | null;\n// return nullable if `fragmentType` is nullable or undefined\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>\n): Array<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): Array<TType> | null | undefined;\n// return readonly array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return readonly array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__\n ?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every(field => data && field in data);\n}\n"],"mappings":";AAyDO,SAAS,YACd,eACA,cACgE;AAChE,SAAO;AACT;AAGO,SAAS,iBAGd,MAAU,WAA+B;AACzC,SAAO;AACT;AACO,SAAS,gBACd,WACA,cACA,MAC2C;AA3E7C;AA4EE,QAAM,kBAAkB,eAAiF,aAAjF,mBACpB;AAEJ,MAAI,CAAC;AAAgB,WAAO;AAE5B,QAAM,UAAU,aAAa,YAAY,CAAC;AAC1C,QAAM,YAAW,wCAAS,SAAT,mBAAe;AAEhC,QAAM,SAAU,YAAY,eAAe,QAAQ,KAAM,CAAC;AAC1D,SAAO,OAAO,SAAS,KAAK,OAAO,MAAM,WAAS,QAAQ,SAAS,IAAI;AACzE;","names":[]}
@@ -1,7 +1,6 @@
1
- import * as urql from 'urql';
2
- import { OperationResultSource, OperationResult } from 'urql';
3
- import { X as GenerateCopilotResponseMutationVariables, Y as GenerateCopilotResponseMutation, E as Exact, G as GenerateCopilotResponseInput, I as InputMaybe, S as Scalars, _ as AvailableAgentsQuery } from '../graphql-21970cc1.js';
1
+ import { GenerateCopilotResponseMutationVariables, GenerateCopilotResponseMutation, Exact, GenerateCopilotResponseInput, InputMaybe, Scalars } from '../graphql/@generated/graphql.js';
4
2
  import { Client } from '@urql/core';
3
+ import { OperationResultSource, OperationResult } from 'urql';
5
4
  import '@graphql-typed-document-node/core';
6
5
 
7
6
  interface CopilotRuntimeClientOptions {
@@ -26,7 +25,6 @@ declare class CopilotRuntimeClient {
26
25
  asStream<S, T>(source: OperationResultSource<OperationResult<S, {
27
26
  data: T;
28
27
  }>>): ReadableStream<S>;
29
- availableAgents(): OperationResultSource<OperationResult<AvailableAgentsQuery, urql.AnyVariables>>;
30
28
  }
31
29
 
32
30
  export { CopilotRuntimeClient, CopilotRuntimeClientOptions };