@codelitdev/platform-cli 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preset.json
CHANGED
|
@@ -5,42 +5,42 @@
|
|
|
5
5
|
},
|
|
6
6
|
"packages": {
|
|
7
7
|
"@codelitdev/platform": {
|
|
8
|
-
"recommended": "0.
|
|
8
|
+
"recommended": "0.5.0",
|
|
9
9
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
10
10
|
"minimumSecure": "0.1.0-alpha.0"
|
|
11
11
|
},
|
|
12
12
|
"@codelitdev/observability": {
|
|
13
|
-
"recommended": "0.
|
|
13
|
+
"recommended": "0.5.0",
|
|
14
14
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
15
15
|
"minimumSecure": "0.1.0-alpha.0"
|
|
16
16
|
},
|
|
17
17
|
"@codelitdev/mcp-server-kit": {
|
|
18
|
-
"recommended": "0.
|
|
18
|
+
"recommended": "0.5.0",
|
|
19
19
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
20
20
|
"minimumSecure": "0.1.0-alpha.0"
|
|
21
21
|
},
|
|
22
22
|
"@codelitdev/platform-conformance": {
|
|
23
|
-
"recommended": "0.
|
|
23
|
+
"recommended": "0.5.0",
|
|
24
24
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
25
25
|
"minimumSecure": "0.1.0-alpha.0"
|
|
26
26
|
},
|
|
27
27
|
"@codelitdev/platform-cli": {
|
|
28
|
-
"recommended": "0.
|
|
28
|
+
"recommended": "0.5.0",
|
|
29
29
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
30
30
|
"minimumSecure": "0.1.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"@codelitdev/billing": {
|
|
33
|
-
"recommended": "0.
|
|
33
|
+
"recommended": "0.5.0",
|
|
34
34
|
"supported": ">=0.1.0-alpha.4 <1",
|
|
35
35
|
"minimumSecure": "0.1.0-alpha.4"
|
|
36
36
|
},
|
|
37
37
|
"@codelitdev/oauth-server-kit": {
|
|
38
|
-
"recommended": "0.
|
|
38
|
+
"recommended": "0.5.0",
|
|
39
39
|
"supported": ">=0.1.0-alpha.2 <1",
|
|
40
40
|
"minimumSecure": "0.1.0-alpha.2"
|
|
41
41
|
},
|
|
42
42
|
"@codelitdev/design-system": {
|
|
43
|
-
"recommended": "0.
|
|
43
|
+
"recommended": "0.5.0",
|
|
44
44
|
"supported": ">=0.1.0-alpha.7 <1",
|
|
45
45
|
"minimumSecure": "0.1.0-alpha.7"
|
|
46
46
|
}
|
package/package.json
CHANGED
|
@@ -9,6 +9,14 @@ import { createExpressApp } from "./express-app.js";
|
|
|
9
9
|
import { createPgliteRuntime, freezeRuntimeClock } from "./runtime.js";
|
|
10
10
|
import { mintOAuthToken, seedWorld } from "./seed.js";
|
|
11
11
|
|
|
12
|
+
/** The platform code of an MCP tool result reported with `isError`. */
|
|
13
|
+
function toolErrorCode(body: unknown): string | undefined {
|
|
14
|
+
const result = (
|
|
15
|
+
body as { result?: { isError?: boolean; structuredContent?: { code?: string } } }
|
|
16
|
+
).result;
|
|
17
|
+
return result?.isError ? result.structuredContent?.code : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
describe.serial("reference API adapters", () => {
|
|
13
21
|
it("does not run DDL when oauth-server-kit options and schema modules are imported", async () => {
|
|
14
22
|
const { PGlite } = await import("@electric-sql/pglite");
|
|
@@ -332,9 +340,9 @@ describe.serial("reference API adapters", () => {
|
|
|
332
340
|
const restItems = (restList.body as { items: Array<{ id: string }> }).items;
|
|
333
341
|
const mcpJson = (
|
|
334
342
|
mcpList.body as {
|
|
335
|
-
result: {
|
|
343
|
+
result: { structuredContent: { items: Array<{ id: string }> } };
|
|
336
344
|
}
|
|
337
|
-
).result.
|
|
345
|
+
).result.structuredContent;
|
|
338
346
|
expect(mcpJson?.items.map((item) => item.id)).toEqual(
|
|
339
347
|
restItems.map((item) => item.id),
|
|
340
348
|
);
|
|
@@ -352,16 +360,15 @@ describe.serial("reference API adapters", () => {
|
|
|
352
360
|
id: 10,
|
|
353
361
|
method: "initialize",
|
|
354
362
|
params: {
|
|
355
|
-
protocolVersion: "2025-
|
|
363
|
+
protocolVersion: "2025-11-25",
|
|
356
364
|
capabilities: {},
|
|
357
365
|
clientInfo: { name: "reference-test", version: "0" },
|
|
358
366
|
},
|
|
359
367
|
},
|
|
360
368
|
});
|
|
361
|
-
|
|
362
|
-
expect(initialized.
|
|
363
|
-
|
|
364
|
-
);
|
|
369
|
+
// MCP is stateless: 2025-era clients still initialize, but no session is minted.
|
|
370
|
+
expect(initialized.status).toBe(200);
|
|
371
|
+
expect(initialized.headers?.["Mcp-Session-Id"]).toBeUndefined();
|
|
365
372
|
|
|
366
373
|
const cross = await dispatch(runtime, {
|
|
367
374
|
method: "POST",
|
|
@@ -380,7 +387,7 @@ describe.serial("reference API adapters", () => {
|
|
|
380
387
|
},
|
|
381
388
|
},
|
|
382
389
|
});
|
|
383
|
-
expect((cross.body
|
|
390
|
+
expect(toolErrorCode(cross.body)).toBe("not_found");
|
|
384
391
|
|
|
385
392
|
const denied = await dispatch(runtime, {
|
|
386
393
|
method: "POST",
|
|
@@ -399,7 +406,7 @@ describe.serial("reference API adapters", () => {
|
|
|
399
406
|
},
|
|
400
407
|
},
|
|
401
408
|
});
|
|
402
|
-
expect((denied.body
|
|
409
|
+
expect(toolErrorCode(denied.body)).toBe("forbidden");
|
|
403
410
|
|
|
404
411
|
const deleted = await dispatch(runtime, {
|
|
405
412
|
method: "POST",
|