@copilotkit/core 1.55.2-next.1 → 1.55.3-canary.1776215089

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.
package/dist/index.cjs CHANGED
@@ -516,6 +516,7 @@ var ProxiedCopilotRuntimeAgent = class ProxiedCopilotRuntimeAgent extends _ag_ui
516
516
  singleEndpointUrl;
517
517
  runtimeMode;
518
518
  intelligence;
519
+ _capabilities;
519
520
  delegate;
520
521
  runtimeInfoPromise;
521
522
  constructor(config) {
@@ -532,8 +533,15 @@ var ProxiedCopilotRuntimeAgent = class ProxiedCopilotRuntimeAgent extends _ag_ui
532
533
  this.transport = transport;
533
534
  this.runtimeMode = config.runtimeMode ?? _copilotkit_shared.RUNTIME_MODE_SSE;
534
535
  this.intelligence = config.intelligence;
536
+ this._capabilities = config.capabilities;
535
537
  if (this.transport === "single") this.singleEndpointUrl = this.runtimeUrl;
536
538
  }
539
+ get capabilities() {
540
+ return this._capabilities;
541
+ }
542
+ async getCapabilities() {
543
+ return this._capabilities ?? {};
544
+ }
537
545
  async detachActiveRun() {
538
546
  if (this.delegate) await this.delegate.detachActiveRun();
539
547
  await super.detachActiveRun();
@@ -661,7 +669,8 @@ var ProxiedCopilotRuntimeAgent = class ProxiedCopilotRuntimeAgent extends _ag_ui
661
669
  credentials: this.credentials,
662
670
  transport: this.transport,
663
671
  runtimeMode: this.runtimeMode,
664
- intelligence: this.intelligence
672
+ intelligence: this.intelligence,
673
+ capabilities: this._capabilities
665
674
  });
666
675
  cloned.threadId = this.threadId;
667
676
  cloned.setState(this.state);
@@ -963,7 +972,7 @@ var AgentRegistry = class {
963
972
  const runtimeInfoResponse = await this.fetchRuntimeInfo();
964
973
  const { version, ...runtimeInfo } = runtimeInfoResponse;
965
974
  const credentials = this.core.credentials;
966
- this.remoteAgents = Object.fromEntries(Object.entries(runtimeInfo.agents).map(([id, { description }]) => {
975
+ this.remoteAgents = Object.fromEntries(Object.entries(runtimeInfo.agents).map(([id, { description, capabilities }]) => {
967
976
  const agent = new ProxiedCopilotRuntimeAgent({
968
977
  runtimeUrl: this.runtimeUrl,
969
978
  agentId: id,
@@ -971,7 +980,8 @@ var AgentRegistry = class {
971
980
  transport: this._runtimeTransport,
972
981
  credentials,
973
982
  runtimeMode: runtimeInfoResponse.mode ?? _copilotkit_shared.RUNTIME_MODE_SSE,
974
- intelligence: runtimeInfoResponse.intelligence
983
+ intelligence: runtimeInfoResponse.intelligence,
984
+ capabilities
975
985
  });
976
986
  this.applyHeadersToAgent(agent);
977
987
  return [id, agent];
@@ -1539,6 +1549,10 @@ var RunHandler = class {
1539
1549
  agent.setMessages([]);
1540
1550
  agent.setState({});
1541
1551
  if (agent instanceof _ag_ui_client.HttpAgent) agent.headers = { ...this._internal.headers };
1552
+ await this._internal.notifySubscribers((subscriber) => subscriber.onAgentRunStarted?.({
1553
+ copilotkit: this.core,
1554
+ agent
1555
+ }), "Subscriber onAgentRunStarted error:");
1542
1556
  const runAgentResult = await agent.connectAgent({
1543
1557
  forwardedProps: this._internal.properties,
1544
1558
  tools: this.buildFrontendTools(agent.agentId),
@@ -1570,6 +1584,10 @@ var RunHandler = class {
1570
1584
  if (agent instanceof _ag_ui_client.HttpAgent) agent.headers = { ...this._internal.headers };
1571
1585
  if (agent.detachActiveRun) await agent.detachActiveRun();
1572
1586
  this._internal.subscribeAgentToStateManager(agent);
1587
+ await this._internal.notifySubscribers((subscriber) => subscriber.onAgentRunStarted?.({
1588
+ copilotkit: this.core,
1589
+ agent
1590
+ }), "Subscriber onAgentRunStarted error:");
1573
1591
  const isTopLevel = this._runDepth === 0;
1574
1592
  let originalAbortRun;
1575
1593
  if (isTopLevel) {