@copilotkit/core 1.69.1 → 1.69.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5025,67 +5025,6 @@ var CopilotKitCore = class {
5025
5025
  async waitForPendingFrameworkUpdates() {}
5026
5026
  };
5027
5027
 
5028
- //#endregion
5029
- //#region src/core/inspect-inject.ts
5030
- const REMINT_ID_KEYS = [
5031
- "messageId",
5032
- "parentMessageId",
5033
- "toolCallId",
5034
- "runId"
5035
- ];
5036
- function newInspectorId() {
5037
- if (typeof crypto !== "undefined" && "randomUUID" in crypto) return crypto.randomUUID();
5038
- return `cpk-inject-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
5039
- }
5040
- function remintInspectorEventIds(events) {
5041
- const mapped = /* @__PURE__ */ new Map();
5042
- const idFor = (value) => {
5043
- const existing = mapped.get(value);
5044
- if (existing) return existing;
5045
- const next = newInspectorId();
5046
- mapped.set(value, next);
5047
- return next;
5048
- };
5049
- return events.map((event) => {
5050
- const copy = { ...event };
5051
- for (const key of REMINT_ID_KEYS) {
5052
- const value = copy[key];
5053
- if (typeof value === "string" && value.length > 0) copy[key] = idFor(value);
5054
- }
5055
- return copy;
5056
- });
5057
- }
5058
- /**
5059
- * Inspector-only helper. Apply AG-UI events to a live agent through the
5060
- * same runAgent path a real agent uses, so chat and frontend-tool handlers
5061
- * update. Not a documented product API.
5062
- */
5063
- async function ɵinjectInspectorEvents(params) {
5064
- const { core, agent, events } = params;
5065
- if (agent.isRunning) throw new Error("The agent is running. Wait for the current run to end.");
5066
- if (events.length === 0) throw new Error("Snippet JSON must be an array of events.");
5067
- const before = new Set(agent.messages.map((message) => message.id));
5068
- const originalRun = agent.run;
5069
- const runEvents = remintInspectorEventIds(events);
5070
- agent.run = (_input) => (0, rxjs.from)(runEvents);
5071
- try {
5072
- await core.runAgent({ agent });
5073
- } finally {
5074
- agent.run = originalRun;
5075
- }
5076
- return { messageIds: agent.messages.filter((message) => !before.has(message.id)).map((message) => message.id) };
5077
- }
5078
- /**
5079
- * Remove messages created by the last Inspector inject. Does not undo
5080
- * frontend-tool handler side effects.
5081
- */
5082
- function ɵresetInspectorInject(params) {
5083
- const drop = new Set(params.messageIds);
5084
- if (drop.size === 0) return;
5085
- const next = params.agent.messages.filter((message) => !drop.has(message.id));
5086
- params.agent.setMessages(next);
5087
- }
5088
-
5089
5028
  //#endregion
5090
5029
  //#region src/types.ts
5091
5030
  /**
@@ -6272,7 +6211,6 @@ exports.ɵMAX_SOCKET_RETRIES = ɵMAX_SOCKET_RETRIES;
6272
6211
  exports.ɵcreateMemoryStore = createMemoryStore;
6273
6212
  exports.ɵcreateThreadSelectors = ɵcreateThreadSelectors;
6274
6213
  exports.ɵcreateThreadStore = createThreadStore;
6275
- exports.ɵinjectInspectorEvents = ɵinjectInspectorEvents;
6276
6214
  exports.ɵisCopilotKitFeature = ɵisCopilotKitFeature;
6277
6215
  exports.ɵisRetryableMemoryStatus = isRetryableStatus;
6278
6216
  exports.ɵjoinPhoenixChannel$ = ɵjoinPhoenixChannel$;
@@ -6287,7 +6225,6 @@ exports.ɵobservePhoenixSocketHealth$ = ɵobservePhoenixSocketHealth$;
6287
6225
  exports.ɵobservePhoenixSocketSignals$ = ɵobservePhoenixSocketSignals$;
6288
6226
  exports.ɵphoenixChannel$ = ɵphoenixChannel$;
6289
6227
  exports.ɵphoenixSocket$ = ɵphoenixSocket$;
6290
- exports.ɵresetInspectorInject = ɵresetInspectorInject;
6291
6228
  exports.ɵselectFetchMoreError = ɵselectFetchMoreError;
6292
6229
  exports.ɵselectHasNextPage = ɵselectHasNextPage;
6293
6230
  exports.ɵselectIsFetchingNextPage = ɵselectIsFetchingNextPage;