@copilotkit/core 1.55.3 → 1.56.0

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,16 @@ 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;
537
+ if (config.debug) this.debug = config.debug;
535
538
  if (this.transport === "single") this.singleEndpointUrl = this.runtimeUrl;
536
539
  }
540
+ get capabilities() {
541
+ return this._capabilities;
542
+ }
543
+ async getCapabilities() {
544
+ return this._capabilities ?? {};
545
+ }
537
546
  async detachActiveRun() {
538
547
  if (this.delegate) await this.delegate.detachActiveRun();
539
548
  await super.detachActiveRun();
@@ -661,7 +670,9 @@ var ProxiedCopilotRuntimeAgent = class ProxiedCopilotRuntimeAgent extends _ag_ui
661
670
  credentials: this.credentials,
662
671
  transport: this.transport,
663
672
  runtimeMode: this.runtimeMode,
664
- intelligence: this.intelligence
673
+ intelligence: this.intelligence,
674
+ capabilities: this._capabilities,
675
+ debug: this.debug
665
676
  });
666
677
  cloned.threadId = this.threadId;
667
678
  cloned.setState(this.state);
@@ -963,7 +974,8 @@ var AgentRegistry = class {
963
974
  const runtimeInfoResponse = await this.fetchRuntimeInfo();
964
975
  const { version, ...runtimeInfo } = runtimeInfoResponse;
965
976
  const credentials = this.core.credentials;
966
- this.remoteAgents = Object.fromEntries(Object.entries(runtimeInfo.agents).map(([id, { description }]) => {
977
+ const rawDebug = this.core.debug;
978
+ this.remoteAgents = Object.fromEntries(Object.entries(runtimeInfo.agents).map(([id, { description, capabilities }]) => {
967
979
  const agent = new ProxiedCopilotRuntimeAgent({
968
980
  runtimeUrl: this.runtimeUrl,
969
981
  agentId: id,
@@ -971,7 +983,9 @@ var AgentRegistry = class {
971
983
  transport: this._runtimeTransport,
972
984
  credentials,
973
985
  runtimeMode: runtimeInfoResponse.mode ?? _copilotkit_shared.RUNTIME_MODE_SSE,
974
- intelligence: runtimeInfoResponse.intelligence
986
+ intelligence: runtimeInfoResponse.intelligence,
987
+ capabilities,
988
+ debug: rawDebug ? (0, _copilotkit_shared.resolveDebugConfig)(rawDebug) : void 0
975
989
  });
976
990
  this.applyHeadersToAgent(agent);
977
991
  return [id, agent];
@@ -1539,6 +1553,10 @@ var RunHandler = class {
1539
1553
  agent.setMessages([]);
1540
1554
  agent.setState({});
1541
1555
  if (agent instanceof _ag_ui_client.HttpAgent) agent.headers = { ...this._internal.headers };
1556
+ await this._internal.notifySubscribers((subscriber) => subscriber.onAgentRunStarted?.({
1557
+ copilotkit: this.core,
1558
+ agent
1559
+ }), "Subscriber onAgentRunStarted error:");
1542
1560
  const runAgentResult = await agent.connectAgent({
1543
1561
  forwardedProps: this._internal.properties,
1544
1562
  tools: this.buildFrontendTools(agent.agentId),
@@ -1570,6 +1588,10 @@ var RunHandler = class {
1570
1588
  if (agent instanceof _ag_ui_client.HttpAgent) agent.headers = { ...this._internal.headers };
1571
1589
  if (agent.detachActiveRun) await agent.detachActiveRun();
1572
1590
  this._internal.subscribeAgentToStateManager(agent);
1591
+ await this._internal.notifySubscribers((subscriber) => subscriber.onAgentRunStarted?.({
1592
+ copilotkit: this.core,
1593
+ agent
1594
+ }), "Subscriber onAgentRunStarted error:");
1573
1595
  const isTopLevel = this._runDepth === 0;
1574
1596
  let originalAbortRun;
1575
1597
  if (isTopLevel) {
@@ -2298,16 +2320,18 @@ var CopilotKitCore = class {
2298
2320
  _credentials;
2299
2321
  _properties;
2300
2322
  _defaultThrottleMs;
2323
+ _debug;
2301
2324
  subscribers = /* @__PURE__ */ new Set();
2302
2325
  agentRegistry;
2303
2326
  contextStore;
2304
2327
  suggestionEngine;
2305
2328
  runHandler;
2306
2329
  stateManager;
2307
- constructor({ runtimeUrl, runtimeTransport = "auto", headers = {}, credentials, properties = {}, agents__unsafe_dev_only = {}, tools = [], suggestionsConfig = [] }) {
2330
+ constructor({ runtimeUrl, runtimeTransport = "auto", headers = {}, credentials, properties = {}, agents__unsafe_dev_only = {}, tools = [], suggestionsConfig = [], debug }) {
2308
2331
  this._headers = headers;
2309
2332
  this._credentials = credentials;
2310
2333
  this._properties = properties;
2334
+ this._debug = debug;
2311
2335
  this.agentRegistry = new AgentRegistry(this);
2312
2336
  this.contextStore = new ContextStore(this);
2313
2337
  this.suggestionEngine = new SuggestionEngine(this);
@@ -2400,6 +2424,12 @@ var CopilotKitCore = class {
2400
2424
  }
2401
2425
  this._defaultThrottleMs = value;
2402
2426
  }
2427
+ get debug() {
2428
+ return this._debug;
2429
+ }
2430
+ setDebug(debug) {
2431
+ this._debug = debug;
2432
+ }
2403
2433
  get runtimeConnectionStatus() {
2404
2434
  return this.agentRegistry.runtimeConnectionStatus;
2405
2435
  }