@copilotkit/runtime 1.10.5-next.0 → 1.10.5-next.1

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 (52) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/__snapshots__/schema/schema.graphql +6 -0
  3. package/dist/{chunk-2JRX6LGW.mjs → chunk-C56AVUZI.mjs} +2 -2
  4. package/dist/{chunk-4GRKJVD6.mjs → chunk-CX4GADTM.mjs} +2 -2
  5. package/dist/{chunk-HZWVUP7K.mjs → chunk-FOXQPOXW.mjs} +184 -136
  6. package/dist/chunk-FOXQPOXW.mjs.map +1 -0
  7. package/dist/{chunk-TPMK44TE.mjs → chunk-H6QUY5ZQ.mjs} +16 -6
  8. package/dist/chunk-H6QUY5ZQ.mjs.map +1 -0
  9. package/dist/{chunk-WGOBL6DV.mjs → chunk-T4NLPBCY.mjs} +2 -2
  10. package/dist/graphql/types/converted/index.d.ts +1 -1
  11. package/dist/{groq-adapter-4ba7b2f0.d.ts → groq-adapter-c8aec5c5.d.ts} +1 -1
  12. package/dist/{index-d4614f9b.d.ts → index-96b330da.d.ts} +1 -1
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +216 -158
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +5 -5
  17. package/dist/{langserve-3f99bf2e.d.ts → langserve-0c6100e3.d.ts} +1 -1
  18. package/dist/lib/index.d.ts +12 -6
  19. package/dist/lib/index.js +216 -158
  20. package/dist/lib/index.js.map +1 -1
  21. package/dist/lib/index.mjs +5 -5
  22. package/dist/lib/integrations/index.d.ts +4 -4
  23. package/dist/lib/integrations/index.js +188 -143
  24. package/dist/lib/integrations/index.js.map +1 -1
  25. package/dist/lib/integrations/index.mjs +4 -4
  26. package/dist/lib/integrations/nest/index.d.ts +3 -3
  27. package/dist/lib/integrations/nest/index.js +188 -143
  28. package/dist/lib/integrations/nest/index.js.map +1 -1
  29. package/dist/lib/integrations/nest/index.mjs +2 -2
  30. package/dist/lib/integrations/node-express/index.d.ts +3 -3
  31. package/dist/lib/integrations/node-express/index.js +188 -143
  32. package/dist/lib/integrations/node-express/index.js.map +1 -1
  33. package/dist/lib/integrations/node-express/index.mjs +2 -2
  34. package/dist/lib/integrations/node-http/index.d.ts +3 -3
  35. package/dist/lib/integrations/node-http/index.js +188 -143
  36. package/dist/lib/integrations/node-http/index.js.map +1 -1
  37. package/dist/lib/integrations/node-http/index.mjs +1 -1
  38. package/dist/service-adapters/index.d.ts +5 -5
  39. package/dist/{shared-26958730.d.ts → shared-35015e40.d.ts} +9 -2
  40. package/package.json +3 -3
  41. package/src/graphql/inputs/copilot-context.input.ts +10 -0
  42. package/src/graphql/inputs/generate-copilot-response.input.ts +4 -0
  43. package/src/graphql/resolvers/copilot.resolver.ts +1 -0
  44. package/src/lib/runtime/agui-action.ts +4 -0
  45. package/src/lib/runtime/copilot-runtime.ts +5 -0
  46. package/src/lib/runtime/langgraph/langgraph-agent.ts +27 -7
  47. package/src/lib/runtime/remote-actions.ts +4 -0
  48. package/dist/chunk-HZWVUP7K.mjs.map +0 -1
  49. package/dist/chunk-TPMK44TE.mjs.map +0 -1
  50. /package/dist/{chunk-2JRX6LGW.mjs.map → chunk-C56AVUZI.mjs.map} +0 -0
  51. /package/dist/{chunk-4GRKJVD6.mjs.map → chunk-CX4GADTM.mjs.map} +0 -0
  52. /package/dist/{chunk-WGOBL6DV.mjs.map → chunk-T4NLPBCY.mjs.map} +0 -0
@@ -2,18 +2,18 @@ import {
2
2
  CustomEventNames,
3
3
  LangGraphAgent,
4
4
  LangGraphHttpAgent
5
- } from "../chunk-TPMK44TE.mjs";
5
+ } from "../chunk-H6QUY5ZQ.mjs";
6
6
  import {
7
7
  config,
8
8
  copilotRuntimeNextJSAppRouterEndpoint,
9
9
  copilotRuntimeNextJSPagesRouterEndpoint
10
- } from "../chunk-4GRKJVD6.mjs";
10
+ } from "../chunk-CX4GADTM.mjs";
11
11
  import {
12
12
  copilotRuntimeNestEndpoint
13
- } from "../chunk-WGOBL6DV.mjs";
13
+ } from "../chunk-T4NLPBCY.mjs";
14
14
  import {
15
15
  copilotRuntimeNodeExpressEndpoint
16
- } from "../chunk-2JRX6LGW.mjs";
16
+ } from "../chunk-C56AVUZI.mjs";
17
17
  import {
18
18
  CopilotRuntime,
19
19
  addCustomHeaderPlugin,
@@ -29,7 +29,7 @@ import {
29
29
  getCommonConfig,
30
30
  langGraphPlatformEndpoint,
31
31
  resolveEndpointType
32
- } from "../chunk-HZWVUP7K.mjs";
32
+ } from "../chunk-FOXQPOXW.mjs";
33
33
  import "../chunk-SHBDMA63.mjs";
34
34
  import {
35
35
  GoogleGenerativeAIAdapter,
@@ -1,5 +1,5 @@
1
- import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../shared-26958730.js';
2
- export { e as CommonConfig, C as CopilotRequestContextProperties, a as addCustomHeaderPlugin, d as buildSchema, c as createContext, g as getCommonConfig } from '../../shared-26958730.js';
1
+ import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../shared-35015e40.js';
2
+ export { e as CommonConfig, C as CopilotRequestContextProperties, a as addCustomHeaderPlugin, d as buildSchema, c as createContext, g as getCommonConfig } from '../../shared-35015e40.js';
3
3
  import * as graphql_yoga from 'graphql-yoga';
4
4
  import { YogaServerInstance } from 'graphql-yoga';
5
5
  export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
@@ -8,8 +8,8 @@ export { copilotRuntimeNestEndpoint } from './nest/index.js';
8
8
  import 'graphql';
9
9
  import 'pino';
10
10
  import '@copilotkit/shared';
11
- import '../../langserve-3f99bf2e.js';
12
- import '../../index-d4614f9b.js';
11
+ import '../../langserve-0c6100e3.js';
12
+ import '../../index-96b330da.js';
13
13
  import '../../graphql/types/base/index.js';
14
14
  import 'rxjs';
15
15
  import '../cloud/index.js';
@@ -44,7 +44,7 @@ var require_package = __commonJS({
44
44
  publishConfig: {
45
45
  access: "public"
46
46
  },
47
- version: "1.10.5-next.0",
47
+ version: "1.10.5-next.1",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -85,7 +85,7 @@ var require_package = __commonJS({
85
85
  "@ag-ui/client": "^0.0.37",
86
86
  "@ag-ui/core": "^0.0.37",
87
87
  "@ag-ui/encoder": "^0.0.37",
88
- "@ag-ui/langgraph": "^0.0.12",
88
+ "@ag-ui/langgraph": "^0.0.13",
89
89
  "@ag-ui/proto": "^0.0.37",
90
90
  "@anthropic-ai/sdk": "^0.57.0",
91
91
  "@copilotkit/shared": "workspace:*",
@@ -153,14 +153,14 @@ __export(integrations_exports, {
153
153
  module.exports = __toCommonJS(integrations_exports);
154
154
 
155
155
  // src/lib/integrations/shared.ts
156
- var import_type_graphql26 = require("type-graphql");
156
+ var import_type_graphql27 = require("type-graphql");
157
157
 
158
158
  // src/graphql/resolvers/copilot.resolver.ts
159
- var import_type_graphql20 = require("type-graphql");
159
+ var import_type_graphql21 = require("type-graphql");
160
160
  var import_rxjs3 = require("rxjs");
161
161
 
162
162
  // src/graphql/inputs/generate-copilot-response.input.ts
163
- var import_type_graphql18 = require("type-graphql");
163
+ var import_type_graphql19 = require("type-graphql");
164
164
 
165
165
  // src/graphql/inputs/message.input.ts
166
166
  var import_type_graphql3 = require("type-graphql");
@@ -1518,7 +1518,8 @@ MetaEventInput = _ts_decorate16([
1518
1518
  (0, import_type_graphql17.InputType)()
1519
1519
  ], MetaEventInput);
1520
1520
 
1521
- // src/graphql/inputs/generate-copilot-response.input.ts
1521
+ // src/graphql/inputs/copilot-context.input.ts
1522
+ var import_type_graphql18 = require("type-graphql");
1522
1523
  function _ts_decorate17(decorators, target, key, desc) {
1523
1524
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1524
1525
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -1535,18 +1536,52 @@ function _ts_metadata17(k, v) {
1535
1536
  return Reflect.metadata(k, v);
1536
1537
  }
1537
1538
  __name(_ts_metadata17, "_ts_metadata");
1539
+ var CopilotContextInput = class {
1540
+ description;
1541
+ value;
1542
+ };
1543
+ __name(CopilotContextInput, "CopilotContextInput");
1544
+ _ts_decorate17([
1545
+ (0, import_type_graphql18.Field)(() => String),
1546
+ _ts_metadata17("design:type", String)
1547
+ ], CopilotContextInput.prototype, "description", void 0);
1548
+ _ts_decorate17([
1549
+ (0, import_type_graphql18.Field)(() => String),
1550
+ _ts_metadata17("design:type", String)
1551
+ ], CopilotContextInput.prototype, "value", void 0);
1552
+ CopilotContextInput = _ts_decorate17([
1553
+ (0, import_type_graphql18.InputType)()
1554
+ ], CopilotContextInput);
1555
+
1556
+ // src/graphql/inputs/generate-copilot-response.input.ts
1557
+ function _ts_decorate18(decorators, target, key, desc) {
1558
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1559
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1560
+ r = Reflect.decorate(decorators, target, key, desc);
1561
+ else
1562
+ for (var i = decorators.length - 1; i >= 0; i--)
1563
+ if (d = decorators[i])
1564
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1565
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1566
+ }
1567
+ __name(_ts_decorate18, "_ts_decorate");
1568
+ function _ts_metadata18(k, v) {
1569
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1570
+ return Reflect.metadata(k, v);
1571
+ }
1572
+ __name(_ts_metadata18, "_ts_metadata");
1538
1573
  var GenerateCopilotResponseMetadataInput = class {
1539
1574
  requestType;
1540
1575
  };
1541
1576
  __name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
1542
- _ts_decorate17([
1543
- (0, import_type_graphql18.Field)(() => CopilotRequestType, {
1577
+ _ts_decorate18([
1578
+ (0, import_type_graphql19.Field)(() => CopilotRequestType, {
1544
1579
  nullable: true
1545
1580
  }),
1546
- _ts_metadata17("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
1581
+ _ts_metadata18("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
1547
1582
  ], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
1548
- GenerateCopilotResponseMetadataInput = _ts_decorate17([
1549
- (0, import_type_graphql18.InputType)()
1583
+ GenerateCopilotResponseMetadataInput = _ts_decorate18([
1584
+ (0, import_type_graphql19.InputType)()
1550
1585
  ], GenerateCopilotResponseMetadataInput);
1551
1586
  var GenerateCopilotResponseInput = class {
1552
1587
  metadata;
@@ -1561,84 +1596,93 @@ var GenerateCopilotResponseInput = class {
1561
1596
  agentStates;
1562
1597
  extensions;
1563
1598
  metaEvents;
1599
+ context;
1564
1600
  };
1565
1601
  __name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
1566
- _ts_decorate17([
1567
- (0, import_type_graphql18.Field)(() => GenerateCopilotResponseMetadataInput, {
1602
+ _ts_decorate18([
1603
+ (0, import_type_graphql19.Field)(() => GenerateCopilotResponseMetadataInput, {
1568
1604
  nullable: false
1569
1605
  }),
1570
- _ts_metadata17("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
1606
+ _ts_metadata18("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
1571
1607
  ], GenerateCopilotResponseInput.prototype, "metadata", void 0);
1572
- _ts_decorate17([
1573
- (0, import_type_graphql18.Field)(() => String, {
1608
+ _ts_decorate18([
1609
+ (0, import_type_graphql19.Field)(() => String, {
1574
1610
  nullable: true
1575
1611
  }),
1576
- _ts_metadata17("design:type", String)
1612
+ _ts_metadata18("design:type", String)
1577
1613
  ], GenerateCopilotResponseInput.prototype, "threadId", void 0);
1578
- _ts_decorate17([
1579
- (0, import_type_graphql18.Field)(() => String, {
1614
+ _ts_decorate18([
1615
+ (0, import_type_graphql19.Field)(() => String, {
1580
1616
  nullable: true
1581
1617
  }),
1582
- _ts_metadata17("design:type", String)
1618
+ _ts_metadata18("design:type", String)
1583
1619
  ], GenerateCopilotResponseInput.prototype, "runId", void 0);
1584
- _ts_decorate17([
1585
- (0, import_type_graphql18.Field)(() => [
1620
+ _ts_decorate18([
1621
+ (0, import_type_graphql19.Field)(() => [
1586
1622
  MessageInput
1587
1623
  ]),
1588
- _ts_metadata17("design:type", Array)
1624
+ _ts_metadata18("design:type", Array)
1589
1625
  ], GenerateCopilotResponseInput.prototype, "messages", void 0);
1590
- _ts_decorate17([
1591
- (0, import_type_graphql18.Field)(() => FrontendInput),
1592
- _ts_metadata17("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
1626
+ _ts_decorate18([
1627
+ (0, import_type_graphql19.Field)(() => FrontendInput),
1628
+ _ts_metadata18("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
1593
1629
  ], GenerateCopilotResponseInput.prototype, "frontend", void 0);
1594
- _ts_decorate17([
1595
- (0, import_type_graphql18.Field)(() => CloudInput, {
1630
+ _ts_decorate18([
1631
+ (0, import_type_graphql19.Field)(() => CloudInput, {
1596
1632
  nullable: true
1597
1633
  }),
1598
- _ts_metadata17("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
1634
+ _ts_metadata18("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
1599
1635
  ], GenerateCopilotResponseInput.prototype, "cloud", void 0);
1600
- _ts_decorate17([
1601
- (0, import_type_graphql18.Field)(() => ForwardedParametersInput, {
1636
+ _ts_decorate18([
1637
+ (0, import_type_graphql19.Field)(() => ForwardedParametersInput, {
1602
1638
  nullable: true
1603
1639
  }),
1604
- _ts_metadata17("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
1640
+ _ts_metadata18("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
1605
1641
  ], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
1606
- _ts_decorate17([
1607
- (0, import_type_graphql18.Field)(() => AgentSessionInput, {
1642
+ _ts_decorate18([
1643
+ (0, import_type_graphql19.Field)(() => AgentSessionInput, {
1608
1644
  nullable: true
1609
1645
  }),
1610
- _ts_metadata17("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
1646
+ _ts_metadata18("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
1611
1647
  ], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
1612
- _ts_decorate17([
1613
- (0, import_type_graphql18.Field)(() => AgentStateInput, {
1648
+ _ts_decorate18([
1649
+ (0, import_type_graphql19.Field)(() => AgentStateInput, {
1614
1650
  nullable: true
1615
1651
  }),
1616
- _ts_metadata17("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
1652
+ _ts_metadata18("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
1617
1653
  ], GenerateCopilotResponseInput.prototype, "agentState", void 0);
1618
- _ts_decorate17([
1619
- (0, import_type_graphql18.Field)(() => [
1654
+ _ts_decorate18([
1655
+ (0, import_type_graphql19.Field)(() => [
1620
1656
  AgentStateInput
1621
1657
  ], {
1622
1658
  nullable: true
1623
1659
  }),
1624
- _ts_metadata17("design:type", Array)
1660
+ _ts_metadata18("design:type", Array)
1625
1661
  ], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
1626
- _ts_decorate17([
1627
- (0, import_type_graphql18.Field)(() => ExtensionsInput, {
1662
+ _ts_decorate18([
1663
+ (0, import_type_graphql19.Field)(() => ExtensionsInput, {
1628
1664
  nullable: true
1629
1665
  }),
1630
- _ts_metadata17("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
1666
+ _ts_metadata18("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
1631
1667
  ], GenerateCopilotResponseInput.prototype, "extensions", void 0);
1632
- _ts_decorate17([
1633
- (0, import_type_graphql18.Field)(() => [
1668
+ _ts_decorate18([
1669
+ (0, import_type_graphql19.Field)(() => [
1634
1670
  MetaEventInput
1635
1671
  ], {
1636
1672
  nullable: true
1637
1673
  }),
1638
- _ts_metadata17("design:type", Array)
1674
+ _ts_metadata18("design:type", Array)
1639
1675
  ], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
1640
- GenerateCopilotResponseInput = _ts_decorate17([
1641
- (0, import_type_graphql18.InputType)()
1676
+ _ts_decorate18([
1677
+ (0, import_type_graphql19.Field)(() => [
1678
+ CopilotContextInput
1679
+ ], {
1680
+ nullable: true
1681
+ }),
1682
+ _ts_metadata18("design:type", Array)
1683
+ ], GenerateCopilotResponseInput.prototype, "context", void 0);
1684
+ GenerateCopilotResponseInput = _ts_decorate18([
1685
+ (0, import_type_graphql19.InputType)()
1642
1686
  ], GenerateCopilotResponseInput);
1643
1687
 
1644
1688
  // src/graphql/resolvers/copilot.resolver.ts
@@ -1952,8 +1996,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
1952
1996
  var import_shared6 = require("@copilotkit/shared");
1953
1997
 
1954
1998
  // src/graphql/types/agents-response.type.ts
1955
- var import_type_graphql19 = require("type-graphql");
1956
- function _ts_decorate18(decorators, target, key, desc) {
1999
+ var import_type_graphql20 = require("type-graphql");
2000
+ function _ts_decorate19(decorators, target, key, desc) {
1957
2001
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1958
2002
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1959
2003
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1963,50 +2007,50 @@ function _ts_decorate18(decorators, target, key, desc) {
1963
2007
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1964
2008
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1965
2009
  }
1966
- __name(_ts_decorate18, "_ts_decorate");
1967
- function _ts_metadata18(k, v) {
2010
+ __name(_ts_decorate19, "_ts_decorate");
2011
+ function _ts_metadata19(k, v) {
1968
2012
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1969
2013
  return Reflect.metadata(k, v);
1970
2014
  }
1971
- __name(_ts_metadata18, "_ts_metadata");
2015
+ __name(_ts_metadata19, "_ts_metadata");
1972
2016
  var Agent = class {
1973
2017
  id;
1974
2018
  name;
1975
2019
  description;
1976
2020
  };
1977
2021
  __name(Agent, "Agent");
1978
- _ts_decorate18([
1979
- (0, import_type_graphql19.Field)(() => String),
1980
- _ts_metadata18("design:type", String)
2022
+ _ts_decorate19([
2023
+ (0, import_type_graphql20.Field)(() => String),
2024
+ _ts_metadata19("design:type", String)
1981
2025
  ], Agent.prototype, "id", void 0);
1982
- _ts_decorate18([
1983
- (0, import_type_graphql19.Field)(() => String),
1984
- _ts_metadata18("design:type", String)
2026
+ _ts_decorate19([
2027
+ (0, import_type_graphql20.Field)(() => String),
2028
+ _ts_metadata19("design:type", String)
1985
2029
  ], Agent.prototype, "name", void 0);
1986
- _ts_decorate18([
1987
- (0, import_type_graphql19.Field)(() => String),
1988
- _ts_metadata18("design:type", String)
2030
+ _ts_decorate19([
2031
+ (0, import_type_graphql20.Field)(() => String),
2032
+ _ts_metadata19("design:type", String)
1989
2033
  ], Agent.prototype, "description", void 0);
1990
- Agent = _ts_decorate18([
1991
- (0, import_type_graphql19.ObjectType)()
2034
+ Agent = _ts_decorate19([
2035
+ (0, import_type_graphql20.ObjectType)()
1992
2036
  ], Agent);
1993
2037
  var AgentsResponse = class {
1994
2038
  agents;
1995
2039
  };
1996
2040
  __name(AgentsResponse, "AgentsResponse");
1997
- _ts_decorate18([
1998
- (0, import_type_graphql19.Field)(() => [
2041
+ _ts_decorate19([
2042
+ (0, import_type_graphql20.Field)(() => [
1999
2043
  Agent
2000
2044
  ]),
2001
- _ts_metadata18("design:type", Array)
2045
+ _ts_metadata19("design:type", Array)
2002
2046
  ], AgentsResponse.prototype, "agents", void 0);
2003
- AgentsResponse = _ts_decorate18([
2004
- (0, import_type_graphql19.ObjectType)()
2047
+ AgentsResponse = _ts_decorate19([
2048
+ (0, import_type_graphql20.ObjectType)()
2005
2049
  ], AgentsResponse);
2006
2050
 
2007
2051
  // src/graphql/resolvers/copilot.resolver.ts
2008
2052
  var import_shared7 = require("@copilotkit/shared");
2009
- function _ts_decorate19(decorators, target, key, desc) {
2053
+ function _ts_decorate20(decorators, target, key, desc) {
2010
2054
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2011
2055
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2012
2056
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2016,12 +2060,12 @@ function _ts_decorate19(decorators, target, key, desc) {
2016
2060
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2017
2061
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2018
2062
  }
2019
- __name(_ts_decorate19, "_ts_decorate");
2020
- function _ts_metadata19(k, v) {
2063
+ __name(_ts_decorate20, "_ts_decorate");
2064
+ function _ts_metadata20(k, v) {
2021
2065
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2022
2066
  return Reflect.metadata(k, v);
2023
2067
  }
2024
- __name(_ts_metadata19, "_ts_metadata");
2068
+ __name(_ts_metadata20, "_ts_metadata");
2025
2069
  function _ts_param(paramIndex, decorator) {
2026
2070
  return function(target, key) {
2027
2071
  decorator(target, key, paramIndex);
@@ -2170,7 +2214,8 @@ var CopilotResolver = class {
2170
2214
  agentStates: data.agentStates,
2171
2215
  url: data.frontend.url,
2172
2216
  extensions: data.extensions,
2173
- metaEvents: data.metaEvents
2217
+ metaEvents: data.metaEvents,
2218
+ context: data.context
2174
2219
  });
2175
2220
  } catch (error) {
2176
2221
  if ((0, import_shared7.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
@@ -2567,38 +2612,38 @@ var CopilotResolver = class {
2567
2612
  }
2568
2613
  };
2569
2614
  __name(CopilotResolver, "CopilotResolver");
2570
- _ts_decorate19([
2571
- (0, import_type_graphql20.Query)(() => String),
2572
- _ts_metadata19("design:type", Function),
2573
- _ts_metadata19("design:paramtypes", []),
2574
- _ts_metadata19("design:returntype", Promise)
2615
+ _ts_decorate20([
2616
+ (0, import_type_graphql21.Query)(() => String),
2617
+ _ts_metadata20("design:type", Function),
2618
+ _ts_metadata20("design:paramtypes", []),
2619
+ _ts_metadata20("design:returntype", Promise)
2575
2620
  ], CopilotResolver.prototype, "hello", null);
2576
- _ts_decorate19([
2577
- (0, import_type_graphql20.Query)(() => AgentsResponse),
2578
- _ts_param(0, (0, import_type_graphql20.Ctx)()),
2579
- _ts_metadata19("design:type", Function),
2580
- _ts_metadata19("design:paramtypes", [
2621
+ _ts_decorate20([
2622
+ (0, import_type_graphql21.Query)(() => AgentsResponse),
2623
+ _ts_param(0, (0, import_type_graphql21.Ctx)()),
2624
+ _ts_metadata20("design:type", Function),
2625
+ _ts_metadata20("design:paramtypes", [
2581
2626
  typeof GraphQLContext === "undefined" ? Object : GraphQLContext
2582
2627
  ]),
2583
- _ts_metadata19("design:returntype", Promise)
2628
+ _ts_metadata20("design:returntype", Promise)
2584
2629
  ], CopilotResolver.prototype, "availableAgents", null);
2585
- _ts_decorate19([
2586
- (0, import_type_graphql20.Mutation)(() => CopilotResponse),
2587
- _ts_param(0, (0, import_type_graphql20.Ctx)()),
2588
- _ts_param(1, (0, import_type_graphql20.Arg)("data")),
2589
- _ts_param(2, (0, import_type_graphql20.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
2630
+ _ts_decorate20([
2631
+ (0, import_type_graphql21.Mutation)(() => CopilotResponse),
2632
+ _ts_param(0, (0, import_type_graphql21.Ctx)()),
2633
+ _ts_param(1, (0, import_type_graphql21.Arg)("data")),
2634
+ _ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
2590
2635
  nullable: true
2591
2636
  })),
2592
- _ts_metadata19("design:type", Function),
2593
- _ts_metadata19("design:paramtypes", [
2637
+ _ts_metadata20("design:type", Function),
2638
+ _ts_metadata20("design:paramtypes", [
2594
2639
  typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
2595
2640
  typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
2596
2641
  typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
2597
2642
  ]),
2598
- _ts_metadata19("design:returntype", Promise)
2643
+ _ts_metadata20("design:returntype", Promise)
2599
2644
  ], CopilotResolver.prototype, "generateCopilotResponse", null);
2600
- CopilotResolver = _ts_decorate19([
2601
- (0, import_type_graphql20.Resolver)(() => CopilotResponse)
2645
+ CopilotResolver = _ts_decorate20([
2646
+ (0, import_type_graphql21.Resolver)(() => CopilotResponse)
2602
2647
  ], CopilotResolver);
2603
2648
 
2604
2649
  // src/lib/integrations/shared.ts
@@ -2633,13 +2678,13 @@ function createLogger(options) {
2633
2678
  __name(createLogger, "createLogger");
2634
2679
 
2635
2680
  // src/graphql/resolvers/state.resolver.ts
2636
- var import_type_graphql23 = require("type-graphql");
2637
2681
  var import_type_graphql24 = require("type-graphql");
2638
2682
  var import_type_graphql25 = require("type-graphql");
2683
+ var import_type_graphql26 = require("type-graphql");
2639
2684
 
2640
2685
  // src/graphql/types/load-agent-state-response.type.ts
2641
- var import_type_graphql21 = require("type-graphql");
2642
- function _ts_decorate20(decorators, target, key, desc) {
2686
+ var import_type_graphql22 = require("type-graphql");
2687
+ function _ts_decorate21(decorators, target, key, desc) {
2643
2688
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2644
2689
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2645
2690
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2649,12 +2694,12 @@ function _ts_decorate20(decorators, target, key, desc) {
2649
2694
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2650
2695
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2651
2696
  }
2652
- __name(_ts_decorate20, "_ts_decorate");
2653
- function _ts_metadata20(k, v) {
2697
+ __name(_ts_decorate21, "_ts_decorate");
2698
+ function _ts_metadata21(k, v) {
2654
2699
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2655
2700
  return Reflect.metadata(k, v);
2656
2701
  }
2657
- __name(_ts_metadata20, "_ts_metadata");
2702
+ __name(_ts_metadata21, "_ts_metadata");
2658
2703
  var LoadAgentStateResponse = class {
2659
2704
  threadId;
2660
2705
  threadExists;
@@ -2662,29 +2707,29 @@ var LoadAgentStateResponse = class {
2662
2707
  messages;
2663
2708
  };
2664
2709
  __name(LoadAgentStateResponse, "LoadAgentStateResponse");
2665
- _ts_decorate20([
2666
- (0, import_type_graphql21.Field)(() => String),
2667
- _ts_metadata20("design:type", String)
2710
+ _ts_decorate21([
2711
+ (0, import_type_graphql22.Field)(() => String),
2712
+ _ts_metadata21("design:type", String)
2668
2713
  ], LoadAgentStateResponse.prototype, "threadId", void 0);
2669
- _ts_decorate20([
2670
- (0, import_type_graphql21.Field)(() => Boolean),
2671
- _ts_metadata20("design:type", Boolean)
2714
+ _ts_decorate21([
2715
+ (0, import_type_graphql22.Field)(() => Boolean),
2716
+ _ts_metadata21("design:type", Boolean)
2672
2717
  ], LoadAgentStateResponse.prototype, "threadExists", void 0);
2673
- _ts_decorate20([
2674
- (0, import_type_graphql21.Field)(() => String),
2675
- _ts_metadata20("design:type", String)
2718
+ _ts_decorate21([
2719
+ (0, import_type_graphql22.Field)(() => String),
2720
+ _ts_metadata21("design:type", String)
2676
2721
  ], LoadAgentStateResponse.prototype, "state", void 0);
2677
- _ts_decorate20([
2678
- (0, import_type_graphql21.Field)(() => String),
2679
- _ts_metadata20("design:type", String)
2722
+ _ts_decorate21([
2723
+ (0, import_type_graphql22.Field)(() => String),
2724
+ _ts_metadata21("design:type", String)
2680
2725
  ], LoadAgentStateResponse.prototype, "messages", void 0);
2681
- LoadAgentStateResponse = _ts_decorate20([
2682
- (0, import_type_graphql21.ObjectType)()
2726
+ LoadAgentStateResponse = _ts_decorate21([
2727
+ (0, import_type_graphql22.ObjectType)()
2683
2728
  ], LoadAgentStateResponse);
2684
2729
 
2685
2730
  // src/graphql/inputs/load-agent-state.input.ts
2686
- var import_type_graphql22 = require("type-graphql");
2687
- function _ts_decorate21(decorators, target, key, desc) {
2731
+ var import_type_graphql23 = require("type-graphql");
2732
+ function _ts_decorate22(decorators, target, key, desc) {
2688
2733
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2689
2734
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2690
2735
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2694,32 +2739,32 @@ function _ts_decorate21(decorators, target, key, desc) {
2694
2739
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2695
2740
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2696
2741
  }
2697
- __name(_ts_decorate21, "_ts_decorate");
2698
- function _ts_metadata21(k, v) {
2742
+ __name(_ts_decorate22, "_ts_decorate");
2743
+ function _ts_metadata22(k, v) {
2699
2744
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2700
2745
  return Reflect.metadata(k, v);
2701
2746
  }
2702
- __name(_ts_metadata21, "_ts_metadata");
2747
+ __name(_ts_metadata22, "_ts_metadata");
2703
2748
  var LoadAgentStateInput = class {
2704
2749
  threadId;
2705
2750
  agentName;
2706
2751
  };
2707
2752
  __name(LoadAgentStateInput, "LoadAgentStateInput");
2708
- _ts_decorate21([
2709
- (0, import_type_graphql22.Field)(() => String),
2710
- _ts_metadata21("design:type", String)
2753
+ _ts_decorate22([
2754
+ (0, import_type_graphql23.Field)(() => String),
2755
+ _ts_metadata22("design:type", String)
2711
2756
  ], LoadAgentStateInput.prototype, "threadId", void 0);
2712
- _ts_decorate21([
2713
- (0, import_type_graphql22.Field)(() => String),
2714
- _ts_metadata21("design:type", String)
2757
+ _ts_decorate22([
2758
+ (0, import_type_graphql23.Field)(() => String),
2759
+ _ts_metadata22("design:type", String)
2715
2760
  ], LoadAgentStateInput.prototype, "agentName", void 0);
2716
- LoadAgentStateInput = _ts_decorate21([
2717
- (0, import_type_graphql22.InputType)()
2761
+ LoadAgentStateInput = _ts_decorate22([
2762
+ (0, import_type_graphql23.InputType)()
2718
2763
  ], LoadAgentStateInput);
2719
2764
 
2720
2765
  // src/graphql/resolvers/state.resolver.ts
2721
2766
  var import_shared8 = require("@copilotkit/shared");
2722
- function _ts_decorate22(decorators, target, key, desc) {
2767
+ function _ts_decorate23(decorators, target, key, desc) {
2723
2768
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2724
2769
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2725
2770
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2729,12 +2774,12 @@ function _ts_decorate22(decorators, target, key, desc) {
2729
2774
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2730
2775
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2731
2776
  }
2732
- __name(_ts_decorate22, "_ts_decorate");
2733
- function _ts_metadata22(k, v) {
2777
+ __name(_ts_decorate23, "_ts_decorate");
2778
+ function _ts_metadata23(k, v) {
2734
2779
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2735
2780
  return Reflect.metadata(k, v);
2736
2781
  }
2737
- __name(_ts_metadata22, "_ts_metadata");
2782
+ __name(_ts_metadata23, "_ts_metadata");
2738
2783
  function _ts_param2(paramIndex, decorator) {
2739
2784
  return function(target, key) {
2740
2785
  decorator(target, key, paramIndex);
@@ -2759,19 +2804,19 @@ var StateResolver = class {
2759
2804
  }
2760
2805
  };
2761
2806
  __name(StateResolver, "StateResolver");
2762
- _ts_decorate22([
2763
- (0, import_type_graphql25.Query)(() => LoadAgentStateResponse),
2764
- _ts_param2(0, (0, import_type_graphql24.Ctx)()),
2765
- _ts_param2(1, (0, import_type_graphql23.Arg)("data")),
2766
- _ts_metadata22("design:type", Function),
2767
- _ts_metadata22("design:paramtypes", [
2807
+ _ts_decorate23([
2808
+ (0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
2809
+ _ts_param2(0, (0, import_type_graphql25.Ctx)()),
2810
+ _ts_param2(1, (0, import_type_graphql24.Arg)("data")),
2811
+ _ts_metadata23("design:type", Function),
2812
+ _ts_metadata23("design:paramtypes", [
2768
2813
  typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
2769
2814
  typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
2770
2815
  ]),
2771
- _ts_metadata22("design:returntype", Promise)
2816
+ _ts_metadata23("design:returntype", Promise)
2772
2817
  ], StateResolver.prototype, "loadAgentState", null);
2773
- StateResolver = _ts_decorate22([
2774
- (0, import_type_graphql23.Resolver)(() => LoadAgentStateResponse)
2818
+ StateResolver = _ts_decorate23([
2819
+ (0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
2775
2820
  ], StateResolver);
2776
2821
 
2777
2822
  // src/lib/integrations/shared.ts
@@ -2802,7 +2847,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
2802
2847
  __name(createContext, "createContext");
2803
2848
  function buildSchema(options = {}) {
2804
2849
  logger.debug("Building GraphQL schema...");
2805
- const schema = (0, import_type_graphql26.buildSchemaSync)({
2850
+ const schema = (0, import_type_graphql27.buildSchemaSync)({
2806
2851
  resolvers: [
2807
2852
  CopilotResolver,
2808
2853
  StateResolver