@copilotkit/runtime 1.5.12-next.4 → 1.5.12-next.6
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/CHANGELOG.md +17 -0
- package/dist/{chunk-53ZLUGHX.mjs → chunk-BKIGYRXE.mjs} +2 -2
- package/dist/{chunk-U3DYEEGJ.mjs → chunk-ON4AESON.mjs} +128 -80
- package/dist/chunk-ON4AESON.mjs.map +1 -0
- package/dist/{chunk-CLGKEUOA.mjs → chunk-TPTCSIAR.mjs} +6 -4
- package/dist/chunk-TPTCSIAR.mjs.map +1 -0
- package/dist/{chunk-6PZWWJ32.mjs → chunk-XM2VJFL6.mjs} +2 -2
- package/dist/{chunk-FOUJ36SV.mjs → chunk-YGXAWYRB.mjs} +2 -2
- package/dist/{copilot-runtime-1a224a0f.d.ts → copilot-runtime-da917bd5.d.ts} +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +143 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +140 -92
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.d.ts +2 -2
- package/dist/lib/integrations/index.js +12 -10
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.d.ts +1 -1
- package/dist/lib/integrations/nest/index.js +12 -10
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +3 -3
- package/dist/lib/integrations/node-express/index.d.ts +1 -1
- package/dist/lib/integrations/node-express/index.js +12 -10
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +3 -3
- package/dist/lib/integrations/node-http/index.d.ts +1 -1
- package/dist/lib/integrations/node-http/index.js +12 -10
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +2 -2
- package/dist/service-adapters/index.d.ts +5 -4
- package/dist/service-adapters/index.js +6 -3
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +3 -1
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +63 -29
- package/src/lib/runtime/remote-action-constructors.ts +42 -33
- package/src/lib/runtime/remote-actions.ts +12 -7
- package/src/service-adapters/{experimental/empty → empty}/empty-adapter.ts +6 -4
- package/src/service-adapters/index.ts +1 -1
- package/dist/chunk-CLGKEUOA.mjs.map +0 -1
- package/dist/chunk-U3DYEEGJ.mjs.map +0 -1
- /package/dist/{chunk-53ZLUGHX.mjs.map → chunk-BKIGYRXE.mjs.map} +0 -0
- /package/dist/{chunk-6PZWWJ32.mjs.map → chunk-XM2VJFL6.mjs.map} +0 -0
- /package/dist/{chunk-FOUJ36SV.mjs.map → chunk-YGXAWYRB.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.12-next.
|
|
47
|
+
version: "1.5.12-next.6",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -126,6 +126,7 @@ var src_exports = {};
|
|
|
126
126
|
__export(src_exports, {
|
|
127
127
|
AnthropicAdapter: () => AnthropicAdapter,
|
|
128
128
|
CopilotRuntime: () => CopilotRuntime,
|
|
129
|
+
EmptyAdapter: () => EmptyAdapter,
|
|
129
130
|
ExperimentalEmptyAdapter: () => ExperimentalEmptyAdapter,
|
|
130
131
|
ExperimentalOllamaAdapter: () => ExperimentalOllamaAdapter,
|
|
131
132
|
GoogleGenerativeAIAdapter: () => GoogleGenerativeAIAdapter,
|
|
@@ -156,7 +157,8 @@ module.exports = __toCommonJS(src_exports);
|
|
|
156
157
|
var import_reflect_metadata = require("reflect-metadata");
|
|
157
158
|
|
|
158
159
|
// src/lib/runtime/copilot-runtime.ts
|
|
159
|
-
var
|
|
160
|
+
var import_shared14 = require("@copilotkit/shared");
|
|
161
|
+
var import_langgraph_sdk2 = require("@langchain/langgraph-sdk");
|
|
160
162
|
|
|
161
163
|
// src/service-adapters/langchain/langserve.ts
|
|
162
164
|
var import_remote = require("langchain/runnables/remote");
|
|
@@ -1537,23 +1539,24 @@ var ExperimentalOllamaAdapter = class {
|
|
|
1537
1539
|
};
|
|
1538
1540
|
__name(ExperimentalOllamaAdapter, "ExperimentalOllamaAdapter");
|
|
1539
1541
|
|
|
1540
|
-
// src/service-adapters/
|
|
1542
|
+
// src/service-adapters/empty/empty-adapter.ts
|
|
1541
1543
|
var import_shared8 = require("@copilotkit/shared");
|
|
1542
|
-
var
|
|
1544
|
+
var EmptyAdapter = class {
|
|
1543
1545
|
async process(request) {
|
|
1544
1546
|
return {
|
|
1545
1547
|
threadId: request.threadId || (0, import_shared8.randomId)()
|
|
1546
1548
|
};
|
|
1547
1549
|
}
|
|
1548
1550
|
};
|
|
1549
|
-
__name(
|
|
1551
|
+
__name(EmptyAdapter, "EmptyAdapter");
|
|
1552
|
+
var ExperimentalEmptyAdapter = EmptyAdapter;
|
|
1550
1553
|
|
|
1551
1554
|
// src/service-adapters/events.ts
|
|
1552
|
-
var
|
|
1555
|
+
var import_shared13 = require("@copilotkit/shared");
|
|
1553
1556
|
var import_rxjs2 = require("rxjs");
|
|
1554
1557
|
|
|
1555
1558
|
// src/lib/telemetry-client.ts
|
|
1556
|
-
var
|
|
1559
|
+
var import_shared12 = require("@copilotkit/shared");
|
|
1557
1560
|
|
|
1558
1561
|
// src/lib/runtime/remote-action-constructors.ts
|
|
1559
1562
|
var import_node_crypto2 = require("crypto");
|
|
@@ -2303,6 +2306,7 @@ function copilotkitMessagesToLangChain(messages) {
|
|
|
2303
2306
|
__name(copilotkitMessagesToLangChain, "copilotkitMessagesToLangChain");
|
|
2304
2307
|
|
|
2305
2308
|
// src/lib/runtime/remote-action-constructors.ts
|
|
2309
|
+
var import_shared10 = require("@copilotkit/shared");
|
|
2306
2310
|
function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, messages, agentStates }) {
|
|
2307
2311
|
const agents = endpoint.agents.map((agent) => ({
|
|
2308
2312
|
name: agent.name,
|
|
@@ -2383,8 +2387,9 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2383
2387
|
type: "self-hosted",
|
|
2384
2388
|
agentsAmount: totalAgents
|
|
2385
2389
|
});
|
|
2390
|
+
const fetchUrl = `${url}/actions/execute`;
|
|
2386
2391
|
try {
|
|
2387
|
-
const response = await fetch(
|
|
2392
|
+
const response = await fetch(fetchUrl, {
|
|
2388
2393
|
method: "POST",
|
|
2389
2394
|
headers,
|
|
2390
2395
|
body: JSON.stringify({
|
|
@@ -2409,10 +2414,13 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2409
2414
|
}, "Executed remote action");
|
|
2410
2415
|
return result;
|
|
2411
2416
|
} catch (error) {
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
}
|
|
2415
|
-
|
|
2417
|
+
if (error instanceof import_shared10.CopilotKitError) {
|
|
2418
|
+
throw error;
|
|
2419
|
+
}
|
|
2420
|
+
throw new import_shared10.CopilotKitLowLevelError({
|
|
2421
|
+
error,
|
|
2422
|
+
url: fetchUrl
|
|
2423
|
+
});
|
|
2416
2424
|
}
|
|
2417
2425
|
}
|
|
2418
2426
|
}));
|
|
@@ -2440,37 +2448,48 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2440
2448
|
state = JSON.parse(jsonState);
|
|
2441
2449
|
}
|
|
2442
2450
|
}
|
|
2443
|
-
const
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2451
|
+
const fetchUrl = `${url}/agents/execute`;
|
|
2452
|
+
try {
|
|
2453
|
+
const response = await fetch(fetchUrl, {
|
|
2454
|
+
method: "POST",
|
|
2455
|
+
headers,
|
|
2456
|
+
body: JSON.stringify({
|
|
2457
|
+
name,
|
|
2458
|
+
threadId,
|
|
2459
|
+
nodeName,
|
|
2460
|
+
messages: [
|
|
2461
|
+
...messages,
|
|
2462
|
+
...additionalMessages
|
|
2463
|
+
],
|
|
2464
|
+
state,
|
|
2465
|
+
properties: graphqlContext.properties,
|
|
2466
|
+
actions: actionInputsWithoutAgents.map((action) => ({
|
|
2467
|
+
name: action.name,
|
|
2468
|
+
description: action.description,
|
|
2469
|
+
parameters: JSON.parse(action.jsonSchema)
|
|
2470
|
+
}))
|
|
2471
|
+
})
|
|
2472
|
+
});
|
|
2473
|
+
if (!response.ok) {
|
|
2474
|
+
logger2.error({
|
|
2475
|
+
url,
|
|
2476
|
+
status: response.status,
|
|
2477
|
+
body: await response.text()
|
|
2478
|
+
}, "Failed to execute remote agent");
|
|
2479
|
+
throw new Error("Failed to execute remote agent");
|
|
2480
|
+
}
|
|
2481
|
+
const eventSource = new RemoteLangGraphEventSource();
|
|
2482
|
+
streamResponse(response.body, eventSource.eventStream$);
|
|
2483
|
+
return eventSource.processLangGraphEvents();
|
|
2484
|
+
} catch (error) {
|
|
2485
|
+
if (error instanceof import_shared10.CopilotKitError) {
|
|
2486
|
+
throw error;
|
|
2487
|
+
}
|
|
2488
|
+
throw new import_shared10.CopilotKitLowLevelError({
|
|
2489
|
+
error,
|
|
2490
|
+
url: fetchUrl
|
|
2491
|
+
});
|
|
2470
2492
|
}
|
|
2471
|
-
const eventSource = new RemoteLangGraphEventSource();
|
|
2472
|
-
streamResponse(response.body, eventSource.eventStream$);
|
|
2473
|
-
return eventSource.processLangGraphEvents();
|
|
2474
2493
|
}
|
|
2475
2494
|
})) : [];
|
|
2476
2495
|
return [
|
|
@@ -2540,6 +2559,7 @@ function createHeaders(onBeforeRequest, graphqlContext) {
|
|
|
2540
2559
|
__name(createHeaders, "createHeaders");
|
|
2541
2560
|
|
|
2542
2561
|
// src/lib/runtime/remote-actions.ts
|
|
2562
|
+
var import_shared11 = require("@copilotkit/shared");
|
|
2543
2563
|
var EndpointType;
|
|
2544
2564
|
(function(EndpointType2) {
|
|
2545
2565
|
EndpointType2["CopilotKit"] = "copilotKit";
|
|
@@ -2557,8 +2577,9 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
2557
2577
|
url
|
|
2558
2578
|
}, "Fetching actions from url");
|
|
2559
2579
|
const headers = createHeaders(onBeforeRequest, graphqlContext);
|
|
2580
|
+
const fetchUrl = `${url}/info`;
|
|
2560
2581
|
try {
|
|
2561
|
-
const response = await fetch(
|
|
2582
|
+
const response = await fetch(fetchUrl, {
|
|
2562
2583
|
method: "POST",
|
|
2563
2584
|
headers,
|
|
2564
2585
|
body: JSON.stringify({
|
|
@@ -2572,10 +2593,10 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
2572
2593
|
status: response.status,
|
|
2573
2594
|
body: await response.text()
|
|
2574
2595
|
}, "Failed to fetch actions from url");
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
};
|
|
2596
|
+
throw new import_shared11.ResolvedCopilotKitError({
|
|
2597
|
+
status: response.status,
|
|
2598
|
+
isRemoteEndpoint: true
|
|
2599
|
+
});
|
|
2579
2600
|
}
|
|
2580
2601
|
const json = await response.json();
|
|
2581
2602
|
logger2.debug({
|
|
@@ -2583,13 +2604,13 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
2583
2604
|
}, "Fetched actions from url");
|
|
2584
2605
|
return json;
|
|
2585
2606
|
} catch (error) {
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
};
|
|
2607
|
+
if (error instanceof import_shared11.CopilotKitError) {
|
|
2608
|
+
throw error;
|
|
2609
|
+
}
|
|
2610
|
+
throw new import_shared11.CopilotKitLowLevelError({
|
|
2611
|
+
error,
|
|
2612
|
+
url: fetchUrl
|
|
2613
|
+
});
|
|
2593
2614
|
}
|
|
2594
2615
|
}
|
|
2595
2616
|
__name(fetchRemoteInfo, "fetchRemoteInfo");
|
|
@@ -2649,7 +2670,7 @@ __name(setupRemoteActions, "setupRemoteActions");
|
|
|
2649
2670
|
// src/lib/telemetry-client.ts
|
|
2650
2671
|
var import_node_crypto3 = require("crypto");
|
|
2651
2672
|
var packageJson = require_package();
|
|
2652
|
-
var telemetryClient = new
|
|
2673
|
+
var telemetryClient = new import_shared12.TelemetryClient({
|
|
2653
2674
|
packageName: packageJson.name,
|
|
2654
2675
|
packageVersion: packageJson.version
|
|
2655
2676
|
});
|
|
@@ -2959,10 +2980,10 @@ var RuntimeEventSource = class {
|
|
|
2959
2980
|
const errorMessage = `\u274C ${message}`;
|
|
2960
2981
|
if (!this.callback) {
|
|
2961
2982
|
this.stream(async (eventStream$) => {
|
|
2962
|
-
eventStream$.sendTextMessage((0,
|
|
2983
|
+
eventStream$.sendTextMessage((0, import_shared13.randomId)(), errorMessage);
|
|
2963
2984
|
});
|
|
2964
2985
|
} else {
|
|
2965
|
-
this.eventStream$.sendTextMessage((0,
|
|
2986
|
+
this.eventStream$.sendTextMessage((0, import_shared13.randomId)(), errorMessage);
|
|
2966
2987
|
}
|
|
2967
2988
|
}
|
|
2968
2989
|
processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents }) {
|
|
@@ -3193,10 +3214,12 @@ var CopilotRuntime = class {
|
|
|
3193
3214
|
if (agentSession) {
|
|
3194
3215
|
return await this.processAgentRequest(request);
|
|
3195
3216
|
}
|
|
3196
|
-
if (serviceAdapter instanceof
|
|
3197
|
-
throw new
|
|
3217
|
+
if (serviceAdapter instanceof EmptyAdapter) {
|
|
3218
|
+
throw new import_shared14.CopilotKitMisuseError({
|
|
3219
|
+
message: `Invalid adapter configuration: EmptyAdapter is only meant to be used with agent lock mode.
|
|
3198
3220
|
For non-agent components like useCopilotChatSuggestions, CopilotTextarea, or CopilotTask,
|
|
3199
|
-
please use an LLM adapter instead.`
|
|
3221
|
+
please use an LLM adapter instead.`
|
|
3222
|
+
});
|
|
3200
3223
|
}
|
|
3201
3224
|
const messages = rawMessages.filter((message) => !message.agentStateMessage);
|
|
3202
3225
|
const inputMessages = convertGqlInputToMessages(messages);
|
|
@@ -3204,7 +3227,7 @@ please use an LLM adapter instead.`);
|
|
|
3204
3227
|
const serverSideActionsInput = serverSideActions.map((action) => ({
|
|
3205
3228
|
name: action.name,
|
|
3206
3229
|
description: action.description,
|
|
3207
|
-
jsonSchema: JSON.stringify((0,
|
|
3230
|
+
jsonSchema: JSON.stringify((0, import_shared14.actionParametersToJsonSchema)(action.parameters))
|
|
3208
3231
|
}));
|
|
3209
3232
|
const actionInputs = flattenToolCallsNoDuplicates([
|
|
3210
3233
|
...serverSideActionsInput,
|
|
@@ -3251,6 +3274,9 @@ please use an LLM adapter instead.`);
|
|
|
3251
3274
|
))
|
|
3252
3275
|
};
|
|
3253
3276
|
} catch (error) {
|
|
3277
|
+
if (error instanceof import_shared14.CopilotKitError) {
|
|
3278
|
+
throw error;
|
|
3279
|
+
}
|
|
3254
3280
|
console.error("Error getting response:", error);
|
|
3255
3281
|
eventSource.sendErrorMessageToChat();
|
|
3256
3282
|
throw error;
|
|
@@ -3261,37 +3287,59 @@ please use an LLM adapter instead.`);
|
|
|
3261
3287
|
const agents = this.remoteEndpointDefinitions.reduce(async (acc, endpoint) => {
|
|
3262
3288
|
const agents2 = await acc;
|
|
3263
3289
|
if (endpoint.type === EndpointType.LangGraphPlatform) {
|
|
3264
|
-
const
|
|
3265
|
-
|
|
3266
|
-
|
|
3290
|
+
const client = new import_langgraph_sdk2.Client({
|
|
3291
|
+
apiUrl: endpoint.deploymentUrl,
|
|
3292
|
+
apiKey: endpoint.langsmithApiKey
|
|
3267
3293
|
});
|
|
3268
|
-
const
|
|
3269
|
-
const
|
|
3294
|
+
const data = await client.assistants.search();
|
|
3295
|
+
const endpointAgents = (data ?? []).map((entry) => ({
|
|
3270
3296
|
name: entry.graph_id,
|
|
3271
|
-
id: entry.assistant_id
|
|
3297
|
+
id: entry.assistant_id,
|
|
3298
|
+
description: "",
|
|
3299
|
+
endpoint
|
|
3272
3300
|
}));
|
|
3273
3301
|
return [
|
|
3274
3302
|
...agents2,
|
|
3275
|
-
...
|
|
3303
|
+
...endpointAgents
|
|
3276
3304
|
];
|
|
3277
3305
|
}
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3306
|
+
const fetchUrl = `${endpoint.url}/info`;
|
|
3307
|
+
try {
|
|
3308
|
+
const response = await fetch(fetchUrl, {
|
|
3309
|
+
method: "POST",
|
|
3310
|
+
headers,
|
|
3311
|
+
body: JSON.stringify({
|
|
3312
|
+
properties: graphqlContext.properties
|
|
3313
|
+
})
|
|
3314
|
+
});
|
|
3315
|
+
if (!response.ok) {
|
|
3316
|
+
if (response.status === 404) {
|
|
3317
|
+
throw new import_shared14.CopilotKitApiDiscoveryError();
|
|
3318
|
+
}
|
|
3319
|
+
throw new import_shared14.ResolvedCopilotKitError({
|
|
3320
|
+
status: response.status,
|
|
3321
|
+
isRemoteEndpoint: true
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
const data = await response.json();
|
|
3325
|
+
const endpointAgents = ((data == null ? void 0 : data.agents) ?? []).map((agent) => ({
|
|
3326
|
+
name: agent.name,
|
|
3327
|
+
description: agent.description ?? "",
|
|
3328
|
+
id: (0, import_shared14.randomId)()
|
|
3329
|
+
}));
|
|
3330
|
+
return [
|
|
3331
|
+
...agents2,
|
|
3332
|
+
...endpointAgents
|
|
3333
|
+
];
|
|
3334
|
+
} catch (error) {
|
|
3335
|
+
if (error instanceof import_shared14.CopilotKitError) {
|
|
3336
|
+
throw error;
|
|
3337
|
+
}
|
|
3338
|
+
throw new import_shared14.CopilotKitLowLevelError({
|
|
3339
|
+
error,
|
|
3340
|
+
url: fetchUrl
|
|
3341
|
+
});
|
|
3342
|
+
}
|
|
3295
3343
|
}, Promise.resolve([]));
|
|
3296
3344
|
return agents;
|
|
3297
3345
|
}
|
|
@@ -3303,12 +3351,14 @@ please use an LLM adapter instead.`);
|
|
|
3303
3351
|
const messages = convertGqlInputToMessages(rawMessages);
|
|
3304
3352
|
const agent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
|
|
3305
3353
|
if (!agent) {
|
|
3306
|
-
throw new
|
|
3354
|
+
throw new import_shared14.CopilotKitAgentDiscoveryError({
|
|
3355
|
+
agentName
|
|
3356
|
+
});
|
|
3307
3357
|
}
|
|
3308
3358
|
const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
|
|
3309
3359
|
name: action.name,
|
|
3310
3360
|
description: action.description,
|
|
3311
|
-
jsonSchema: JSON.stringify((0,
|
|
3361
|
+
jsonSchema: JSON.stringify((0, import_shared14.actionParametersToJsonSchema)(action.parameters))
|
|
3312
3362
|
}));
|
|
3313
3363
|
const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
|
|
3314
3364
|
...serverSideActionsInput,
|
|
@@ -4502,7 +4552,7 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
4502
4552
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
4503
4553
|
|
|
4504
4554
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
4505
|
-
var
|
|
4555
|
+
var import_shared15 = require("@copilotkit/shared");
|
|
4506
4556
|
|
|
4507
4557
|
// src/graphql/types/agents-response.type.ts
|
|
4508
4558
|
var import_type_graphql15 = require("type-graphql");
|
|
@@ -4685,7 +4735,7 @@ var CopilotResolver = class {
|
|
|
4685
4735
|
rejectOutputMessagesPromise = reject;
|
|
4686
4736
|
});
|
|
4687
4737
|
logger2.debug("Processing");
|
|
4688
|
-
const { eventSource, threadId = (0,
|
|
4738
|
+
const { eventSource, threadId = (0, import_shared15.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
4689
4739
|
serviceAdapter,
|
|
4690
4740
|
messages: data.messages,
|
|
4691
4741
|
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
@@ -4730,7 +4780,7 @@ var CopilotResolver = class {
|
|
|
4730
4780
|
});
|
|
4731
4781
|
outputMessages = [
|
|
4732
4782
|
(0, import_class_transformer3.plainToInstance)(TextMessage, {
|
|
4733
|
-
id: (0,
|
|
4783
|
+
id: (0, import_shared15.randomId)(),
|
|
4734
4784
|
createdAt: /* @__PURE__ */ new Date(),
|
|
4735
4785
|
content: result.reason,
|
|
4736
4786
|
role: MessageRole.assistant
|
|
@@ -4921,7 +4971,7 @@ var CopilotResolver = class {
|
|
|
4921
4971
|
event
|
|
4922
4972
|
}, "Agent message event received");
|
|
4923
4973
|
pushMessage({
|
|
4924
|
-
id: (0,
|
|
4974
|
+
id: (0, import_shared15.randomId)(),
|
|
4925
4975
|
status: new SuccessMessageStatus(),
|
|
4926
4976
|
threadId: event.threadId,
|
|
4927
4977
|
agentName: event.agentName,
|
|
@@ -4934,7 +4984,7 @@ var CopilotResolver = class {
|
|
|
4934
4984
|
createdAt: /* @__PURE__ */ new Date()
|
|
4935
4985
|
});
|
|
4936
4986
|
outputMessages.push((0, import_class_transformer3.plainToInstance)(AgentStateMessage, {
|
|
4937
|
-
id: (0,
|
|
4987
|
+
id: (0, import_shared15.randomId)(),
|
|
4938
4988
|
threadId: event.threadId,
|
|
4939
4989
|
agentName: event.agentName,
|
|
4940
4990
|
nodeName: event.nodeName,
|
|
@@ -5234,6 +5284,7 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
5234
5284
|
0 && (module.exports = {
|
|
5235
5285
|
AnthropicAdapter,
|
|
5236
5286
|
CopilotRuntime,
|
|
5287
|
+
EmptyAdapter,
|
|
5237
5288
|
ExperimentalEmptyAdapter,
|
|
5238
5289
|
ExperimentalOllamaAdapter,
|
|
5239
5290
|
GoogleGenerativeAIAdapter,
|