@copilotkit/runtime 1.4.8-no-pino-redact.1 → 1.5.0-coagents-v0-3.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/CHANGELOG.md +20 -5
- package/__snapshots__/schema/schema.graphql +7 -9
- package/dist/{chunk-OKQVDDJ2.mjs → chunk-4AYRDPWK.mjs} +285 -63
- package/dist/chunk-4AYRDPWK.mjs.map +1 -0
- package/dist/{chunk-APVJZO3R.mjs → chunk-7BOO3OFP.mjs} +2 -2
- package/dist/{chunk-OSWF5QDO.mjs → chunk-GSTWFOZF.mjs} +2 -2
- package/dist/{chunk-M74ZTUCC.mjs → chunk-OMAAKIJQ.mjs} +2 -2
- package/dist/{chunk-36AYTJIE.mjs → chunk-PXS4SBRF.mjs} +447 -321
- package/dist/chunk-PXS4SBRF.mjs.map +1 -0
- package/dist/{chunk-B74M7FXG.mjs → chunk-RFF5IIZJ.mjs} +3 -2
- package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
- package/dist/{copilot-runtime-12e7ac40.d.ts → copilot-runtime-2e46a7b6.d.ts} +2 -2
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/graphql/types/converted/index.js +2 -1
- package/dist/graphql/types/converted/index.js.map +1 -1
- package/dist/graphql/types/converted/index.mjs +1 -1
- package/dist/{groq-adapter-24abe931.d.ts → groq-adapter-7bf6824b.d.ts} +1 -1
- package/dist/{index-10b1c870.d.ts → index-ff3fbc33.d.ts} +7 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +824 -473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-f021ab9c.d.ts → langserve-f318db89.d.ts} +53 -14
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +729 -452
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +6 -6
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +79 -31
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +6 -6
- package/dist/lib/integrations/nest/index.d.ts +3 -3
- package/dist/lib/integrations/nest/index.js +79 -31
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +4 -4
- package/dist/lib/integrations/node-express/index.d.ts +3 -3
- package/dist/lib/integrations/node-express/index.js +79 -31
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +4 -4
- package/dist/lib/integrations/node-http/index.d.ts +3 -3
- package/dist/lib/integrations/node-http/index.js +79 -31
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +3 -3
- package/dist/service-adapters/index.d.ts +36 -5
- package/dist/service-adapters/index.js +285 -61
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +5 -1
- package/package.json +2 -2
- package/src/agents/langgraph/event-source.ts +140 -148
- package/src/agents/langgraph/events.ts +1 -1
- package/src/graphql/inputs/message.input.ts +15 -3
- package/src/graphql/resolvers/copilot.resolver.ts +32 -6
- package/src/graphql/types/converted/index.ts +4 -3
- package/src/graphql/types/copilot-response.type.ts +12 -3
- package/src/graphql/types/enums.ts +0 -11
- package/src/lib/logger.ts +4 -0
- package/src/lib/runtime/copilot-runtime.ts +1 -7
- package/src/lib/runtime/remote-action-constructors.ts +64 -58
- package/src/lib/runtime/remote-actions.ts +1 -0
- package/src/lib/runtime/remote-lg-action.ts +159 -140
- package/src/service-adapters/anthropic/anthropic-adapter.ts +16 -6
- package/src/service-adapters/conversion.ts +2 -1
- package/src/service-adapters/events.ts +118 -54
- package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +7 -3
- package/src/service-adapters/groq/groq-adapter.ts +23 -8
- package/src/service-adapters/index.ts +7 -1
- package/src/service-adapters/langchain/utils.ts +55 -32
- package/src/service-adapters/openai/openai-adapter.ts +22 -9
- package/src/service-adapters/openai/openai-assistant-adapter.ts +22 -8
- package/src/service-adapters/unify/unify-adapter.ts +28 -11
- package/dist/chunk-36AYTJIE.mjs.map +0 -1
- package/dist/chunk-B74M7FXG.mjs.map +0 -1
- package/dist/chunk-OKQVDDJ2.mjs.map +0 -1
- /package/dist/{chunk-APVJZO3R.mjs.map → chunk-7BOO3OFP.mjs.map} +0 -0
- /package/dist/{chunk-OSWF5QDO.mjs.map → chunk-GSTWFOZF.mjs.map} +0 -0
- /package/dist/{chunk-M74ZTUCC.mjs.map → chunk-OMAAKIJQ.mjs.map} +0 -0
package/dist/lib/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GSTWFOZF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-OMAAKIJQ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-7BOO3OFP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-PXS4SBRF.mjs";
|
|
24
24
|
import {
|
|
25
25
|
GoogleGenerativeAIAdapter,
|
|
26
26
|
GroqAdapter,
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
OpenAIAdapter,
|
|
29
29
|
OpenAIAssistantAdapter,
|
|
30
30
|
UnifyAdapter
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-4AYRDPWK.mjs";
|
|
32
32
|
import "../chunk-U3V2BCGI.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-RFF5IIZJ.mjs";
|
|
34
34
|
import "../chunk-D2WLFQS6.mjs";
|
|
35
35
|
import "../chunk-44O2JGUY.mjs";
|
|
36
36
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-
|
|
2
|
-
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-
|
|
1
|
+
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-2e46a7b6.js';
|
|
2
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-2e46a7b6.js';
|
|
3
3
|
import * as graphql_yoga from 'graphql-yoga';
|
|
4
4
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
5
5
|
export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
|
|
6
6
|
export { copilotRuntimeNodeExpressEndpoint } from './node-express/index.js';
|
|
7
7
|
export { copilotRuntimeNestEndpoint } from './nest/index.js';
|
|
8
8
|
import '@copilotkit/shared';
|
|
9
|
-
import '../../langserve-
|
|
10
|
-
import '../../index-
|
|
9
|
+
import '../../langserve-f318db89.js';
|
|
10
|
+
import '../../index-ff3fbc33.js';
|
|
11
11
|
import '../../graphql/types/base/index.js';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import 'graphql';
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.
|
|
47
|
+
version: "1.5.0-coagents-v0-3.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -158,12 +158,6 @@ var MessageRole;
|
|
|
158
158
|
MessageRole2["system"] = "system";
|
|
159
159
|
MessageRole2["tool"] = "tool";
|
|
160
160
|
})(MessageRole || (MessageRole = {}));
|
|
161
|
-
var ActionExecutionScope;
|
|
162
|
-
(function(ActionExecutionScope2) {
|
|
163
|
-
ActionExecutionScope2["server"] = "server";
|
|
164
|
-
ActionExecutionScope2["client"] = "client";
|
|
165
|
-
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
166
|
-
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
167
161
|
var CopilotRequestType;
|
|
168
162
|
(function(CopilotRequestType2) {
|
|
169
163
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -182,10 +176,6 @@ var ActionInputAvailability;
|
|
|
182
176
|
name: "MessageRole",
|
|
183
177
|
description: "The role of the message"
|
|
184
178
|
});
|
|
185
|
-
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
186
|
-
name: "ActionExecutionScope",
|
|
187
|
-
description: "The scope of the action"
|
|
188
|
-
});
|
|
189
179
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
190
180
|
name: "CopilotRequestType",
|
|
191
181
|
description: "The type of Copilot request"
|
|
@@ -283,6 +273,7 @@ MessageInput = _ts_decorate2([
|
|
|
283
273
|
], MessageInput);
|
|
284
274
|
var TextMessageInput = class {
|
|
285
275
|
content;
|
|
276
|
+
parentMessageId;
|
|
286
277
|
role;
|
|
287
278
|
};
|
|
288
279
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -290,6 +281,12 @@ _ts_decorate2([
|
|
|
290
281
|
(0, import_type_graphql3.Field)(() => String),
|
|
291
282
|
_ts_metadata2("design:type", String)
|
|
292
283
|
], TextMessageInput.prototype, "content", void 0);
|
|
284
|
+
_ts_decorate2([
|
|
285
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
286
|
+
nullable: true
|
|
287
|
+
}),
|
|
288
|
+
_ts_metadata2("design:type", String)
|
|
289
|
+
], TextMessageInput.prototype, "parentMessageId", void 0);
|
|
293
290
|
_ts_decorate2([
|
|
294
291
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
295
292
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -300,6 +297,7 @@ TextMessageInput = _ts_decorate2([
|
|
|
300
297
|
var ActionExecutionMessageInput = class {
|
|
301
298
|
name;
|
|
302
299
|
arguments;
|
|
300
|
+
parentMessageId;
|
|
303
301
|
scope;
|
|
304
302
|
};
|
|
305
303
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -312,8 +310,17 @@ _ts_decorate2([
|
|
|
312
310
|
_ts_metadata2("design:type", String)
|
|
313
311
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
314
312
|
_ts_decorate2([
|
|
315
|
-
(0, import_type_graphql3.Field)(() =>
|
|
316
|
-
|
|
313
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
314
|
+
nullable: true
|
|
315
|
+
}),
|
|
316
|
+
_ts_metadata2("design:type", String)
|
|
317
|
+
], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
|
|
318
|
+
_ts_decorate2([
|
|
319
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
320
|
+
nullable: true,
|
|
321
|
+
deprecationReason: "This field will be removed in a future version"
|
|
322
|
+
}),
|
|
323
|
+
_ts_metadata2("design:type", typeof String === "undefined" ? Object : String)
|
|
317
324
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
318
325
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
319
326
|
(0, import_type_graphql3.InputType)()
|
|
@@ -321,6 +328,7 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
321
328
|
var ResultMessageInput = class {
|
|
322
329
|
actionExecutionId;
|
|
323
330
|
actionName;
|
|
331
|
+
parentMessageId;
|
|
324
332
|
result;
|
|
325
333
|
};
|
|
326
334
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -332,6 +340,12 @@ _ts_decorate2([
|
|
|
332
340
|
(0, import_type_graphql3.Field)(() => String),
|
|
333
341
|
_ts_metadata2("design:type", String)
|
|
334
342
|
], ResultMessageInput.prototype, "actionName", void 0);
|
|
343
|
+
_ts_decorate2([
|
|
344
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
345
|
+
nullable: true
|
|
346
|
+
}),
|
|
347
|
+
_ts_metadata2("design:type", String)
|
|
348
|
+
], ResultMessageInput.prototype, "parentMessageId", void 0);
|
|
335
349
|
_ts_decorate2([
|
|
336
350
|
(0, import_type_graphql3.Field)(() => String),
|
|
337
351
|
_ts_metadata2("design:type", String)
|
|
@@ -1054,6 +1068,7 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1054
1068
|
var TextMessageOutput = class {
|
|
1055
1069
|
role;
|
|
1056
1070
|
content;
|
|
1071
|
+
parentMessageId;
|
|
1057
1072
|
};
|
|
1058
1073
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1059
1074
|
_ts_decorate13([
|
|
@@ -1066,6 +1081,12 @@ _ts_decorate13([
|
|
|
1066
1081
|
]),
|
|
1067
1082
|
_ts_metadata13("design:type", Array)
|
|
1068
1083
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1084
|
+
_ts_decorate13([
|
|
1085
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1086
|
+
nullable: true
|
|
1087
|
+
}),
|
|
1088
|
+
_ts_metadata13("design:type", String)
|
|
1089
|
+
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1069
1090
|
TextMessageOutput = _ts_decorate13([
|
|
1070
1091
|
(0, import_type_graphql14.ObjectType)({
|
|
1071
1092
|
implements: BaseMessageOutput
|
|
@@ -1075,6 +1096,7 @@ var ActionExecutionMessageOutput = class {
|
|
|
1075
1096
|
name;
|
|
1076
1097
|
scope;
|
|
1077
1098
|
arguments;
|
|
1099
|
+
parentMessageId;
|
|
1078
1100
|
};
|
|
1079
1101
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1080
1102
|
_ts_decorate13([
|
|
@@ -1082,8 +1104,11 @@ _ts_decorate13([
|
|
|
1082
1104
|
_ts_metadata13("design:type", String)
|
|
1083
1105
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1084
1106
|
_ts_decorate13([
|
|
1085
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1086
|
-
|
|
1107
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1108
|
+
nullable: true,
|
|
1109
|
+
deprecationReason: "This field will be removed in a future version"
|
|
1110
|
+
}),
|
|
1111
|
+
_ts_metadata13("design:type", String)
|
|
1087
1112
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1088
1113
|
_ts_decorate13([
|
|
1089
1114
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1091,6 +1116,12 @@ _ts_decorate13([
|
|
|
1091
1116
|
]),
|
|
1092
1117
|
_ts_metadata13("design:type", Array)
|
|
1093
1118
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1119
|
+
_ts_decorate13([
|
|
1120
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1121
|
+
nullable: true
|
|
1122
|
+
}),
|
|
1123
|
+
_ts_metadata13("design:type", String)
|
|
1124
|
+
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1094
1125
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1095
1126
|
(0, import_type_graphql14.ObjectType)({
|
|
1096
1127
|
implements: BaseMessageOutput
|
|
@@ -1242,13 +1273,14 @@ var TextMessage = class extends Message {
|
|
|
1242
1273
|
type = "TextMessage";
|
|
1243
1274
|
content;
|
|
1244
1275
|
role;
|
|
1276
|
+
parentMessageId;
|
|
1245
1277
|
};
|
|
1246
1278
|
__name(TextMessage, "TextMessage");
|
|
1247
1279
|
var ActionExecutionMessage = class extends Message {
|
|
1248
1280
|
type = "ActionExecutionMessage";
|
|
1249
1281
|
name;
|
|
1250
1282
|
arguments;
|
|
1251
|
-
|
|
1283
|
+
parentMessageId;
|
|
1252
1284
|
};
|
|
1253
1285
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1254
1286
|
var ResultMessage = class extends Message {
|
|
@@ -1332,6 +1364,7 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1332
1364
|
var telemetry_client_default = telemetryClient;
|
|
1333
1365
|
|
|
1334
1366
|
// src/service-adapters/events.ts
|
|
1367
|
+
var import_class_transformer = require("class-transformer");
|
|
1335
1368
|
var RuntimeEventTypes;
|
|
1336
1369
|
(function(RuntimeEventTypes2) {
|
|
1337
1370
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1346,7 +1379,7 @@ var RuntimeEventTypes;
|
|
|
1346
1379
|
|
|
1347
1380
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1348
1381
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1349
|
-
var
|
|
1382
|
+
var import_class_transformer2 = require("class-transformer");
|
|
1350
1383
|
var import_graphql = require("graphql");
|
|
1351
1384
|
|
|
1352
1385
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1544,7 +1577,7 @@ var CopilotResolver = class {
|
|
|
1544
1577
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1545
1578
|
});
|
|
1546
1579
|
outputMessages = [
|
|
1547
|
-
(0,
|
|
1580
|
+
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1548
1581
|
id: (0, import_shared4.randomId)(),
|
|
1549
1582
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1550
1583
|
content: result.reason,
|
|
@@ -1593,12 +1626,15 @@ var CopilotResolver = class {
|
|
|
1593
1626
|
// skip until this message start event
|
|
1594
1627
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1595
1628
|
// take until the message end event
|
|
1596
|
-
(0, import_rxjs3.takeWhile)((e) => e.type
|
|
1629
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.TextMessageEnd && e.messageId == event.messageId)),
|
|
1630
|
+
// filter out any other message events or message ids
|
|
1631
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1597
1632
|
);
|
|
1598
1633
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1599
1634
|
const messageId = event.messageId;
|
|
1600
1635
|
pushMessage({
|
|
1601
1636
|
id: messageId,
|
|
1637
|
+
parentMessageId: event.parentMessageId,
|
|
1602
1638
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1603
1639
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1604
1640
|
role: MessageRole.assistant,
|
|
@@ -1611,7 +1647,7 @@ var CopilotResolver = class {
|
|
|
1611
1647
|
reason,
|
|
1612
1648
|
messageId: messageId2
|
|
1613
1649
|
}, "Text streaming interrupted");
|
|
1614
|
-
streamingTextStatus.next((0,
|
|
1650
|
+
streamingTextStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1615
1651
|
reason
|
|
1616
1652
|
}));
|
|
1617
1653
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1644,7 +1680,7 @@ var CopilotResolver = class {
|
|
|
1644
1680
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1645
1681
|
stopStreamingText();
|
|
1646
1682
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1647
|
-
outputMessages.push((0,
|
|
1683
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1648
1684
|
id: messageId,
|
|
1649
1685
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1650
1686
|
content: textChunks.join(""),
|
|
@@ -1657,14 +1693,20 @@ var CopilotResolver = class {
|
|
|
1657
1693
|
break;
|
|
1658
1694
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1659
1695
|
logger2.debug("Action execution start event received");
|
|
1660
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1696
|
+
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1697
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1698
|
+
// take until the action execution end event
|
|
1699
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1700
|
+
// filter out any other action execution events or action execution ids
|
|
1701
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1702
|
+
);
|
|
1661
1703
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1662
1704
|
pushMessage({
|
|
1663
1705
|
id: event.actionExecutionId,
|
|
1706
|
+
parentMessageId: event.parentMessageId,
|
|
1664
1707
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1665
1708
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1666
1709
|
name: event.actionName,
|
|
1667
|
-
scope: event.scope,
|
|
1668
1710
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1669
1711
|
logger2.debug("Action execution argument stream created");
|
|
1670
1712
|
const argumentChunks = [];
|
|
@@ -1680,7 +1722,7 @@ var CopilotResolver = class {
|
|
|
1680
1722
|
logger2.error({
|
|
1681
1723
|
err
|
|
1682
1724
|
}, "Error in action execution argument stream");
|
|
1683
|
-
streamingArgumentsStatus.next((0,
|
|
1725
|
+
streamingArgumentsStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1684
1726
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1685
1727
|
}));
|
|
1686
1728
|
stopStreamingArguments();
|
|
@@ -1691,11 +1733,10 @@ var CopilotResolver = class {
|
|
|
1691
1733
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1692
1734
|
stopStreamingArguments();
|
|
1693
1735
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1694
|
-
outputMessages.push((0,
|
|
1736
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ActionExecutionMessage, {
|
|
1695
1737
|
id: event.actionExecutionId,
|
|
1696
1738
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1697
1739
|
name: event.actionName,
|
|
1698
|
-
scope: event.scope,
|
|
1699
1740
|
arguments: argumentChunks.join("")
|
|
1700
1741
|
}));
|
|
1701
1742
|
}
|
|
@@ -1708,15 +1749,15 @@ var CopilotResolver = class {
|
|
|
1708
1749
|
result: event.result
|
|
1709
1750
|
}, "Action execution result event received");
|
|
1710
1751
|
pushMessage({
|
|
1711
|
-
id:
|
|
1752
|
+
id: "result-" + event.actionExecutionId,
|
|
1712
1753
|
status: new SuccessMessageStatus(),
|
|
1713
1754
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1714
1755
|
actionExecutionId: event.actionExecutionId,
|
|
1715
1756
|
actionName: event.actionName,
|
|
1716
1757
|
result: event.result
|
|
1717
1758
|
});
|
|
1718
|
-
outputMessages.push((0,
|
|
1719
|
-
id:
|
|
1759
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
|
|
1760
|
+
id: "result-" + event.actionExecutionId,
|
|
1720
1761
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1721
1762
|
actionExecutionId: event.actionExecutionId,
|
|
1722
1763
|
actionName: event.actionName,
|
|
@@ -1740,7 +1781,7 @@ var CopilotResolver = class {
|
|
|
1740
1781
|
role: MessageRole.assistant,
|
|
1741
1782
|
createdAt: /* @__PURE__ */ new Date()
|
|
1742
1783
|
});
|
|
1743
|
-
outputMessages.push((0,
|
|
1784
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
1744
1785
|
id: (0, import_shared4.randomId)(),
|
|
1745
1786
|
threadId: event.threadId,
|
|
1746
1787
|
agentName: event.agentName,
|
|
@@ -1822,7 +1863,14 @@ function createLogger(options) {
|
|
|
1822
1863
|
colorize: true
|
|
1823
1864
|
});
|
|
1824
1865
|
const logger2 = (0, import_pino.default)({
|
|
1825
|
-
level: process.env.LOG_LEVEL || level || "error"
|
|
1866
|
+
level: process.env.LOG_LEVEL || level || "error",
|
|
1867
|
+
redact: {
|
|
1868
|
+
paths: [
|
|
1869
|
+
"pid",
|
|
1870
|
+
"hostname"
|
|
1871
|
+
],
|
|
1872
|
+
remove: true
|
|
1873
|
+
}
|
|
1826
1874
|
}, stream);
|
|
1827
1875
|
if (component) {
|
|
1828
1876
|
return logger2.child({
|