@copilotkitnext/runtime 0.0.2 → 0.0.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/dist/index.js +1 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/.turbo/turbo-build.log +0 -23
- package/.turbo/turbo-check-types.log +0 -4
- package/.turbo/turbo-lint.log +0 -56
- package/.turbo/turbo-test$colon$coverage.log +0 -149
- package/.turbo/turbo-test.log +0 -107
- package/src/__tests__/get-runtime-info.test.ts +0 -117
- package/src/__tests__/handle-run.test.ts +0 -69
- package/src/__tests__/handle-transcribe.test.ts +0 -289
- package/src/__tests__/in-process-agent-runner-messages.test.ts +0 -599
- package/src/__tests__/in-process-agent-runner.test.ts +0 -726
- package/src/__tests__/middleware.test.ts +0 -432
- package/src/__tests__/routing.test.ts +0 -257
- package/src/endpoint.ts +0 -150
- package/src/handler.ts +0 -3
- package/src/handlers/get-runtime-info.ts +0 -50
- package/src/handlers/handle-connect.ts +0 -144
- package/src/handlers/handle-run.ts +0 -156
- package/src/handlers/handle-transcribe.ts +0 -126
- package/src/index.ts +0 -8
- package/src/middleware.ts +0 -232
- package/src/runner/__tests__/enterprise-runner.test.ts +0 -992
- package/src/runner/__tests__/event-compaction.test.ts +0 -253
- package/src/runner/__tests__/in-memory-runner.test.ts +0 -483
- package/src/runner/__tests__/sqlite-runner.test.ts +0 -975
- package/src/runner/agent-runner.ts +0 -27
- package/src/runner/enterprise.ts +0 -653
- package/src/runner/event-compaction.ts +0 -250
- package/src/runner/in-memory.ts +0 -341
- package/src/runner/index.ts +0 -0
- package/src/runner/sqlite.ts +0 -481
- package/src/runtime.ts +0 -53
- package/src/transcription-service/transcription-service-openai.ts +0 -29
- package/src/transcription-service/transcription-service.ts +0 -11
- package/tsconfig.json +0 -13
- package/tsup.config.ts +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkitnext/runtime",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Server-side runtime package for CopilotKit2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"tsup": "^8.5.0",
|
|
25
25
|
"typescript": "5.8.2",
|
|
26
26
|
"vitest": "^3.0.5",
|
|
27
|
-
"@copilotkitnext/
|
|
28
|
-
"@copilotkitnext/
|
|
27
|
+
"@copilotkitnext/typescript-config": "0.0.0",
|
|
28
|
+
"@copilotkitnext/eslint-config": "0.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@ag-ui/client": "0.0.36-alpha.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"ioredis": "^5.7.0",
|
|
36
36
|
"kysely": "^0.28.5",
|
|
37
37
|
"rxjs": "7.8.1",
|
|
38
|
-
"@copilotkitnext/shared": "0.0.
|
|
38
|
+
"@copilotkitnext/shared": "0.0.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"better-sqlite3": "^12.2.0",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @copilotkitnext/runtime@0.0.1 build /Users/mme/Code/vnext_experimental/packages/runtime
|
|
4
|
-
> tsup
|
|
5
|
-
|
|
6
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
-
[34mCLI[39m tsup v8.5.0
|
|
9
|
-
[34mCLI[39m Using tsup config: /Users/mme/Code/vnext_experimental/packages/runtime/tsup.config.ts
|
|
10
|
-
[34mCLI[39m Target: es2022
|
|
11
|
-
[34mCLI[39m Cleaning output folder
|
|
12
|
-
[34mCJS[39m Build start
|
|
13
|
-
[34mESM[39m Build start
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m56.01 KB[39m
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m117.94 KB[39m
|
|
16
|
-
[32mESM[39m ⚡️ Build success in 18ms
|
|
17
|
-
[32mCJS[39m [1mdist/index.js [22m[32m58.53 KB[39m
|
|
18
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m118.22 KB[39m
|
|
19
|
-
[32mCJS[39m ⚡️ Build success in 18ms
|
|
20
|
-
DTS Build start
|
|
21
|
-
DTS ⚡️ Build success in 1717ms
|
|
22
|
-
DTS dist/index.d.ts 7.96 KB
|
|
23
|
-
DTS dist/index.d.mts 7.96 KB
|
package/.turbo/turbo-lint.log
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @copilotkit/runtime@0.0.0 lint /Users/mme/Code/CopilotKit2/packages/runtime
|
|
3
|
-
> eslint . --max-warnings 0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/Users/mme/Code/CopilotKit2/packages/runtime/src/__tests__/in-process-agent-runner-messages.test.ts
|
|
7
|
-
35:17 warning 'input' is defined but never used @typescript-eslint/no-unused-vars
|
|
8
|
-
46:5 warning Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer @typescript-eslint/ban-ts-comment
|
|
9
|
-
|
|
10
|
-
/Users/mme/Code/CopilotKit2/packages/runtime/src/runner/__tests__/event-compaction.test.ts
|
|
11
|
-
21:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
12
|
-
41:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
13
|
-
45:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
14
|
-
47:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
15
|
-
66:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
16
|
-
68:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
17
|
-
72:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
18
|
-
74:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
19
|
-
90:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
20
|
-
117:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
21
|
-
137:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
22
|
-
157:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
23
|
-
161:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
24
|
-
163:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
25
|
-
182:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
26
|
-
184:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
27
|
-
188:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
28
|
-
190:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
29
|
-
206:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
30
|
-
221:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
31
|
-
244:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
32
|
-
249:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
33
|
-
|
|
34
|
-
/Users/mme/Code/CopilotKit2/packages/runtime/src/runner/event-compaction.ts
|
|
35
|
-
129:19 warning 'messageId' is assigned a value but never used @typescript-eslint/no-unused-vars
|
|
36
|
-
140:21 warning 'toolCallId' is assigned a value but never used @typescript-eslint/no-unused-vars
|
|
37
|
-
|
|
38
|
-
/Users/mme/Code/CopilotKit2/packages/runtime/src/runner/in-memory.ts
|
|
39
|
-
8:10 warning 'EMPTY' is defined but never used @typescript-eslint/no-unused-vars
|
|
40
|
-
99:31 warning 'args' is defined but never used @typescript-eslint/no-unused-vars
|
|
41
|
-
121:16 warning 'error' is defined but never used @typescript-eslint/no-unused-vars
|
|
42
|
-
|
|
43
|
-
/Users/mme/Code/CopilotKit2/packages/runtime/src/runner/sqlite.ts
|
|
44
|
-
8:10 warning 'EMPTY' is defined but never used @typescript-eslint/no-unused-vars
|
|
45
|
-
60:15 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
46
|
-
68:41 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
47
|
-
71:24 warning A `require()` style import is forbidden @typescript-eslint/no-require-imports
|
|
48
|
-
73:14 warning 'e' is defined but never used @typescript-eslint/no-unused-vars
|
|
49
|
-
164:50 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
50
|
-
232:31 warning 'args' is defined but never used @typescript-eslint/no-unused-vars
|
|
51
|
-
254:16 warning 'error' is defined but never used @typescript-eslint/no-unused-vars
|
|
52
|
-
|
|
53
|
-
✖ 37 problems (0 errors, 37 warnings)
|
|
54
|
-
|
|
55
|
-
ESLint found too many warnings (maximum: 0).
|
|
56
|
-
ELIFECYCLE Command failed with exit code 1.
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @copilotkit/runtime@0.0.0 test:coverage /Users/mme/Code/CopilotKit2/packages/runtime
|
|
4
|
-
> jest --coverage
|
|
5
|
-
|
|
6
|
-
[1m[2mDetermining test suites to run...[22m[22m[999D[K
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
10
|
-
|
|
11
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
12
|
-
|
|
13
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
14
|
-
|
|
15
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
16
|
-
|
|
17
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
18
|
-
|
|
19
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
20
|
-
|
|
21
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
22
|
-
|
|
23
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
24
|
-
|
|
25
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
26
|
-
|
|
27
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
28
|
-
|
|
29
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
30
|
-
|
|
31
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
32
|
-
|
|
33
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
34
|
-
|
|
35
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
36
|
-
|
|
37
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
38
|
-
|
|
39
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
40
|
-
|
|
41
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
42
|
-
|
|
43
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
44
|
-
|
|
45
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
46
|
-
|
|
47
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
48
|
-
|
|
49
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2msrc/__tests__/[22m[1mendpoint.test.ts[22m
|
|
131
|
-
|
|
132
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
133
|
-
----------------|---------|----------|---------|---------|-------------------
|
|
134
|
-
[31;1mAll files [0m | [31;1m 43.47[0m | [33;1m 52.17[0m | [31;1m 15.38[0m | [31;1m 43.47[0m | [31;1m [0m
|
|
135
|
-
[31;1m src [0m | [31;1m 46.42[0m | [33;1m 57.14[0m | [31;1m 22.22[0m | [31;1m 46.42[0m | [31;1m [0m
|
|
136
|
-
[31;1m endpoint.ts [0m | [31;1m 38.63[0m | [31;1m 36.36[0m | [31;1m 14.28[0m | [31;1m 38.63[0m | [31;1m10-40,85-131 [0m
|
|
137
|
-
[32;1m handler.ts [0m | [32;1m 100[0m | [32;1m 100[0m | [32;1m 100[0m | [32;1m 100[0m | [33;1m [0m
|
|
138
|
-
[32;1m logger.ts [0m | [32;1m 100[0m | [33;1m 75[0m | [32;1m 100[0m | [32;1m 100[0m | [33;1m12-16 [0m
|
|
139
|
-
[33;1m runtime.ts [0m | [33;1m 50[0m | [32;1m 100[0m | [31;1m 0[0m | [33;1m 50[0m | [31;1m44-46 [0m
|
|
140
|
-
[31;1m src/handlers [0m | [31;1m 30.76[0m | [31;1m 0[0m | [31;1m 0[0m | [31;1m 30.76[0m | [31;1m [0m
|
|
141
|
-
[31;1m get-agents.ts[0m | [31;1m 12.5[0m | [31;1m 0[0m | [31;1m 0[0m | [31;1m 12.5[0m | [31;1m10-34 [0m
|
|
142
|
-
[33;1m get-info.ts [0m | [33;1m 66.66[0m | [32;1m 100[0m | [31;1m 0[0m | [33;1m 66.66[0m | [31;1m10 [0m
|
|
143
|
-
[33;1m handle-run.ts[0m | [33;1m 50[0m | [32;1m 100[0m | [31;1m 0[0m | [33;1m 50[0m | [31;1m14 [0m
|
|
144
|
-
----------------|---------|----------|---------|---------|-------------------
|
|
145
|
-
[1mTest Suites: [22m[1m[32m1 passed[39m[22m, 1 total
|
|
146
|
-
[1mTests: [22m[1m[32m20 passed[39m[22m, 20 total
|
|
147
|
-
[1mSnapshots: [22m0 total
|
|
148
|
-
[1mTime:[22m 0.556 s, estimated 1 s
|
|
149
|
-
[2mRan all test suites[22m[2m.[22m
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @copilotkitnext/runtime@0.0.0 test /Users/mme/Code/CopilotKit2/packages/runtime
|
|
3
|
-
> vitest run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v3.2.4 /Users/mme/Code/CopilotKit2/packages/runtime
|
|
7
|
-
|
|
8
|
-
✓ src/__tests__/handle-transcribe.test.ts (12 tests) 36ms
|
|
9
|
-
stderr | src/__tests__/handle-run.test.ts > handleRunAgent > should return 500 when runtime.agents throws an error
|
|
10
|
-
Error running agent: Error: Database connection failed
|
|
11
|
-
at [90m/Users/mme/Code/CopilotKit2/packages/runtime/[39msrc/__tests__/handle-run.test.ts:46:30
|
|
12
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:155:11
|
|
13
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:752:26
|
|
14
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:1897:20
|
|
15
|
-
at new Promise (<anonymous>)
|
|
16
|
-
at runWithTimeout (file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:1863:10)
|
|
17
|
-
at runTest (file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:1574:12)
|
|
18
|
-
[90m at processTicksAndRejections (node:internal/process/task_queues:95:5)[39m
|
|
19
|
-
at runSuite (file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:1729:8)
|
|
20
|
-
at runSuite (file:///Users/mme/Code/CopilotKit2/node_modules/[4m.pnpm[24m/@vitest+runner@3.2.4/node_modules/[4m@vitest[24m/runner/dist/chunk-hooks.js:1729:8)
|
|
21
|
-
Error stack: Error: Database connection failed
|
|
22
|
-
at /Users/mme/Code/CopilotKit2/packages/runtime/src/__tests__/handle-run.test.ts:46:30
|
|
23
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:155:11
|
|
24
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:752:26
|
|
25
|
-
at file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1897:20
|
|
26
|
-
at new Promise (<anonymous>)
|
|
27
|
-
at runWithTimeout (file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1863:10)
|
|
28
|
-
at runTest (file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1574:12)
|
|
29
|
-
at processTicksAndRejections (node:internal/process/task_queues:95:5)
|
|
30
|
-
at runSuite (file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1729:8)
|
|
31
|
-
at runSuite (file:///Users/mme/Code/CopilotKit2/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1729:8)
|
|
32
|
-
Error details: {
|
|
33
|
-
name: [32m'Error'[39m,
|
|
34
|
-
message: [32m'Database connection failed'[39m,
|
|
35
|
-
cause: [90mundefined[39m
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
✓ src/runner/__tests__/in-memory-runner.test.ts (7 tests) 8ms
|
|
39
|
-
✓ src/__tests__/in-process-agent-runner-messages.test.ts (7 tests) 8ms
|
|
40
|
-
✓ src/__tests__/handle-run.test.ts (2 tests) 16ms
|
|
41
|
-
✓ src/__tests__/routing.test.ts (21 tests) 39ms
|
|
42
|
-
✓ src/runner/__tests__/sqlite-runner.test.ts (19 tests) 201ms
|
|
43
|
-
✓ src/__tests__/in-process-agent-runner.test.ts (18 tests) 749ms
|
|
44
|
-
✓ src/runner/__tests__/event-compaction.test.ts (12 tests) 28ms
|
|
45
|
-
✓ src/__tests__/get-runtime-info.test.ts (4 tests) 8ms
|
|
46
|
-
stderr | src/__tests__/middleware.test.ts > CopilotEndpoint middleware > handles webhook middleware timeout
|
|
47
|
-
{
|
|
48
|
-
err: Response {
|
|
49
|
-
status: [33m502[39m,
|
|
50
|
-
statusText: [32m''[39m,
|
|
51
|
-
headers: Headers {},
|
|
52
|
-
body: [1mnull[22m,
|
|
53
|
-
bodyUsed: [33mfalse[39m,
|
|
54
|
-
ok: [33mfalse[39m,
|
|
55
|
-
redirected: [33mfalse[39m,
|
|
56
|
-
type: [32m'default'[39m,
|
|
57
|
-
url: [32m''[39m
|
|
58
|
-
},
|
|
59
|
-
url: [32m'https://example.com/info'[39m,
|
|
60
|
-
path: [32m'/info'[39m
|
|
61
|
-
} Error running before request middleware
|
|
62
|
-
|
|
63
|
-
stderr | src/__tests__/middleware.test.ts > CopilotEndpoint middleware > handles webhook middleware error responses
|
|
64
|
-
{
|
|
65
|
-
err: Response {
|
|
66
|
-
status: [33m400[39m,
|
|
67
|
-
statusText: [32m''[39m,
|
|
68
|
-
headers: Headers { [32m'content-type'[39m: [32m'text/plain;charset=UTF-8'[39m },
|
|
69
|
-
body: ReadableStream { locked: [33mfalse[39m, state: [32m'readable'[39m, supportsBYOB: [33mtrue[39m },
|
|
70
|
-
bodyUsed: [33mfalse[39m,
|
|
71
|
-
ok: [33mfalse[39m,
|
|
72
|
-
redirected: [33mfalse[39m,
|
|
73
|
-
type: [32m'default'[39m,
|
|
74
|
-
url: [32m''[39m
|
|
75
|
-
},
|
|
76
|
-
url: [32m'https://example.com/info'[39m,
|
|
77
|
-
path: [32m'/info'[39m
|
|
78
|
-
} Error running before request middleware
|
|
79
|
-
|
|
80
|
-
stderr | src/__tests__/middleware.test.ts > CopilotEndpoint middleware > handles webhook middleware server error
|
|
81
|
-
{
|
|
82
|
-
err: Response {
|
|
83
|
-
status: [33m502[39m,
|
|
84
|
-
statusText: [32m''[39m,
|
|
85
|
-
headers: Headers {},
|
|
86
|
-
body: [1mnull[22m,
|
|
87
|
-
bodyUsed: [33mfalse[39m,
|
|
88
|
-
ok: [33mfalse[39m,
|
|
89
|
-
redirected: [33mfalse[39m,
|
|
90
|
-
type: [32m'default'[39m,
|
|
91
|
-
url: [32m''[39m
|
|
92
|
-
},
|
|
93
|
-
url: [32m'https://example.com/info'[39m,
|
|
94
|
-
path: [32m'/info'[39m
|
|
95
|
-
} Error running before request middleware
|
|
96
|
-
|
|
97
|
-
✓ src/__tests__/middleware.test.ts (11 tests) 2378ms
|
|
98
|
-
✓ CopilotEndpoint middleware > handles webhook middleware timeout 2003ms
|
|
99
|
-
✓ src/runner/__tests__/enterprise-runner.test.ts (20 tests) 3206ms
|
|
100
|
-
✓ EnterpriseAgentRunner > should prevent concurrent runs on same thread 630ms
|
|
101
|
-
✓ EnterpriseAgentRunner > should track running state correctly 303ms
|
|
102
|
-
|
|
103
|
-
Test Files 11 passed (11)
|
|
104
|
-
Tests 133 passed (133)
|
|
105
|
-
Start at 10:38:14
|
|
106
|
-
Duration 4.92s (transform 1.12s, setup 0ms, collect 6.01s, tests 6.68s, environment 1ms, prepare 2.04s)
|
|
107
|
-
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { handleGetRuntimeInfo } from "../handlers/get-runtime-info";
|
|
2
|
-
import { CopilotRuntime } from "../runtime";
|
|
3
|
-
import { TranscriptionService } from "../transcription-service/transcription-service";
|
|
4
|
-
import { describe, it, expect } from "vitest";
|
|
5
|
-
import type { AbstractAgent } from "@ag-ui/client";
|
|
6
|
-
|
|
7
|
-
// Mock transcription service
|
|
8
|
-
class MockTranscriptionService extends TranscriptionService {
|
|
9
|
-
async transcribeFile(): Promise<string> {
|
|
10
|
-
return "Mock transcription result";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe("handleGetRuntimeInfo", () => {
|
|
15
|
-
const mockRequest = new Request("https://example.com/info");
|
|
16
|
-
|
|
17
|
-
it("should return runtime info with audioFileTranscriptionEnabled=false when no transcription service", async () => {
|
|
18
|
-
const runtime = new CopilotRuntime({
|
|
19
|
-
agents: {},
|
|
20
|
-
// No transcriptionService provided
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const response = await handleGetRuntimeInfo({
|
|
24
|
-
runtime,
|
|
25
|
-
request: mockRequest,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
expect(response.status).toBe(200);
|
|
29
|
-
|
|
30
|
-
const data = await response.json();
|
|
31
|
-
expect(data).toEqual({
|
|
32
|
-
version: expect.any(String),
|
|
33
|
-
agents: {},
|
|
34
|
-
audioFileTranscriptionEnabled: false,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should return runtime info with audioFileTranscriptionEnabled=true when transcription service is configured", async () => {
|
|
39
|
-
const mockTranscriptionService = new MockTranscriptionService();
|
|
40
|
-
const runtime = new CopilotRuntime({
|
|
41
|
-
agents: {},
|
|
42
|
-
transcriptionService: mockTranscriptionService,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const response = await handleGetRuntimeInfo({
|
|
46
|
-
runtime,
|
|
47
|
-
request: mockRequest,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
expect(response.status).toBe(200);
|
|
51
|
-
|
|
52
|
-
const data = await response.json();
|
|
53
|
-
expect(data).toEqual({
|
|
54
|
-
version: expect.any(String),
|
|
55
|
-
agents: {},
|
|
56
|
-
audioFileTranscriptionEnabled: true,
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should include agents information along with audioFileTranscriptionEnabled", async () => {
|
|
61
|
-
const mockAgent = {
|
|
62
|
-
description: "Test agent description",
|
|
63
|
-
constructor: { name: "TestAgent" },
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const runtime = new CopilotRuntime({
|
|
67
|
-
agents: {
|
|
68
|
-
testAgent: mockAgent as AbstractAgent,
|
|
69
|
-
},
|
|
70
|
-
transcriptionService: new MockTranscriptionService(),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const response = await handleGetRuntimeInfo({
|
|
74
|
-
runtime,
|
|
75
|
-
request: mockRequest,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
expect(response.status).toBe(200);
|
|
79
|
-
|
|
80
|
-
const data = await response.json();
|
|
81
|
-
expect(data).toEqual({
|
|
82
|
-
version: expect.any(String),
|
|
83
|
-
agents: {
|
|
84
|
-
testAgent: {
|
|
85
|
-
name: "testAgent",
|
|
86
|
-
description: "Test agent description",
|
|
87
|
-
className: "TestAgent",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
audioFileTranscriptionEnabled: true,
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("should return 500 error when runtime.agents throws an error", async () => {
|
|
95
|
-
const runtime = {
|
|
96
|
-
get agents(): Record<string, AbstractAgent> {
|
|
97
|
-
throw new Error("Failed to get agents");
|
|
98
|
-
},
|
|
99
|
-
transcriptionService: undefined,
|
|
100
|
-
beforeRequestMiddleware: undefined,
|
|
101
|
-
afterRequestMiddleware: undefined,
|
|
102
|
-
} as CopilotRuntime;
|
|
103
|
-
|
|
104
|
-
const response = await handleGetRuntimeInfo({
|
|
105
|
-
runtime,
|
|
106
|
-
request: mockRequest,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
expect(response.status).toBe(500);
|
|
110
|
-
|
|
111
|
-
const data = await response.json();
|
|
112
|
-
expect(data).toEqual({
|
|
113
|
-
error: "Failed to retrieve runtime information",
|
|
114
|
-
message: "Failed to get agents",
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { handleRunAgent } from "../handlers/handle-run";
|
|
2
|
-
import { CopilotRuntime } from "../runtime";
|
|
3
|
-
import { describe, it, expect } from "vitest";
|
|
4
|
-
|
|
5
|
-
describe("handleRunAgent", () => {
|
|
6
|
-
const createMockRuntime = (
|
|
7
|
-
agents: Record<string, unknown> = {}
|
|
8
|
-
): CopilotRuntime => {
|
|
9
|
-
return {
|
|
10
|
-
agents: Promise.resolve(agents),
|
|
11
|
-
transcriptionService: undefined,
|
|
12
|
-
beforeRequestMiddleware: undefined,
|
|
13
|
-
afterRequestMiddleware: undefined,
|
|
14
|
-
} as CopilotRuntime;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const createMockRequest = (): Request => {
|
|
18
|
-
return new Request("https://example.com/agent/test/run", {
|
|
19
|
-
method: "POST",
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
it("should return 404 when agent does not exist", async () => {
|
|
24
|
-
const runtime = createMockRuntime({}); // Empty agents
|
|
25
|
-
const request = createMockRequest();
|
|
26
|
-
const agentId = "nonexistent-agent";
|
|
27
|
-
|
|
28
|
-
const response = await handleRunAgent({
|
|
29
|
-
runtime,
|
|
30
|
-
request,
|
|
31
|
-
agentId,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
expect(response.status).toBe(404);
|
|
35
|
-
expect(response.headers.get("Content-Type")).toBe("application/json");
|
|
36
|
-
|
|
37
|
-
const body = await response.json();
|
|
38
|
-
expect(body).toEqual({
|
|
39
|
-
error: "Agent not found",
|
|
40
|
-
message: "Agent 'nonexistent-agent' does not exist",
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("should return 500 when runtime.agents throws an error", async () => {
|
|
45
|
-
const runtime = {
|
|
46
|
-
agents: Promise.reject(new Error("Database connection failed")),
|
|
47
|
-
transcriptionService: undefined,
|
|
48
|
-
beforeRequestMiddleware: undefined,
|
|
49
|
-
afterRequestMiddleware: undefined,
|
|
50
|
-
} as CopilotRuntime;
|
|
51
|
-
const request = createMockRequest();
|
|
52
|
-
const agentId = "test-agent";
|
|
53
|
-
|
|
54
|
-
const response = await handleRunAgent({
|
|
55
|
-
runtime,
|
|
56
|
-
request,
|
|
57
|
-
agentId,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
expect(response.status).toBe(500);
|
|
61
|
-
expect(response.headers.get("Content-Type")).toBe("application/json");
|
|
62
|
-
|
|
63
|
-
const body = await response.json();
|
|
64
|
-
expect(body).toEqual({
|
|
65
|
-
error: "Failed to run agent",
|
|
66
|
-
message: "Database connection failed",
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|