@kya-os/create-mcpi-app 1.7.38 → 1.7.39-canary.1

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.
@@ -9,15 +9,13 @@
9
9
   15 │ "types": "./dist/index.d.ts"
10
10
  ╵ ~~~~~~~
11
11
 
12
- The "import" condition comes earlier and will be used for all "import"
13
- statements:
12
+ The "import" condition comes earlier and will be used for all "import" statements:
14
13
 
15
14
  package.json:13:6:
16
15
   13 │ "import": "./dist/index.js",
17
16
  ╵ ~~~~~~~~
18
17
 
19
- The "require" condition comes earlier and will be used for all "require"
20
- calls:
18
+ The "require" condition comes earlier and will be used for all "require" calls:
21
19
 
22
20
  package.json:14:6:
23
21
   14 │ "require": "./dist/index.js",
@@ -29,15 +27,13 @@
29
27
   20 │ "types": "./dist/helpers/config-builder.d.ts"
30
28
  ╵ ~~~~~~~
31
29
 
32
- The "import" condition comes earlier and will be used for all "import"
33
- statements:
30
+ The "import" condition comes earlier and will be used for all "import" statements:
34
31
 
35
32
  package.json:18:6:
36
33
   18 │ "import": "./dist/helpers/config-builder.js",
37
34
  ╵ ~~~~~~~~
38
35
 
39
- The "require" condition comes earlier and will be used for all "require"
40
- calls:
36
+ The "require" condition comes earlier and will be used for all "require" calls:
41
37
 
42
38
  package.json:19:6:
43
39
   19 │ "require": "./dist/helpers/config-builder.js",
@@ -48,708 +44,335 @@
48
44
  Coverage enabled with v8
49
45
 
50
46
  [?2026h
51
-  ❯ src/__tests__/cloudflare-template.test.ts [queued]
47
+  ❯ test-cloudflare/tests/session-management.test.ts [queued]
52
48
 
53
49
   Test Files 0 passed (13)
54
50
   Tests 0 passed (0)
55
-  Start at 05:30:02
56
-  Duration 176ms
57
- [?2026l[?2026h
51
+  Start at 05:49:13
52
+  Duration 314ms
53
+ [?2026l[?2026hstdout | test-cloudflare/tests/session-management.test.ts > Session Management > Session Security > should not expose session data in logs
54
+ [Session] Created session: secure-session
55
+
56
+
58
57
   ❯ src/__tests__/cloudflare-template.test.ts [queued]
58
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts [queued]
59
59
   ❯ src/__tests__/helpers/generate-config.test.ts [queued]
60
60
   ❯ src/__tests__/helpers/generate-identity.test.ts [queued]
61
61
   ❯ src/__tests__/helpers/install.test.ts [queued]
62
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
63
-  ❯ src/helpers/__tests__/config-builder.spec.ts [queued]
64
62
   ❯ src/utils/__tests__/fetch-remote-config.test.ts [queued]
65
63
   ❯ test-cloudflare/tests/cache-invalidation.test.ts [queued]
66
-  ❯ test-cloudflare/tests/delegation.test.ts [queued]
67
-  ❯ test-cloudflare/tests/session-management.test.ts [queued]
64
+  ❯ test-cloudflare/tests/cors-security.test.ts 0/29
65
+  ❯ test-cloudflare/tests/delegation.test.ts 0/12
66
+  ❯ test-cloudflare/tests/session-management.test.ts 0/17
68
67
 
69
68
   Test Files 0 passed (13)
70
-  Tests 0 passed (0)
71
-  Start at 05:30:02
72
-  Duration 276ms
73
- [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with npm
74
- 
75
- 📦 Installing dependencies with npm...
76
- ✓ Lockfile created (package-lock.json) - remember to commit it
77
-
78
- stdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with yarn
79
- 
80
- 📦 Installing dependencies with yarn...
81
- ✓ Lockfile created (yarn.lock) - remember to commit it
69
+  Tests 0 passed (58)
70
+  Start at 05:49:13
71
+  Duration 422ms
72
+ [?2026l[?2026h ✓ test-cloudflare/tests/delegation.test.ts (12 tests) 7ms
73
+ ✓ test-cloudflare/tests/cors-security.test.ts (29 tests) 6ms
74
+ ✓ test-cloudflare/tests/session-management.test.ts (17 tests) 29ms
82
75
 
83
- stdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with pnpm
84
- 
85
- 📦 Installing dependencies with pnpm...
86
- Lockfile created (pnpm-lock.yaml) - remember to commit it
76
+  src/__tests__/cloudflare-template.test.ts [queued]
77
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts [queued]
78
+  src/__tests__/helpers/generate-config.test.ts [queued]
79
+  src/__tests__/helpers/generate-identity.test.ts [queued]
80
+  ❯ src/__tests__/helpers/install.test.ts [queued]
81
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
82
+  ❯ src/helpers/__tests__/config-builder.spec.ts [queued]
83
+  ❯ src/utils/__tests__/fetch-remote-config.test.ts [queued]
84
+  ❯ test-cloudflare/tests/cache-invalidation.test.ts 0/18
85
+  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
87
86
 
88
- stdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should use correct working directory
89
- 
90
- 📦 Installing dependencies with npm...
91
- Lockfile created (package-lock.json) - remember to commit it
87
+  Test Files 3 passed (13)
88
+  Tests 58 passed (90)
89
+  Start at 05:49:13
90
+  Duration 529ms
91
+ [?2026l[?2026h ✓ test-cloudflare/tests/cache-invalidation.test.ts (18 tests) 49ms
92
92
 
93
93
 
94
94
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
95
95
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
96
96
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
97
97
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
98
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
98
+  ❯ src/__tests__/helpers/install.test.ts 0/20
99
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
99
100
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
100
101
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
101
102
 
102
-  Test Files 6 passed (13)
103
-  Tests 106 passed (246)
104
-  Start at 05:30:02
105
-  Duration 376ms
106
- [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Install progress reporting > should report correct package manager in log
107
- ⚠️ Warning: No lockfile generated (pnpm-lock.yaml)
103
+  Test Files 5 passed (13)
104
+  Tests 86 passed (223)
105
+  Start at 05:49:13
106
+  Duration 729ms
107
+ [?2026l[?2026hstderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if API request fails
108
+ [RemoteConfig] API returned 404: Not Found
109
+
110
+ stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if API throws error
111
+ [RemoteConfig] Failed to fetch config: Error: Network error
112
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/create-mcpi-app/src/utils/__tests__/fetch-remote-config.test.ts:173:35
113
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
114
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
115
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
116
+ at new Promise (<anonymous>)
117
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
118
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
119
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
120
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
121
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
122
+
123
+ stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
124
+ [RemoteConfig] Neither projectId nor agentDid provided
125
+
126
+ stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
127
+ [RemoteConfig] Cache read failed: Error: Cache error
128
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/create-mcpi-app/src/utils/__tests__/fetch-remote-config.test.ts:201:50
129
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
130
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
131
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
132
+ at new Promise (<anonymous>)
133
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
134
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
135
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
136
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
137
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
108
138
 
109
139
 
110
140
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
111
141
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
112
142
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
113
143
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
114
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
144
+  ❯ src/__tests__/helpers/install.test.ts 0/20
145
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
115
146
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
116
147
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
117
148
 
118
-  Test Files 6 passed (13)
119
-  Tests 106 passed (246)
120
-  Start at 05:30:02
121
-  Duration 376ms
122
- [?2026l[?2026h ✓ test-cloudflare/tests/cache-invalidation.test.ts (18 tests) 7ms
123
- stdout | src/__tests__/helpers/install.test.ts > install > Install progress reporting > should check for lockfile after installation
149
+  Test Files 5 passed (13)
150
+  Tests 86 passed (223)
151
+  Start at 05:49:13
152
+  Duration 729ms
153
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with npm
124
154
  
125
155
  📦 Installing dependencies with npm...
126
156
  ✓ Lockfile created (package-lock.json) - remember to commit it
127
157
 
128
- stdout | src/__tests__/helpers/install.test.ts > install > Error handling > should throw error when installation fails
129
- 
130
- 📦 Installing dependencies with npm...
131
-
158
+ ✓ src/utils/__tests__/fetch-remote-config.test.ts (9 tests) 37ms
132
159
 
133
160
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
134
161
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
135
162
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
136
163
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
137
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
164
+  ❯ src/__tests__/helpers/install.test.ts 0/20
165
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
138
166
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
139
167
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
140
168
 
141
-  Test Files 6 passed (13)
142
-  Tests 106 passed (246)
143
-  Start at 05:30:02
144
-  Duration 376ms
145
- [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should throw error when installation fails
146
- Failed to install dependencies with npm.
169
+  Test Files 5 passed (13)
170
+  Tests 86 passed (223)
171
+  Start at 05:49:13
172
+  Duration 729ms
173
+ [?2026l[?2026hstderr | src/helpers/__tests__/config-builder.spec.ts > buildConfigWithRemote > should fallback to local config when remote fetch fails
174
+ [RemoteConfig] Neither projectId nor agentDid provided
147
175
 
148
176
 
149
177
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
150
178
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
151
179
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
152
180
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
153
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
181
+  ❯ src/__tests__/helpers/install.test.ts 0/20
182
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
154
183
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
155
184
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
156
185
 
157
-  Test Files 6 passed (13)
158
-  Tests 106 passed (246)
159
-  Start at 05:30:02
160
-  Duration 376ms
161
- [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle network errors during installation
186
+  Test Files 5 passed (13)
187
+  Tests 86 passed (223)
188
+  Start at 05:49:13
189
+  Duration 729ms
190
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with yarn
191
+ 
192
+ 📦 Installing dependencies with yarn...
193
+ ✓ Lockfile created (yarn.lock) - remember to commit it
194
+
195
+ stdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should install dependencies with pnpm
196
+ 
197
+ 📦 Installing dependencies with pnpm...
198
+ ✓ Lockfile created (pnpm-lock.yaml) - remember to commit it
199
+
200
+ stdout | src/__tests__/helpers/install.test.ts > install > Dependency installation > should use correct working directory
162
201
  
163
202
  📦 Installing dependencies with npm...
203
+ ✓ Lockfile created (package-lock.json) - remember to commit it
164
204
 
165
205
 
166
206
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
167
207
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
168
208
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
169
209
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
170
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
210
+  ❯ src/__tests__/helpers/install.test.ts 0/20
211
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
171
212
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
172
213
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
173
214
 
174
-  Test Files 6 passed (13)
175
-  Tests 106 passed (246)
176
-  Start at 05:30:02
177
-  Duration 376ms
178
- [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle network errors during installation
179
- Failed to install dependencies with npm.
215
+  Test Files 5 passed (13)
216
+  Tests 86 passed (223)
217
+  Start at 05:49:13
218
+  Duration 729ms
219
+ [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Install progress reporting > should report correct package manager in log
220
+ ⚠️ Warning: No lockfile generated (pnpm-lock.yaml)
180
221
 
181
222
 
182
223
   ❯ src/__tests__/cloudflare-template.test.ts 0/24
183
224
   ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
184
225
   ❯ src/__tests__/helpers/generate-config.test.ts 0/25
185
226
   ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
186
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
227
+  ❯ src/__tests__/helpers/install.test.ts 0/20
228
+  ❯ src/__tests__/helpers/validate-project-structure.test.ts [queued]
187
229
   ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
188
230
   ❯ test-cloudflare/tests/do-routing.test.ts 0/14
189
231
 
190
-  Test Files 6 passed (13)
191
-  Tests 106 passed (246)
192
-  Start at 05:30:02
193
-  Duration 376ms
194
- [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle permission errors during installation
232
+  Test Files 5 passed (13)
233
+  Tests 86 passed (223)
234
+  Start at 05:49:13
235
+  Duration 729ms
236
+ [?2026l[?2026h ✓ src/helpers/__tests__/config-builder.spec.ts (12 tests) 22ms
237
+ stdout | src/__tests__/helpers/install.test.ts > install > Install progress reporting > should check for lockfile after installation
195
238
  
196
239
  📦 Installing dependencies with npm...
240
+ ✓ Lockfile created (package-lock.json) - remember to commit it
197
241
 
242
+ stdout | src/__tests__/helpers/install.test.ts > install > Error handling > should throw error when installation fails
243
+ 
244
+ 📦 Installing dependencies with npm...
198
245
 
199
-  ❯ src/__tests__/cloudflare-template.test.ts 0/24
200
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
201
-  ❯ src/__tests__/helpers/generate-config.test.ts 0/25
202
-  ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
203
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
204
-  ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
205
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
206
246
 
207
-  Test Files 6 passed (13)
208
-  Tests 106 passed (246)
209
-  Start at 05:30:02
210
-  Duration 376ms
211
- [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle permission errors during installation
247
+  src/__tests__/cloudflare-template.test.ts 5/24
248
+  src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
249
+
250
+  Test Files 11 passed (13)
251
+  Tests 210 passed (246)
252
+  Start at 05:49:13
253
+  Duration 831ms
254
+ [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should throw error when installation fails
212
255
  Failed to install dependencies with npm.
213
256
 
214
257
 
215
-  ❯ src/__tests__/cloudflare-template.test.ts 0/24
216
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
217
-  ❯ src/__tests__/helpers/generate-config.test.ts 0/25
218
-  ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
219
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
220
-  ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
221
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
258
+  ❯ src/__tests__/cloudflare-template.test.ts 5/24
259
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
222
260
 
223
-  Test Files 6 passed (13)
224
-  Tests 106 passed (246)
225
-  Start at 05:30:02
226
-  Duration 376ms
227
- [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should log error message when installation fails
261
+  Test Files 11 passed (13)
262
+  Tests 210 passed (246)
263
+  Start at 05:49:13
264
+  Duration 831ms
265
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle network errors during installation
228
266
  
229
267
  📦 Installing dependencies with npm...
230
268
 
231
- stdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle invalid package manager gracefully
232
- 
233
- 📦 Installing dependencies with unknown...
234
269
 
270
+  ❯ src/__tests__/cloudflare-template.test.ts 5/24
271
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
235
272
 
236
-  src/__tests__/cloudflare-template.test.ts 0/24
237
-  src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
238
-  src/__tests__/helpers/generate-config.test.ts 0/25
239
-  ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
240
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
241
-  src/helpers/__tests__/config-builder.spec.ts 1/12
242
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
273
+  Test Files 11 passed (13)
274
+  Tests 210 passed (246)
275
+  Start at 05:49:13
276
+  Duration 831ms
277
+ [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle network errors during installation
278
+ Failed to install dependencies with npm.
243
279
 
244
-  Test Files 6 passed (13)
245
-  Tests 106 passed (246)
246
-  Start at 05:30:02
247
-  Duration 376ms
248
- [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle invalid package manager gracefully
249
- ⚠️ Warning: Unknown package manager "unknown", cannot check lockfile
250
280
 
251
- stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if API request fails
252
- [RemoteConfig] API returned 404: Not Found
281
+  src/__tests__/cloudflare-template.test.ts 5/24
282
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
253
283
 
254
- stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if API throws error
255
- [RemoteConfig] Failed to fetch config: Error: Network error
256
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/create-mcpi-app/src/utils/__tests__/fetch-remote-config.test.ts:173:35
257
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
258
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
259
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
260
- at new Promise (<anonymous>)
261
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
262
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
263
-  at processTicksAndRejections (node:internal/process/task_queues:103:5)
264
- at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
265
- at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
284
+  Test Files 11 passed (13)
285
+  Tests 210 passed (246)
286
+  Start at 05:49:13
287
+  Duration 831ms
288
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle permission errors during installation
289
+ 
290
+ 📦 Installing dependencies with npm...
266
291
 
267
- stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
268
- [RemoteConfig] Neither projectId nor agentDid provided
269
292
 
270
- stderr | src/utils/__tests__/fetch-remote-config.test.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
271
- [RemoteConfig] Cache read failed: Error: Cache error
272
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/create-mcpi-app/src/utils/__tests__/fetch-remote-config.test.ts:201:50
273
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
274
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
275
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
276
- at new Promise (<anonymous>)
277
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
278
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
279
-  at processTicksAndRejections (node:internal/process/task_queues:103:5)
280
- at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
281
- at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
293
+  src/__tests__/cloudflare-template.test.ts 5/24
294
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
282
295
 
296
+  Test Files 11 passed (13)
297
+  Tests 210 passed (246)
298
+  Start at 05:49:13
299
+  Duration 831ms
300
+ [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle permission errors during installation
301
+ Failed to install dependencies with npm.
283
302
 
284
-  ❯ src/__tests__/cloudflare-template.test.ts 0/24
285
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
286
-  ❯ src/__tests__/helpers/generate-config.test.ts 0/25
287
-  ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
288
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
289
-  ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
290
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
291
303
 
292
-  Test Files 6 passed (13)
293
-  Tests 106 passed (246)
294
-  Start at 05:30:02
295
-  Duration 376ms
296
- [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Lockfile validation > should warn when lockfile not created
304
+  src/__tests__/cloudflare-template.test.ts 5/24
305
+  src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
306
+
307
+  Test Files 11 passed (13)
308
+  Tests 210 passed (246)
309
+  Start at 05:49:13
310
+  Duration 831ms
311
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Error handling > should log error message when installation fails
297
312
  
298
313
  📦 Installing dependencies with npm...
299
314
 
300
- stdout | test-cloudflare/tests/session-management.test.ts > Session Management > Session Security > should not expose session data in logs
301
- [Session] Created session: secure-session
315
+ stdout | src/__tests__/helpers/install.test.ts > install > Error handling > should handle invalid package manager gracefully
316
+ 
317
+ 📦 Installing dependencies with unknown...
302
318
 
303
- ✓ test-cloudflare/tests/delegation.test.ts (12 tests) 6ms
304
- ✓ src/__tests__/helpers/install.test.ts (20 tests) 36ms
305
- ✓ test-cloudflare/tests/session-management.test.ts (17 tests) 27ms
306
- ✓ src/utils/__tests__/fetch-remote-config.test.ts (9 tests) 10ms
307
- ✓ test-cloudflare/tests/cors-security.test.ts (29 tests) 6ms
308
319
 
309
-  ❯ src/__tests__/cloudflare-template.test.ts 0/24
310
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
311
-  ❯ src/__tests__/helpers/generate-config.test.ts 0/25
312
-  ❯ src/__tests__/helpers/generate-identity.test.ts 0/24
313
-  ❯ src/__tests__/helpers/validate-project-structure.test.ts 0/23
314
-  ❯ src/helpers/__tests__/config-builder.spec.ts 1/12
315
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
320
+  ❯ src/__tests__/cloudflare-template.test.ts 5/24
321
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
316
322
 
317
-  Test Files 6 passed (13)
318
-  Tests 106 passed (246)
319
-  Start at 05:30:02
320
-  Duration 376ms
321
- [?2026l[?2026hstderr | src/helpers/__tests__/config-builder.spec.ts > buildConfigWithRemote > should fallback to local config when remote fetch fails
322
- [RemoteConfig] Neither projectId nor agentDid provided
323
+  Test Files 11 passed (13)
324
+  Tests 210 passed (246)
325
+  Start at 05:49:13
326
+  Duration 831ms
327
+ [?2026l[?2026hstderr | src/__tests__/helpers/install.test.ts > install > Error handling > should handle invalid package manager gracefully
328
+ ⚠️ Warning: Unknown package manager "unknown", cannot check lockfile
323
329
 
324
330
 
325
-  ❯ src/__tests__/cloudflare-template.test.ts 0/24
326
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 0/19
327
-  ❯ src/__tests__/helpers/generate-config.test.ts 0/25
328
-  src/__tests__/helpers/generate-identity.test.ts 0/24
329
-  src/__tests__/helpers/validate-project-structure.test.ts 0/23
330
-  src/helpers/__tests__/config-builder.spec.ts 1/12
331
-  ❯ test-cloudflare/tests/do-routing.test.ts 0/14
331
+  ❯ src/__tests__/cloudflare-template.test.ts 5/24
332
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
333
+
334
+  Test Files 11 passed (13)
335
+  Tests 210 passed (246)
336
+  Start at 05:49:13
337
+  Duration 831ms
338
+ [?2026l[?2026hstdout | src/__tests__/helpers/install.test.ts > install > Lockfile validation > should warn when lockfile not created
339
+ 
340
+ 📦 Installing dependencies with npm...
332
341
 
333
-  Test Files 6 passed (13)
334
-  Tests 106 passed (246)
335
-  Start at 05:30:02
336
-  Duration 376ms
337
- [?2026l[?2026h ✓ src/helpers/__tests__/config-builder.spec.ts (12 tests) 5ms
338
- ✓ src/__tests__/helpers/generate-identity.test.ts (24 tests) 45ms
339
- ✓ src/__tests__/helpers/generate-config.test.ts (25 tests) 54ms
340
- ✓ src/__tests__/helpers/validate-project-structure.test.ts (23 tests) 56ms
341
- ✓ test-cloudflare/tests/do-routing.test.ts (14 tests) 99ms
342
+ ✓ src/__tests__/helpers/generate-config.test.ts (25 tests) 148ms
343
+ ✓ src/__tests__/helpers/generate-identity.test.ts (24 tests) 131ms
344
+ ✓ src/__tests__/helpers/install.test.ts (20 tests) 159ms
345
+ ✓ test-cloudflare/tests/do-routing.test.ts (14 tests) 198ms
346
+ ✓ src/__tests__/helpers/validate-project-structure.test.ts (23 tests) 61ms
342
347
 
343
-  ❯ src/__tests__/cloudflare-template.test.ts 10/24
344
-  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 11/19
348
+  ❯ src/__tests__/cloudflare-template.test.ts 5/24
349
+  ❯ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts 2/19
345
350
 
346
351
   Test Files 11 passed (13)
347
-  Tests 6 failed | 218 passed (246)
348
-  Start at 05:30:02
349
-  Duration 577ms
350
- [?2026l ✓ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts (19 tests) 142ms
351
- ❯ src/__tests__/cloudflare-template.test.ts (24 tests | 7 failed) 165ms
352
-  × should create all required files and directories 24ms
353
-  × should create mcpi-runtime-config.ts with correct structure 15ms
354
-  × should create index.ts with correct structure 10ms
355
- ✓ should include MCP_SERVER_URL placeholder in wrangler.toml 10ms
356
-  × should log warning when MCP_SERVER_URL not configured 11ms
357
-  × should store MCP_SERVER_URL in class property 7ms
358
- ✓ should include all required KV namespace bindings in wrangler.toml 5ms
359
- ✓ should create KV namespace creation scripts in package.json 7ms
360
- ✓ should create KV namespace listing scripts 5ms
361
-  × should include tool protection configuration in runtime config 6ms
362
-  × should include CloudflareRuntime import for tool protection 7ms
363
- ✓ should conditionally enable tool protection KV when API key provided 5ms
364
- ✓ should comment out tool protection KV when no API key provided 5ms
365
- ✓ should generate identity when skipIdentity is false 5ms
366
- ✓ should skip identity generation when skipIdentity is true 4ms
367
- ✓ should include identity variables in wrangler.toml 5ms
368
- ✓ should create .dev.vars.example template 6ms
369
- ✓ should handle file system errors gracefully 1ms
370
- ✓ should handle invalid project names 5ms
371
- ✓ should use correct package manager in scripts 4ms
372
- ✓ should create correct package.json structure 4ms
373
- ✓ should create greet tool with correct structure 5ms
374
- ✓ should create test files with correct structure 4ms
375
- ✓ should create README with project name 4ms
376
-
377
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 7 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
378
-
379
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > Basic template structure > should create all required files and directories
380
- AssertionError: expected false to be true // Object.is equality
381
-
382
- - Expected
383
- + Received
384
-
385
- - true
386
- + false
387
-
388
-  ❯ src/__tests__/cloudflare-template.test.ts:89:69
389
-  87|  expect(fs.existsSync(path.join(tempDir, ".gitignore"))).toBe(…
390
-  88|  expect(fs.existsSync(path.join(tempDir, "README.md"))).toBe(t…
391
-  89|  expect(fs.existsSync(path.join(tempDir, "vitest.config.ts")))…
392
-  |  ^
393
-  90|  });
394
-  91| 
395
-
396
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/7]⎯
397
-
398
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > Basic template structure > should create mcpi-runtime-config.ts with correct structure
399
- AssertionError: expected 'import type { CloudflareRuntimeConfig…' to contain 'buildBaseConfig'
400
-
401
- - Expected
402
- + Received
403
-
404
- - buildBaseConfig
405
- + import type { CloudflareRuntimeConfig } from '@kya-os/mcp-i-cloudflare/config';
406
- + import type { CloudflareEnv } from '@kya-os/mcp-i-cloudflare';
407
- + import { defineConfig } from '@kya-os/mcp-i-cloudflare';
408
- +
409
- + /**
410
- + * Runtime configuration for MCP-I server
411
- + *
412
- + * This file configures runtime features like proof submission to AgentShield,
413
- + * delegation verification, and audit logging.
414
- + *
415
- + * Environment variables are automatically injected from wrangler.toml (Cloudflare)
416
- + * or .env (Node.js). Configure them there:
417
- + * - AGENTSHIELD_API_URL: AgentShield API base URL
418
- + * - AGENTSHIELD_API_KEY: Your AgentShield API key
419
- + * - MCPI_ENV: "development" or "production"
420
- + *
421
- + * Note: The service fetches tool protection config by agent DID automatically.
422
- + * No project ID configuration needed!
423
- + */
424
- + export function getRuntimeConfig(env: CloudflareEnv): CloudflareRuntimeConfig {
425
- + return defineConfig({
426
- + // Only specify overrides - defaults are handled automatically
427
- + vars: {
428
- + ENVIRONMENT: env.ENVIRONMENT || env.MCPI_ENV || 'development',
429
- + AGENTSHIELD_API_KEY: env.AGENTSHIELD_API_KEY,
430
- + AGENTSHIELD_API_URL: env.AGENTSHIELD_API_URL,
431
- + },
432
- + // Optional: Enable admin endpoints
433
- + admin: {
434
- + enabled: false, // Set to true and provide ADMIN_API_KEY to enable
435
- + apiKey: env.ADMIN_API_KEY,
436
- + },
437
- + });
438
- + }
439
- +
440
-
441
-  ❯ src/__tests__/cloudflare-template.test.ts:103:29
442
- 101|  const configContent = fs.readFileSync(configPath, "utf-8");
443
- 102|  expect(configContent).toContain("getRuntimeConfig");
444
- 103|  expect(configContent).toContain("buildBaseConfig");
445
-  |  ^
446
- 104|  expect(configContent).toContain("CloudflareRuntimeConfig");
447
- 105|  });
448
-
449
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/7]⎯
450
-
451
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > Basic template structure > should create index.ts with correct structure
452
- AssertionError: expected 'import { MCPICloudflareAgent, createM…' to contain 'McpAgent'
453
-
454
- - Expected
455
- + Received
456
-
457
- - McpAgent
458
- + import { MCPICloudflareAgent, createMCPIApp, type PrefixedCloudflareEnv } from "@kya-os/mcp-i-cloudflare";
459
- + import { greetTool } from "./tools/greet";
460
- + import { getRuntimeConfig } from "./mcpi-runtime-config";
461
- +
462
- + /**
463
- + * Extended CloudflareEnv with prefixed KV bindings for multi-agent deployments
464
- + */
465
- + interface MyPrefixedCloudflareEnv extends PrefixedCloudflareEnv {
466
- + TESTPROJECT_NONCE_CACHE?: KVNamespace;
467
- + TESTPROJECT_PROOF_ARCHIVE?: KVNamespace;
468
- + TESTPROJECT_IDENTITY_STORAGE?: KVNamespace;
469
- + TESTPROJECT_DELEGATION_STORAGE?: KVNamespace;
470
- + TESTPROJECT_TOOL_PROTECTION_KV?: KVNamespace;
471
- + }
472
- +
473
- + /**
474
- + * Your custom MCP agent - only define your tools here!
475
- + * All framework complexity (runtime initialization, proof generation, etc.) is handled automatically.
476
- + */
477
- + export class TestprojectMCP extends MCPICloudflareAgent {
478
- + async registerTools() {
479
- + // Register your custom tools - proofs are generated automatically
480
- + this.server.tool(
481
- + greetTool.name,
482
- + greetTool.description,
483
- + greetTool.inputSchema.shape,
484
- + async (args: { name: string }) => {
485
- + return this.executeToolWithProof(
486
- + greetTool.name,
487
- + args,
488
- + greetTool.handler
489
- + );
490
- + }
491
- + );
492
- + }
493
- + }
494
- +
495
- + // Create and export the app - all routing is handled automatically
496
- + export default createMCPIApp({
497
- + AgentClass: TestprojectMCP,
498
- + agentName: "test-project",
499
- + agentVersion: "1.0.0",
500
- + envPrefix: "TESTPROJECT",
501
- + getRuntimeConfig,
502
- + });
503
- +
504
-
505
-  ❯ src/__tests__/cloudflare-template.test.ts:117:28
506
- 115| 
507
- 116|  const indexContent = fs.readFileSync(indexPath, "utf-8");
508
- 117|  expect(indexContent).toContain("McpAgent");
509
-  |  ^
510
- 118|  expect(indexContent).toContain("createCloudflareRuntime");
511
- 119|  expect(indexContent).toContain("class");
512
-
513
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/7]⎯
514
-
515
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > MCP_SERVER_URL configuration > should log warning when MCP_SERVER_URL not configured
516
- AssertionError: expected 'import { MCPICloudflareAgent, createM…' to contain 'MCP Server URL will be auto-detected …'
517
-
518
- - Expected
519
- + Received
520
-
521
- - MCP Server URL will be auto-detected from request
522
- + import { MCPICloudflareAgent, createMCPIApp, type PrefixedCloudflareEnv } from "@kya-os/mcp-i-cloudflare";
523
- + import { greetTool } from "./tools/greet";
524
- + import { getRuntimeConfig } from "./mcpi-runtime-config";
525
- +
526
- + /**
527
- + * Extended CloudflareEnv with prefixed KV bindings for multi-agent deployments
528
- + */
529
- + interface MyPrefixedCloudflareEnv extends PrefixedCloudflareEnv {
530
- + TESTPROJECT_NONCE_CACHE?: KVNamespace;
531
- + TESTPROJECT_PROOF_ARCHIVE?: KVNamespace;
532
- + TESTPROJECT_IDENTITY_STORAGE?: KVNamespace;
533
- + TESTPROJECT_DELEGATION_STORAGE?: KVNamespace;
534
- + TESTPROJECT_TOOL_PROTECTION_KV?: KVNamespace;
535
- + }
536
- +
537
- + /**
538
- + * Your custom MCP agent - only define your tools here!
539
- + * All framework complexity (runtime initialization, proof generation, etc.) is handled automatically.
540
- + */
541
- + export class TestprojectMCP extends MCPICloudflareAgent {
542
- + async registerTools() {
543
- + // Register your custom tools - proofs are generated automatically
544
- + this.server.tool(
545
- + greetTool.name,
546
- + greetTool.description,
547
- + greetTool.inputSchema.shape,
548
- + async (args: { name: string }) => {
549
- + return this.executeToolWithProof(
550
- + greetTool.name,
551
- + args,
552
- + greetTool.handler
553
- + );
554
- + }
555
- + );
556
- + }
557
- + }
558
- +
559
- + // Create and export the app - all routing is handled automatically
560
- + export default createMCPIApp({
561
- + AgentClass: TestprojectMCP,
562
- + agentName: "test-project",
563
- + agentVersion: "1.0.0",
564
- + envPrefix: "TESTPROJECT",
565
- + getRuntimeConfig,
566
- + });
567
- +
568
-
569
-  ❯ src/__tests__/cloudflare-template.test.ts:149:28
570
- 147| 
571
- 148|  // Check that auto-detection message is logged in index.ts wh…
572
- 149|  expect(indexContent).toContain(
573
-  |  ^
574
- 150|  "MCP Server URL will be auto-detected from request"
575
- 151|  );
576
-
577
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/7]⎯
578
-
579
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > MCP_SERVER_URL configuration > should store MCP_SERVER_URL in class property
580
- AssertionError: expected 'import { MCPICloudflareAgent, createM…' to contain 'this.mcpServerUrl'
581
-
582
- - Expected
583
- + Received
584
-
585
- - this.mcpServerUrl
586
- + import { MCPICloudflareAgent, createMCPIApp, type PrefixedCloudflareEnv } from "@kya-os/mcp-i-cloudflare";
587
- + import { greetTool } from "./tools/greet";
588
- + import { getRuntimeConfig } from "./mcpi-runtime-config";
589
- +
590
- + /**
591
- + * Extended CloudflareEnv with prefixed KV bindings for multi-agent deployments
592
- + */
593
- + interface MyPrefixedCloudflareEnv extends PrefixedCloudflareEnv {
594
- + TESTPROJECT_NONCE_CACHE?: KVNamespace;
595
- + TESTPROJECT_PROOF_ARCHIVE?: KVNamespace;
596
- + TESTPROJECT_IDENTITY_STORAGE?: KVNamespace;
597
- + TESTPROJECT_DELEGATION_STORAGE?: KVNamespace;
598
- + TESTPROJECT_TOOL_PROTECTION_KV?: KVNamespace;
599
- + }
600
- +
601
- + /**
602
- + * Your custom MCP agent - only define your tools here!
603
- + * All framework complexity (runtime initialization, proof generation, etc.) is handled automatically.
604
- + */
605
- + export class TestprojectMCP extends MCPICloudflareAgent {
606
- + async registerTools() {
607
- + // Register your custom tools - proofs are generated automatically
608
- + this.server.tool(
609
- + greetTool.name,
610
- + greetTool.description,
611
- + greetTool.inputSchema.shape,
612
- + async (args: { name: string }) => {
613
- + return this.executeToolWithProof(
614
- + greetTool.name,
615
- + args,
616
- + greetTool.handler
617
- + );
618
- + }
619
- + );
620
- + }
621
- + }
622
- +
623
- + // Create and export the app - all routing is handled automatically
624
- + export default createMCPIApp({
625
- + AgentClass: TestprojectMCP,
626
- + agentName: "test-project",
627
- + agentVersion: "1.0.0",
628
- + envPrefix: "TESTPROJECT",
629
- + getRuntimeConfig,
630
- + });
631
- +
632
-
633
-  ❯ src/__tests__/cloudflare-template.test.ts:163:28
634
- 161|  const indexContent = fs.readFileSync(indexPath, "utf-8");
635
- 162| 
636
- 163|  expect(indexContent).toContain("this.mcpServerUrl");
637
-  |  ^
638
- 164|  expect(indexContent).toContain("env.MCP_SERVER_URL");
639
- 165|  });
640
-
641
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/7]⎯
642
-
643
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > Tool protection setup > should include tool protection configuration in runtime config
644
- AssertionError: expected 'import type { CloudflareRuntimeConfig…' to contain 'toolProtection'
645
-
646
- - Expected
647
- + Received
648
-
649
- - toolProtection
650
- + import type { CloudflareRuntimeConfig } from '@kya-os/mcp-i-cloudflare/config';
651
- + import type { CloudflareEnv } from '@kya-os/mcp-i-cloudflare';
652
- + import { defineConfig } from '@kya-os/mcp-i-cloudflare';
653
- +
654
- + /**
655
- + * Runtime configuration for MCP-I server
656
- + *
657
- + * This file configures runtime features like proof submission to AgentShield,
658
- + * delegation verification, and audit logging.
659
- + *
660
- + * Environment variables are automatically injected from wrangler.toml (Cloudflare)
661
- + * or .env (Node.js). Configure them there:
662
- + * - AGENTSHIELD_API_URL: AgentShield API base URL
663
- + * - AGENTSHIELD_API_KEY: Your AgentShield API key
664
- + * - MCPI_ENV: "development" or "production"
665
- + *
666
- + * Note: The service fetches tool protection config by agent DID automatically.
667
- + * No project ID configuration needed!
668
- + */
669
- + export function getRuntimeConfig(env: CloudflareEnv): CloudflareRuntimeConfig {
670
- + return defineConfig({
671
- + // Only specify overrides - defaults are handled automatically
672
- + vars: {
673
- + ENVIRONMENT: env.ENVIRONMENT || env.MCPI_ENV || 'development',
674
- + AGENTSHIELD_API_KEY: env.AGENTSHIELD_API_KEY,
675
- + AGENTSHIELD_API_URL: env.AGENTSHIELD_API_URL,
676
- + },
677
- + // Optional: Enable admin endpoints
678
- + admin: {
679
- + enabled: false, // Set to true and provide ADMIN_API_KEY to enable
680
- + apiKey: env.ADMIN_API_KEY,
681
- + },
682
- + });
683
- + }
684
- +
685
-
686
-  ❯ src/__tests__/cloudflare-template.test.ts:232:29
687
- 230|  const configContent = fs.readFileSync(configPath, "utf-8");
688
- 231| 
689
- 232|  expect(configContent).toContain("toolProtection");
690
-  |  ^
691
- 233|  expect(configContent).toContain("CloudflareRuntime");
692
- 234|  });
693
-
694
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/7]⎯
695
-
696
-  FAIL  src/__tests__/cloudflare-template.test.ts > Cloudflare Template Generation > Tool protection setup > should include CloudflareRuntime import for tool protection
697
- AssertionError: expected 'import type { CloudflareRuntimeConfig…' to contain 'from "@kya-os/mcp-i-cloudflare"'
698
-
699
- - Expected
700
- + Received
701
-
702
- - from "@kya-os/mcp-i-cloudflare"
703
- + import type { CloudflareRuntimeConfig } from '@kya-os/mcp-i-cloudflare/config';
704
- + import type { CloudflareEnv } from '@kya-os/mcp-i-cloudflare';
705
- + import { defineConfig } from '@kya-os/mcp-i-cloudflare';
706
- +
707
- + /**
708
- + * Runtime configuration for MCP-I server
709
- + *
710
- + * This file configures runtime features like proof submission to AgentShield,
711
- + * delegation verification, and audit logging.
712
- + *
713
- + * Environment variables are automatically injected from wrangler.toml (Cloudflare)
714
- + * or .env (Node.js). Configure them there:
715
- + * - AGENTSHIELD_API_URL: AgentShield API base URL
716
- + * - AGENTSHIELD_API_KEY: Your AgentShield API key
717
- + * - MCPI_ENV: "development" or "production"
718
- + *
719
- + * Note: The service fetches tool protection config by agent DID automatically.
720
- + * No project ID configuration needed!
721
- + */
722
- + export function getRuntimeConfig(env: CloudflareEnv): CloudflareRuntimeConfig {
723
- + return defineConfig({
724
- + // Only specify overrides - defaults are handled automatically
725
- + vars: {
726
- + ENVIRONMENT: env.ENVIRONMENT || env.MCPI_ENV || 'development',
727
- + AGENTSHIELD_API_KEY: env.AGENTSHIELD_API_KEY,
728
- + AGENTSHIELD_API_URL: env.AGENTSHIELD_API_URL,
729
- + },
730
- + // Optional: Enable admin endpoints
731
- + admin: {
732
- + enabled: false, // Set to true and provide ADMIN_API_KEY to enable
733
- + apiKey: env.ADMIN_API_KEY,
734
- + },
735
- + });
736
- + }
737
- +
738
-
739
-  ❯ src/__tests__/cloudflare-template.test.ts:246:29
740
- 244| 
741
- 245|  expect(configContent).toContain("CloudflareRuntime");
742
- 246|  expect(configContent).toContain('from "@kya-os/mcp-i-cloudfla…
743
-  |  ^
744
- 247|  });
745
- 248| 
746
-
747
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/7]⎯
748
-
749
-
750
-  Test Files  1 failed | 12 passed (13)
751
-  Tests  7 failed | 239 passed (246)
752
-  Start at  05:30:02
753
-  Duration  633ms (transform 818ms, setup 0ms, collect 1.41s, tests 658ms, environment 1ms, prepare 458ms)
754
-
755
- [?25h ELIFECYCLE  Command failed with exit code 1.
352
+  Tests 210 passed (246)
353
+  Start at 05:49:13
354
+  Duration 831ms
355
+ [?2026l ✓ src/__tests__/helpers/fetch-cloudflare-mcpi-template.test.ts (19 tests) 278ms
356
+ ✓ src/__tests__/cloudflare-template.test.ts (24 tests) 321ms
357
+
358
+  Test Files  13 passed (13)
359
+  Tests  246 passed (246)
360
+  Start at  05:49:13
361
+  Duration  994ms (transform 1.04s, setup 0ms, collect 1.87s, tests 1.45s, environment 3ms, prepare 763ms)
362
+
363
+  % Coverage report from v8
364
+ -------------------------------|---------|----------|---------|---------|-------------------
365
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
366
+ -------------------------------|---------|----------|---------|---------|-------------------
367
+ All files  |  96.52 |  93.79 |  100 |  96.52 |  
368
+  helpers  |  97.32 |  94.78 |  100 |  97.32 |  
369
+  config-builder.ts  |  100 |  100 |  100 |  100 |  
370
+  ...oudflare-mcpi-template.ts |  94.64 |  89.65 |  100 |  94.64 | ...1013,1118-1126
371
+  generate-config.ts  |  100 |  100 |  100 |  100 |  
372
+  generate-identity.ts  |  100 |  100 |  100 |  100 |  
373
+  install.ts  |  100 |  100 |  100 |  100 |  
374
+  ...date-project-structure.ts |  100 |  100 |  100 |  100 |  
375
+  utils  |  91.42 |  90 |  100 |  91.42 |  
376
+  fetch-remote-config.ts  |  91.42 |  90 |  100 |  91.42 | 152-153,169 
377
+ -------------------------------|---------|----------|---------|---------|-------------------
378
+ [?25h