@copilotkit/runtime 1.50.0-beta.1 → 1.50.0-beta.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -4
- package/src/graphql/message-conversion/agui-to-gql.test.ts +2 -2
- package/src/graphql/message-conversion/gql-to-agui.test.ts +30 -28
- package/src/graphql/message-conversion/roundtrip-conversion.test.ts +8 -8
- package/src/lib/integrations/nextjs/app-router.ts +3 -1
- package/src/lib/integrations/node-http/index.ts +3 -1
- package/src/lib/integrations/shared.ts +2 -2
- package/src/lib/runtime/copilot-runtime.ts +9 -7
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.50.0-beta.
|
|
12
|
+
"version": "1.50.0-beta.2",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@anthropic-ai/sdk": "^0.57.0",
|
|
50
|
-
"@copilotkitnext/agent": "0.0.
|
|
51
|
-
"@copilotkitnext/runtime": "0.0.
|
|
50
|
+
"@copilotkitnext/agent": "0.0.23",
|
|
51
|
+
"@copilotkitnext/runtime": "0.0.23",
|
|
52
52
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
53
53
|
"@langchain/aws": "^0.1.9",
|
|
54
54
|
"@langchain/community": "^0.3.29",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"rxjs": "7.8.1",
|
|
75
75
|
"type-graphql": "2.0.0-rc.1",
|
|
76
76
|
"zod": "^3.23.3",
|
|
77
|
-
"@copilotkit/shared": "1.50.0-beta.
|
|
77
|
+
"@copilotkit/shared": "1.50.0-beta.2"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@ag-ui/client": ">=0.0.39",
|
|
@@ -83,6 +83,11 @@
|
|
|
83
83
|
"@ag-ui/langgraph": ">=0.0.18",
|
|
84
84
|
"@ag-ui/proto": ">=0.0.39"
|
|
85
85
|
},
|
|
86
|
+
"peerDependenciesMeta": {
|
|
87
|
+
"@ag-ui/langgraph": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
86
91
|
"keywords": [
|
|
87
92
|
"copilotkit",
|
|
88
93
|
"copilot",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, test, expect
|
|
1
|
+
import { describe, test, expect } from "@jest/globals";
|
|
2
2
|
import * as gql from "../types/converted/index";
|
|
3
3
|
import agui from "@copilotkit/shared";
|
|
4
4
|
import {
|
|
@@ -587,7 +587,7 @@ describe("agui-to-gql", () => {
|
|
|
587
587
|
});
|
|
588
588
|
|
|
589
589
|
test("should verify render function receives correct props including name", () => {
|
|
590
|
-
const mockRender =
|
|
590
|
+
const mockRender = jest.fn(
|
|
591
591
|
(props) => `Rendered: ${props.name} with args: ${JSON.stringify(props.args)}`,
|
|
592
592
|
);
|
|
593
593
|
const aguiMessage: agui.Message = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, test, expect
|
|
1
|
+
import { describe, test, expect } from "@jest/globals";
|
|
2
2
|
import * as gql from "../types/converted/index";
|
|
3
3
|
import { MessageStatusCode } from "../types/message-status.type";
|
|
4
4
|
import {
|
|
@@ -370,7 +370,7 @@ describe("message-conversion", () => {
|
|
|
370
370
|
status: { code: MessageStatusCode.Pending },
|
|
371
371
|
});
|
|
372
372
|
|
|
373
|
-
const mockRender =
|
|
373
|
+
const mockRender = jest.fn();
|
|
374
374
|
const mockRenderAndWaitForResponse = (props: any) => "Test Render With Response";
|
|
375
375
|
|
|
376
376
|
const actions = {
|
|
@@ -414,7 +414,7 @@ describe("message-conversion", () => {
|
|
|
414
414
|
status: { code: MessageStatusCode.Pending },
|
|
415
415
|
});
|
|
416
416
|
|
|
417
|
-
const mockRender =
|
|
417
|
+
const mockRender = jest.fn();
|
|
418
418
|
const actions = {
|
|
419
419
|
testAction: {
|
|
420
420
|
name: "testAction",
|
|
@@ -445,7 +445,7 @@ describe("message-conversion", () => {
|
|
|
445
445
|
status: { code: MessageStatusCode.Success },
|
|
446
446
|
});
|
|
447
447
|
|
|
448
|
-
const mockRender =
|
|
448
|
+
const mockRender = jest.fn();
|
|
449
449
|
const actions = {
|
|
450
450
|
testAction: {
|
|
451
451
|
name: "testAction",
|
|
@@ -483,7 +483,7 @@ describe("message-conversion", () => {
|
|
|
483
483
|
actionName: "testAction",
|
|
484
484
|
});
|
|
485
485
|
|
|
486
|
-
const mockRender =
|
|
486
|
+
const mockRender = jest.fn();
|
|
487
487
|
const actions = {
|
|
488
488
|
testAction: {
|
|
489
489
|
name: "testAction",
|
|
@@ -517,7 +517,7 @@ describe("message-conversion", () => {
|
|
|
517
517
|
status: { code: MessageStatusCode.Pending },
|
|
518
518
|
});
|
|
519
519
|
|
|
520
|
-
const mockRender =
|
|
520
|
+
const mockRender = jest.fn();
|
|
521
521
|
const actions = {
|
|
522
522
|
testAction: {
|
|
523
523
|
name: "testAction",
|
|
@@ -627,7 +627,7 @@ describe("message-conversion", () => {
|
|
|
627
627
|
role: gql.Role.assistant,
|
|
628
628
|
});
|
|
629
629
|
|
|
630
|
-
const mockRender =
|
|
630
|
+
const mockRender = jest.fn();
|
|
631
631
|
const coAgentStateRenders = {
|
|
632
632
|
testAgent: {
|
|
633
633
|
name: "testAgent",
|
|
@@ -740,7 +740,7 @@ describe("message-conversion", () => {
|
|
|
740
740
|
role: gql.Role.assistant,
|
|
741
741
|
});
|
|
742
742
|
|
|
743
|
-
const mockRender =
|
|
743
|
+
const mockRender = jest.fn();
|
|
744
744
|
const coAgentStateRenders = {
|
|
745
745
|
testAgent: {
|
|
746
746
|
name: "testAgent",
|
|
@@ -853,7 +853,7 @@ describe("message-conversion", () => {
|
|
|
853
853
|
const actions = {
|
|
854
854
|
testAction: {
|
|
855
855
|
name: "testAction",
|
|
856
|
-
render:
|
|
856
|
+
render: jest.fn((props) => `Rendered: ${props.args.test}`),
|
|
857
857
|
},
|
|
858
858
|
};
|
|
859
859
|
|
|
@@ -889,7 +889,7 @@ describe("message-conversion", () => {
|
|
|
889
889
|
const actions = {
|
|
890
890
|
"*": {
|
|
891
891
|
name: "*",
|
|
892
|
-
render:
|
|
892
|
+
render: jest.fn((props) => `Wildcard rendered: ${props.args.test}`),
|
|
893
893
|
},
|
|
894
894
|
};
|
|
895
895
|
|
|
@@ -922,7 +922,7 @@ describe("message-conversion", () => {
|
|
|
922
922
|
});
|
|
923
923
|
|
|
924
924
|
test("should pass tool name to wildcard action render function", () => {
|
|
925
|
-
const mockRender =
|
|
925
|
+
const mockRender = jest.fn(
|
|
926
926
|
(props) => `Wildcard rendered: ${props.name} with args: ${JSON.stringify(props.args)}`,
|
|
927
927
|
);
|
|
928
928
|
const actions = {
|
|
@@ -954,7 +954,9 @@ describe("message-conversion", () => {
|
|
|
954
954
|
});
|
|
955
955
|
|
|
956
956
|
test("should pass tool name to regular action render function", () => {
|
|
957
|
-
const mockRender =
|
|
957
|
+
const mockRender = jest.fn(
|
|
958
|
+
(props) => `Regular action rendered: ${JSON.stringify(props.args)}`,
|
|
959
|
+
);
|
|
958
960
|
const actions = {
|
|
959
961
|
testAction: {
|
|
960
962
|
name: "testAction",
|
|
@@ -992,11 +994,11 @@ describe("message-conversion", () => {
|
|
|
992
994
|
const actions = {
|
|
993
995
|
specificAction: {
|
|
994
996
|
name: "specificAction",
|
|
995
|
-
render:
|
|
997
|
+
render: jest.fn((props) => "Specific action rendered"),
|
|
996
998
|
},
|
|
997
999
|
"*": {
|
|
998
1000
|
name: "*",
|
|
999
|
-
render:
|
|
1001
|
+
render: jest.fn((props) => "Wildcard action rendered"),
|
|
1000
1002
|
},
|
|
1001
1003
|
};
|
|
1002
1004
|
|
|
@@ -1032,7 +1034,7 @@ describe("message-conversion", () => {
|
|
|
1032
1034
|
const actions = {
|
|
1033
1035
|
otherAction: {
|
|
1034
1036
|
name: "otherAction",
|
|
1035
|
-
render:
|
|
1037
|
+
render: jest.fn(),
|
|
1036
1038
|
},
|
|
1037
1039
|
};
|
|
1038
1040
|
|
|
@@ -1095,7 +1097,7 @@ describe("message-conversion", () => {
|
|
|
1095
1097
|
const actions = {
|
|
1096
1098
|
"*": {
|
|
1097
1099
|
name: "*",
|
|
1098
|
-
render:
|
|
1100
|
+
render: jest.fn((props) => `Result: ${props.result}`),
|
|
1099
1101
|
},
|
|
1100
1102
|
};
|
|
1101
1103
|
|
|
@@ -1133,7 +1135,7 @@ describe("message-conversion", () => {
|
|
|
1133
1135
|
const actions = {
|
|
1134
1136
|
"*": {
|
|
1135
1137
|
name: "*",
|
|
1136
|
-
render:
|
|
1138
|
+
render: jest.fn((props) => `Status: ${props.status}`),
|
|
1137
1139
|
},
|
|
1138
1140
|
};
|
|
1139
1141
|
|
|
@@ -1170,7 +1172,7 @@ describe("message-conversion", () => {
|
|
|
1170
1172
|
const actions = {
|
|
1171
1173
|
"*": {
|
|
1172
1174
|
name: "*",
|
|
1173
|
-
render:
|
|
1175
|
+
render: jest.fn((props) => `Status: ${props.status}`),
|
|
1174
1176
|
},
|
|
1175
1177
|
};
|
|
1176
1178
|
|
|
@@ -1207,7 +1209,7 @@ describe("message-conversion", () => {
|
|
|
1207
1209
|
const actions = {
|
|
1208
1210
|
"*": {
|
|
1209
1211
|
name: "*",
|
|
1210
|
-
render:
|
|
1212
|
+
render: jest.fn((props) => `Status: ${props.status}`),
|
|
1211
1213
|
},
|
|
1212
1214
|
};
|
|
1213
1215
|
|
|
@@ -1244,7 +1246,7 @@ describe("message-conversion", () => {
|
|
|
1244
1246
|
const actions = {
|
|
1245
1247
|
"*": {
|
|
1246
1248
|
name: "*",
|
|
1247
|
-
render:
|
|
1249
|
+
render: jest.fn((props) => `Status: ${props.status}`),
|
|
1248
1250
|
},
|
|
1249
1251
|
};
|
|
1250
1252
|
|
|
@@ -1281,7 +1283,7 @@ describe("message-conversion", () => {
|
|
|
1281
1283
|
const actions = {
|
|
1282
1284
|
"*": {
|
|
1283
1285
|
name: "*",
|
|
1284
|
-
render:
|
|
1286
|
+
render: jest.fn((props) => `Args: ${JSON.stringify(props.args)}`),
|
|
1285
1287
|
},
|
|
1286
1288
|
};
|
|
1287
1289
|
|
|
@@ -1317,7 +1319,7 @@ describe("message-conversion", () => {
|
|
|
1317
1319
|
const actions = {
|
|
1318
1320
|
"*": {
|
|
1319
1321
|
name: "*",
|
|
1320
|
-
render:
|
|
1322
|
+
render: jest.fn((props) => `Args: ${JSON.stringify(props.args)}`),
|
|
1321
1323
|
},
|
|
1322
1324
|
};
|
|
1323
1325
|
|
|
@@ -1353,7 +1355,7 @@ describe("message-conversion", () => {
|
|
|
1353
1355
|
const actions = {
|
|
1354
1356
|
"*": {
|
|
1355
1357
|
name: "*",
|
|
1356
|
-
render:
|
|
1358
|
+
render: jest.fn((props) => `Complex: ${JSON.stringify(props.args)}`),
|
|
1357
1359
|
},
|
|
1358
1360
|
};
|
|
1359
1361
|
|
|
@@ -1401,11 +1403,11 @@ describe("message-conversion", () => {
|
|
|
1401
1403
|
const actions = {
|
|
1402
1404
|
wildcard1: {
|
|
1403
1405
|
name: "*",
|
|
1404
|
-
render:
|
|
1406
|
+
render: jest.fn((props) => "First wildcard"),
|
|
1405
1407
|
},
|
|
1406
1408
|
wildcard2: {
|
|
1407
1409
|
name: "*",
|
|
1408
|
-
render:
|
|
1410
|
+
render: jest.fn((props) => "Second wildcard"),
|
|
1409
1411
|
},
|
|
1410
1412
|
};
|
|
1411
1413
|
|
|
@@ -1441,7 +1443,7 @@ describe("message-conversion", () => {
|
|
|
1441
1443
|
const actions = {
|
|
1442
1444
|
"*": {
|
|
1443
1445
|
name: "*",
|
|
1444
|
-
render:
|
|
1446
|
+
render: jest.fn((props) => `Result: ${JSON.stringify(props.result)}`),
|
|
1445
1447
|
},
|
|
1446
1448
|
};
|
|
1447
1449
|
|
|
@@ -1478,7 +1480,7 @@ describe("message-conversion", () => {
|
|
|
1478
1480
|
const actions = {
|
|
1479
1481
|
"*": {
|
|
1480
1482
|
name: "*",
|
|
1481
|
-
render:
|
|
1483
|
+
render: jest.fn((props) => `Result: ${JSON.stringify(props.result)}`),
|
|
1482
1484
|
},
|
|
1483
1485
|
};
|
|
1484
1486
|
|
|
@@ -1515,7 +1517,7 @@ describe("message-conversion", () => {
|
|
|
1515
1517
|
const actions = {
|
|
1516
1518
|
"*": {
|
|
1517
1519
|
name: "*",
|
|
1518
|
-
render:
|
|
1520
|
+
render: jest.fn((props) => `Result: ${JSON.stringify(props.result)}`),
|
|
1519
1521
|
},
|
|
1520
1522
|
};
|
|
1521
1523
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, test, expect
|
|
1
|
+
import { describe, test, expect } from "@jest/globals";
|
|
2
2
|
import * as gql from "../types/converted/index";
|
|
3
3
|
import agui from "@copilotkit/shared";
|
|
4
4
|
import { aguiToGQL } from "./agui-to-gql";
|
|
@@ -131,7 +131,7 @@ describe("roundtrip message conversion", () => {
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
test("action execution with render function roundtrip", () => {
|
|
134
|
-
const mockRender =
|
|
134
|
+
const mockRender = jest.fn();
|
|
135
135
|
const aguiMsg: agui.Message = {
|
|
136
136
|
id: "assistant-1",
|
|
137
137
|
role: "assistant",
|
|
@@ -211,7 +211,7 @@ describe("roundtrip message conversion", () => {
|
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
test("wild card action roundtrip conversion", () => {
|
|
214
|
-
const mockRender =
|
|
214
|
+
const mockRender = jest.fn((props) => `Wildcard rendered: ${props.args.test}`);
|
|
215
215
|
const aguiMsg: agui.Message = {
|
|
216
216
|
id: "assistant-wildcard-1",
|
|
217
217
|
role: "assistant",
|
|
@@ -256,7 +256,7 @@ describe("roundtrip message conversion", () => {
|
|
|
256
256
|
});
|
|
257
257
|
|
|
258
258
|
test("wild card action with specific action priority roundtrip", () => {
|
|
259
|
-
const mockRender =
|
|
259
|
+
const mockRender = jest.fn((props) => `Specific action rendered: ${props.args.test}`);
|
|
260
260
|
const aguiMsg: agui.Message = {
|
|
261
261
|
id: "assistant-priority-1",
|
|
262
262
|
role: "assistant",
|
|
@@ -313,7 +313,7 @@ describe("roundtrip message conversion", () => {
|
|
|
313
313
|
const actions: Record<string, any> = {
|
|
314
314
|
"*": {
|
|
315
315
|
name: "*",
|
|
316
|
-
render:
|
|
316
|
+
render: jest.fn((props) => `GQL wildcard rendered: ${props.args.test}`),
|
|
317
317
|
},
|
|
318
318
|
};
|
|
319
319
|
|
|
@@ -379,7 +379,7 @@ describe("roundtrip message conversion", () => {
|
|
|
379
379
|
});
|
|
380
380
|
|
|
381
381
|
test("roundtrip conversion with action execution and result parsing", () => {
|
|
382
|
-
const mockRender =
|
|
382
|
+
const mockRender = jest.fn((props) => `Rendered: ${JSON.stringify(props.result)}`);
|
|
383
383
|
|
|
384
384
|
// Create action execution message
|
|
385
385
|
const actionExecMsg = new gql.ActionExecutionMessage({
|
|
@@ -439,7 +439,7 @@ describe("roundtrip message conversion", () => {
|
|
|
439
439
|
});
|
|
440
440
|
|
|
441
441
|
test("roundtrip conversion verifies correct property distribution for regular actions", () => {
|
|
442
|
-
const mockRender =
|
|
442
|
+
const mockRender = jest.fn((props) => `Regular action: ${JSON.stringify(props.args)}`);
|
|
443
443
|
|
|
444
444
|
const actionExecMsg = new gql.ActionExecutionMessage({
|
|
445
445
|
id: "regular-action-test",
|
|
@@ -481,7 +481,7 @@ describe("roundtrip message conversion", () => {
|
|
|
481
481
|
});
|
|
482
482
|
|
|
483
483
|
test("roundtrip conversion verifies correct property distribution for wildcard actions", () => {
|
|
484
|
-
const mockRender =
|
|
484
|
+
const mockRender = jest.fn(
|
|
485
485
|
(props) => `Wildcard action: ${props.name} with ${JSON.stringify(props.args)}`,
|
|
486
486
|
);
|
|
487
487
|
|
|
@@ -24,7 +24,9 @@ export function copilotRuntimeNextJSAppRouterEndpoint(options: CreateCopilotRunt
|
|
|
24
24
|
logger.debug("Creating NextJS App Router endpoint");
|
|
25
25
|
|
|
26
26
|
const serviceAdapter = options.serviceAdapter;
|
|
27
|
-
|
|
27
|
+
if (serviceAdapter) {
|
|
28
|
+
options.runtime.handleServiceAdapter(serviceAdapter);
|
|
29
|
+
}
|
|
28
30
|
|
|
29
31
|
const copilotRoute = createCopilotEndpointSingleRoute({
|
|
30
32
|
runtime: options.runtime.instance,
|
|
@@ -55,7 +55,9 @@ export function copilotRuntimeNodeHttpEndpoint(options: CreateCopilotRuntimeServ
|
|
|
55
55
|
logger.debug("Creating Node HTTP endpoint");
|
|
56
56
|
|
|
57
57
|
const serviceAdapter = options.serviceAdapter;
|
|
58
|
-
|
|
58
|
+
if (serviceAdapter) {
|
|
59
|
+
options.runtime.handleServiceAdapter(serviceAdapter);
|
|
60
|
+
}
|
|
59
61
|
|
|
60
62
|
const honoApp = createCopilotEndpointSingleRoute({
|
|
61
63
|
runtime: options.runtime.instance,
|
|
@@ -34,8 +34,8 @@ export type GraphQLContext = YogaInitialContext & {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export interface CreateCopilotRuntimeServerOptions {
|
|
37
|
-
runtime: CopilotRuntime
|
|
38
|
-
serviceAdapter
|
|
37
|
+
runtime: CopilotRuntime<any>;
|
|
38
|
+
serviceAdapter?: CopilotServiceAdapter;
|
|
39
39
|
endpoint: string;
|
|
40
40
|
baseUrl?: string;
|
|
41
41
|
cloud?: CopilotCloudOptions;
|
|
@@ -312,8 +312,8 @@ interface CopilotRuntimeConstructorParams<T extends Parameter[] | [] = []>
|
|
|
312
312
|
/**
|
|
313
313
|
* Central runtime object passed to all request handlers.
|
|
314
314
|
*/
|
|
315
|
-
export class CopilotRuntime {
|
|
316
|
-
params?: CopilotRuntimeConstructorParams
|
|
315
|
+
export class CopilotRuntime<const T extends Parameter[] | [] = []> {
|
|
316
|
+
params?: CopilotRuntimeConstructorParams<T>;
|
|
317
317
|
private observability?: CopilotObservabilityConfig;
|
|
318
318
|
// Cache MCP tools per endpoint to avoid re-fetching repeatedly
|
|
319
319
|
private mcpToolsCache: Map<string, BasicAgentConfiguration["tools"]> = new Map();
|
|
@@ -321,7 +321,7 @@ export class CopilotRuntime {
|
|
|
321
321
|
private _instance: CopilotRuntimeVNext;
|
|
322
322
|
|
|
323
323
|
constructor(
|
|
324
|
-
params?: CopilotRuntimeConstructorParams & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
324
|
+
params?: CopilotRuntimeConstructorParams<T> & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
325
325
|
) {
|
|
326
326
|
const agents = params?.agents ?? {};
|
|
327
327
|
this.runtimeArgs = {
|
|
@@ -345,7 +345,9 @@ export class CopilotRuntime {
|
|
|
345
345
|
return this._instance;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
private assignEndpointsToAgents(
|
|
348
|
+
private assignEndpointsToAgents(
|
|
349
|
+
endpoints: CopilotRuntimeConstructorParams<T>["remoteEndpoints"],
|
|
350
|
+
) {
|
|
349
351
|
return endpoints.reduce((acc, endpoint) => {
|
|
350
352
|
if (resolveEndpointType(endpoint) == EndpointType.LangGraphPlatform) {
|
|
351
353
|
let lgAgents = {};
|
|
@@ -393,7 +395,7 @@ export class CopilotRuntime {
|
|
|
393
395
|
});
|
|
394
396
|
}
|
|
395
397
|
|
|
396
|
-
if (this.params.actions
|
|
398
|
+
if (this.params.actions) {
|
|
397
399
|
const mcpTools = await this.getToolsFromMCP();
|
|
398
400
|
agentsList = this.assignToolsToAgents(agents, [
|
|
399
401
|
...this.getToolsFromActions(this.params.actions),
|
|
@@ -454,7 +456,7 @@ export class CopilotRuntime {
|
|
|
454
456
|
}
|
|
455
457
|
|
|
456
458
|
private createOnBeforeRequestHandler(
|
|
457
|
-
params?: CopilotRuntimeConstructorParams & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
459
|
+
params?: CopilotRuntimeConstructorParams<T> & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
458
460
|
) {
|
|
459
461
|
return async (hookParams: BeforeRequestMiddlewareFnParameters[0]) => {
|
|
460
462
|
// TODO: get public api key and run with expected data
|
|
@@ -492,7 +494,7 @@ export class CopilotRuntime {
|
|
|
492
494
|
}
|
|
493
495
|
|
|
494
496
|
private createOnAfterRequestHandler(
|
|
495
|
-
params?: CopilotRuntimeConstructorParams & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
497
|
+
params?: CopilotRuntimeConstructorParams<T> & PartialBy<CopilotRuntimeOptions, "agents">,
|
|
496
498
|
) {
|
|
497
499
|
return async (hookParams: AfterRequestMiddlewareFnParameters[0]) => {
|
|
498
500
|
// TODO: get public api key and run with expected data
|