@copilotkit/core 1.69.1 → 1.69.2
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 +0 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -26
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -26
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -62
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +0 -63
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -5209,67 +5209,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5209
5209
|
async waitForPendingFrameworkUpdates() {}
|
|
5210
5210
|
};
|
|
5211
5211
|
|
|
5212
|
-
//#endregion
|
|
5213
|
-
//#region src/core/inspect-inject.ts
|
|
5214
|
-
const REMINT_ID_KEYS = [
|
|
5215
|
-
"messageId",
|
|
5216
|
-
"parentMessageId",
|
|
5217
|
-
"toolCallId",
|
|
5218
|
-
"runId"
|
|
5219
|
-
];
|
|
5220
|
-
function newInspectorId() {
|
|
5221
|
-
if (typeof crypto !== "undefined" && "randomUUID" in crypto) return crypto.randomUUID();
|
|
5222
|
-
return `cpk-inject-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
5223
|
-
}
|
|
5224
|
-
function remintInspectorEventIds(events) {
|
|
5225
|
-
const mapped = /* @__PURE__ */ new Map();
|
|
5226
|
-
const idFor = (value) => {
|
|
5227
|
-
const existing = mapped.get(value);
|
|
5228
|
-
if (existing) return existing;
|
|
5229
|
-
const next = newInspectorId();
|
|
5230
|
-
mapped.set(value, next);
|
|
5231
|
-
return next;
|
|
5232
|
-
};
|
|
5233
|
-
return events.map((event) => {
|
|
5234
|
-
const copy = { ...event };
|
|
5235
|
-
for (const key of REMINT_ID_KEYS) {
|
|
5236
|
-
const value = copy[key];
|
|
5237
|
-
if (typeof value === "string" && value.length > 0) copy[key] = idFor(value);
|
|
5238
|
-
}
|
|
5239
|
-
return copy;
|
|
5240
|
-
});
|
|
5241
|
-
}
|
|
5242
|
-
/**
|
|
5243
|
-
* Inspector-only helper. Apply AG-UI events to a live agent through the
|
|
5244
|
-
* same runAgent path a real agent uses, so chat and frontend-tool handlers
|
|
5245
|
-
* update. Not a documented product API.
|
|
5246
|
-
*/
|
|
5247
|
-
async function ɵinjectInspectorEvents(params) {
|
|
5248
|
-
const { core, agent, events } = params;
|
|
5249
|
-
if (agent.isRunning) throw new Error("The agent is running. Wait for the current run to end.");
|
|
5250
|
-
if (events.length === 0) throw new Error("Snippet JSON must be an array of events.");
|
|
5251
|
-
const before = new Set(agent.messages.map((message) => message.id));
|
|
5252
|
-
const originalRun = agent.run;
|
|
5253
|
-
const runEvents = remintInspectorEventIds(events);
|
|
5254
|
-
agent.run = (_input) => (0, rxjs.from)(runEvents);
|
|
5255
|
-
try {
|
|
5256
|
-
await core.runAgent({ agent });
|
|
5257
|
-
} finally {
|
|
5258
|
-
agent.run = originalRun;
|
|
5259
|
-
}
|
|
5260
|
-
return { messageIds: agent.messages.filter((message) => !before.has(message.id)).map((message) => message.id) };
|
|
5261
|
-
}
|
|
5262
|
-
/**
|
|
5263
|
-
* Remove messages created by the last Inspector inject. Does not undo
|
|
5264
|
-
* frontend-tool handler side effects.
|
|
5265
|
-
*/
|
|
5266
|
-
function ɵresetInspectorInject(params) {
|
|
5267
|
-
const drop = new Set(params.messageIds);
|
|
5268
|
-
if (drop.size === 0) return;
|
|
5269
|
-
const next = params.agent.messages.filter((message) => !drop.has(message.id));
|
|
5270
|
-
params.agent.setMessages(next);
|
|
5271
|
-
}
|
|
5272
|
-
|
|
5273
5212
|
//#endregion
|
|
5274
5213
|
//#region src/types.ts
|
|
5275
5214
|
/**
|
|
@@ -6502,7 +6441,6 @@ exports.ɵMAX_SOCKET_RETRIES = ɵMAX_SOCKET_RETRIES;
|
|
|
6502
6441
|
exports.ɵcreateMemoryStore = createMemoryStore;
|
|
6503
6442
|
exports.ɵcreateThreadSelectors = ɵcreateThreadSelectors;
|
|
6504
6443
|
exports.ɵcreateThreadStore = createThreadStore;
|
|
6505
|
-
exports.ɵinjectInspectorEvents = ɵinjectInspectorEvents;
|
|
6506
6444
|
exports.ɵisCopilotKitFeature = ɵisCopilotKitFeature;
|
|
6507
6445
|
exports.ɵisRetryableMemoryStatus = isRetryableStatus;
|
|
6508
6446
|
exports.ɵjoinPhoenixChannel$ = ɵjoinPhoenixChannel$;
|
|
@@ -6517,7 +6455,6 @@ exports.ɵobservePhoenixSocketHealth$ = ɵobservePhoenixSocketHealth$;
|
|
|
6517
6455
|
exports.ɵobservePhoenixSocketSignals$ = ɵobservePhoenixSocketSignals$;
|
|
6518
6456
|
exports.ɵphoenixChannel$ = ɵphoenixChannel$;
|
|
6519
6457
|
exports.ɵphoenixSocket$ = ɵphoenixSocket$;
|
|
6520
|
-
exports.ɵresetInspectorInject = ɵresetInspectorInject;
|
|
6521
6458
|
exports.ɵselectFetchMoreError = ɵselectFetchMoreError;
|
|
6522
6459
|
exports.ɵselectHasNextPage = ɵselectHasNextPage;
|
|
6523
6460
|
exports.ɵselectIsFetchingNextPage = ɵselectIsFetchingNextPage;
|