@copilotkit/runtime 1.4.0-pre-1-4-0.11 → 1.4.0-pre-1-4-0-alpha.10
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 +33 -100
- package/dist/{chunk-BNQDVBQH.mjs → chunk-56IQ6PGC.mjs} +449 -75
- package/dist/chunk-56IQ6PGC.mjs.map +1 -0
- package/dist/chunk-DFOKBSIS.mjs +1 -0
- package/dist/chunk-DFOKBSIS.mjs.map +1 -0
- package/dist/{chunk-VBGS6IWV.mjs → chunk-RDHJQVWH.mjs} +483 -71
- package/dist/chunk-RDHJQVWH.mjs.map +1 -0
- package/dist/{chunk-V2YEM4Z5.mjs → chunk-SBWLAAB3.mjs} +4 -3
- package/dist/chunk-SBWLAAB3.mjs.map +1 -0
- package/dist/{chunk-677K33J7.mjs → chunk-SVL5LEKB.mjs} +4 -3
- package/dist/chunk-SVL5LEKB.mjs.map +1 -0
- package/dist/{chunk-3DNY5YTL.mjs → chunk-YUJSVJWS.mjs} +5 -4
- package/dist/chunk-YUJSVJWS.mjs.map +1 -0
- package/dist/{copilot-runtime-8d3f40c7.d.ts → copilot-runtime-dbe5fa02.d.ts} +4 -4
- package/dist/{groq-adapter-dbfba3eb.d.ts → groq-adapter-192d2413.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +486 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-f00629d2.d.ts → langserve-878c62b9.d.ts} +46 -9
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +465 -163
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +21 -21
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +161 -85
- 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 +2 -2
- package/dist/lib/integrations/nest/index.js +158 -82
- 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 +2 -2
- package/dist/lib/integrations/node-express/index.js +158 -82
- 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 +2 -2
- package/dist/lib/integrations/node-http/index.js +157 -81
- 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 +3 -3
- package/dist/service-adapters/index.js +243 -73
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -2
- package/package.json +4 -4
- package/src/agents/langgraph/event-source.ts +12 -0
- package/src/agents/langgraph/events.ts +2 -0
- package/src/graphql/resolvers/copilot.resolver.ts +28 -2
- package/src/lib/integrations/nest/index.ts +5 -2
- package/src/lib/integrations/nextjs/app-router.ts +5 -2
- package/src/lib/integrations/nextjs/pages-router.ts +5 -2
- package/src/lib/integrations/node-express/index.ts +5 -2
- package/src/lib/integrations/node-http/index.ts +5 -2
- package/src/lib/runtime/copilot-runtime.ts +48 -42
- package/src/lib/runtime/remote-action-constructors.ts +17 -3
- package/src/lib/runtime/remote-lg-cloud-action.ts +41 -15
- package/src/lib/telemetry-client.ts +43 -0
- package/src/service-adapters/anthropic/anthropic-adapter.ts +15 -6
- package/src/service-adapters/events.ts +86 -36
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +7 -3
- package/src/service-adapters/google/google-genai-adapter.ts +2 -2
- package/src/service-adapters/groq/groq-adapter.ts +22 -8
- package/src/service-adapters/langchain/langchain-adapter.ts +22 -16
- package/src/service-adapters/langchain/utils.ts +47 -31
- package/src/service-adapters/openai/openai-adapter.ts +25 -8
- package/src/service-adapters/openai/openai-assistant-adapter.ts +21 -8
- package/src/service-adapters/unify/unify-adapter.ts +28 -11
- package/dist/chunk-3DNY5YTL.mjs.map +0 -1
- package/dist/chunk-677K33J7.mjs.map +0 -1
- package/dist/chunk-BNQDVBQH.mjs.map +0 -1
- package/dist/chunk-FL67XJAX.mjs +0 -288
- package/dist/chunk-FL67XJAX.mjs.map +0 -1
- package/dist/chunk-MXXPWWBF.mjs +0 -218
- package/dist/chunk-MXXPWWBF.mjs.map +0 -1
- package/dist/chunk-V2YEM4Z5.mjs.map +0 -1
- package/dist/chunk-VBGS6IWV.mjs.map +0 -1
|
@@ -12,11 +12,11 @@ var __export = (target, all) => {
|
|
|
12
12
|
for (var name in all)
|
|
13
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
14
|
};
|
|
15
|
-
var __copyProps = (to,
|
|
16
|
-
if (
|
|
17
|
-
for (let key of __getOwnPropNames(
|
|
15
|
+
var __copyProps = (to, from3, except, desc) => {
|
|
16
|
+
if (from3 && typeof from3 === "object" || typeof from3 === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from3))
|
|
18
18
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () =>
|
|
19
|
+
__defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable });
|
|
20
20
|
}
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.4.0-pre-1-4-0.
|
|
47
|
+
version: "1.4.0-pre-1-4-0-alpha.10",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -136,7 +136,7 @@ var import_type_graphql16 = require("type-graphql");
|
|
|
136
136
|
|
|
137
137
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
138
138
|
var import_type_graphql15 = require("type-graphql");
|
|
139
|
-
var
|
|
139
|
+
var import_rxjs3 = require("rxjs");
|
|
140
140
|
|
|
141
141
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
142
142
|
var import_type_graphql11 = require("type-graphql");
|
|
@@ -1180,15 +1180,133 @@ CopilotResponse = _ts_decorate13([
|
|
|
1180
1180
|
var import_graphql_yoga = require("graphql-yoga");
|
|
1181
1181
|
|
|
1182
1182
|
// src/service-adapters/events.ts
|
|
1183
|
-
var
|
|
1183
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
1184
|
+
var import_rxjs2 = require("rxjs");
|
|
1185
|
+
|
|
1186
|
+
// src/lib/telemetry-client.ts
|
|
1187
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
1188
|
+
|
|
1189
|
+
// src/lib/runtime/remote-actions.ts
|
|
1190
|
+
var EndpointType;
|
|
1191
|
+
(function(EndpointType2) {
|
|
1192
|
+
EndpointType2["CopilotKit"] = "copilotKit";
|
|
1193
|
+
EndpointType2["LangGraphCloud"] = "langgraph-cloud";
|
|
1194
|
+
})(EndpointType || (EndpointType = {}));
|
|
1184
1195
|
|
|
1185
1196
|
// src/lib/telemetry-client.ts
|
|
1197
|
+
var import_node_crypto = require("crypto");
|
|
1198
|
+
|
|
1199
|
+
// src/lib/runtime/copilot-runtime.ts
|
|
1186
1200
|
var import_shared = require("@copilotkit/shared");
|
|
1201
|
+
|
|
1202
|
+
// src/graphql/types/converted/index.ts
|
|
1203
|
+
var Message = class extends BaseMessageInput {
|
|
1204
|
+
type;
|
|
1205
|
+
isTextMessage() {
|
|
1206
|
+
return this.type === "TextMessage";
|
|
1207
|
+
}
|
|
1208
|
+
isActionExecutionMessage() {
|
|
1209
|
+
return this.type === "ActionExecutionMessage";
|
|
1210
|
+
}
|
|
1211
|
+
isResultMessage() {
|
|
1212
|
+
return this.type === "ResultMessage";
|
|
1213
|
+
}
|
|
1214
|
+
isAgentStateMessage() {
|
|
1215
|
+
return this.type === "AgentStateMessage";
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
__name(Message, "Message");
|
|
1219
|
+
var TextMessage = class extends Message {
|
|
1220
|
+
type = "TextMessage";
|
|
1221
|
+
content;
|
|
1222
|
+
role;
|
|
1223
|
+
};
|
|
1224
|
+
__name(TextMessage, "TextMessage");
|
|
1225
|
+
var ActionExecutionMessage = class extends Message {
|
|
1226
|
+
type = "ActionExecutionMessage";
|
|
1227
|
+
name;
|
|
1228
|
+
arguments;
|
|
1229
|
+
scope;
|
|
1230
|
+
};
|
|
1231
|
+
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1232
|
+
var ResultMessage = class extends Message {
|
|
1233
|
+
type = "ResultMessage";
|
|
1234
|
+
actionExecutionId;
|
|
1235
|
+
actionName;
|
|
1236
|
+
result;
|
|
1237
|
+
};
|
|
1238
|
+
__name(ResultMessage, "ResultMessage");
|
|
1239
|
+
var AgentStateMessage = class extends Message {
|
|
1240
|
+
type = "AgentStateMessage";
|
|
1241
|
+
threadId;
|
|
1242
|
+
agentName;
|
|
1243
|
+
nodeName;
|
|
1244
|
+
runId;
|
|
1245
|
+
active;
|
|
1246
|
+
role;
|
|
1247
|
+
state;
|
|
1248
|
+
running;
|
|
1249
|
+
};
|
|
1250
|
+
__name(AgentStateMessage, "AgentStateMessage");
|
|
1251
|
+
|
|
1252
|
+
// src/lib/runtime/copilot-runtime.ts
|
|
1253
|
+
var import_rxjs = require("rxjs");
|
|
1254
|
+
function resolveEndpointType(endpoint) {
|
|
1255
|
+
if (!endpoint.type) {
|
|
1256
|
+
if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
|
|
1257
|
+
return EndpointType.LangGraphCloud;
|
|
1258
|
+
} else {
|
|
1259
|
+
return EndpointType.CopilotKit;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
return endpoint.type;
|
|
1263
|
+
}
|
|
1264
|
+
__name(resolveEndpointType, "resolveEndpointType");
|
|
1265
|
+
|
|
1266
|
+
// src/lib/telemetry-client.ts
|
|
1187
1267
|
var packageJson = require_package();
|
|
1188
|
-
var telemetryClient = new
|
|
1268
|
+
var telemetryClient = new import_shared2.TelemetryClient({
|
|
1189
1269
|
packageName: packageJson.name,
|
|
1190
1270
|
packageVersion: packageJson.version
|
|
1191
1271
|
});
|
|
1272
|
+
function getRuntimeInstanceTelemetryInfo(runtime) {
|
|
1273
|
+
const endpointsInfo = runtime.remoteEndpointDefinitions.reduce((acc, endpoint) => {
|
|
1274
|
+
let info = {
|
|
1275
|
+
...acc
|
|
1276
|
+
};
|
|
1277
|
+
const endpointType = resolveEndpointType(endpoint);
|
|
1278
|
+
if (!info.endpointTypes.includes(endpointType)) {
|
|
1279
|
+
info = {
|
|
1280
|
+
...info,
|
|
1281
|
+
endpointTypes: [
|
|
1282
|
+
...info.endpointTypes,
|
|
1283
|
+
endpointType
|
|
1284
|
+
]
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
if (endpointType === EndpointType.LangGraphCloud) {
|
|
1288
|
+
const ep = endpoint;
|
|
1289
|
+
info = {
|
|
1290
|
+
...info,
|
|
1291
|
+
agentsAmount: ep.agents.length,
|
|
1292
|
+
hashedKey: (0, import_node_crypto.createHash)("sha256").update(ep.langsmithApiKey).digest("hex")
|
|
1293
|
+
};
|
|
1294
|
+
}
|
|
1295
|
+
return info;
|
|
1296
|
+
}, {
|
|
1297
|
+
endpointTypes: [],
|
|
1298
|
+
agentsAmount: null,
|
|
1299
|
+
hashedKey: null
|
|
1300
|
+
});
|
|
1301
|
+
return {
|
|
1302
|
+
actionsAmount: runtime.actions.length,
|
|
1303
|
+
endpointsAmount: runtime.remoteEndpointDefinitions.length,
|
|
1304
|
+
endpointTypes: endpointsInfo.endpointTypes,
|
|
1305
|
+
agentsAmount: endpointsInfo.agentsAmount,
|
|
1306
|
+
hashedLgcKey: endpointsInfo.hashedKey
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
__name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
1192
1310
|
var telemetry_client_default = telemetryClient;
|
|
1193
1311
|
|
|
1194
1312
|
// src/service-adapters/events.ts
|
|
@@ -1242,58 +1360,8 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1242
1360
|
};
|
|
1243
1361
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1244
1362
|
|
|
1245
|
-
// src/graphql/types/converted/index.ts
|
|
1246
|
-
var Message = class extends BaseMessageInput {
|
|
1247
|
-
type;
|
|
1248
|
-
isTextMessage() {
|
|
1249
|
-
return this.type === "TextMessage";
|
|
1250
|
-
}
|
|
1251
|
-
isActionExecutionMessage() {
|
|
1252
|
-
return this.type === "ActionExecutionMessage";
|
|
1253
|
-
}
|
|
1254
|
-
isResultMessage() {
|
|
1255
|
-
return this.type === "ResultMessage";
|
|
1256
|
-
}
|
|
1257
|
-
isAgentStateMessage() {
|
|
1258
|
-
return this.type === "AgentStateMessage";
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
__name(Message, "Message");
|
|
1262
|
-
var TextMessage = class extends Message {
|
|
1263
|
-
type = "TextMessage";
|
|
1264
|
-
content;
|
|
1265
|
-
role;
|
|
1266
|
-
};
|
|
1267
|
-
__name(TextMessage, "TextMessage");
|
|
1268
|
-
var ActionExecutionMessage = class extends Message {
|
|
1269
|
-
type = "ActionExecutionMessage";
|
|
1270
|
-
name;
|
|
1271
|
-
arguments;
|
|
1272
|
-
scope;
|
|
1273
|
-
};
|
|
1274
|
-
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1275
|
-
var ResultMessage = class extends Message {
|
|
1276
|
-
type = "ResultMessage";
|
|
1277
|
-
actionExecutionId;
|
|
1278
|
-
actionName;
|
|
1279
|
-
result;
|
|
1280
|
-
};
|
|
1281
|
-
__name(ResultMessage, "ResultMessage");
|
|
1282
|
-
var AgentStateMessage = class extends Message {
|
|
1283
|
-
type = "AgentStateMessage";
|
|
1284
|
-
threadId;
|
|
1285
|
-
agentName;
|
|
1286
|
-
nodeName;
|
|
1287
|
-
runId;
|
|
1288
|
-
active;
|
|
1289
|
-
role;
|
|
1290
|
-
state;
|
|
1291
|
-
running;
|
|
1292
|
-
};
|
|
1293
|
-
__name(AgentStateMessage, "AgentStateMessage");
|
|
1294
|
-
|
|
1295
1363
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1296
|
-
var
|
|
1364
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
1297
1365
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
1298
1366
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1299
1367
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1399,9 +1467,9 @@ var CopilotResolver = class {
|
|
|
1399
1467
|
});
|
|
1400
1468
|
}
|
|
1401
1469
|
logger2.debug("Setting up subjects");
|
|
1402
|
-
const responseStatus$ = new
|
|
1403
|
-
const interruptStreaming$ = new
|
|
1404
|
-
const guardrailsResult$ = new
|
|
1470
|
+
const responseStatus$ = new import_rxjs3.ReplaySubject();
|
|
1471
|
+
const interruptStreaming$ = new import_rxjs3.ReplaySubject();
|
|
1472
|
+
const guardrailsResult$ = new import_rxjs3.ReplaySubject();
|
|
1405
1473
|
let outputMessages = [];
|
|
1406
1474
|
let resolveOutputMessagesPromise;
|
|
1407
1475
|
let rejectOutputMessagesPromise;
|
|
@@ -1410,7 +1478,7 @@ var CopilotResolver = class {
|
|
|
1410
1478
|
rejectOutputMessagesPromise = reject;
|
|
1411
1479
|
});
|
|
1412
1480
|
logger2.debug("Processing");
|
|
1413
|
-
const { eventSource, threadId = (0,
|
|
1481
|
+
const { eventSource, threadId = (0, import_shared4.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
1414
1482
|
serviceAdapter,
|
|
1415
1483
|
messages: data.messages,
|
|
1416
1484
|
actions: data.frontend.actions,
|
|
@@ -1428,7 +1496,7 @@ var CopilotResolver = class {
|
|
|
1428
1496
|
const response = {
|
|
1429
1497
|
threadId,
|
|
1430
1498
|
runId,
|
|
1431
|
-
status: (0,
|
|
1499
|
+
status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
|
|
1432
1500
|
messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
|
|
1433
1501
|
var _a2, _b2;
|
|
1434
1502
|
logger2.debug("Messages repeater created");
|
|
@@ -1455,7 +1523,7 @@ var CopilotResolver = class {
|
|
|
1455
1523
|
});
|
|
1456
1524
|
outputMessages = [
|
|
1457
1525
|
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1458
|
-
id: (0,
|
|
1526
|
+
id: (0, import_shared4.randomId)(),
|
|
1459
1527
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1460
1528
|
content: result.reason,
|
|
1461
1529
|
role: MessageRole.assistant
|
|
@@ -1489,8 +1557,8 @@ var CopilotResolver = class {
|
|
|
1489
1557
|
}).pipe(
|
|
1490
1558
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1491
1559
|
// just the events that were emitted after the subscriber was added.
|
|
1492
|
-
(0,
|
|
1493
|
-
(0,
|
|
1560
|
+
(0, import_rxjs3.shareReplay)(),
|
|
1561
|
+
(0, import_rxjs3.finalize)(() => {
|
|
1494
1562
|
logger2.debug("Event stream finalized");
|
|
1495
1563
|
})
|
|
1496
1564
|
);
|
|
@@ -1501,22 +1569,24 @@ var CopilotResolver = class {
|
|
|
1501
1569
|
case RuntimeEventTypes.TextMessageStart:
|
|
1502
1570
|
const textMessageContentStream = eventStream.pipe(
|
|
1503
1571
|
// skip until this message start event
|
|
1504
|
-
(0,
|
|
1572
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1505
1573
|
// take until the message end event
|
|
1506
|
-
(0,
|
|
1574
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.TextMessageEnd && e.messageId == event.messageId)),
|
|
1575
|
+
// filter out any other message events or message ids
|
|
1576
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1507
1577
|
);
|
|
1508
|
-
const streamingTextStatus = new
|
|
1578
|
+
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1509
1579
|
const messageId = event.messageId;
|
|
1510
1580
|
pushMessage({
|
|
1511
1581
|
id: messageId,
|
|
1512
|
-
status: (0,
|
|
1582
|
+
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1513
1583
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1514
1584
|
role: MessageRole.assistant,
|
|
1515
1585
|
content: new import_graphql_yoga.Repeater(async (pushTextChunk, stopStreamingText) => {
|
|
1516
1586
|
logger2.debug("Text message content repeater created");
|
|
1517
1587
|
const textChunks = [];
|
|
1518
1588
|
let textSubscription;
|
|
1519
|
-
interruptStreaming$.pipe((0,
|
|
1589
|
+
interruptStreaming$.pipe((0, import_rxjs3.shareReplay)(), (0, import_rxjs3.take)(1), (0, import_rxjs3.tap)(({ reason, messageId: messageId2 }) => {
|
|
1520
1590
|
logger2.debug({
|
|
1521
1591
|
reason,
|
|
1522
1592
|
messageId: messageId2
|
|
@@ -1567,11 +1637,17 @@ var CopilotResolver = class {
|
|
|
1567
1637
|
break;
|
|
1568
1638
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1569
1639
|
logger2.debug("Action execution start event received");
|
|
1570
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1571
|
-
|
|
1640
|
+
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1641
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1642
|
+
// take until the action execution end event
|
|
1643
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1644
|
+
// filter out any other action execution events or action execution ids
|
|
1645
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1646
|
+
);
|
|
1647
|
+
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1572
1648
|
pushMessage({
|
|
1573
1649
|
id: event.actionExecutionId,
|
|
1574
|
-
status: (0,
|
|
1650
|
+
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1575
1651
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1576
1652
|
name: event.actionName,
|
|
1577
1653
|
scope: event.scope,
|
|
@@ -1618,7 +1694,7 @@ var CopilotResolver = class {
|
|
|
1618
1694
|
result: event.result
|
|
1619
1695
|
}, "Action execution result event received");
|
|
1620
1696
|
pushMessage({
|
|
1621
|
-
id: (0,
|
|
1697
|
+
id: (0, import_shared4.randomId)(),
|
|
1622
1698
|
status: new SuccessMessageStatus(),
|
|
1623
1699
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1624
1700
|
actionExecutionId: event.actionExecutionId,
|
|
@@ -1626,7 +1702,7 @@ var CopilotResolver = class {
|
|
|
1626
1702
|
result: event.result
|
|
1627
1703
|
});
|
|
1628
1704
|
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1629
|
-
id: (0,
|
|
1705
|
+
id: (0, import_shared4.randomId)(),
|
|
1630
1706
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1631
1707
|
actionExecutionId: event.actionExecutionId,
|
|
1632
1708
|
actionName: event.actionName,
|
|
@@ -1638,7 +1714,7 @@ var CopilotResolver = class {
|
|
|
1638
1714
|
event
|
|
1639
1715
|
}, "Agent message event received");
|
|
1640
1716
|
pushMessage({
|
|
1641
|
-
id: (0,
|
|
1717
|
+
id: (0, import_shared4.randomId)(),
|
|
1642
1718
|
status: new SuccessMessageStatus(),
|
|
1643
1719
|
threadId: event.threadId,
|
|
1644
1720
|
agentName: event.agentName,
|
|
@@ -1651,7 +1727,7 @@ var CopilotResolver = class {
|
|
|
1651
1727
|
createdAt: /* @__PURE__ */ new Date()
|
|
1652
1728
|
});
|
|
1653
1729
|
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1654
|
-
id: (0,
|
|
1730
|
+
id: (0, import_shared4.randomId)(),
|
|
1655
1731
|
threadId: event.threadId,
|
|
1656
1732
|
agentName: event.agentName,
|
|
1657
1733
|
nodeName: event.nodeName,
|
|
@@ -1681,7 +1757,7 @@ var CopilotResolver = class {
|
|
|
1681
1757
|
logger2.debug("Event stream completed");
|
|
1682
1758
|
if ((_a3 = data.cloud) == null ? void 0 : _a3.guardrails) {
|
|
1683
1759
|
logger2.debug("Guardrails is enabled, waiting for guardrails result");
|
|
1684
|
-
await (0,
|
|
1760
|
+
await (0, import_rxjs3.firstValueFrom)(guardrailsResult$);
|
|
1685
1761
|
}
|
|
1686
1762
|
responseStatus$.next(new SuccessResponseStatus());
|
|
1687
1763
|
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
@@ -1838,7 +1914,7 @@ function copilotRuntimeNodeHttpEndpoint(options) {
|
|
|
1838
1914
|
_copilotkit: options.properties._copilotkit
|
|
1839
1915
|
});
|
|
1840
1916
|
}
|
|
1841
|
-
telemetry_client_default.capture("oss.runtime.instance_created",
|
|
1917
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
|
|
1842
1918
|
const logger2 = commonConfig.logging;
|
|
1843
1919
|
logger2.debug("Creating Node HTTP endpoint");
|
|
1844
1920
|
const yoga = (0, import_graphql_yoga2.createYoga)({
|
|
@@ -1856,7 +1932,7 @@ function copilotRuntimeNestEndpoint(options) {
|
|
|
1856
1932
|
framework: "nest"
|
|
1857
1933
|
}
|
|
1858
1934
|
});
|
|
1859
|
-
telemetry_client_default.capture("oss.runtime.instance_created",
|
|
1935
|
+
telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
|
|
1860
1936
|
return copilotRuntimeNodeHttpEndpoint(options);
|
|
1861
1937
|
}
|
|
1862
1938
|
__name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|