@copilotkit/runtime 1.5.12-next.3 → 1.5.12-next.4
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 +8 -0
- package/dist/{chunk-JGMDVBJN.mjs → chunk-53ZLUGHX.mjs} +2 -2
- package/dist/{chunk-VFFEKEC2.mjs → chunk-6PZWWJ32.mjs} +2 -2
- package/dist/{chunk-4A5VMMYR.mjs → chunk-FOUJ36SV.mjs} +2 -2
- package/dist/{chunk-QAUSY7SM.mjs → chunk-U3DYEEGJ.mjs} +8 -2
- package/dist/{chunk-QAUSY7SM.mjs.map → chunk-U3DYEEGJ.mjs.map} +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +33 -17
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +1 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.js +1 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +12 -1
- /package/dist/{chunk-JGMDVBJN.mjs.map → chunk-53ZLUGHX.mjs.map} +0 -0
- /package/dist/{chunk-VFFEKEC2.mjs.map → chunk-6PZWWJ32.mjs.map} +0 -0
- /package/dist/{chunk-4A5VMMYR.mjs.map → chunk-FOUJ36SV.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-53ZLUGHX.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FOUJ36SV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6PZWWJ32.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-U3DYEEGJ.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AnthropicAdapter,
|
|
26
26
|
ExperimentalEmptyAdapter,
|
package/dist/lib/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.4",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -148,7 +148,7 @@ __export(lib_exports, {
|
|
|
148
148
|
module.exports = __toCommonJS(lib_exports);
|
|
149
149
|
|
|
150
150
|
// src/lib/runtime/copilot-runtime.ts
|
|
151
|
-
var
|
|
151
|
+
var import_shared10 = require("@copilotkit/shared");
|
|
152
152
|
|
|
153
153
|
// src/service-adapters/langchain/langserve.ts
|
|
154
154
|
var import_remote = require("langchain/runnables/remote");
|
|
@@ -1203,12 +1203,23 @@ var GroqAdapter = class {
|
|
|
1203
1203
|
};
|
|
1204
1204
|
__name(GroqAdapter, "GroqAdapter");
|
|
1205
1205
|
|
|
1206
|
+
// src/service-adapters/experimental/empty/empty-adapter.ts
|
|
1207
|
+
var import_shared6 = require("@copilotkit/shared");
|
|
1208
|
+
var ExperimentalEmptyAdapter = class {
|
|
1209
|
+
async process(request) {
|
|
1210
|
+
return {
|
|
1211
|
+
threadId: request.threadId || (0, import_shared6.randomId)()
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
__name(ExperimentalEmptyAdapter, "ExperimentalEmptyAdapter");
|
|
1216
|
+
|
|
1206
1217
|
// src/service-adapters/events.ts
|
|
1207
|
-
var
|
|
1218
|
+
var import_shared9 = require("@copilotkit/shared");
|
|
1208
1219
|
var import_rxjs2 = require("rxjs");
|
|
1209
1220
|
|
|
1210
1221
|
// src/lib/telemetry-client.ts
|
|
1211
|
-
var
|
|
1222
|
+
var import_shared8 = require("@copilotkit/shared");
|
|
1212
1223
|
|
|
1213
1224
|
// src/lib/runtime/remote-action-constructors.ts
|
|
1214
1225
|
var import_node_crypto2 = require("crypto");
|
|
@@ -1241,7 +1252,7 @@ var CustomEventNames;
|
|
|
1241
1252
|
})(CustomEventNames || (CustomEventNames = {}));
|
|
1242
1253
|
|
|
1243
1254
|
// src/agents/langgraph/event-source.ts
|
|
1244
|
-
var
|
|
1255
|
+
var import_shared7 = require("@copilotkit/shared");
|
|
1245
1256
|
var RemoteLangGraphEventSource = class {
|
|
1246
1257
|
eventStream$ = new import_rxjs.ReplaySubject();
|
|
1247
1258
|
shouldEmitToolCall(shouldEmitToolCalls, toolCallName) {
|
|
@@ -1433,7 +1444,7 @@ var RemoteLangGraphEventSource = class {
|
|
|
1433
1444
|
actionExecutionId: lastEventWithState.lastToolCallId
|
|
1434
1445
|
});
|
|
1435
1446
|
}
|
|
1436
|
-
const messageId = (0,
|
|
1447
|
+
const messageId = (0, import_shared7.randomId)();
|
|
1437
1448
|
events.push({
|
|
1438
1449
|
type: RuntimeEventTypes.TextMessageStart,
|
|
1439
1450
|
messageId
|
|
@@ -2304,7 +2315,7 @@ __name(setupRemoteActions, "setupRemoteActions");
|
|
|
2304
2315
|
// src/lib/telemetry-client.ts
|
|
2305
2316
|
var import_node_crypto3 = require("crypto");
|
|
2306
2317
|
var packageJson = require_package();
|
|
2307
|
-
var telemetryClient = new
|
|
2318
|
+
var telemetryClient = new import_shared8.TelemetryClient({
|
|
2308
2319
|
packageName: packageJson.name,
|
|
2309
2320
|
packageVersion: packageJson.version
|
|
2310
2321
|
});
|
|
@@ -2614,10 +2625,10 @@ var RuntimeEventSource = class {
|
|
|
2614
2625
|
const errorMessage = `\u274C ${message}`;
|
|
2615
2626
|
if (!this.callback) {
|
|
2616
2627
|
this.stream(async (eventStream$) => {
|
|
2617
|
-
eventStream$.sendTextMessage((0,
|
|
2628
|
+
eventStream$.sendTextMessage((0, import_shared9.randomId)(), errorMessage);
|
|
2618
2629
|
});
|
|
2619
2630
|
} else {
|
|
2620
|
-
this.eventStream$.sendTextMessage((0,
|
|
2631
|
+
this.eventStream$.sendTextMessage((0, import_shared9.randomId)(), errorMessage);
|
|
2621
2632
|
}
|
|
2622
2633
|
}
|
|
2623
2634
|
processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents }) {
|
|
@@ -2848,13 +2859,18 @@ var CopilotRuntime = class {
|
|
|
2848
2859
|
if (agentSession) {
|
|
2849
2860
|
return await this.processAgentRequest(request);
|
|
2850
2861
|
}
|
|
2862
|
+
if (serviceAdapter instanceof ExperimentalEmptyAdapter) {
|
|
2863
|
+
throw new Error(`Invalid adapter configuration: ExperimentalEmptyAdapter is only meant to be used with agent lock mode.
|
|
2864
|
+
For non-agent components like useCopilotChatSuggestions, CopilotTextarea, or CopilotTask,
|
|
2865
|
+
please use an LLM adapter instead.`);
|
|
2866
|
+
}
|
|
2851
2867
|
const messages = rawMessages.filter((message) => !message.agentStateMessage);
|
|
2852
2868
|
const inputMessages = convertGqlInputToMessages(messages);
|
|
2853
2869
|
const serverSideActions = await this.getServerSideActions(request);
|
|
2854
2870
|
const serverSideActionsInput = serverSideActions.map((action) => ({
|
|
2855
2871
|
name: action.name,
|
|
2856
2872
|
description: action.description,
|
|
2857
|
-
jsonSchema: JSON.stringify((0,
|
|
2873
|
+
jsonSchema: JSON.stringify((0, import_shared10.actionParametersToJsonSchema)(action.parameters))
|
|
2858
2874
|
}));
|
|
2859
2875
|
const actionInputs = flattenToolCallsNoDuplicates([
|
|
2860
2876
|
...serverSideActionsInput,
|
|
@@ -2936,7 +2952,7 @@ var CopilotRuntime = class {
|
|
|
2936
2952
|
const endpointAgents = ((data == null ? void 0 : data.agents) ?? []).map((agent) => ({
|
|
2937
2953
|
name: agent.name,
|
|
2938
2954
|
description: agent.description,
|
|
2939
|
-
id: (0,
|
|
2955
|
+
id: (0, import_shared10.randomId)()
|
|
2940
2956
|
}));
|
|
2941
2957
|
return [
|
|
2942
2958
|
...agents2,
|
|
@@ -2958,7 +2974,7 @@ var CopilotRuntime = class {
|
|
|
2958
2974
|
const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
|
|
2959
2975
|
name: action.name,
|
|
2960
2976
|
description: action.description,
|
|
2961
|
-
jsonSchema: JSON.stringify((0,
|
|
2977
|
+
jsonSchema: JSON.stringify((0, import_shared10.actionParametersToJsonSchema)(action.parameters))
|
|
2962
2978
|
}));
|
|
2963
2979
|
const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
|
|
2964
2980
|
...serverSideActionsInput,
|
|
@@ -4152,7 +4168,7 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
4152
4168
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
4153
4169
|
|
|
4154
4170
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
4155
|
-
var
|
|
4171
|
+
var import_shared11 = require("@copilotkit/shared");
|
|
4156
4172
|
|
|
4157
4173
|
// src/graphql/types/agents-response.type.ts
|
|
4158
4174
|
var import_type_graphql15 = require("type-graphql");
|
|
@@ -4335,7 +4351,7 @@ var CopilotResolver = class {
|
|
|
4335
4351
|
rejectOutputMessagesPromise = reject;
|
|
4336
4352
|
});
|
|
4337
4353
|
logger2.debug("Processing");
|
|
4338
|
-
const { eventSource, threadId = (0,
|
|
4354
|
+
const { eventSource, threadId = (0, import_shared11.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
4339
4355
|
serviceAdapter,
|
|
4340
4356
|
messages: data.messages,
|
|
4341
4357
|
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
@@ -4380,7 +4396,7 @@ var CopilotResolver = class {
|
|
|
4380
4396
|
});
|
|
4381
4397
|
outputMessages = [
|
|
4382
4398
|
(0, import_class_transformer3.plainToInstance)(TextMessage, {
|
|
4383
|
-
id: (0,
|
|
4399
|
+
id: (0, import_shared11.randomId)(),
|
|
4384
4400
|
createdAt: /* @__PURE__ */ new Date(),
|
|
4385
4401
|
content: result.reason,
|
|
4386
4402
|
role: MessageRole.assistant
|
|
@@ -4571,7 +4587,7 @@ var CopilotResolver = class {
|
|
|
4571
4587
|
event
|
|
4572
4588
|
}, "Agent message event received");
|
|
4573
4589
|
pushMessage({
|
|
4574
|
-
id: (0,
|
|
4590
|
+
id: (0, import_shared11.randomId)(),
|
|
4575
4591
|
status: new SuccessMessageStatus(),
|
|
4576
4592
|
threadId: event.threadId,
|
|
4577
4593
|
agentName: event.agentName,
|
|
@@ -4584,7 +4600,7 @@ var CopilotResolver = class {
|
|
|
4584
4600
|
createdAt: /* @__PURE__ */ new Date()
|
|
4585
4601
|
});
|
|
4586
4602
|
outputMessages.push((0, import_class_transformer3.plainToInstance)(AgentStateMessage, {
|
|
4587
|
-
id: (0,
|
|
4603
|
+
id: (0, import_shared11.randomId)(),
|
|
4588
4604
|
threadId: event.threadId,
|
|
4589
4605
|
agentName: event.agentName,
|
|
4590
4606
|
nodeName: event.nodeName,
|