@copilotkit/runtime 1.5.15-next.6 → 1.5.15-next.8

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 (51) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/__snapshots__/schema/schema.graphql +14 -1
  3. package/dist/{chunk-AJWO2KBE.mjs → chunk-253HES6R.mjs} +2 -2
  4. package/dist/{chunk-MKC4PI66.mjs → chunk-5EJIMI36.mjs} +2 -2
  5. package/dist/{chunk-EMZY3B5S.mjs → chunk-HG6ZQKQW.mjs} +551 -425
  6. package/dist/chunk-HG6ZQKQW.mjs.map +1 -0
  7. package/dist/{chunk-OI2VCNPX.mjs → chunk-R7GOSVTA.mjs} +2 -2
  8. package/dist/{copilot-runtime-a113045f.d.ts → copilot-runtime-3e7f1c7b.d.ts} +5 -4
  9. package/dist/graphql/types/converted/index.d.ts +1 -1
  10. package/dist/{groq-adapter-248058e8.d.ts → groq-adapter-3b894689.d.ts} +1 -1
  11. package/dist/{index-a7f37670.d.ts → index-f6d1f30b.d.ts} +1 -1
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +1296 -1170
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +4 -4
  16. package/dist/{langserve-9580bd66.d.ts → langserve-3a591089.d.ts} +11 -3
  17. package/dist/lib/index.d.ts +4 -4
  18. package/dist/lib/index.js +1296 -1170
  19. package/dist/lib/index.js.map +1 -1
  20. package/dist/lib/index.mjs +4 -4
  21. package/dist/lib/integrations/index.d.ts +4 -4
  22. package/dist/lib/integrations/index.js +493 -400
  23. package/dist/lib/integrations/index.js.map +1 -1
  24. package/dist/lib/integrations/index.mjs +4 -4
  25. package/dist/lib/integrations/nest/index.d.ts +3 -3
  26. package/dist/lib/integrations/nest/index.js +493 -400
  27. package/dist/lib/integrations/nest/index.js.map +1 -1
  28. package/dist/lib/integrations/nest/index.mjs +2 -2
  29. package/dist/lib/integrations/node-express/index.d.ts +3 -3
  30. package/dist/lib/integrations/node-express/index.js +493 -400
  31. package/dist/lib/integrations/node-express/index.js.map +1 -1
  32. package/dist/lib/integrations/node-express/index.mjs +2 -2
  33. package/dist/lib/integrations/node-http/index.d.ts +3 -3
  34. package/dist/lib/integrations/node-http/index.js +493 -400
  35. package/dist/lib/integrations/node-http/index.js.map +1 -1
  36. package/dist/lib/integrations/node-http/index.mjs +1 -1
  37. package/dist/service-adapters/index.d.ts +4 -4
  38. package/package.json +2 -2
  39. package/src/agents/langgraph/event-source.ts +7 -0
  40. package/src/agents/langgraph/events.ts +11 -1
  41. package/src/graphql/inputs/meta-event.input.ts +4 -3
  42. package/src/graphql/resolvers/copilot.resolver.ts +44 -1
  43. package/src/graphql/types/copilot-response.type.ts +1 -3
  44. package/src/graphql/types/meta-events.type.ts +41 -1
  45. package/src/lib/runtime/copilot-runtime.ts +18 -9
  46. package/src/lib/runtime/remote-lg-action.ts +44 -19
  47. package/src/service-adapters/events.ts +8 -2
  48. package/dist/chunk-EMZY3B5S.mjs.map +0 -1
  49. /package/dist/{chunk-AJWO2KBE.mjs.map → chunk-253HES6R.mjs.map} +0 -0
  50. /package/dist/{chunk-MKC4PI66.mjs.map → chunk-5EJIMI36.mjs.map} +0 -0
  51. /package/dist/{chunk-OI2VCNPX.mjs.map → chunk-R7GOSVTA.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.5.15-next.6",
47
+ version: "1.5.15-next.8",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1591,10 +1591,12 @@ var LangGraphEventTypes;
1591
1591
  LangGraphEventTypes2["OnCopilotKitEmitToolCall"] = "on_copilotkit_emit_tool_call";
1592
1592
  LangGraphEventTypes2["OnCustomEvent"] = "on_custom_event";
1593
1593
  LangGraphEventTypes2["OnInterrupt"] = "on_interrupt";
1594
+ LangGraphEventTypes2["OnCopilotKitInterrupt"] = "on_copilotkit_interrupt";
1594
1595
  })(LangGraphEventTypes || (LangGraphEventTypes = {}));
1595
1596
  var MetaEventNames;
1596
1597
  (function(MetaEventNames2) {
1597
1598
  MetaEventNames2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
1599
+ MetaEventNames2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
1598
1600
  })(MetaEventNames || (MetaEventNames = {}));
1599
1601
  var CustomEventNames;
1600
1602
  (function(CustomEventNames2) {
@@ -1699,6 +1701,13 @@ var RemoteLangGraphEventSource = class {
1699
1701
  value: acc.event.value
1700
1702
  });
1701
1703
  }
1704
+ if (acc.event.event === LangGraphEventTypes.OnCopilotKitInterrupt) {
1705
+ events.push({
1706
+ type: RuntimeEventTypes.MetaEvent,
1707
+ name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent,
1708
+ data: acc.event.data
1709
+ });
1710
+ }
1702
1711
  const responseMetadata = this.getResponseMetadata(acc.event);
1703
1712
  if ((responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "tool_calls" && this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName)) {
1704
1713
  events.push({
@@ -1867,6 +1876,12 @@ var ActionInputAvailability;
1867
1876
  });
1868
1877
 
1869
1878
  // src/graphql/types/meta-events.type.ts
1879
+ var import_type_graphql6 = require("type-graphql");
1880
+
1881
+ // src/graphql/types/copilot-response.type.ts
1882
+ var import_type_graphql5 = require("type-graphql");
1883
+
1884
+ // src/graphql/types/message-status.type.ts
1870
1885
  var import_type_graphql2 = require("type-graphql");
1871
1886
  function _ts_decorate(decorators, target, key, desc) {
1872
1887
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1884,151 +1899,634 @@ function _ts_metadata(k, v) {
1884
1899
  return Reflect.metadata(k, v);
1885
1900
  }
1886
1901
  __name(_ts_metadata, "_ts_metadata");
1887
- var MetaEventName;
1888
- (function(MetaEventName2) {
1889
- MetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
1890
- })(MetaEventName || (MetaEventName = {}));
1891
- (0, import_type_graphql2.registerEnumType)(MetaEventName, {
1892
- name: "MetaEventName",
1893
- description: "Meta event types"
1902
+ var MessageStatusCode;
1903
+ (function(MessageStatusCode2) {
1904
+ MessageStatusCode2["Pending"] = "pending";
1905
+ MessageStatusCode2["Success"] = "success";
1906
+ MessageStatusCode2["Failed"] = "failed";
1907
+ })(MessageStatusCode || (MessageStatusCode = {}));
1908
+ (0, import_type_graphql2.registerEnumType)(MessageStatusCode, {
1909
+ name: "MessageStatusCode"
1894
1910
  });
1895
- var BaseMetaEvent = class {
1896
- type = "MetaEvent";
1897
- name;
1898
- };
1899
- __name(BaseMetaEvent, "BaseMetaEvent");
1900
- _ts_decorate([
1901
- (0, import_type_graphql2.Field)(() => String),
1902
- _ts_metadata("design:type", String)
1903
- ], BaseMetaEvent.prototype, "type", void 0);
1911
+ var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
1912
+ code;
1913
+ }, "BaseMessageStatus");
1904
1914
  _ts_decorate([
1905
- (0, import_type_graphql2.Field)(() => MetaEventName),
1915
+ (0, import_type_graphql2.Field)(() => MessageStatusCode),
1906
1916
  _ts_metadata("design:type", String)
1907
- ], BaseMetaEvent.prototype, "name", void 0);
1908
- BaseMetaEvent = _ts_decorate([
1909
- (0, import_type_graphql2.InterfaceType)()
1910
- ], BaseMetaEvent);
1911
- var LangGraphInterruptEvent = class {
1912
- name = "LangGraphInterruptEvent";
1913
- value;
1914
- response;
1917
+ ], BaseMessageStatus.prototype, "code", void 0);
1918
+ BaseMessageStatus = _ts_decorate([
1919
+ (0, import_type_graphql2.ObjectType)()
1920
+ ], BaseMessageStatus);
1921
+ var PendingMessageStatus = class extends BaseMessageStatus {
1922
+ code = "pending";
1915
1923
  };
1916
- __name(LangGraphInterruptEvent, "LangGraphInterruptEvent");
1917
- _ts_decorate([
1918
- (0, import_type_graphql2.Field)(() => MetaEventName),
1919
- _ts_metadata("design:type", typeof MetaEventName === "undefined" || false ? Object : "LangGraphInterruptEvent")
1920
- ], LangGraphInterruptEvent.prototype, "name", void 0);
1924
+ __name(PendingMessageStatus, "PendingMessageStatus");
1925
+ PendingMessageStatus = _ts_decorate([
1926
+ (0, import_type_graphql2.ObjectType)()
1927
+ ], PendingMessageStatus);
1928
+ var SuccessMessageStatus = class extends BaseMessageStatus {
1929
+ code = "success";
1930
+ };
1931
+ __name(SuccessMessageStatus, "SuccessMessageStatus");
1932
+ SuccessMessageStatus = _ts_decorate([
1933
+ (0, import_type_graphql2.ObjectType)()
1934
+ ], SuccessMessageStatus);
1935
+ var FailedMessageStatus = class extends BaseMessageStatus {
1936
+ code = "failed";
1937
+ reason;
1938
+ };
1939
+ __name(FailedMessageStatus, "FailedMessageStatus");
1921
1940
  _ts_decorate([
1922
1941
  (0, import_type_graphql2.Field)(() => String),
1923
1942
  _ts_metadata("design:type", String)
1924
- ], LangGraphInterruptEvent.prototype, "value", void 0);
1925
- _ts_decorate([
1926
- (0, import_type_graphql2.Field)(() => String, {
1943
+ ], FailedMessageStatus.prototype, "reason", void 0);
1944
+ FailedMessageStatus = _ts_decorate([
1945
+ (0, import_type_graphql2.ObjectType)()
1946
+ ], FailedMessageStatus);
1947
+ var MessageStatusUnion = (0, import_type_graphql2.createUnionType)({
1948
+ name: "MessageStatus",
1949
+ types: () => [
1950
+ PendingMessageStatus,
1951
+ SuccessMessageStatus,
1952
+ FailedMessageStatus
1953
+ ]
1954
+ });
1955
+
1956
+ // src/graphql/types/response-status.type.ts
1957
+ var import_graphql_scalars = require("graphql-scalars");
1958
+ var import_type_graphql3 = require("type-graphql");
1959
+ function _ts_decorate2(decorators, target, key, desc) {
1960
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1961
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1962
+ r = Reflect.decorate(decorators, target, key, desc);
1963
+ else
1964
+ for (var i = decorators.length - 1; i >= 0; i--)
1965
+ if (d = decorators[i])
1966
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1967
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1968
+ }
1969
+ __name(_ts_decorate2, "_ts_decorate");
1970
+ function _ts_metadata2(k, v) {
1971
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1972
+ return Reflect.metadata(k, v);
1973
+ }
1974
+ __name(_ts_metadata2, "_ts_metadata");
1975
+ var ResponseStatusCode;
1976
+ (function(ResponseStatusCode2) {
1977
+ ResponseStatusCode2["Pending"] = "pending";
1978
+ ResponseStatusCode2["Success"] = "success";
1979
+ ResponseStatusCode2["Failed"] = "failed";
1980
+ })(ResponseStatusCode || (ResponseStatusCode = {}));
1981
+ (0, import_type_graphql3.registerEnumType)(ResponseStatusCode, {
1982
+ name: "ResponseStatusCode"
1983
+ });
1984
+ var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
1985
+ code;
1986
+ }, "BaseResponseStatus");
1987
+ _ts_decorate2([
1988
+ (0, import_type_graphql3.Field)(() => ResponseStatusCode),
1989
+ _ts_metadata2("design:type", String)
1990
+ ], BaseResponseStatus.prototype, "code", void 0);
1991
+ BaseResponseStatus = _ts_decorate2([
1992
+ (0, import_type_graphql3.InterfaceType)({
1993
+ resolveType(value) {
1994
+ if (value.code === "success") {
1995
+ return SuccessResponseStatus;
1996
+ } else if (value.code === "failed") {
1997
+ return FailedResponseStatus;
1998
+ } else if (value.code === "pending") {
1999
+ return PendingResponseStatus;
2000
+ }
2001
+ return void 0;
2002
+ }
2003
+ }),
2004
+ (0, import_type_graphql3.ObjectType)()
2005
+ ], BaseResponseStatus);
2006
+ var PendingResponseStatus = class extends BaseResponseStatus {
2007
+ code = "pending";
2008
+ };
2009
+ __name(PendingResponseStatus, "PendingResponseStatus");
2010
+ PendingResponseStatus = _ts_decorate2([
2011
+ (0, import_type_graphql3.ObjectType)({
2012
+ implements: BaseResponseStatus
2013
+ })
2014
+ ], PendingResponseStatus);
2015
+ var SuccessResponseStatus = class extends BaseResponseStatus {
2016
+ code = "success";
2017
+ };
2018
+ __name(SuccessResponseStatus, "SuccessResponseStatus");
2019
+ SuccessResponseStatus = _ts_decorate2([
2020
+ (0, import_type_graphql3.ObjectType)({
2021
+ implements: BaseResponseStatus
2022
+ })
2023
+ ], SuccessResponseStatus);
2024
+ var FailedResponseStatusReason;
2025
+ (function(FailedResponseStatusReason2) {
2026
+ FailedResponseStatusReason2["GUARDRAILS_VALIDATION_FAILED"] = "GUARDRAILS_VALIDATION_FAILED";
2027
+ FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
2028
+ FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
2029
+ })(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
2030
+ (0, import_type_graphql3.registerEnumType)(FailedResponseStatusReason, {
2031
+ name: "FailedResponseStatusReason"
2032
+ });
2033
+ var FailedResponseStatus = class extends BaseResponseStatus {
2034
+ code = "failed";
2035
+ reason;
2036
+ details = null;
2037
+ };
2038
+ __name(FailedResponseStatus, "FailedResponseStatus");
2039
+ _ts_decorate2([
2040
+ (0, import_type_graphql3.Field)(() => FailedResponseStatusReason),
2041
+ _ts_metadata2("design:type", String)
2042
+ ], FailedResponseStatus.prototype, "reason", void 0);
2043
+ _ts_decorate2([
2044
+ (0, import_type_graphql3.Field)(() => import_graphql_scalars.GraphQLJSON, {
1927
2045
  nullable: true
1928
2046
  }),
1929
- _ts_metadata("design:type", String)
1930
- ], LangGraphInterruptEvent.prototype, "response", void 0);
1931
- LangGraphInterruptEvent = _ts_decorate([
1932
- (0, import_type_graphql2.ObjectType)({
1933
- implements: BaseMetaEvent
2047
+ _ts_metadata2("design:type", typeof Record === "undefined" ? Object : Record)
2048
+ ], FailedResponseStatus.prototype, "details", void 0);
2049
+ FailedResponseStatus = _ts_decorate2([
2050
+ (0, import_type_graphql3.ObjectType)({
2051
+ implements: BaseResponseStatus
1934
2052
  })
1935
- ], LangGraphInterruptEvent);
2053
+ ], FailedResponseStatus);
2054
+ var ResponseStatusUnion = (0, import_type_graphql3.createUnionType)({
2055
+ name: "ResponseStatus",
2056
+ types: () => [
2057
+ PendingResponseStatus,
2058
+ SuccessResponseStatus,
2059
+ FailedResponseStatus
2060
+ ]
2061
+ });
1936
2062
 
1937
- // src/lib/runtime/remote-lg-action.ts
1938
- async function execute(args) {
1939
- return new ReadableStream({
1940
- async start(controller) {
1941
- try {
1942
- await streamEvents(controller, args);
1943
- controller.close();
1944
- } catch (err) {
1945
- }
1946
- }
1947
- });
2063
+ // src/graphql/types/extensions-response.type.ts
2064
+ var import_type_graphql4 = require("type-graphql");
2065
+ function _ts_decorate3(decorators, target, key, desc) {
2066
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2067
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2068
+ r = Reflect.decorate(decorators, target, key, desc);
2069
+ else
2070
+ for (var i = decorators.length - 1; i >= 0; i--)
2071
+ if (d = decorators[i])
2072
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2073
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1948
2074
  }
1949
- __name(execute, "execute");
1950
- async function streamEvents(controller, args) {
1951
- var _a, _b, _c, _d, _e, _f, _g, _h;
1952
- const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, messages, actions, logger: logger2, properties, metaEvents } = args;
1953
- let nodeName = initialNodeName;
1954
- let state = initialState;
1955
- const { name, assistantId: initialAssistantId } = agent;
1956
- const propertyHeaders = properties.authorization ? {
1957
- authorization: `Bearer ${properties.authorization}`
1958
- } : null;
1959
- const client = new import_langgraph_sdk.Client({
1960
- apiUrl: deploymentUrl,
1961
- apiKey: langsmithApiKey,
1962
- defaultHeaders: {
1963
- ...propertyHeaders
1964
- }
1965
- });
1966
- let threadId = argsInitialThreadId ?? (0, import_shared10.randomUUID)();
1967
- if (argsInitialThreadId && argsInitialThreadId.startsWith("ck-")) {
1968
- threadId = argsInitialThreadId.substring(3);
1969
- }
1970
- if (!(0, import_shared10.isValidUUID)(threadId)) {
1971
- console.warn(`Cannot use the threadId ${threadId} with LangGraph Platform. Must be a valid UUID.`);
1972
- }
1973
- let wasInitiatedWithExistingThread = true;
1974
- try {
1975
- await client.threads.get(threadId);
1976
- } catch (error) {
1977
- wasInitiatedWithExistingThread = false;
1978
- await client.threads.create({
1979
- threadId
1980
- });
1981
- }
1982
- let agentState = {
1983
- values: {}
1984
- };
1985
- if (wasInitiatedWithExistingThread) {
1986
- agentState = await client.threads.getState(threadId);
1987
- }
1988
- const agentStateValues = agentState.values;
1989
- state.messages = agentStateValues.messages;
1990
- const mode = threadId && nodeName != "__end__" && nodeName != void 0 && nodeName != null ? "continue" : "start";
1991
- let formattedMessages = [];
1992
- try {
1993
- formattedMessages = copilotkitMessagesToLangChain(messages);
1994
- } catch (e) {
1995
- logger2.error(e, `Error event thrown: ${e.message}`);
1996
- }
1997
- state = langGraphDefaultMergeState(state, formattedMessages, actions, name);
1998
- const lgInterruptEvent = metaEvents == null ? void 0 : metaEvents.find((ev) => ev.name === MetaEventName.LangGraphInterruptEvent);
1999
- if (mode === "continue" && !lgInterruptEvent) {
2000
- await client.threads.updateState(threadId, {
2001
- values: state,
2002
- asNode: nodeName
2003
- });
2004
- }
2005
- let streamInfo = {
2006
- hashedLgcKey: (0, import_node_crypto.createHash)("sha256").update(langsmithApiKey).digest("hex")
2007
- };
2008
- const assistants = await client.assistants.search();
2009
- const retrievedAssistant = assistants.find((a) => a.name === name || a.assistant_id === initialAssistantId);
2010
- if (!retrievedAssistant) {
2011
- telemetry_client_default.capture("oss.runtime.agent_execution_stream_errored", {
2012
- ...streamInfo,
2013
- error: `Found no assistants for given information, while ${assistants.length} assistants exists`
2014
- });
2015
- console.error(`
2016
- No agent found for the agent name specified in CopilotKit provider
2017
- Please check your available agents or provide an agent ID in the LangGraph Platform endpoint definition.
2018
-
2019
-
2020
- These are the available agents: [${assistants.map((a) => `${a.name} (ID: ${a.assistant_id})`).join(", ")}]
2021
- `);
2022
- throw new Error("No agent id found");
2075
+ __name(_ts_decorate3, "_ts_decorate");
2076
+ function _ts_metadata3(k, v) {
2077
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2078
+ return Reflect.metadata(k, v);
2079
+ }
2080
+ __name(_ts_metadata3, "_ts_metadata");
2081
+ var ExtensionsResponse = class {
2082
+ openaiAssistantAPI;
2083
+ };
2084
+ __name(ExtensionsResponse, "ExtensionsResponse");
2085
+ _ts_decorate3([
2086
+ (0, import_type_graphql4.Field)(() => OpenAIApiAssistantAPIResponse, {
2087
+ nullable: true
2088
+ }),
2089
+ _ts_metadata3("design:type", typeof OpenAIApiAssistantAPIResponse === "undefined" ? Object : OpenAIApiAssistantAPIResponse)
2090
+ ], ExtensionsResponse.prototype, "openaiAssistantAPI", void 0);
2091
+ ExtensionsResponse = _ts_decorate3([
2092
+ (0, import_type_graphql4.ObjectType)()
2093
+ ], ExtensionsResponse);
2094
+ var OpenAIApiAssistantAPIResponse = class {
2095
+ runId;
2096
+ threadId;
2097
+ };
2098
+ __name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
2099
+ _ts_decorate3([
2100
+ (0, import_type_graphql4.Field)(() => String, {
2101
+ nullable: true
2102
+ }),
2103
+ _ts_metadata3("design:type", String)
2104
+ ], OpenAIApiAssistantAPIResponse.prototype, "runId", void 0);
2105
+ _ts_decorate3([
2106
+ (0, import_type_graphql4.Field)(() => String, {
2107
+ nullable: true
2108
+ }),
2109
+ _ts_metadata3("design:type", String)
2110
+ ], OpenAIApiAssistantAPIResponse.prototype, "threadId", void 0);
2111
+ OpenAIApiAssistantAPIResponse = _ts_decorate3([
2112
+ (0, import_type_graphql4.ObjectType)()
2113
+ ], OpenAIApiAssistantAPIResponse);
2114
+
2115
+ // src/graphql/types/copilot-response.type.ts
2116
+ function _ts_decorate4(decorators, target, key, desc) {
2117
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2118
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2119
+ r = Reflect.decorate(decorators, target, key, desc);
2120
+ else
2121
+ for (var i = decorators.length - 1; i >= 0; i--)
2122
+ if (d = decorators[i])
2123
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2124
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2125
+ }
2126
+ __name(_ts_decorate4, "_ts_decorate");
2127
+ function _ts_metadata4(k, v) {
2128
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2129
+ return Reflect.metadata(k, v);
2130
+ }
2131
+ __name(_ts_metadata4, "_ts_metadata");
2132
+ var BaseMessageOutput = class {
2133
+ id;
2134
+ createdAt;
2135
+ status;
2136
+ };
2137
+ __name(BaseMessageOutput, "BaseMessageOutput");
2138
+ _ts_decorate4([
2139
+ (0, import_type_graphql5.Field)(() => String),
2140
+ _ts_metadata4("design:type", String)
2141
+ ], BaseMessageOutput.prototype, "id", void 0);
2142
+ _ts_decorate4([
2143
+ (0, import_type_graphql5.Field)(() => Date),
2144
+ _ts_metadata4("design:type", typeof Date === "undefined" ? Object : Date)
2145
+ ], BaseMessageOutput.prototype, "createdAt", void 0);
2146
+ _ts_decorate4([
2147
+ (0, import_type_graphql5.Field)(() => MessageStatusUnion),
2148
+ _ts_metadata4("design:type", Object)
2149
+ ], BaseMessageOutput.prototype, "status", void 0);
2150
+ BaseMessageOutput = _ts_decorate4([
2151
+ (0, import_type_graphql5.InterfaceType)({
2152
+ resolveType(value) {
2153
+ if (value.hasOwnProperty("content")) {
2154
+ return TextMessageOutput;
2155
+ } else if (value.hasOwnProperty("name")) {
2156
+ return ActionExecutionMessageOutput;
2157
+ } else if (value.hasOwnProperty("result")) {
2158
+ return ResultMessageOutput;
2159
+ } else if (value.hasOwnProperty("state")) {
2160
+ return AgentStateMessageOutput;
2161
+ }
2162
+ return void 0;
2163
+ }
2164
+ })
2165
+ ], BaseMessageOutput);
2166
+ var TextMessageOutput = class {
2167
+ role;
2168
+ content;
2169
+ parentMessageId;
2170
+ };
2171
+ __name(TextMessageOutput, "TextMessageOutput");
2172
+ _ts_decorate4([
2173
+ (0, import_type_graphql5.Field)(() => MessageRole),
2174
+ _ts_metadata4("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
2175
+ ], TextMessageOutput.prototype, "role", void 0);
2176
+ _ts_decorate4([
2177
+ (0, import_type_graphql5.Field)(() => [
2178
+ String
2179
+ ]),
2180
+ _ts_metadata4("design:type", Array)
2181
+ ], TextMessageOutput.prototype, "content", void 0);
2182
+ _ts_decorate4([
2183
+ (0, import_type_graphql5.Field)(() => String, {
2184
+ nullable: true
2185
+ }),
2186
+ _ts_metadata4("design:type", String)
2187
+ ], TextMessageOutput.prototype, "parentMessageId", void 0);
2188
+ TextMessageOutput = _ts_decorate4([
2189
+ (0, import_type_graphql5.ObjectType)({
2190
+ implements: BaseMessageOutput
2191
+ })
2192
+ ], TextMessageOutput);
2193
+ var ActionExecutionMessageOutput = class {
2194
+ name;
2195
+ scope;
2196
+ arguments;
2197
+ parentMessageId;
2198
+ };
2199
+ __name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
2200
+ _ts_decorate4([
2201
+ (0, import_type_graphql5.Field)(() => String),
2202
+ _ts_metadata4("design:type", String)
2203
+ ], ActionExecutionMessageOutput.prototype, "name", void 0);
2204
+ _ts_decorate4([
2205
+ (0, import_type_graphql5.Field)(() => String, {
2206
+ nullable: true,
2207
+ deprecationReason: "This field will be removed in a future version"
2208
+ }),
2209
+ _ts_metadata4("design:type", String)
2210
+ ], ActionExecutionMessageOutput.prototype, "scope", void 0);
2211
+ _ts_decorate4([
2212
+ (0, import_type_graphql5.Field)(() => [
2213
+ String
2214
+ ]),
2215
+ _ts_metadata4("design:type", Array)
2216
+ ], ActionExecutionMessageOutput.prototype, "arguments", void 0);
2217
+ _ts_decorate4([
2218
+ (0, import_type_graphql5.Field)(() => String, {
2219
+ nullable: true
2220
+ }),
2221
+ _ts_metadata4("design:type", String)
2222
+ ], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
2223
+ ActionExecutionMessageOutput = _ts_decorate4([
2224
+ (0, import_type_graphql5.ObjectType)({
2225
+ implements: BaseMessageOutput
2226
+ })
2227
+ ], ActionExecutionMessageOutput);
2228
+ var ResultMessageOutput = class {
2229
+ actionExecutionId;
2230
+ actionName;
2231
+ result;
2232
+ };
2233
+ __name(ResultMessageOutput, "ResultMessageOutput");
2234
+ _ts_decorate4([
2235
+ (0, import_type_graphql5.Field)(() => String),
2236
+ _ts_metadata4("design:type", String)
2237
+ ], ResultMessageOutput.prototype, "actionExecutionId", void 0);
2238
+ _ts_decorate4([
2239
+ (0, import_type_graphql5.Field)(() => String),
2240
+ _ts_metadata4("design:type", String)
2241
+ ], ResultMessageOutput.prototype, "actionName", void 0);
2242
+ _ts_decorate4([
2243
+ (0, import_type_graphql5.Field)(() => String),
2244
+ _ts_metadata4("design:type", String)
2245
+ ], ResultMessageOutput.prototype, "result", void 0);
2246
+ ResultMessageOutput = _ts_decorate4([
2247
+ (0, import_type_graphql5.ObjectType)({
2248
+ implements: BaseMessageOutput
2249
+ })
2250
+ ], ResultMessageOutput);
2251
+ var AgentStateMessageOutput = class {
2252
+ threadId;
2253
+ agentName;
2254
+ nodeName;
2255
+ runId;
2256
+ active;
2257
+ role;
2258
+ state;
2259
+ running;
2260
+ };
2261
+ __name(AgentStateMessageOutput, "AgentStateMessageOutput");
2262
+ _ts_decorate4([
2263
+ (0, import_type_graphql5.Field)(() => String),
2264
+ _ts_metadata4("design:type", String)
2265
+ ], AgentStateMessageOutput.prototype, "threadId", void 0);
2266
+ _ts_decorate4([
2267
+ (0, import_type_graphql5.Field)(() => String),
2268
+ _ts_metadata4("design:type", String)
2269
+ ], AgentStateMessageOutput.prototype, "agentName", void 0);
2270
+ _ts_decorate4([
2271
+ (0, import_type_graphql5.Field)(() => String),
2272
+ _ts_metadata4("design:type", String)
2273
+ ], AgentStateMessageOutput.prototype, "nodeName", void 0);
2274
+ _ts_decorate4([
2275
+ (0, import_type_graphql5.Field)(() => String),
2276
+ _ts_metadata4("design:type", String)
2277
+ ], AgentStateMessageOutput.prototype, "runId", void 0);
2278
+ _ts_decorate4([
2279
+ (0, import_type_graphql5.Field)(() => Boolean),
2280
+ _ts_metadata4("design:type", Boolean)
2281
+ ], AgentStateMessageOutput.prototype, "active", void 0);
2282
+ _ts_decorate4([
2283
+ (0, import_type_graphql5.Field)(() => MessageRole),
2284
+ _ts_metadata4("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
2285
+ ], AgentStateMessageOutput.prototype, "role", void 0);
2286
+ _ts_decorate4([
2287
+ (0, import_type_graphql5.Field)(() => String),
2288
+ _ts_metadata4("design:type", String)
2289
+ ], AgentStateMessageOutput.prototype, "state", void 0);
2290
+ _ts_decorate4([
2291
+ (0, import_type_graphql5.Field)(() => Boolean),
2292
+ _ts_metadata4("design:type", Boolean)
2293
+ ], AgentStateMessageOutput.prototype, "running", void 0);
2294
+ AgentStateMessageOutput = _ts_decorate4([
2295
+ (0, import_type_graphql5.ObjectType)({
2296
+ implements: BaseMessageOutput
2297
+ })
2298
+ ], AgentStateMessageOutput);
2299
+ var CopilotResponse = class {
2300
+ threadId;
2301
+ status;
2302
+ runId;
2303
+ messages;
2304
+ extensions;
2305
+ metaEvents;
2306
+ };
2307
+ __name(CopilotResponse, "CopilotResponse");
2308
+ _ts_decorate4([
2309
+ (0, import_type_graphql5.Field)(() => String),
2310
+ _ts_metadata4("design:type", String)
2311
+ ], CopilotResponse.prototype, "threadId", void 0);
2312
+ _ts_decorate4([
2313
+ (0, import_type_graphql5.Field)(() => ResponseStatusUnion),
2314
+ _ts_metadata4("design:type", Object)
2315
+ ], CopilotResponse.prototype, "status", void 0);
2316
+ _ts_decorate4([
2317
+ (0, import_type_graphql5.Field)({
2318
+ nullable: true
2319
+ }),
2320
+ _ts_metadata4("design:type", String)
2321
+ ], CopilotResponse.prototype, "runId", void 0);
2322
+ _ts_decorate4([
2323
+ (0, import_type_graphql5.Field)(() => [
2324
+ BaseMessageOutput
2325
+ ]),
2326
+ _ts_metadata4("design:type", Array)
2327
+ ], CopilotResponse.prototype, "messages", void 0);
2328
+ _ts_decorate4([
2329
+ (0, import_type_graphql5.Field)(() => ExtensionsResponse, {
2330
+ nullable: true
2331
+ }),
2332
+ _ts_metadata4("design:type", typeof ExtensionsResponse === "undefined" ? Object : ExtensionsResponse)
2333
+ ], CopilotResponse.prototype, "extensions", void 0);
2334
+ _ts_decorate4([
2335
+ (0, import_type_graphql5.Field)(() => [
2336
+ BaseMetaEvent
2337
+ ], {
2338
+ nullable: true
2339
+ }),
2340
+ _ts_metadata4("design:type", Array)
2341
+ ], CopilotResponse.prototype, "metaEvents", void 0);
2342
+ CopilotResponse = _ts_decorate4([
2343
+ (0, import_type_graphql5.ObjectType)()
2344
+ ], CopilotResponse);
2345
+
2346
+ // src/graphql/types/meta-events.type.ts
2347
+ function _ts_decorate5(decorators, target, key, desc) {
2348
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2349
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2350
+ r = Reflect.decorate(decorators, target, key, desc);
2351
+ else
2352
+ for (var i = decorators.length - 1; i >= 0; i--)
2353
+ if (d = decorators[i])
2354
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2355
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2356
+ }
2357
+ __name(_ts_decorate5, "_ts_decorate");
2358
+ function _ts_metadata5(k, v) {
2359
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2360
+ return Reflect.metadata(k, v);
2361
+ }
2362
+ __name(_ts_metadata5, "_ts_metadata");
2363
+ var MetaEventName;
2364
+ (function(MetaEventName2) {
2365
+ MetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
2366
+ MetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
2367
+ })(MetaEventName || (MetaEventName = {}));
2368
+ (0, import_type_graphql6.registerEnumType)(MetaEventName, {
2369
+ name: "MetaEventName",
2370
+ description: "Meta event types"
2371
+ });
2372
+ var BaseMetaEvent = class {
2373
+ type = "MetaEvent";
2374
+ name;
2375
+ };
2376
+ __name(BaseMetaEvent, "BaseMetaEvent");
2377
+ _ts_decorate5([
2378
+ (0, import_type_graphql6.Field)(() => String),
2379
+ _ts_metadata5("design:type", String)
2380
+ ], BaseMetaEvent.prototype, "type", void 0);
2381
+ _ts_decorate5([
2382
+ (0, import_type_graphql6.Field)(() => MetaEventName),
2383
+ _ts_metadata5("design:type", String)
2384
+ ], BaseMetaEvent.prototype, "name", void 0);
2385
+ BaseMetaEvent = _ts_decorate5([
2386
+ (0, import_type_graphql6.InterfaceType)({
2387
+ resolveType(value) {
2388
+ if (value.name === "LangGraphInterruptEvent") {
2389
+ return LangGraphInterruptEvent;
2390
+ } else if (value.name === "CopilotKitLangGraphInterruptEvent") {
2391
+ return CopilotKitLangGraphInterruptEvent;
2392
+ }
2393
+ return void 0;
2394
+ }
2395
+ }),
2396
+ (0, import_type_graphql6.InterfaceType)()
2397
+ ], BaseMetaEvent);
2398
+ var CopilotKitLangGraphInterruptEventData = class {
2399
+ value;
2400
+ messages;
2401
+ };
2402
+ __name(CopilotKitLangGraphInterruptEventData, "CopilotKitLangGraphInterruptEventData");
2403
+ _ts_decorate5([
2404
+ (0, import_type_graphql6.Field)(() => String),
2405
+ _ts_metadata5("design:type", String)
2406
+ ], CopilotKitLangGraphInterruptEventData.prototype, "value", void 0);
2407
+ _ts_decorate5([
2408
+ (0, import_type_graphql6.Field)(() => [
2409
+ BaseMessageOutput
2410
+ ]),
2411
+ _ts_metadata5("design:type", Array)
2412
+ ], CopilotKitLangGraphInterruptEventData.prototype, "messages", void 0);
2413
+ CopilotKitLangGraphInterruptEventData = _ts_decorate5([
2414
+ (0, import_type_graphql6.ObjectType)()
2415
+ ], CopilotKitLangGraphInterruptEventData);
2416
+ var LangGraphInterruptEvent = class {
2417
+ name = "LangGraphInterruptEvent";
2418
+ value;
2419
+ response;
2420
+ };
2421
+ __name(LangGraphInterruptEvent, "LangGraphInterruptEvent");
2422
+ _ts_decorate5([
2423
+ (0, import_type_graphql6.Field)(() => MetaEventName),
2424
+ _ts_metadata5("design:type", typeof MetaEventName === "undefined" || false ? Object : "LangGraphInterruptEvent")
2425
+ ], LangGraphInterruptEvent.prototype, "name", void 0);
2426
+ _ts_decorate5([
2427
+ (0, import_type_graphql6.Field)(() => String),
2428
+ _ts_metadata5("design:type", String)
2429
+ ], LangGraphInterruptEvent.prototype, "value", void 0);
2430
+ _ts_decorate5([
2431
+ (0, import_type_graphql6.Field)(() => String, {
2432
+ nullable: true
2433
+ }),
2434
+ _ts_metadata5("design:type", String)
2435
+ ], LangGraphInterruptEvent.prototype, "response", void 0);
2436
+ LangGraphInterruptEvent = _ts_decorate5([
2437
+ (0, import_type_graphql6.ObjectType)({
2438
+ implements: BaseMetaEvent
2439
+ })
2440
+ ], LangGraphInterruptEvent);
2441
+ var CopilotKitLangGraphInterruptEvent = class {
2442
+ name = "CopilotKitLangGraphInterruptEvent";
2443
+ data;
2444
+ response;
2445
+ };
2446
+ __name(CopilotKitLangGraphInterruptEvent, "CopilotKitLangGraphInterruptEvent");
2447
+ _ts_decorate5([
2448
+ (0, import_type_graphql6.Field)(() => MetaEventName),
2449
+ _ts_metadata5("design:type", typeof MetaEventName === "undefined" || false ? Object : "CopilotKitLangGraphInterruptEvent")
2450
+ ], CopilotKitLangGraphInterruptEvent.prototype, "name", void 0);
2451
+ _ts_decorate5([
2452
+ (0, import_type_graphql6.Field)(() => CopilotKitLangGraphInterruptEventData),
2453
+ _ts_metadata5("design:type", typeof CopilotKitLangGraphInterruptEventData === "undefined" ? Object : CopilotKitLangGraphInterruptEventData)
2454
+ ], CopilotKitLangGraphInterruptEvent.prototype, "data", void 0);
2455
+ _ts_decorate5([
2456
+ (0, import_type_graphql6.Field)(() => String, {
2457
+ nullable: true
2458
+ }),
2459
+ _ts_metadata5("design:type", String)
2460
+ ], CopilotKitLangGraphInterruptEvent.prototype, "response", void 0);
2461
+ CopilotKitLangGraphInterruptEvent = _ts_decorate5([
2462
+ (0, import_type_graphql6.ObjectType)({
2463
+ implements: BaseMetaEvent
2464
+ })
2465
+ ], CopilotKitLangGraphInterruptEvent);
2466
+
2467
+ // src/lib/runtime/remote-lg-action.ts
2468
+ var activeInterruptEvent = false;
2469
+ async function execute(args) {
2470
+ return new ReadableStream({
2471
+ async start(controller) {
2472
+ try {
2473
+ await streamEvents(controller, args);
2474
+ controller.close();
2475
+ } catch (err) {
2476
+ }
2477
+ }
2478
+ });
2479
+ }
2480
+ __name(execute, "execute");
2481
+ async function streamEvents(controller, args) {
2482
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2483
+ const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, messages, actions, logger: logger2, properties, metaEvents } = args;
2484
+ let nodeName = initialNodeName;
2485
+ let state = initialState;
2486
+ const { name, assistantId: initialAssistantId } = agent;
2487
+ const propertyHeaders = properties.authorization ? {
2488
+ authorization: `Bearer ${properties.authorization}`
2489
+ } : null;
2490
+ const client = new import_langgraph_sdk.Client({
2491
+ apiUrl: deploymentUrl,
2492
+ apiKey: langsmithApiKey,
2493
+ defaultHeaders: {
2494
+ ...propertyHeaders
2495
+ }
2496
+ });
2497
+ let threadId = argsInitialThreadId ?? (0, import_shared10.randomUUID)();
2498
+ if (argsInitialThreadId && argsInitialThreadId.startsWith("ck-")) {
2499
+ threadId = argsInitialThreadId.substring(3);
2023
2500
  }
2024
- const assistantId = retrievedAssistant.assistant_id;
2025
- const graphInfo = await client.assistants.getGraph(assistantId);
2501
+ if (!(0, import_shared10.isValidUUID)(threadId)) {
2502
+ console.warn(`Cannot use the threadId ${threadId} with LangGraph Platform. Must be a valid UUID.`);
2503
+ }
2504
+ let wasInitiatedWithExistingThread = true;
2505
+ try {
2506
+ await client.threads.get(threadId);
2507
+ } catch (error) {
2508
+ wasInitiatedWithExistingThread = false;
2509
+ await client.threads.create({
2510
+ threadId
2511
+ });
2512
+ }
2513
+ let agentState = {
2514
+ values: {}
2515
+ };
2516
+ if (wasInitiatedWithExistingThread) {
2517
+ agentState = await client.threads.getState(threadId);
2518
+ }
2519
+ const agentStateValues = agentState.values;
2520
+ state.messages = agentStateValues.messages;
2521
+ const mode = threadId && nodeName != "__end__" && nodeName != void 0 && nodeName != null ? "continue" : "start";
2522
+ let formattedMessages = [];
2523
+ try {
2524
+ formattedMessages = copilotkitMessagesToLangChain(messages);
2525
+ } catch (e) {
2526
+ logger2.error(e, `Error event thrown: ${e.message}`);
2527
+ }
2528
+ state = langGraphDefaultMergeState(state, formattedMessages, actions, name);
2026
2529
  const streamInput = mode === "start" ? state : null;
2027
- let streamingStateExtractor = new StreamingStateExtractor([]);
2028
- let prevNodeName = null;
2029
- let emitIntermediateStateUntilEnd = null;
2030
- let shouldExit = false;
2031
- let externalRunId = null;
2032
2530
  const payload = {
2033
2531
  input: streamInput,
2034
2532
  streamMode: [
@@ -2038,16 +2536,55 @@ async function streamEvents(controller, args) {
2038
2536
  ],
2039
2537
  command: void 0
2040
2538
  };
2041
- if (lgInterruptEvent == null ? void 0 : lgInterruptEvent.response) {
2539
+ const lgInterruptMetaEvent = metaEvents == null ? void 0 : metaEvents.find((ev) => ev.name === MetaEventName.LangGraphInterruptEvent);
2540
+ if (activeInterruptEvent && !lgInterruptMetaEvent) {
2541
+ payload.command = {
2542
+ resume: formattedMessages[formattedMessages.length - 1]
2543
+ };
2544
+ }
2545
+ if (lgInterruptMetaEvent == null ? void 0 : lgInterruptMetaEvent.response) {
2042
2546
  payload.command = {
2043
- resume: lgInterruptEvent.response
2547
+ resume: lgInterruptMetaEvent.response
2044
2548
  };
2045
2549
  }
2550
+ if (mode === "continue" && !activeInterruptEvent) {
2551
+ await client.threads.updateState(threadId, {
2552
+ values: state,
2553
+ asNode: nodeName
2554
+ });
2555
+ }
2556
+ let streamInfo = {
2557
+ hashedLgcKey: (0, import_node_crypto.createHash)("sha256").update(langsmithApiKey).digest("hex")
2558
+ };
2559
+ const assistants = await client.assistants.search();
2560
+ const retrievedAssistant = assistants.find((a) => a.name === name || a.assistant_id === initialAssistantId);
2561
+ if (!retrievedAssistant) {
2562
+ telemetry_client_default.capture("oss.runtime.agent_execution_stream_errored", {
2563
+ ...streamInfo,
2564
+ error: `Found no assistants for given information, while ${assistants.length} assistants exists`
2565
+ });
2566
+ console.error(`
2567
+ No agent found for the agent name specified in CopilotKit provider
2568
+ Please check your available agents or provide an agent ID in the LangGraph Platform endpoint definition.
2569
+
2570
+
2571
+ These are the available agents: [${assistants.map((a) => `${a.name} (ID: ${a.assistant_id})`).join(", ")}]
2572
+ `);
2573
+ throw new Error("No agent id found");
2574
+ }
2575
+ const assistantId = retrievedAssistant.assistant_id;
2576
+ const graphInfo = await client.assistants.getGraph(assistantId);
2577
+ let streamingStateExtractor = new StreamingStateExtractor([]);
2578
+ let prevNodeName = null;
2579
+ let emitIntermediateStateUntilEnd = null;
2580
+ let shouldExit = false;
2581
+ let externalRunId = null;
2046
2582
  const streamResponse2 = client.runs.stream(threadId, assistantId, payload);
2047
2583
  const emit = /* @__PURE__ */ __name((message) => controller.enqueue(new TextEncoder().encode(message)), "emit");
2048
2584
  let latestStateValues = {};
2049
2585
  let updatedState = state;
2050
2586
  let manuallyEmittedState = null;
2587
+ activeInterruptEvent = false;
2051
2588
  try {
2052
2589
  telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
2053
2590
  hashedLgcKey: streamInfo.hashedLgcKey
@@ -2063,11 +2600,24 @@ async function streamEvents(controller, args) {
2063
2600
  if (chunk.event === "error") {
2064
2601
  throw new Error(`Error event thrown: ${chunk.data.message}`);
2065
2602
  }
2066
- if (chunk.event === "updates" && chunk.data.__interrupt__) {
2067
- emit(JSON.stringify({
2068
- event: LangGraphEventTypes.OnInterrupt,
2069
- value: chunk.data.__interrupt__[0].value
2070
- }) + "\n");
2603
+ const interruptEvents = (_a = chunk.data) == null ? void 0 : _a.__interrupt__;
2604
+ if (interruptEvents == null ? void 0 : interruptEvents.length) {
2605
+ activeInterruptEvent = true;
2606
+ const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
2607
+ if (typeof interruptValue != "string" && "__copilotkit_interrupt_value__" in interruptValue) {
2608
+ emit(JSON.stringify({
2609
+ event: LangGraphEventTypes.OnCopilotKitInterrupt,
2610
+ data: {
2611
+ value: interruptValue.__copilotkit_interrupt_value__,
2612
+ messages: langchainMessagesToCopilotKit(interruptValue.__copilotkit_messages__)
2613
+ }
2614
+ }) + "\n");
2615
+ } else {
2616
+ emit(JSON.stringify({
2617
+ event: LangGraphEventTypes.OnInterrupt,
2618
+ value: interruptValue
2619
+ }) + "\n");
2620
+ }
2071
2621
  continue;
2072
2622
  }
2073
2623
  if (chunk.event === "updates")
@@ -2082,8 +2632,8 @@ async function streamEvents(controller, args) {
2082
2632
  const runId = event.metadata.run_id;
2083
2633
  externalRunId = runId;
2084
2634
  const metadata = event.metadata;
2085
- if (((_b = (_a = event.data) == null ? void 0 : _a.output) == null ? void 0 : _b.model) != null && ((_d = (_c = event.data) == null ? void 0 : _c.output) == null ? void 0 : _d.model) != "") {
2086
- streamInfo.provider = (_f = (_e = event.data) == null ? void 0 : _e.output) == null ? void 0 : _f.model;
2635
+ if (((_c = (_b = event.data) == null ? void 0 : _b.output) == null ? void 0 : _c.model) != null && ((_e = (_d = event.data) == null ? void 0 : _d.output) == null ? void 0 : _e.model) != "") {
2636
+ streamInfo.provider = (_g = (_f = event.data) == null ? void 0 : _f.output) == null ? void 0 : _g.model;
2087
2637
  }
2088
2638
  if (metadata.langgraph_host != null && metadata.langgraph_host != "") {
2089
2639
  streamInfo.langGraphHost = metadata.langgraph_host;
@@ -2152,7 +2702,7 @@ async function streamEvents(controller, args) {
2152
2702
  emit(JSON.stringify(event) + "\n");
2153
2703
  }
2154
2704
  state = await client.threads.getState(threadId);
2155
- const interrupts = (_h = (_g = state.tasks) == null ? void 0 : _g[0]) == null ? void 0 : _h.interrupts;
2705
+ const interrupts = (_i = (_h = state.tasks) == null ? void 0 : _h[0]) == null ? void 0 : _i.interrupts;
2156
2706
  nodeName = interrupts ? nodeName : Object.keys(state.metadata.writes)[0];
2157
2707
  const isEndNode = state.next.length === 0 && !interrupts;
2158
2708
  telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
@@ -2840,8 +3390,8 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
2840
3390
  var telemetry_client_default = telemetryClient;
2841
3391
 
2842
3392
  // src/graphql/types/base/index.ts
2843
- var import_type_graphql3 = require("type-graphql");
2844
- function _ts_decorate2(decorators, target, key, desc) {
3393
+ var import_type_graphql7 = require("type-graphql");
3394
+ function _ts_decorate6(decorators, target, key, desc) {
2845
3395
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2846
3396
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2847
3397
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2851,27 +3401,27 @@ function _ts_decorate2(decorators, target, key, desc) {
2851
3401
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2852
3402
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2853
3403
  }
2854
- __name(_ts_decorate2, "_ts_decorate");
2855
- function _ts_metadata2(k, v) {
3404
+ __name(_ts_decorate6, "_ts_decorate");
3405
+ function _ts_metadata6(k, v) {
2856
3406
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2857
3407
  return Reflect.metadata(k, v);
2858
3408
  }
2859
- __name(_ts_metadata2, "_ts_metadata");
3409
+ __name(_ts_metadata6, "_ts_metadata");
2860
3410
  var BaseMessageInput = class {
2861
3411
  id;
2862
3412
  createdAt;
2863
3413
  };
2864
3414
  __name(BaseMessageInput, "BaseMessageInput");
2865
- _ts_decorate2([
2866
- (0, import_type_graphql3.Field)(() => String),
2867
- _ts_metadata2("design:type", String)
3415
+ _ts_decorate6([
3416
+ (0, import_type_graphql7.Field)(() => String),
3417
+ _ts_metadata6("design:type", String)
2868
3418
  ], BaseMessageInput.prototype, "id", void 0);
2869
- _ts_decorate2([
2870
- (0, import_type_graphql3.Field)(() => Date),
2871
- _ts_metadata2("design:type", typeof Date === "undefined" ? Object : Date)
3419
+ _ts_decorate6([
3420
+ (0, import_type_graphql7.Field)(() => Date),
3421
+ _ts_metadata6("design:type", typeof Date === "undefined" ? Object : Date)
2872
3422
  ], BaseMessageInput.prototype, "createdAt", void 0);
2873
- BaseMessageInput = _ts_decorate2([
2874
- (0, import_type_graphql3.InputType)()
3423
+ BaseMessageInput = _ts_decorate6([
3424
+ (0, import_type_graphql7.InputType)()
2875
3425
  ], BaseMessageInput);
2876
3426
 
2877
3427
  // src/graphql/types/converted/index.ts
@@ -3006,6 +3556,7 @@ var RuntimeMetaEventName;
3006
3556
  (function(RuntimeMetaEventName2) {
3007
3557
  RuntimeMetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
3008
3558
  RuntimeMetaEventName2["LangGraphInterruptResumeEvent"] = "LangGraphInterruptResumeEvent";
3559
+ RuntimeMetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
3009
3560
  })(RuntimeMetaEventName || (RuntimeMetaEventName = {}));
3010
3561
  var RuntimeEventSubject = class extends import_rxjs2.ReplaySubject {
3011
3562
  constructor() {
@@ -3557,19 +4108,23 @@ please use an LLM adapter instead.`
3557
4108
  const threadId = threadIdFromRequest ?? agentSession.threadId;
3558
4109
  const serverSideActions = await this.getServerSideActions(request);
3559
4110
  const messages = convertGqlInputToMessages(rawMessages);
3560
- const agent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
3561
- if (!agent) {
4111
+ const currentAgent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
4112
+ if (!currentAgent) {
3562
4113
  throw new import_shared15.CopilotKitAgentDiscoveryError({
3563
4114
  agentName
3564
4115
  });
3565
4116
  }
3566
- const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
4117
+ const availableActionsForCurrentAgent = serverSideActions.filter((action) => (
4118
+ // Case 1: Keep all regular (non-agent) actions
4119
+ !isLangGraphAgentAction(action) || // Case 2: For agent actions, keep all except self (prevent infinite loops)
4120
+ isLangGraphAgentAction(action) && action.name !== agentName
4121
+ )).map((action) => ({
3567
4122
  name: action.name,
3568
4123
  description: action.description,
3569
4124
  jsonSchema: JSON.stringify((0, import_shared15.actionParametersToJsonSchema)(action.parameters))
3570
4125
  }));
3571
- const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
3572
- ...serverSideActionsInput,
4126
+ const allAvailableActions = flattenToolCallsNoDuplicates([
4127
+ ...availableActionsForCurrentAgent,
3573
4128
  ...request.actions
3574
4129
  ]);
3575
4130
  await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
@@ -3580,466 +4135,132 @@ please use an LLM adapter instead.`
3580
4135
  }));
3581
4136
  try {
3582
4137
  const eventSource = new RuntimeEventSource();
3583
- const stream = await agent.langGraphAgentHandler({
4138
+ const stream = await currentAgent.langGraphAgentHandler({
3584
4139
  name: agentName,
3585
4140
  threadId,
3586
4141
  nodeName,
3587
- actionInputsWithoutAgents,
3588
- metaEvents
4142
+ metaEvents,
4143
+ actionInputsWithoutAgents: allAvailableActions
3589
4144
  });
3590
4145
  eventSource.stream(async (eventStream$) => {
3591
4146
  (0, import_rxjs3.from)(stream).subscribe({
3592
4147
  next: (event) => eventStream$.next(event),
3593
- error: (err) => {
3594
- console.error("Error in stream", err);
3595
- eventStream$.error(err);
3596
- eventStream$.complete();
3597
- },
3598
- complete: () => eventStream$.complete()
3599
- });
3600
- });
3601
- outputMessagesPromise.then((outputMessages) => {
3602
- var _a2;
3603
- (_a2 = this.onAfterRequest) == null ? void 0 : _a2.call(this, {
3604
- threadId,
3605
- runId: void 0,
3606
- inputMessages: messages,
3607
- outputMessages,
3608
- properties: graphqlContext.properties
3609
- });
3610
- }).catch((_error) => {
3611
- });
3612
- return {
3613
- threadId,
3614
- runId: void 0,
3615
- eventSource,
3616
- serverSideActions: [],
3617
- actionInputsWithoutAgents
3618
- };
3619
- } catch (error) {
3620
- console.error("Error getting response:", error);
3621
- throw error;
3622
- }
3623
- }
3624
- async getServerSideActions(request) {
3625
- const { messages: rawMessages, graphqlContext, agentStates, url } = request;
3626
- const inputMessages = convertGqlInputToMessages(rawMessages);
3627
- const langserveFunctions = [];
3628
- for (const chainPromise of this.langserve) {
3629
- try {
3630
- const chain = await chainPromise;
3631
- langserveFunctions.push(chain);
3632
- } catch (error) {
3633
- console.error("Error loading langserve chain:", error);
3634
- }
3635
- }
3636
- const remoteEndpointDefinitions = this.remoteEndpointDefinitions.map((endpoint) => ({
3637
- ...endpoint,
3638
- type: resolveEndpointType(endpoint)
3639
- }));
3640
- const remoteActions = await setupRemoteActions({
3641
- remoteEndpointDefinitions,
3642
- graphqlContext,
3643
- messages: inputMessages,
3644
- agentStates,
3645
- frontendUrl: url
3646
- });
3647
- const configuredActions = typeof this.actions === "function" ? this.actions({
3648
- properties: graphqlContext.properties,
3649
- url
3650
- }) : this.actions;
3651
- return [
3652
- ...configuredActions,
3653
- ...langserveFunctions,
3654
- ...remoteActions
3655
- ];
3656
- }
3657
- };
3658
- __name(CopilotRuntime, "CopilotRuntime");
3659
- function flattenToolCallsNoDuplicates(toolsByPriority) {
3660
- let allTools = [];
3661
- const allToolNames = [];
3662
- for (const tool of toolsByPriority) {
3663
- if (!allToolNames.includes(tool.name)) {
3664
- allTools.push(tool);
3665
- allToolNames.push(tool.name);
3666
- }
3667
- }
3668
- return allTools;
3669
- }
3670
- __name(flattenToolCallsNoDuplicates, "flattenToolCallsNoDuplicates");
3671
- function copilotKitEndpoint(config2) {
3672
- return {
3673
- ...config2,
3674
- type: EndpointType.CopilotKit
3675
- };
3676
- }
3677
- __name(copilotKitEndpoint, "copilotKitEndpoint");
3678
- function langGraphPlatformEndpoint(config2) {
3679
- return {
3680
- ...config2,
3681
- type: EndpointType.LangGraphPlatform
3682
- };
3683
- }
3684
- __name(langGraphPlatformEndpoint, "langGraphPlatformEndpoint");
3685
- function resolveEndpointType(endpoint) {
3686
- if (!endpoint.type) {
3687
- if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
3688
- return EndpointType.LangGraphPlatform;
3689
- } else {
3690
- return EndpointType.CopilotKit;
3691
- }
3692
- }
3693
- return endpoint.type;
3694
- }
3695
- __name(resolveEndpointType, "resolveEndpointType");
3696
-
3697
- // src/lib/integrations/shared.ts
3698
- var import_type_graphql26 = require("type-graphql");
3699
-
3700
- // src/graphql/resolvers/copilot.resolver.ts
3701
- var import_type_graphql20 = require("type-graphql");
3702
- var import_rxjs4 = require("rxjs");
3703
-
3704
- // src/graphql/inputs/generate-copilot-response.input.ts
3705
- var import_type_graphql14 = require("type-graphql");
3706
-
3707
- // src/graphql/inputs/message.input.ts
3708
- var import_type_graphql4 = require("type-graphql");
3709
- function _ts_decorate3(decorators, target, key, desc) {
3710
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3711
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3712
- r = Reflect.decorate(decorators, target, key, desc);
3713
- else
3714
- for (var i = decorators.length - 1; i >= 0; i--)
3715
- if (d = decorators[i])
3716
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3717
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3718
- }
3719
- __name(_ts_decorate3, "_ts_decorate");
3720
- function _ts_metadata3(k, v) {
3721
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3722
- return Reflect.metadata(k, v);
3723
- }
3724
- __name(_ts_metadata3, "_ts_metadata");
3725
- var MessageInput = class extends BaseMessageInput {
3726
- textMessage;
3727
- actionExecutionMessage;
3728
- resultMessage;
3729
- agentStateMessage;
3730
- };
3731
- __name(MessageInput, "MessageInput");
3732
- _ts_decorate3([
3733
- (0, import_type_graphql4.Field)(() => TextMessageInput, {
3734
- nullable: true
3735
- }),
3736
- _ts_metadata3("design:type", typeof TextMessageInput === "undefined" ? Object : TextMessageInput)
3737
- ], MessageInput.prototype, "textMessage", void 0);
3738
- _ts_decorate3([
3739
- (0, import_type_graphql4.Field)(() => ActionExecutionMessageInput, {
3740
- nullable: true
3741
- }),
3742
- _ts_metadata3("design:type", typeof ActionExecutionMessageInput === "undefined" ? Object : ActionExecutionMessageInput)
3743
- ], MessageInput.prototype, "actionExecutionMessage", void 0);
3744
- _ts_decorate3([
3745
- (0, import_type_graphql4.Field)(() => ResultMessageInput, {
3746
- nullable: true
3747
- }),
3748
- _ts_metadata3("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
3749
- ], MessageInput.prototype, "resultMessage", void 0);
3750
- _ts_decorate3([
3751
- (0, import_type_graphql4.Field)(() => AgentStateMessageInput, {
3752
- nullable: true
3753
- }),
3754
- _ts_metadata3("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
3755
- ], MessageInput.prototype, "agentStateMessage", void 0);
3756
- MessageInput = _ts_decorate3([
3757
- (0, import_type_graphql4.InputType)()
3758
- ], MessageInput);
3759
- var TextMessageInput = class {
3760
- content;
3761
- parentMessageId;
3762
- role;
3763
- };
3764
- __name(TextMessageInput, "TextMessageInput");
3765
- _ts_decorate3([
3766
- (0, import_type_graphql4.Field)(() => String),
3767
- _ts_metadata3("design:type", String)
3768
- ], TextMessageInput.prototype, "content", void 0);
3769
- _ts_decorate3([
3770
- (0, import_type_graphql4.Field)(() => String, {
3771
- nullable: true
3772
- }),
3773
- _ts_metadata3("design:type", String)
3774
- ], TextMessageInput.prototype, "parentMessageId", void 0);
3775
- _ts_decorate3([
3776
- (0, import_type_graphql4.Field)(() => MessageRole),
3777
- _ts_metadata3("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
3778
- ], TextMessageInput.prototype, "role", void 0);
3779
- TextMessageInput = _ts_decorate3([
3780
- (0, import_type_graphql4.InputType)()
3781
- ], TextMessageInput);
3782
- var ActionExecutionMessageInput = class {
3783
- name;
3784
- arguments;
3785
- parentMessageId;
3786
- scope;
3787
- };
3788
- __name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
3789
- _ts_decorate3([
3790
- (0, import_type_graphql4.Field)(() => String),
3791
- _ts_metadata3("design:type", String)
3792
- ], ActionExecutionMessageInput.prototype, "name", void 0);
3793
- _ts_decorate3([
3794
- (0, import_type_graphql4.Field)(() => String),
3795
- _ts_metadata3("design:type", String)
3796
- ], ActionExecutionMessageInput.prototype, "arguments", void 0);
3797
- _ts_decorate3([
3798
- (0, import_type_graphql4.Field)(() => String, {
3799
- nullable: true
3800
- }),
3801
- _ts_metadata3("design:type", String)
3802
- ], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
3803
- _ts_decorate3([
3804
- (0, import_type_graphql4.Field)(() => String, {
3805
- nullable: true,
3806
- deprecationReason: "This field will be removed in a future version"
3807
- }),
3808
- _ts_metadata3("design:type", typeof String === "undefined" ? Object : String)
3809
- ], ActionExecutionMessageInput.prototype, "scope", void 0);
3810
- ActionExecutionMessageInput = _ts_decorate3([
3811
- (0, import_type_graphql4.InputType)()
3812
- ], ActionExecutionMessageInput);
3813
- var ResultMessageInput = class {
3814
- actionExecutionId;
3815
- actionName;
3816
- parentMessageId;
3817
- result;
3818
- };
3819
- __name(ResultMessageInput, "ResultMessageInput");
3820
- _ts_decorate3([
3821
- (0, import_type_graphql4.Field)(() => String),
3822
- _ts_metadata3("design:type", String)
3823
- ], ResultMessageInput.prototype, "actionExecutionId", void 0);
3824
- _ts_decorate3([
3825
- (0, import_type_graphql4.Field)(() => String),
3826
- _ts_metadata3("design:type", String)
3827
- ], ResultMessageInput.prototype, "actionName", void 0);
3828
- _ts_decorate3([
3829
- (0, import_type_graphql4.Field)(() => String, {
3830
- nullable: true
3831
- }),
3832
- _ts_metadata3("design:type", String)
3833
- ], ResultMessageInput.prototype, "parentMessageId", void 0);
3834
- _ts_decorate3([
3835
- (0, import_type_graphql4.Field)(() => String),
3836
- _ts_metadata3("design:type", String)
3837
- ], ResultMessageInput.prototype, "result", void 0);
3838
- ResultMessageInput = _ts_decorate3([
3839
- (0, import_type_graphql4.InputType)()
3840
- ], ResultMessageInput);
3841
- var AgentStateMessageInput = class {
3842
- threadId;
3843
- agentName;
3844
- role;
3845
- state;
3846
- running;
3847
- nodeName;
3848
- runId;
3849
- active;
4148
+ error: (err) => {
4149
+ console.error("Error in stream", err);
4150
+ eventStream$.error(err);
4151
+ eventStream$.complete();
4152
+ },
4153
+ complete: () => eventStream$.complete()
4154
+ });
4155
+ });
4156
+ outputMessagesPromise.then((outputMessages) => {
4157
+ var _a2;
4158
+ (_a2 = this.onAfterRequest) == null ? void 0 : _a2.call(this, {
4159
+ threadId,
4160
+ runId: void 0,
4161
+ inputMessages: messages,
4162
+ outputMessages,
4163
+ properties: graphqlContext.properties
4164
+ });
4165
+ }).catch((_error) => {
4166
+ });
4167
+ return {
4168
+ threadId,
4169
+ runId: void 0,
4170
+ eventSource,
4171
+ serverSideActions: [],
4172
+ actionInputsWithoutAgents: allAvailableActions
4173
+ };
4174
+ } catch (error) {
4175
+ console.error("Error getting response:", error);
4176
+ throw error;
4177
+ }
4178
+ }
4179
+ async getServerSideActions(request) {
4180
+ const { messages: rawMessages, graphqlContext, agentStates, url } = request;
4181
+ const inputMessages = convertGqlInputToMessages(rawMessages);
4182
+ const langserveFunctions = [];
4183
+ for (const chainPromise of this.langserve) {
4184
+ try {
4185
+ const chain = await chainPromise;
4186
+ langserveFunctions.push(chain);
4187
+ } catch (error) {
4188
+ console.error("Error loading langserve chain:", error);
4189
+ }
4190
+ }
4191
+ const remoteEndpointDefinitions = this.remoteEndpointDefinitions.map((endpoint) => ({
4192
+ ...endpoint,
4193
+ type: resolveEndpointType(endpoint)
4194
+ }));
4195
+ const remoteActions = await setupRemoteActions({
4196
+ remoteEndpointDefinitions,
4197
+ graphqlContext,
4198
+ messages: inputMessages,
4199
+ agentStates,
4200
+ frontendUrl: url
4201
+ });
4202
+ const configuredActions = typeof this.actions === "function" ? this.actions({
4203
+ properties: graphqlContext.properties,
4204
+ url
4205
+ }) : this.actions;
4206
+ return [
4207
+ ...configuredActions,
4208
+ ...langserveFunctions,
4209
+ ...remoteActions
4210
+ ];
4211
+ }
3850
4212
  };
3851
- __name(AgentStateMessageInput, "AgentStateMessageInput");
3852
- _ts_decorate3([
3853
- (0, import_type_graphql4.Field)(() => String),
3854
- _ts_metadata3("design:type", String)
3855
- ], AgentStateMessageInput.prototype, "threadId", void 0);
3856
- _ts_decorate3([
3857
- (0, import_type_graphql4.Field)(() => String),
3858
- _ts_metadata3("design:type", String)
3859
- ], AgentStateMessageInput.prototype, "agentName", void 0);
3860
- _ts_decorate3([
3861
- (0, import_type_graphql4.Field)(() => MessageRole),
3862
- _ts_metadata3("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
3863
- ], AgentStateMessageInput.prototype, "role", void 0);
3864
- _ts_decorate3([
3865
- (0, import_type_graphql4.Field)(() => String),
3866
- _ts_metadata3("design:type", String)
3867
- ], AgentStateMessageInput.prototype, "state", void 0);
3868
- _ts_decorate3([
3869
- (0, import_type_graphql4.Field)(() => Boolean),
3870
- _ts_metadata3("design:type", Boolean)
3871
- ], AgentStateMessageInput.prototype, "running", void 0);
3872
- _ts_decorate3([
3873
- (0, import_type_graphql4.Field)(() => String),
3874
- _ts_metadata3("design:type", String)
3875
- ], AgentStateMessageInput.prototype, "nodeName", void 0);
3876
- _ts_decorate3([
3877
- (0, import_type_graphql4.Field)(() => String),
3878
- _ts_metadata3("design:type", String)
3879
- ], AgentStateMessageInput.prototype, "runId", void 0);
3880
- _ts_decorate3([
3881
- (0, import_type_graphql4.Field)(() => Boolean),
3882
- _ts_metadata3("design:type", Boolean)
3883
- ], AgentStateMessageInput.prototype, "active", void 0);
3884
- AgentStateMessageInput = _ts_decorate3([
3885
- (0, import_type_graphql4.InputType)()
3886
- ], AgentStateMessageInput);
3887
-
3888
- // src/graphql/inputs/frontend.input.ts
3889
- var import_type_graphql6 = require("type-graphql");
3890
-
3891
- // src/graphql/inputs/action.input.ts
3892
- var import_type_graphql5 = require("type-graphql");
3893
- function _ts_decorate4(decorators, target, key, desc) {
3894
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3895
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3896
- r = Reflect.decorate(decorators, target, key, desc);
3897
- else
3898
- for (var i = decorators.length - 1; i >= 0; i--)
3899
- if (d = decorators[i])
3900
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3901
- return c > 3 && r && Object.defineProperty(target, key, r), r;
4213
+ __name(CopilotRuntime, "CopilotRuntime");
4214
+ function flattenToolCallsNoDuplicates(toolsByPriority) {
4215
+ let allTools = [];
4216
+ const allToolNames = [];
4217
+ for (const tool of toolsByPriority) {
4218
+ if (!allToolNames.includes(tool.name)) {
4219
+ allTools.push(tool);
4220
+ allToolNames.push(tool.name);
4221
+ }
4222
+ }
4223
+ return allTools;
3902
4224
  }
3903
- __name(_ts_decorate4, "_ts_decorate");
3904
- function _ts_metadata4(k, v) {
3905
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3906
- return Reflect.metadata(k, v);
4225
+ __name(flattenToolCallsNoDuplicates, "flattenToolCallsNoDuplicates");
4226
+ function copilotKitEndpoint(config2) {
4227
+ return {
4228
+ ...config2,
4229
+ type: EndpointType.CopilotKit
4230
+ };
3907
4231
  }
3908
- __name(_ts_metadata4, "_ts_metadata");
3909
- var ActionInput = class {
3910
- name;
3911
- description;
3912
- jsonSchema;
3913
- available;
3914
- };
3915
- __name(ActionInput, "ActionInput");
3916
- _ts_decorate4([
3917
- (0, import_type_graphql5.Field)(() => String),
3918
- _ts_metadata4("design:type", String)
3919
- ], ActionInput.prototype, "name", void 0);
3920
- _ts_decorate4([
3921
- (0, import_type_graphql5.Field)(() => String),
3922
- _ts_metadata4("design:type", String)
3923
- ], ActionInput.prototype, "description", void 0);
3924
- _ts_decorate4([
3925
- (0, import_type_graphql5.Field)(() => String),
3926
- _ts_metadata4("design:type", String)
3927
- ], ActionInput.prototype, "jsonSchema", void 0);
3928
- _ts_decorate4([
3929
- (0, import_type_graphql5.Field)(() => ActionInputAvailability, {
3930
- nullable: true
3931
- }),
3932
- _ts_metadata4("design:type", typeof ActionInputAvailability === "undefined" ? Object : ActionInputAvailability)
3933
- ], ActionInput.prototype, "available", void 0);
3934
- ActionInput = _ts_decorate4([
3935
- (0, import_type_graphql5.InputType)()
3936
- ], ActionInput);
3937
-
3938
- // src/graphql/inputs/frontend.input.ts
3939
- function _ts_decorate5(decorators, target, key, desc) {
3940
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3941
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3942
- r = Reflect.decorate(decorators, target, key, desc);
3943
- else
3944
- for (var i = decorators.length - 1; i >= 0; i--)
3945
- if (d = decorators[i])
3946
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3947
- return c > 3 && r && Object.defineProperty(target, key, r), r;
4232
+ __name(copilotKitEndpoint, "copilotKitEndpoint");
4233
+ function langGraphPlatformEndpoint(config2) {
4234
+ return {
4235
+ ...config2,
4236
+ type: EndpointType.LangGraphPlatform
4237
+ };
3948
4238
  }
3949
- __name(_ts_decorate5, "_ts_decorate");
3950
- function _ts_metadata5(k, v) {
3951
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3952
- return Reflect.metadata(k, v);
4239
+ __name(langGraphPlatformEndpoint, "langGraphPlatformEndpoint");
4240
+ function resolveEndpointType(endpoint) {
4241
+ if (!endpoint.type) {
4242
+ if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
4243
+ return EndpointType.LangGraphPlatform;
4244
+ } else {
4245
+ return EndpointType.CopilotKit;
4246
+ }
4247
+ }
4248
+ return endpoint.type;
3953
4249
  }
3954
- __name(_ts_metadata5, "_ts_metadata");
3955
- var FrontendInput = class {
3956
- toDeprecate_fullContext;
3957
- actions;
3958
- url;
3959
- };
3960
- __name(FrontendInput, "FrontendInput");
3961
- _ts_decorate5([
3962
- (0, import_type_graphql6.Field)(() => String, {
3963
- nullable: true
3964
- }),
3965
- _ts_metadata5("design:type", String)
3966
- ], FrontendInput.prototype, "toDeprecate_fullContext", void 0);
3967
- _ts_decorate5([
3968
- (0, import_type_graphql6.Field)(() => [
3969
- ActionInput
3970
- ]),
3971
- _ts_metadata5("design:type", Array)
3972
- ], FrontendInput.prototype, "actions", void 0);
3973
- _ts_decorate5([
3974
- (0, import_type_graphql6.Field)(() => String, {
3975
- nullable: true
3976
- }),
3977
- _ts_metadata5("design:type", String)
3978
- ], FrontendInput.prototype, "url", void 0);
3979
- FrontendInput = _ts_decorate5([
3980
- (0, import_type_graphql6.InputType)()
3981
- ], FrontendInput);
4250
+ __name(resolveEndpointType, "resolveEndpointType");
3982
4251
 
3983
- // src/graphql/inputs/cloud.input.ts
3984
- var import_type_graphql8 = require("type-graphql");
4252
+ // src/lib/integrations/shared.ts
4253
+ var import_type_graphql26 = require("type-graphql");
3985
4254
 
3986
- // src/graphql/inputs/cloud-guardrails.input.ts
3987
- var import_type_graphql7 = require("type-graphql");
3988
- function _ts_decorate6(decorators, target, key, desc) {
3989
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3990
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3991
- r = Reflect.decorate(decorators, target, key, desc);
3992
- else
3993
- for (var i = decorators.length - 1; i >= 0; i--)
3994
- if (d = decorators[i])
3995
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3996
- return c > 3 && r && Object.defineProperty(target, key, r), r;
3997
- }
3998
- __name(_ts_decorate6, "_ts_decorate");
3999
- function _ts_metadata6(k, v) {
4000
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4001
- return Reflect.metadata(k, v);
4002
- }
4003
- __name(_ts_metadata6, "_ts_metadata");
4004
- var GuardrailsRuleInput = class {
4005
- allowList = [];
4006
- denyList = [];
4007
- };
4008
- __name(GuardrailsRuleInput, "GuardrailsRuleInput");
4009
- _ts_decorate6([
4010
- (0, import_type_graphql7.Field)(() => [
4011
- String
4012
- ], {
4013
- nullable: true
4014
- }),
4015
- _ts_metadata6("design:type", Array)
4016
- ], GuardrailsRuleInput.prototype, "allowList", void 0);
4017
- _ts_decorate6([
4018
- (0, import_type_graphql7.Field)(() => [
4019
- String
4020
- ], {
4021
- nullable: true
4022
- }),
4023
- _ts_metadata6("design:type", Array)
4024
- ], GuardrailsRuleInput.prototype, "denyList", void 0);
4025
- GuardrailsRuleInput = _ts_decorate6([
4026
- (0, import_type_graphql7.InputType)()
4027
- ], GuardrailsRuleInput);
4028
- var GuardrailsInput = class {
4029
- inputValidationRules;
4030
- };
4031
- __name(GuardrailsInput, "GuardrailsInput");
4032
- _ts_decorate6([
4033
- (0, import_type_graphql7.Field)(() => GuardrailsRuleInput, {
4034
- nullable: false
4035
- }),
4036
- _ts_metadata6("design:type", typeof GuardrailsRuleInput === "undefined" ? Object : GuardrailsRuleInput)
4037
- ], GuardrailsInput.prototype, "inputValidationRules", void 0);
4038
- GuardrailsInput = _ts_decorate6([
4039
- (0, import_type_graphql7.InputType)()
4040
- ], GuardrailsInput);
4255
+ // src/graphql/resolvers/copilot.resolver.ts
4256
+ var import_type_graphql20 = require("type-graphql");
4257
+ var import_rxjs4 = require("rxjs");
4041
4258
 
4042
- // src/graphql/inputs/cloud.input.ts
4259
+ // src/graphql/inputs/generate-copilot-response.input.ts
4260
+ var import_type_graphql18 = require("type-graphql");
4261
+
4262
+ // src/graphql/inputs/message.input.ts
4263
+ var import_type_graphql8 = require("type-graphql");
4043
4264
  function _ts_decorate7(decorators, target, key, desc) {
4044
4265
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4045
4266
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -4056,21 +4277,173 @@ function _ts_metadata7(k, v) {
4056
4277
  return Reflect.metadata(k, v);
4057
4278
  }
4058
4279
  __name(_ts_metadata7, "_ts_metadata");
4059
- var CloudInput = class {
4060
- guardrails;
4280
+ var MessageInput = class extends BaseMessageInput {
4281
+ textMessage;
4282
+ actionExecutionMessage;
4283
+ resultMessage;
4284
+ agentStateMessage;
4061
4285
  };
4062
- __name(CloudInput, "CloudInput");
4286
+ __name(MessageInput, "MessageInput");
4063
4287
  _ts_decorate7([
4064
- (0, import_type_graphql8.Field)(() => GuardrailsInput, {
4288
+ (0, import_type_graphql8.Field)(() => TextMessageInput, {
4065
4289
  nullable: true
4066
4290
  }),
4067
- _ts_metadata7("design:type", typeof GuardrailsInput === "undefined" ? Object : GuardrailsInput)
4068
- ], CloudInput.prototype, "guardrails", void 0);
4069
- CloudInput = _ts_decorate7([
4291
+ _ts_metadata7("design:type", typeof TextMessageInput === "undefined" ? Object : TextMessageInput)
4292
+ ], MessageInput.prototype, "textMessage", void 0);
4293
+ _ts_decorate7([
4294
+ (0, import_type_graphql8.Field)(() => ActionExecutionMessageInput, {
4295
+ nullable: true
4296
+ }),
4297
+ _ts_metadata7("design:type", typeof ActionExecutionMessageInput === "undefined" ? Object : ActionExecutionMessageInput)
4298
+ ], MessageInput.prototype, "actionExecutionMessage", void 0);
4299
+ _ts_decorate7([
4300
+ (0, import_type_graphql8.Field)(() => ResultMessageInput, {
4301
+ nullable: true
4302
+ }),
4303
+ _ts_metadata7("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
4304
+ ], MessageInput.prototype, "resultMessage", void 0);
4305
+ _ts_decorate7([
4306
+ (0, import_type_graphql8.Field)(() => AgentStateMessageInput, {
4307
+ nullable: true
4308
+ }),
4309
+ _ts_metadata7("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
4310
+ ], MessageInput.prototype, "agentStateMessage", void 0);
4311
+ MessageInput = _ts_decorate7([
4070
4312
  (0, import_type_graphql8.InputType)()
4071
- ], CloudInput);
4313
+ ], MessageInput);
4314
+ var TextMessageInput = class {
4315
+ content;
4316
+ parentMessageId;
4317
+ role;
4318
+ };
4319
+ __name(TextMessageInput, "TextMessageInput");
4320
+ _ts_decorate7([
4321
+ (0, import_type_graphql8.Field)(() => String),
4322
+ _ts_metadata7("design:type", String)
4323
+ ], TextMessageInput.prototype, "content", void 0);
4324
+ _ts_decorate7([
4325
+ (0, import_type_graphql8.Field)(() => String, {
4326
+ nullable: true
4327
+ }),
4328
+ _ts_metadata7("design:type", String)
4329
+ ], TextMessageInput.prototype, "parentMessageId", void 0);
4330
+ _ts_decorate7([
4331
+ (0, import_type_graphql8.Field)(() => MessageRole),
4332
+ _ts_metadata7("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
4333
+ ], TextMessageInput.prototype, "role", void 0);
4334
+ TextMessageInput = _ts_decorate7([
4335
+ (0, import_type_graphql8.InputType)()
4336
+ ], TextMessageInput);
4337
+ var ActionExecutionMessageInput = class {
4338
+ name;
4339
+ arguments;
4340
+ parentMessageId;
4341
+ scope;
4342
+ };
4343
+ __name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
4344
+ _ts_decorate7([
4345
+ (0, import_type_graphql8.Field)(() => String),
4346
+ _ts_metadata7("design:type", String)
4347
+ ], ActionExecutionMessageInput.prototype, "name", void 0);
4348
+ _ts_decorate7([
4349
+ (0, import_type_graphql8.Field)(() => String),
4350
+ _ts_metadata7("design:type", String)
4351
+ ], ActionExecutionMessageInput.prototype, "arguments", void 0);
4352
+ _ts_decorate7([
4353
+ (0, import_type_graphql8.Field)(() => String, {
4354
+ nullable: true
4355
+ }),
4356
+ _ts_metadata7("design:type", String)
4357
+ ], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
4358
+ _ts_decorate7([
4359
+ (0, import_type_graphql8.Field)(() => String, {
4360
+ nullable: true,
4361
+ deprecationReason: "This field will be removed in a future version"
4362
+ }),
4363
+ _ts_metadata7("design:type", typeof String === "undefined" ? Object : String)
4364
+ ], ActionExecutionMessageInput.prototype, "scope", void 0);
4365
+ ActionExecutionMessageInput = _ts_decorate7([
4366
+ (0, import_type_graphql8.InputType)()
4367
+ ], ActionExecutionMessageInput);
4368
+ var ResultMessageInput = class {
4369
+ actionExecutionId;
4370
+ actionName;
4371
+ parentMessageId;
4372
+ result;
4373
+ };
4374
+ __name(ResultMessageInput, "ResultMessageInput");
4375
+ _ts_decorate7([
4376
+ (0, import_type_graphql8.Field)(() => String),
4377
+ _ts_metadata7("design:type", String)
4378
+ ], ResultMessageInput.prototype, "actionExecutionId", void 0);
4379
+ _ts_decorate7([
4380
+ (0, import_type_graphql8.Field)(() => String),
4381
+ _ts_metadata7("design:type", String)
4382
+ ], ResultMessageInput.prototype, "actionName", void 0);
4383
+ _ts_decorate7([
4384
+ (0, import_type_graphql8.Field)(() => String, {
4385
+ nullable: true
4386
+ }),
4387
+ _ts_metadata7("design:type", String)
4388
+ ], ResultMessageInput.prototype, "parentMessageId", void 0);
4389
+ _ts_decorate7([
4390
+ (0, import_type_graphql8.Field)(() => String),
4391
+ _ts_metadata7("design:type", String)
4392
+ ], ResultMessageInput.prototype, "result", void 0);
4393
+ ResultMessageInput = _ts_decorate7([
4394
+ (0, import_type_graphql8.InputType)()
4395
+ ], ResultMessageInput);
4396
+ var AgentStateMessageInput = class {
4397
+ threadId;
4398
+ agentName;
4399
+ role;
4400
+ state;
4401
+ running;
4402
+ nodeName;
4403
+ runId;
4404
+ active;
4405
+ };
4406
+ __name(AgentStateMessageInput, "AgentStateMessageInput");
4407
+ _ts_decorate7([
4408
+ (0, import_type_graphql8.Field)(() => String),
4409
+ _ts_metadata7("design:type", String)
4410
+ ], AgentStateMessageInput.prototype, "threadId", void 0);
4411
+ _ts_decorate7([
4412
+ (0, import_type_graphql8.Field)(() => String),
4413
+ _ts_metadata7("design:type", String)
4414
+ ], AgentStateMessageInput.prototype, "agentName", void 0);
4415
+ _ts_decorate7([
4416
+ (0, import_type_graphql8.Field)(() => MessageRole),
4417
+ _ts_metadata7("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
4418
+ ], AgentStateMessageInput.prototype, "role", void 0);
4419
+ _ts_decorate7([
4420
+ (0, import_type_graphql8.Field)(() => String),
4421
+ _ts_metadata7("design:type", String)
4422
+ ], AgentStateMessageInput.prototype, "state", void 0);
4423
+ _ts_decorate7([
4424
+ (0, import_type_graphql8.Field)(() => Boolean),
4425
+ _ts_metadata7("design:type", Boolean)
4426
+ ], AgentStateMessageInput.prototype, "running", void 0);
4427
+ _ts_decorate7([
4428
+ (0, import_type_graphql8.Field)(() => String),
4429
+ _ts_metadata7("design:type", String)
4430
+ ], AgentStateMessageInput.prototype, "nodeName", void 0);
4431
+ _ts_decorate7([
4432
+ (0, import_type_graphql8.Field)(() => String),
4433
+ _ts_metadata7("design:type", String)
4434
+ ], AgentStateMessageInput.prototype, "runId", void 0);
4435
+ _ts_decorate7([
4436
+ (0, import_type_graphql8.Field)(() => Boolean),
4437
+ _ts_metadata7("design:type", Boolean)
4438
+ ], AgentStateMessageInput.prototype, "active", void 0);
4439
+ AgentStateMessageInput = _ts_decorate7([
4440
+ (0, import_type_graphql8.InputType)()
4441
+ ], AgentStateMessageInput);
4072
4442
 
4073
- // src/graphql/inputs/forwarded-parameters.input.ts
4443
+ // src/graphql/inputs/frontend.input.ts
4444
+ var import_type_graphql10 = require("type-graphql");
4445
+
4446
+ // src/graphql/inputs/action.input.ts
4074
4447
  var import_type_graphql9 = require("type-graphql");
4075
4448
  function _ts_decorate8(decorators, target, key, desc) {
4076
4449
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4088,59 +4461,36 @@ function _ts_metadata8(k, v) {
4088
4461
  return Reflect.metadata(k, v);
4089
4462
  }
4090
4463
  __name(_ts_metadata8, "_ts_metadata");
4091
- var ForwardedParametersInput = class {
4092
- model;
4093
- maxTokens;
4094
- stop;
4095
- toolChoice;
4096
- toolChoiceFunctionName;
4097
- temperature;
4464
+ var ActionInput = class {
4465
+ name;
4466
+ description;
4467
+ jsonSchema;
4468
+ available;
4098
4469
  };
4099
- __name(ForwardedParametersInput, "ForwardedParametersInput");
4470
+ __name(ActionInput, "ActionInput");
4100
4471
  _ts_decorate8([
4101
- (0, import_type_graphql9.Field)(() => String, {
4102
- nullable: true
4103
- }),
4472
+ (0, import_type_graphql9.Field)(() => String),
4104
4473
  _ts_metadata8("design:type", String)
4105
- ], ForwardedParametersInput.prototype, "model", void 0);
4106
- _ts_decorate8([
4107
- (0, import_type_graphql9.Field)(() => Number, {
4108
- nullable: true
4109
- }),
4110
- _ts_metadata8("design:type", Number)
4111
- ], ForwardedParametersInput.prototype, "maxTokens", void 0);
4112
- _ts_decorate8([
4113
- (0, import_type_graphql9.Field)(() => [
4114
- String
4115
- ], {
4116
- nullable: true
4117
- }),
4118
- _ts_metadata8("design:type", Array)
4119
- ], ForwardedParametersInput.prototype, "stop", void 0);
4474
+ ], ActionInput.prototype, "name", void 0);
4120
4475
  _ts_decorate8([
4121
- (0, import_type_graphql9.Field)(() => String, {
4122
- nullable: true
4123
- }),
4124
- _ts_metadata8("design:type", typeof String === "undefined" ? Object : String)
4125
- ], ForwardedParametersInput.prototype, "toolChoice", void 0);
4476
+ (0, import_type_graphql9.Field)(() => String),
4477
+ _ts_metadata8("design:type", String)
4478
+ ], ActionInput.prototype, "description", void 0);
4126
4479
  _ts_decorate8([
4127
- (0, import_type_graphql9.Field)(() => String, {
4128
- nullable: true
4129
- }),
4480
+ (0, import_type_graphql9.Field)(() => String),
4130
4481
  _ts_metadata8("design:type", String)
4131
- ], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
4482
+ ], ActionInput.prototype, "jsonSchema", void 0);
4132
4483
  _ts_decorate8([
4133
- (0, import_type_graphql9.Field)(() => Number, {
4484
+ (0, import_type_graphql9.Field)(() => ActionInputAvailability, {
4134
4485
  nullable: true
4135
4486
  }),
4136
- _ts_metadata8("design:type", Number)
4137
- ], ForwardedParametersInput.prototype, "temperature", void 0);
4138
- ForwardedParametersInput = _ts_decorate8([
4487
+ _ts_metadata8("design:type", typeof ActionInputAvailability === "undefined" ? Object : ActionInputAvailability)
4488
+ ], ActionInput.prototype, "available", void 0);
4489
+ ActionInput = _ts_decorate8([
4139
4490
  (0, import_type_graphql9.InputType)()
4140
- ], ForwardedParametersInput);
4491
+ ], ActionInput);
4141
4492
 
4142
- // src/graphql/inputs/agent-session.input.ts
4143
- var import_type_graphql10 = require("type-graphql");
4493
+ // src/graphql/inputs/frontend.input.ts
4144
4494
  function _ts_decorate9(decorators, target, key, desc) {
4145
4495
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4146
4496
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -4157,33 +4507,38 @@ function _ts_metadata9(k, v) {
4157
4507
  return Reflect.metadata(k, v);
4158
4508
  }
4159
4509
  __name(_ts_metadata9, "_ts_metadata");
4160
- var AgentSessionInput = class {
4161
- agentName;
4162
- threadId;
4163
- nodeName;
4510
+ var FrontendInput = class {
4511
+ toDeprecate_fullContext;
4512
+ actions;
4513
+ url;
4164
4514
  };
4165
- __name(AgentSessionInput, "AgentSessionInput");
4166
- _ts_decorate9([
4167
- (0, import_type_graphql10.Field)(() => String),
4168
- _ts_metadata9("design:type", String)
4169
- ], AgentSessionInput.prototype, "agentName", void 0);
4515
+ __name(FrontendInput, "FrontendInput");
4170
4516
  _ts_decorate9([
4171
4517
  (0, import_type_graphql10.Field)(() => String, {
4172
4518
  nullable: true
4173
4519
  }),
4174
4520
  _ts_metadata9("design:type", String)
4175
- ], AgentSessionInput.prototype, "threadId", void 0);
4521
+ ], FrontendInput.prototype, "toDeprecate_fullContext", void 0);
4522
+ _ts_decorate9([
4523
+ (0, import_type_graphql10.Field)(() => [
4524
+ ActionInput
4525
+ ]),
4526
+ _ts_metadata9("design:type", Array)
4527
+ ], FrontendInput.prototype, "actions", void 0);
4176
4528
  _ts_decorate9([
4177
4529
  (0, import_type_graphql10.Field)(() => String, {
4178
4530
  nullable: true
4179
4531
  }),
4180
4532
  _ts_metadata9("design:type", String)
4181
- ], AgentSessionInput.prototype, "nodeName", void 0);
4182
- AgentSessionInput = _ts_decorate9([
4533
+ ], FrontendInput.prototype, "url", void 0);
4534
+ FrontendInput = _ts_decorate9([
4183
4535
  (0, import_type_graphql10.InputType)()
4184
- ], AgentSessionInput);
4536
+ ], FrontendInput);
4185
4537
 
4186
- // src/graphql/inputs/agent-state.input.ts
4538
+ // src/graphql/inputs/cloud.input.ts
4539
+ var import_type_graphql12 = require("type-graphql");
4540
+
4541
+ // src/graphql/inputs/cloud-guardrails.input.ts
4187
4542
  var import_type_graphql11 = require("type-graphql");
4188
4543
  function _ts_decorate10(decorators, target, key, desc) {
4189
4544
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4201,76 +4556,76 @@ function _ts_metadata10(k, v) {
4201
4556
  return Reflect.metadata(k, v);
4202
4557
  }
4203
4558
  __name(_ts_metadata10, "_ts_metadata");
4204
- var AgentStateInput = class {
4205
- agentName;
4206
- state;
4559
+ var GuardrailsRuleInput = class {
4560
+ allowList = [];
4561
+ denyList = [];
4207
4562
  };
4208
- __name(AgentStateInput, "AgentStateInput");
4563
+ __name(GuardrailsRuleInput, "GuardrailsRuleInput");
4209
4564
  _ts_decorate10([
4210
- (0, import_type_graphql11.Field)(() => String),
4211
- _ts_metadata10("design:type", String)
4212
- ], AgentStateInput.prototype, "agentName", void 0);
4565
+ (0, import_type_graphql11.Field)(() => [
4566
+ String
4567
+ ], {
4568
+ nullable: true
4569
+ }),
4570
+ _ts_metadata10("design:type", Array)
4571
+ ], GuardrailsRuleInput.prototype, "allowList", void 0);
4213
4572
  _ts_decorate10([
4214
- (0, import_type_graphql11.Field)(() => String),
4215
- _ts_metadata10("design:type", String)
4216
- ], AgentStateInput.prototype, "state", void 0);
4217
- AgentStateInput = _ts_decorate10([
4573
+ (0, import_type_graphql11.Field)(() => [
4574
+ String
4575
+ ], {
4576
+ nullable: true
4577
+ }),
4578
+ _ts_metadata10("design:type", Array)
4579
+ ], GuardrailsRuleInput.prototype, "denyList", void 0);
4580
+ GuardrailsRuleInput = _ts_decorate10([
4218
4581
  (0, import_type_graphql11.InputType)()
4219
- ], AgentStateInput);
4582
+ ], GuardrailsRuleInput);
4583
+ var GuardrailsInput = class {
4584
+ inputValidationRules;
4585
+ };
4586
+ __name(GuardrailsInput, "GuardrailsInput");
4587
+ _ts_decorate10([
4588
+ (0, import_type_graphql11.Field)(() => GuardrailsRuleInput, {
4589
+ nullable: false
4590
+ }),
4591
+ _ts_metadata10("design:type", typeof GuardrailsRuleInput === "undefined" ? Object : GuardrailsRuleInput)
4592
+ ], GuardrailsInput.prototype, "inputValidationRules", void 0);
4593
+ GuardrailsInput = _ts_decorate10([
4594
+ (0, import_type_graphql11.InputType)()
4595
+ ], GuardrailsInput);
4220
4596
 
4221
- // src/graphql/inputs/extensions.input.ts
4222
- var import_type_graphql12 = require("type-graphql");
4597
+ // src/graphql/inputs/cloud.input.ts
4223
4598
  function _ts_decorate11(decorators, target, key, desc) {
4224
4599
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4225
4600
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4226
4601
  r = Reflect.decorate(decorators, target, key, desc);
4227
4602
  else
4228
- for (var i = decorators.length - 1; i >= 0; i--)
4229
- if (d = decorators[i])
4230
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4231
- return c > 3 && r && Object.defineProperty(target, key, r), r;
4232
- }
4233
- __name(_ts_decorate11, "_ts_decorate");
4234
- function _ts_metadata11(k, v) {
4235
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4236
- return Reflect.metadata(k, v);
4237
- }
4238
- __name(_ts_metadata11, "_ts_metadata");
4239
- var ExtensionsInput = class {
4240
- openaiAssistantAPI;
4241
- };
4242
- __name(ExtensionsInput, "ExtensionsInput");
4243
- _ts_decorate11([
4244
- (0, import_type_graphql12.Field)(() => OpenAIApiAssistantAPIInput, {
4245
- nullable: true
4246
- }),
4247
- _ts_metadata11("design:type", typeof OpenAIApiAssistantAPIInput === "undefined" ? Object : OpenAIApiAssistantAPIInput)
4248
- ], ExtensionsInput.prototype, "openaiAssistantAPI", void 0);
4249
- ExtensionsInput = _ts_decorate11([
4250
- (0, import_type_graphql12.InputType)()
4251
- ], ExtensionsInput);
4252
- var OpenAIApiAssistantAPIInput = class {
4253
- runId;
4254
- threadId;
4603
+ for (var i = decorators.length - 1; i >= 0; i--)
4604
+ if (d = decorators[i])
4605
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4606
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4607
+ }
4608
+ __name(_ts_decorate11, "_ts_decorate");
4609
+ function _ts_metadata11(k, v) {
4610
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
4611
+ return Reflect.metadata(k, v);
4612
+ }
4613
+ __name(_ts_metadata11, "_ts_metadata");
4614
+ var CloudInput = class {
4615
+ guardrails;
4255
4616
  };
4256
- __name(OpenAIApiAssistantAPIInput, "OpenAIApiAssistantAPIInput");
4257
- _ts_decorate11([
4258
- (0, import_type_graphql12.Field)(() => String, {
4259
- nullable: true
4260
- }),
4261
- _ts_metadata11("design:type", String)
4262
- ], OpenAIApiAssistantAPIInput.prototype, "runId", void 0);
4617
+ __name(CloudInput, "CloudInput");
4263
4618
  _ts_decorate11([
4264
- (0, import_type_graphql12.Field)(() => String, {
4619
+ (0, import_type_graphql12.Field)(() => GuardrailsInput, {
4265
4620
  nullable: true
4266
4621
  }),
4267
- _ts_metadata11("design:type", String)
4268
- ], OpenAIApiAssistantAPIInput.prototype, "threadId", void 0);
4269
- OpenAIApiAssistantAPIInput = _ts_decorate11([
4622
+ _ts_metadata11("design:type", typeof GuardrailsInput === "undefined" ? Object : GuardrailsInput)
4623
+ ], CloudInput.prototype, "guardrails", void 0);
4624
+ CloudInput = _ts_decorate11([
4270
4625
  (0, import_type_graphql12.InputType)()
4271
- ], OpenAIApiAssistantAPIInput);
4626
+ ], CloudInput);
4272
4627
 
4273
- // src/graphql/inputs/meta-event.input.ts
4628
+ // src/graphql/inputs/forwarded-parameters.input.ts
4274
4629
  var import_type_graphql13 = require("type-graphql");
4275
4630
  function _ts_decorate12(decorators, target, key, desc) {
4276
4631
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4288,36 +4643,59 @@ function _ts_metadata12(k, v) {
4288
4643
  return Reflect.metadata(k, v);
4289
4644
  }
4290
4645
  __name(_ts_metadata12, "_ts_metadata");
4291
- var MetaEventInput = class {
4292
- type = "MetaEvent";
4293
- name;
4294
- value;
4295
- response;
4646
+ var ForwardedParametersInput = class {
4647
+ model;
4648
+ maxTokens;
4649
+ stop;
4650
+ toolChoice;
4651
+ toolChoiceFunctionName;
4652
+ temperature;
4296
4653
  };
4297
- __name(MetaEventInput, "MetaEventInput");
4654
+ __name(ForwardedParametersInput, "ForwardedParametersInput");
4298
4655
  _ts_decorate12([
4299
- (0, import_type_graphql13.Field)(() => String),
4656
+ (0, import_type_graphql13.Field)(() => String, {
4657
+ nullable: true
4658
+ }),
4300
4659
  _ts_metadata12("design:type", String)
4301
- ], MetaEventInput.prototype, "type", void 0);
4660
+ ], ForwardedParametersInput.prototype, "model", void 0);
4302
4661
  _ts_decorate12([
4303
- (0, import_type_graphql13.Field)(() => MetaEventName),
4304
- _ts_metadata12("design:type", typeof MetaEventName === "undefined" ? Object : MetaEventName)
4305
- ], MetaEventInput.prototype, "name", void 0);
4662
+ (0, import_type_graphql13.Field)(() => Number, {
4663
+ nullable: true
4664
+ }),
4665
+ _ts_metadata12("design:type", Number)
4666
+ ], ForwardedParametersInput.prototype, "maxTokens", void 0);
4306
4667
  _ts_decorate12([
4307
- (0, import_type_graphql13.Field)(() => String),
4308
- _ts_metadata12("design:type", String)
4309
- ], MetaEventInput.prototype, "value", void 0);
4668
+ (0, import_type_graphql13.Field)(() => [
4669
+ String
4670
+ ], {
4671
+ nullable: true
4672
+ }),
4673
+ _ts_metadata12("design:type", Array)
4674
+ ], ForwardedParametersInput.prototype, "stop", void 0);
4675
+ _ts_decorate12([
4676
+ (0, import_type_graphql13.Field)(() => String, {
4677
+ nullable: true
4678
+ }),
4679
+ _ts_metadata12("design:type", typeof String === "undefined" ? Object : String)
4680
+ ], ForwardedParametersInput.prototype, "toolChoice", void 0);
4310
4681
  _ts_decorate12([
4311
4682
  (0, import_type_graphql13.Field)(() => String, {
4312
4683
  nullable: true
4313
4684
  }),
4314
4685
  _ts_metadata12("design:type", String)
4315
- ], MetaEventInput.prototype, "response", void 0);
4316
- MetaEventInput = _ts_decorate12([
4686
+ ], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
4687
+ _ts_decorate12([
4688
+ (0, import_type_graphql13.Field)(() => Number, {
4689
+ nullable: true
4690
+ }),
4691
+ _ts_metadata12("design:type", Number)
4692
+ ], ForwardedParametersInput.prototype, "temperature", void 0);
4693
+ ForwardedParametersInput = _ts_decorate12([
4317
4694
  (0, import_type_graphql13.InputType)()
4318
- ], MetaEventInput);
4695
+ ], ForwardedParametersInput);
4319
4696
 
4320
- // src/graphql/inputs/generate-copilot-response.input.ts
4697
+ // src/graphql/inputs/agent-session.input.ts
4698
+ var import_type_graphql14 = require("type-graphql");
4321
4699
  function _ts_decorate13(decorators, target, key, desc) {
4322
4700
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4323
4701
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -4334,116 +4712,33 @@ function _ts_metadata13(k, v) {
4334
4712
  return Reflect.metadata(k, v);
4335
4713
  }
4336
4714
  __name(_ts_metadata13, "_ts_metadata");
4337
- var GenerateCopilotResponseMetadataInput = class {
4338
- requestType;
4339
- };
4340
- __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
4341
- _ts_decorate13([
4342
- (0, import_type_graphql14.Field)(() => CopilotRequestType, {
4343
- nullable: true
4344
- }),
4345
- _ts_metadata13("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
4346
- ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
4347
- GenerateCopilotResponseMetadataInput = _ts_decorate13([
4348
- (0, import_type_graphql14.InputType)()
4349
- ], GenerateCopilotResponseMetadataInput);
4350
- var GenerateCopilotResponseInput = class {
4351
- metadata;
4715
+ var AgentSessionInput = class {
4716
+ agentName;
4352
4717
  threadId;
4353
- runId;
4354
- messages;
4355
- frontend;
4356
- cloud;
4357
- forwardedParameters;
4358
- agentSession;
4359
- agentState;
4360
- agentStates;
4361
- extensions;
4362
- metaEvents;
4718
+ nodeName;
4363
4719
  };
4364
- __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
4720
+ __name(AgentSessionInput, "AgentSessionInput");
4365
4721
  _ts_decorate13([
4366
- (0, import_type_graphql14.Field)(() => GenerateCopilotResponseMetadataInput, {
4367
- nullable: false
4368
- }),
4369
- _ts_metadata13("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
4370
- ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
4722
+ (0, import_type_graphql14.Field)(() => String),
4723
+ _ts_metadata13("design:type", String)
4724
+ ], AgentSessionInput.prototype, "agentName", void 0);
4371
4725
  _ts_decorate13([
4372
4726
  (0, import_type_graphql14.Field)(() => String, {
4373
4727
  nullable: true
4374
4728
  }),
4375
4729
  _ts_metadata13("design:type", String)
4376
- ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
4730
+ ], AgentSessionInput.prototype, "threadId", void 0);
4377
4731
  _ts_decorate13([
4378
4732
  (0, import_type_graphql14.Field)(() => String, {
4379
4733
  nullable: true
4380
4734
  }),
4381
4735
  _ts_metadata13("design:type", String)
4382
- ], GenerateCopilotResponseInput.prototype, "runId", void 0);
4383
- _ts_decorate13([
4384
- (0, import_type_graphql14.Field)(() => [
4385
- MessageInput
4386
- ]),
4387
- _ts_metadata13("design:type", Array)
4388
- ], GenerateCopilotResponseInput.prototype, "messages", void 0);
4389
- _ts_decorate13([
4390
- (0, import_type_graphql14.Field)(() => FrontendInput),
4391
- _ts_metadata13("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
4392
- ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
4393
- _ts_decorate13([
4394
- (0, import_type_graphql14.Field)(() => CloudInput, {
4395
- nullable: true
4396
- }),
4397
- _ts_metadata13("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
4398
- ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
4399
- _ts_decorate13([
4400
- (0, import_type_graphql14.Field)(() => ForwardedParametersInput, {
4401
- nullable: true
4402
- }),
4403
- _ts_metadata13("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
4404
- ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
4405
- _ts_decorate13([
4406
- (0, import_type_graphql14.Field)(() => AgentSessionInput, {
4407
- nullable: true
4408
- }),
4409
- _ts_metadata13("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
4410
- ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
4411
- _ts_decorate13([
4412
- (0, import_type_graphql14.Field)(() => AgentStateInput, {
4413
- nullable: true
4414
- }),
4415
- _ts_metadata13("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
4416
- ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
4417
- _ts_decorate13([
4418
- (0, import_type_graphql14.Field)(() => [
4419
- AgentStateInput
4420
- ], {
4421
- nullable: true
4422
- }),
4423
- _ts_metadata13("design:type", Array)
4424
- ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
4425
- _ts_decorate13([
4426
- (0, import_type_graphql14.Field)(() => ExtensionsInput, {
4427
- nullable: true
4428
- }),
4429
- _ts_metadata13("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
4430
- ], GenerateCopilotResponseInput.prototype, "extensions", void 0);
4431
- _ts_decorate13([
4432
- (0, import_type_graphql14.Field)(() => [
4433
- MetaEventInput
4434
- ], {
4435
- nullable: true
4436
- }),
4437
- _ts_metadata13("design:type", Array)
4438
- ], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
4439
- GenerateCopilotResponseInput = _ts_decorate13([
4736
+ ], AgentSessionInput.prototype, "nodeName", void 0);
4737
+ AgentSessionInput = _ts_decorate13([
4440
4738
  (0, import_type_graphql14.InputType)()
4441
- ], GenerateCopilotResponseInput);
4442
-
4443
- // src/graphql/types/copilot-response.type.ts
4444
- var import_type_graphql18 = require("type-graphql");
4739
+ ], AgentSessionInput);
4445
4740
 
4446
- // src/graphql/types/message-status.type.ts
4741
+ // src/graphql/inputs/agent-state.input.ts
4447
4742
  var import_type_graphql15 = require("type-graphql");
4448
4743
  function _ts_decorate14(decorators, target, key, desc) {
4449
4744
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4461,62 +4756,24 @@ function _ts_metadata14(k, v) {
4461
4756
  return Reflect.metadata(k, v);
4462
4757
  }
4463
4758
  __name(_ts_metadata14, "_ts_metadata");
4464
- var MessageStatusCode;
4465
- (function(MessageStatusCode2) {
4466
- MessageStatusCode2["Pending"] = "pending";
4467
- MessageStatusCode2["Success"] = "success";
4468
- MessageStatusCode2["Failed"] = "failed";
4469
- })(MessageStatusCode || (MessageStatusCode = {}));
4470
- (0, import_type_graphql15.registerEnumType)(MessageStatusCode, {
4471
- name: "MessageStatusCode"
4472
- });
4473
- var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
4474
- code;
4475
- }, "BaseMessageStatus");
4759
+ var AgentStateInput = class {
4760
+ agentName;
4761
+ state;
4762
+ };
4763
+ __name(AgentStateInput, "AgentStateInput");
4476
4764
  _ts_decorate14([
4477
- (0, import_type_graphql15.Field)(() => MessageStatusCode),
4765
+ (0, import_type_graphql15.Field)(() => String),
4478
4766
  _ts_metadata14("design:type", String)
4479
- ], BaseMessageStatus.prototype, "code", void 0);
4480
- BaseMessageStatus = _ts_decorate14([
4481
- (0, import_type_graphql15.ObjectType)()
4482
- ], BaseMessageStatus);
4483
- var PendingMessageStatus = class extends BaseMessageStatus {
4484
- code = "pending";
4485
- };
4486
- __name(PendingMessageStatus, "PendingMessageStatus");
4487
- PendingMessageStatus = _ts_decorate14([
4488
- (0, import_type_graphql15.ObjectType)()
4489
- ], PendingMessageStatus);
4490
- var SuccessMessageStatus = class extends BaseMessageStatus {
4491
- code = "success";
4492
- };
4493
- __name(SuccessMessageStatus, "SuccessMessageStatus");
4494
- SuccessMessageStatus = _ts_decorate14([
4495
- (0, import_type_graphql15.ObjectType)()
4496
- ], SuccessMessageStatus);
4497
- var FailedMessageStatus = class extends BaseMessageStatus {
4498
- code = "failed";
4499
- reason;
4500
- };
4501
- __name(FailedMessageStatus, "FailedMessageStatus");
4767
+ ], AgentStateInput.prototype, "agentName", void 0);
4502
4768
  _ts_decorate14([
4503
4769
  (0, import_type_graphql15.Field)(() => String),
4504
4770
  _ts_metadata14("design:type", String)
4505
- ], FailedMessageStatus.prototype, "reason", void 0);
4506
- FailedMessageStatus = _ts_decorate14([
4507
- (0, import_type_graphql15.ObjectType)()
4508
- ], FailedMessageStatus);
4509
- var MessageStatusUnion = (0, import_type_graphql15.createUnionType)({
4510
- name: "MessageStatus",
4511
- types: () => [
4512
- PendingMessageStatus,
4513
- SuccessMessageStatus,
4514
- FailedMessageStatus
4515
- ]
4516
- });
4771
+ ], AgentStateInput.prototype, "state", void 0);
4772
+ AgentStateInput = _ts_decorate14([
4773
+ (0, import_type_graphql15.InputType)()
4774
+ ], AgentStateInput);
4517
4775
 
4518
- // src/graphql/types/response-status.type.ts
4519
- var import_graphql_scalars = require("graphql-scalars");
4776
+ // src/graphql/inputs/extensions.input.ts
4520
4777
  var import_type_graphql16 = require("type-graphql");
4521
4778
  function _ts_decorate15(decorators, target, key, desc) {
4522
4779
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4534,95 +4791,41 @@ function _ts_metadata15(k, v) {
4534
4791
  return Reflect.metadata(k, v);
4535
4792
  }
4536
4793
  __name(_ts_metadata15, "_ts_metadata");
4537
- var ResponseStatusCode;
4538
- (function(ResponseStatusCode2) {
4539
- ResponseStatusCode2["Pending"] = "pending";
4540
- ResponseStatusCode2["Success"] = "success";
4541
- ResponseStatusCode2["Failed"] = "failed";
4542
- })(ResponseStatusCode || (ResponseStatusCode = {}));
4543
- (0, import_type_graphql16.registerEnumType)(ResponseStatusCode, {
4544
- name: "ResponseStatusCode"
4545
- });
4546
- var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
4547
- code;
4548
- }, "BaseResponseStatus");
4549
- _ts_decorate15([
4550
- (0, import_type_graphql16.Field)(() => ResponseStatusCode),
4551
- _ts_metadata15("design:type", String)
4552
- ], BaseResponseStatus.prototype, "code", void 0);
4553
- BaseResponseStatus = _ts_decorate15([
4554
- (0, import_type_graphql16.InterfaceType)({
4555
- resolveType(value) {
4556
- if (value.code === "success") {
4557
- return SuccessResponseStatus;
4558
- } else if (value.code === "failed") {
4559
- return FailedResponseStatus;
4560
- } else if (value.code === "pending") {
4561
- return PendingResponseStatus;
4562
- }
4563
- return void 0;
4564
- }
4565
- }),
4566
- (0, import_type_graphql16.ObjectType)()
4567
- ], BaseResponseStatus);
4568
- var PendingResponseStatus = class extends BaseResponseStatus {
4569
- code = "pending";
4570
- };
4571
- __name(PendingResponseStatus, "PendingResponseStatus");
4572
- PendingResponseStatus = _ts_decorate15([
4573
- (0, import_type_graphql16.ObjectType)({
4574
- implements: BaseResponseStatus
4575
- })
4576
- ], PendingResponseStatus);
4577
- var SuccessResponseStatus = class extends BaseResponseStatus {
4578
- code = "success";
4794
+ var ExtensionsInput = class {
4795
+ openaiAssistantAPI;
4579
4796
  };
4580
- __name(SuccessResponseStatus, "SuccessResponseStatus");
4581
- SuccessResponseStatus = _ts_decorate15([
4582
- (0, import_type_graphql16.ObjectType)({
4583
- implements: BaseResponseStatus
4584
- })
4585
- ], SuccessResponseStatus);
4586
- var FailedResponseStatusReason;
4587
- (function(FailedResponseStatusReason2) {
4588
- FailedResponseStatusReason2["GUARDRAILS_VALIDATION_FAILED"] = "GUARDRAILS_VALIDATION_FAILED";
4589
- FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
4590
- FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
4591
- })(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
4592
- (0, import_type_graphql16.registerEnumType)(FailedResponseStatusReason, {
4593
- name: "FailedResponseStatusReason"
4594
- });
4595
- var FailedResponseStatus = class extends BaseResponseStatus {
4596
- code = "failed";
4597
- reason;
4598
- details = null;
4797
+ __name(ExtensionsInput, "ExtensionsInput");
4798
+ _ts_decorate15([
4799
+ (0, import_type_graphql16.Field)(() => OpenAIApiAssistantAPIInput, {
4800
+ nullable: true
4801
+ }),
4802
+ _ts_metadata15("design:type", typeof OpenAIApiAssistantAPIInput === "undefined" ? Object : OpenAIApiAssistantAPIInput)
4803
+ ], ExtensionsInput.prototype, "openaiAssistantAPI", void 0);
4804
+ ExtensionsInput = _ts_decorate15([
4805
+ (0, import_type_graphql16.InputType)()
4806
+ ], ExtensionsInput);
4807
+ var OpenAIApiAssistantAPIInput = class {
4808
+ runId;
4809
+ threadId;
4599
4810
  };
4600
- __name(FailedResponseStatus, "FailedResponseStatus");
4811
+ __name(OpenAIApiAssistantAPIInput, "OpenAIApiAssistantAPIInput");
4601
4812
  _ts_decorate15([
4602
- (0, import_type_graphql16.Field)(() => FailedResponseStatusReason),
4813
+ (0, import_type_graphql16.Field)(() => String, {
4814
+ nullable: true
4815
+ }),
4603
4816
  _ts_metadata15("design:type", String)
4604
- ], FailedResponseStatus.prototype, "reason", void 0);
4817
+ ], OpenAIApiAssistantAPIInput.prototype, "runId", void 0);
4605
4818
  _ts_decorate15([
4606
- (0, import_type_graphql16.Field)(() => import_graphql_scalars.GraphQLJSON, {
4819
+ (0, import_type_graphql16.Field)(() => String, {
4607
4820
  nullable: true
4608
4821
  }),
4609
- _ts_metadata15("design:type", typeof Record === "undefined" ? Object : Record)
4610
- ], FailedResponseStatus.prototype, "details", void 0);
4611
- FailedResponseStatus = _ts_decorate15([
4612
- (0, import_type_graphql16.ObjectType)({
4613
- implements: BaseResponseStatus
4614
- })
4615
- ], FailedResponseStatus);
4616
- var ResponseStatusUnion = (0, import_type_graphql16.createUnionType)({
4617
- name: "ResponseStatus",
4618
- types: () => [
4619
- PendingResponseStatus,
4620
- SuccessResponseStatus,
4621
- FailedResponseStatus
4622
- ]
4623
- });
4822
+ _ts_metadata15("design:type", String)
4823
+ ], OpenAIApiAssistantAPIInput.prototype, "threadId", void 0);
4824
+ OpenAIApiAssistantAPIInput = _ts_decorate15([
4825
+ (0, import_type_graphql16.InputType)()
4826
+ ], OpenAIApiAssistantAPIInput);
4624
4827
 
4625
- // src/graphql/types/extensions-response.type.ts
4828
+ // src/graphql/inputs/meta-event.input.ts
4626
4829
  var import_type_graphql17 = require("type-graphql");
4627
4830
  function _ts_decorate16(decorators, target, key, desc) {
4628
4831
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4640,41 +4843,40 @@ function _ts_metadata16(k, v) {
4640
4843
  return Reflect.metadata(k, v);
4641
4844
  }
4642
4845
  __name(_ts_metadata16, "_ts_metadata");
4643
- var ExtensionsResponse = class {
4644
- openaiAssistantAPI;
4846
+ var MetaEventInput = class {
4847
+ name;
4848
+ value;
4849
+ response;
4850
+ messages;
4645
4851
  };
4646
- __name(ExtensionsResponse, "ExtensionsResponse");
4852
+ __name(MetaEventInput, "MetaEventInput");
4647
4853
  _ts_decorate16([
4648
- (0, import_type_graphql17.Field)(() => OpenAIApiAssistantAPIResponse, {
4649
- nullable: true
4650
- }),
4651
- _ts_metadata16("design:type", typeof OpenAIApiAssistantAPIResponse === "undefined" ? Object : OpenAIApiAssistantAPIResponse)
4652
- ], ExtensionsResponse.prototype, "openaiAssistantAPI", void 0);
4653
- ExtensionsResponse = _ts_decorate16([
4654
- (0, import_type_graphql17.ObjectType)()
4655
- ], ExtensionsResponse);
4656
- var OpenAIApiAssistantAPIResponse = class {
4657
- runId;
4658
- threadId;
4659
- };
4660
- __name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
4854
+ (0, import_type_graphql17.Field)(() => MetaEventName),
4855
+ _ts_metadata16("design:type", typeof MetaEventName === "undefined" ? Object : MetaEventName)
4856
+ ], MetaEventInput.prototype, "name", void 0);
4857
+ _ts_decorate16([
4858
+ (0, import_type_graphql17.Field)(() => String),
4859
+ _ts_metadata16("design:type", String)
4860
+ ], MetaEventInput.prototype, "value", void 0);
4661
4861
  _ts_decorate16([
4662
4862
  (0, import_type_graphql17.Field)(() => String, {
4663
4863
  nullable: true
4664
4864
  }),
4665
4865
  _ts_metadata16("design:type", String)
4666
- ], OpenAIApiAssistantAPIResponse.prototype, "runId", void 0);
4866
+ ], MetaEventInput.prototype, "response", void 0);
4667
4867
  _ts_decorate16([
4668
- (0, import_type_graphql17.Field)(() => String, {
4868
+ (0, import_type_graphql17.Field)(() => [
4869
+ MessageInput
4870
+ ], {
4669
4871
  nullable: true
4670
4872
  }),
4671
- _ts_metadata16("design:type", String)
4672
- ], OpenAIApiAssistantAPIResponse.prototype, "threadId", void 0);
4673
- OpenAIApiAssistantAPIResponse = _ts_decorate16([
4674
- (0, import_type_graphql17.ObjectType)()
4675
- ], OpenAIApiAssistantAPIResponse);
4873
+ _ts_metadata16("design:type", Array)
4874
+ ], MetaEventInput.prototype, "messages", void 0);
4875
+ MetaEventInput = _ts_decorate16([
4876
+ (0, import_type_graphql17.InputType)()
4877
+ ], MetaEventInput);
4676
4878
 
4677
- // src/graphql/types/copilot-response.type.ts
4879
+ // src/graphql/inputs/generate-copilot-response.input.ts
4678
4880
  function _ts_decorate17(decorators, target, key, desc) {
4679
4881
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4680
4882
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -4691,221 +4893,111 @@ function _ts_metadata17(k, v) {
4691
4893
  return Reflect.metadata(k, v);
4692
4894
  }
4693
4895
  __name(_ts_metadata17, "_ts_metadata");
4694
- var BaseMessageOutput = class {
4695
- id;
4696
- createdAt;
4697
- status;
4896
+ var GenerateCopilotResponseMetadataInput = class {
4897
+ requestType;
4698
4898
  };
4699
- __name(BaseMessageOutput, "BaseMessageOutput");
4700
- _ts_decorate17([
4701
- (0, import_type_graphql18.Field)(() => String),
4702
- _ts_metadata17("design:type", String)
4703
- ], BaseMessageOutput.prototype, "id", void 0);
4704
- _ts_decorate17([
4705
- (0, import_type_graphql18.Field)(() => Date),
4706
- _ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
4707
- ], BaseMessageOutput.prototype, "createdAt", void 0);
4899
+ __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
4708
4900
  _ts_decorate17([
4709
- (0, import_type_graphql18.Field)(() => MessageStatusUnion),
4710
- _ts_metadata17("design:type", Object)
4711
- ], BaseMessageOutput.prototype, "status", void 0);
4712
- BaseMessageOutput = _ts_decorate17([
4713
- (0, import_type_graphql18.InterfaceType)({
4714
- resolveType(value) {
4715
- if (value.hasOwnProperty("content")) {
4716
- return TextMessageOutput;
4717
- } else if (value.hasOwnProperty("name")) {
4718
- return ActionExecutionMessageOutput;
4719
- } else if (value.hasOwnProperty("result")) {
4720
- return ResultMessageOutput;
4721
- } else if (value.hasOwnProperty("state")) {
4722
- return AgentStateMessageOutput;
4723
- } else if (value.name === MetaEventName.LangGraphInterruptEvent) {
4724
- return LangGraphInterruptEvent;
4725
- }
4726
- return void 0;
4727
- }
4728
- })
4729
- ], BaseMessageOutput);
4730
- var TextMessageOutput = class {
4731
- role;
4732
- content;
4733
- parentMessageId;
4901
+ (0, import_type_graphql18.Field)(() => CopilotRequestType, {
4902
+ nullable: true
4903
+ }),
4904
+ _ts_metadata17("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
4905
+ ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
4906
+ GenerateCopilotResponseMetadataInput = _ts_decorate17([
4907
+ (0, import_type_graphql18.InputType)()
4908
+ ], GenerateCopilotResponseMetadataInput);
4909
+ var GenerateCopilotResponseInput = class {
4910
+ metadata;
4911
+ threadId;
4912
+ runId;
4913
+ messages;
4914
+ frontend;
4915
+ cloud;
4916
+ forwardedParameters;
4917
+ agentSession;
4918
+ agentState;
4919
+ agentStates;
4920
+ extensions;
4921
+ metaEvents;
4734
4922
  };
4735
- __name(TextMessageOutput, "TextMessageOutput");
4736
- _ts_decorate17([
4737
- (0, import_type_graphql18.Field)(() => MessageRole),
4738
- _ts_metadata17("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
4739
- ], TextMessageOutput.prototype, "role", void 0);
4923
+ __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
4740
4924
  _ts_decorate17([
4741
- (0, import_type_graphql18.Field)(() => [
4742
- String
4743
- ]),
4744
- _ts_metadata17("design:type", Array)
4745
- ], TextMessageOutput.prototype, "content", void 0);
4925
+ (0, import_type_graphql18.Field)(() => GenerateCopilotResponseMetadataInput, {
4926
+ nullable: false
4927
+ }),
4928
+ _ts_metadata17("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
4929
+ ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
4746
4930
  _ts_decorate17([
4747
4931
  (0, import_type_graphql18.Field)(() => String, {
4748
4932
  nullable: true
4749
4933
  }),
4750
4934
  _ts_metadata17("design:type", String)
4751
- ], TextMessageOutput.prototype, "parentMessageId", void 0);
4752
- TextMessageOutput = _ts_decorate17([
4753
- (0, import_type_graphql18.ObjectType)({
4754
- implements: BaseMessageOutput
4755
- })
4756
- ], TextMessageOutput);
4757
- var ActionExecutionMessageOutput = class {
4758
- name;
4759
- scope;
4760
- arguments;
4761
- parentMessageId;
4762
- };
4763
- __name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
4764
- _ts_decorate17([
4765
- (0, import_type_graphql18.Field)(() => String),
4766
- _ts_metadata17("design:type", String)
4767
- ], ActionExecutionMessageOutput.prototype, "name", void 0);
4935
+ ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
4768
4936
  _ts_decorate17([
4769
4937
  (0, import_type_graphql18.Field)(() => String, {
4770
- nullable: true,
4771
- deprecationReason: "This field will be removed in a future version"
4938
+ nullable: true
4772
4939
  }),
4773
4940
  _ts_metadata17("design:type", String)
4774
- ], ActionExecutionMessageOutput.prototype, "scope", void 0);
4941
+ ], GenerateCopilotResponseInput.prototype, "runId", void 0);
4775
4942
  _ts_decorate17([
4776
4943
  (0, import_type_graphql18.Field)(() => [
4777
- String
4944
+ MessageInput
4778
4945
  ]),
4779
4946
  _ts_metadata17("design:type", Array)
4780
- ], ActionExecutionMessageOutput.prototype, "arguments", void 0);
4947
+ ], GenerateCopilotResponseInput.prototype, "messages", void 0);
4781
4948
  _ts_decorate17([
4782
- (0, import_type_graphql18.Field)(() => String, {
4949
+ (0, import_type_graphql18.Field)(() => FrontendInput),
4950
+ _ts_metadata17("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
4951
+ ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
4952
+ _ts_decorate17([
4953
+ (0, import_type_graphql18.Field)(() => CloudInput, {
4783
4954
  nullable: true
4784
4955
  }),
4785
- _ts_metadata17("design:type", String)
4786
- ], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
4787
- ActionExecutionMessageOutput = _ts_decorate17([
4788
- (0, import_type_graphql18.ObjectType)({
4789
- implements: BaseMessageOutput
4790
- })
4791
- ], ActionExecutionMessageOutput);
4792
- var ResultMessageOutput = class {
4793
- actionExecutionId;
4794
- actionName;
4795
- result;
4796
- };
4797
- __name(ResultMessageOutput, "ResultMessageOutput");
4798
- _ts_decorate17([
4799
- (0, import_type_graphql18.Field)(() => String),
4800
- _ts_metadata17("design:type", String)
4801
- ], ResultMessageOutput.prototype, "actionExecutionId", void 0);
4802
- _ts_decorate17([
4803
- (0, import_type_graphql18.Field)(() => String),
4804
- _ts_metadata17("design:type", String)
4805
- ], ResultMessageOutput.prototype, "actionName", void 0);
4806
- _ts_decorate17([
4807
- (0, import_type_graphql18.Field)(() => String),
4808
- _ts_metadata17("design:type", String)
4809
- ], ResultMessageOutput.prototype, "result", void 0);
4810
- ResultMessageOutput = _ts_decorate17([
4811
- (0, import_type_graphql18.ObjectType)({
4812
- implements: BaseMessageOutput
4813
- })
4814
- ], ResultMessageOutput);
4815
- var AgentStateMessageOutput = class {
4816
- threadId;
4817
- agentName;
4818
- nodeName;
4819
- runId;
4820
- active;
4821
- role;
4822
- state;
4823
- running;
4824
- };
4825
- __name(AgentStateMessageOutput, "AgentStateMessageOutput");
4826
- _ts_decorate17([
4827
- (0, import_type_graphql18.Field)(() => String),
4828
- _ts_metadata17("design:type", String)
4829
- ], AgentStateMessageOutput.prototype, "threadId", void 0);
4830
- _ts_decorate17([
4831
- (0, import_type_graphql18.Field)(() => String),
4832
- _ts_metadata17("design:type", String)
4833
- ], AgentStateMessageOutput.prototype, "agentName", void 0);
4834
- _ts_decorate17([
4835
- (0, import_type_graphql18.Field)(() => String),
4836
- _ts_metadata17("design:type", String)
4837
- ], AgentStateMessageOutput.prototype, "nodeName", void 0);
4838
- _ts_decorate17([
4839
- (0, import_type_graphql18.Field)(() => String),
4840
- _ts_metadata17("design:type", String)
4841
- ], AgentStateMessageOutput.prototype, "runId", void 0);
4842
- _ts_decorate17([
4843
- (0, import_type_graphql18.Field)(() => Boolean),
4844
- _ts_metadata17("design:type", Boolean)
4845
- ], AgentStateMessageOutput.prototype, "active", void 0);
4846
- _ts_decorate17([
4847
- (0, import_type_graphql18.Field)(() => MessageRole),
4848
- _ts_metadata17("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
4849
- ], AgentStateMessageOutput.prototype, "role", void 0);
4850
- _ts_decorate17([
4851
- (0, import_type_graphql18.Field)(() => String),
4852
- _ts_metadata17("design:type", String)
4853
- ], AgentStateMessageOutput.prototype, "state", void 0);
4854
- _ts_decorate17([
4855
- (0, import_type_graphql18.Field)(() => Boolean),
4856
- _ts_metadata17("design:type", Boolean)
4857
- ], AgentStateMessageOutput.prototype, "running", void 0);
4858
- AgentStateMessageOutput = _ts_decorate17([
4859
- (0, import_type_graphql18.ObjectType)({
4860
- implements: BaseMessageOutput
4861
- })
4862
- ], AgentStateMessageOutput);
4863
- var CopilotResponse = class {
4864
- threadId;
4865
- status;
4866
- runId;
4867
- messages;
4868
- extensions;
4869
- metaEvents;
4870
- };
4871
- __name(CopilotResponse, "CopilotResponse");
4956
+ _ts_metadata17("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
4957
+ ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
4872
4958
  _ts_decorate17([
4873
- (0, import_type_graphql18.Field)(() => String),
4874
- _ts_metadata17("design:type", String)
4875
- ], CopilotResponse.prototype, "threadId", void 0);
4959
+ (0, import_type_graphql18.Field)(() => ForwardedParametersInput, {
4960
+ nullable: true
4961
+ }),
4962
+ _ts_metadata17("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
4963
+ ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
4876
4964
  _ts_decorate17([
4877
- (0, import_type_graphql18.Field)(() => ResponseStatusUnion),
4878
- _ts_metadata17("design:type", Object)
4879
- ], CopilotResponse.prototype, "status", void 0);
4965
+ (0, import_type_graphql18.Field)(() => AgentSessionInput, {
4966
+ nullable: true
4967
+ }),
4968
+ _ts_metadata17("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
4969
+ ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
4880
4970
  _ts_decorate17([
4881
- (0, import_type_graphql18.Field)({
4971
+ (0, import_type_graphql18.Field)(() => AgentStateInput, {
4882
4972
  nullable: true
4883
4973
  }),
4884
- _ts_metadata17("design:type", String)
4885
- ], CopilotResponse.prototype, "runId", void 0);
4974
+ _ts_metadata17("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
4975
+ ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
4886
4976
  _ts_decorate17([
4887
4977
  (0, import_type_graphql18.Field)(() => [
4888
- BaseMessageOutput
4889
- ]),
4978
+ AgentStateInput
4979
+ ], {
4980
+ nullable: true
4981
+ }),
4890
4982
  _ts_metadata17("design:type", Array)
4891
- ], CopilotResponse.prototype, "messages", void 0);
4983
+ ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
4892
4984
  _ts_decorate17([
4893
- (0, import_type_graphql18.Field)(() => ExtensionsResponse, {
4985
+ (0, import_type_graphql18.Field)(() => ExtensionsInput, {
4894
4986
  nullable: true
4895
4987
  }),
4896
- _ts_metadata17("design:type", typeof ExtensionsResponse === "undefined" ? Object : ExtensionsResponse)
4897
- ], CopilotResponse.prototype, "extensions", void 0);
4988
+ _ts_metadata17("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
4989
+ ], GenerateCopilotResponseInput.prototype, "extensions", void 0);
4898
4990
  _ts_decorate17([
4899
4991
  (0, import_type_graphql18.Field)(() => [
4900
- BaseMetaEvent
4992
+ MetaEventInput
4901
4993
  ], {
4902
4994
  nullable: true
4903
4995
  }),
4904
4996
  _ts_metadata17("design:type", Array)
4905
- ], CopilotResponse.prototype, "metaEvents", void 0);
4906
- CopilotResponse = _ts_decorate17([
4907
- (0, import_type_graphql18.ObjectType)()
4908
- ], CopilotResponse);
4997
+ ], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
4998
+ GenerateCopilotResponseInput = _ts_decorate17([
4999
+ (0, import_type_graphql18.InputType)()
5000
+ ], GenerateCopilotResponseInput);
4909
5001
 
4910
5002
  // src/graphql/resolvers/copilot.resolver.ts
4911
5003
  var import_graphql_yoga = require("graphql-yoga");
@@ -5183,6 +5275,40 @@ var CopilotResolver = class {
5183
5275
  value: event.value
5184
5276
  }));
5185
5277
  break;
5278
+ case RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent:
5279
+ push((0, import_class_transformer3.plainToInstance)(CopilotKitLangGraphInterruptEvent, {
5280
+ type: event.type,
5281
+ name: event.name,
5282
+ data: {
5283
+ value: typeof event.data.value === "string" ? event.data.value : JSON.stringify(event.data.value),
5284
+ messages: event.data.messages.map((message) => {
5285
+ if (message.type === "TextMessage" || "content" in message && "role" in message) {
5286
+ return (0, import_class_transformer3.plainToInstance)(TextMessage, {
5287
+ id: message.id,
5288
+ createdAt: /* @__PURE__ */ new Date(),
5289
+ content: [
5290
+ message.content
5291
+ ],
5292
+ role: message.role,
5293
+ status: new SuccessMessageStatus()
5294
+ });
5295
+ }
5296
+ if ("arguments" in message) {
5297
+ return (0, import_class_transformer3.plainToInstance)(ActionExecutionMessage, {
5298
+ name: message.name,
5299
+ id: message.id,
5300
+ arguments: [
5301
+ JSON.stringify(message.arguments)
5302
+ ],
5303
+ createdAt: /* @__PURE__ */ new Date(),
5304
+ status: new SuccessMessageStatus()
5305
+ });
5306
+ }
5307
+ throw new Error("Unknown message in metaEvents copilot resolver");
5308
+ })
5309
+ }
5310
+ }));
5311
+ break;
5186
5312
  }
5187
5313
  },
5188
5314
  error: (err) => {