@axiom-lattice/microsandbox-service 3.0.1 → 3.0.3

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 CHANGED
@@ -1,5 +1,52 @@
1
1
  # @axiom-lattice/microsandbox-service
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b928a17: Follow up the Wiz remediation with `pnpm audit`: bump the pinned transitive
8
+ dependencies to the advisories published after the scan (shell-quote 1.11 —
9
+ critical command injection — fastify 5.12.6, @fastify/busboy 3.2.2,
10
+ @hono/node-server 2.1.3, brace-expansion 1.1.21/2.1.7/5.0.12,
11
+ body-parser 1.20.9/2.4.0, decode-uri-component 0.5.1, fast-uri 3.1.9/4.2.3,
12
+ glob 10.5/11.1/14.0.4, langsmith 0.12, picomatch 2.3.2/4.0.4,
13
+ protobufjs 7.6.5/8.8.1, source-map-js 1.2.2, undici 7.30.1, sanitize-html
14
+ 2.18.1, tar 7.5.22, tmp 0.2.7, vite 6.4.5, yaml 2.9.1, ajv 6.14/8.18,
15
+ mysql2 3.23.1, uuid 11.1, and others). Overrides are scoped per major line
16
+ where different majors are both required, and none pins below a declaring
17
+ package's range. Further zero-out pass: echarts 5.5 → 6.1 in react-sdk,
18
+ katex 0.19.1 (the patched range starts at 0.18.2), glob 14.0.4 for every
19
+ affected major line (10/11/13/14; glob 7 is outside the advisory range),
20
+ minimatch 11.0.8 for every vulnerable line, rimraf 4/5 → 6.1.4 (drops the
21
+ glob 9 dependency), ibm-cloud-sdk-core 5.9.4 (pulls file-type 21.3.4), and
22
+ fast-xml-parser 5.12.0. The client-sdk build moves from tsup 6.7 to 8.5,
23
+ clearing the last GHSA-3mv9-4h5g-vhg3 finding. Drop the unused `xlsx`
24
+ dependency from `apps/web`, which has no patched npm release.
25
+
26
+ Overrides only apply to this monorepo, so also raise the published packages'
27
+ own dependency ranges to patched versions, otherwise downstream consumers
28
+ (fina_demo) resolve the old lower bounds when they reinstall: fastify
29
+ ^5.12.6 (gateway, microsandbox-service, opensandbox-gateway), react-router
30
+ ^7.18.2, vite ^6.4.5, mysql2 ^3.23.1 (core), and uuid ^11.1.1 (core, gateway,
31
+ pg-stores, react-sdk, and the cli-a2a peer range).
32
+
33
+ ## 3.0.2
34
+
35
+ ### Patch Changes
36
+
37
+ - c9b8df8: Remediate the security advisories in the Wiz report of 2026-11-10 by pinning
38
+ transitive dependencies to their first patched releases (axios, protobufjs,
39
+ hono and @hono/node-server, fast-uri, fastify 5.12, fast-xml-parser, dompurify,
40
+ mermaid, js-yaml, lodash, minimatch, postcss, rollup, tar, ws, and others),
41
+ using selector-scoped workspace overrides so incompatible major lines stay
42
+ apart.
43
+
44
+ Companion changes for the new versions: Fastify 5.12 types the error handler's
45
+ argument as `unknown`; `@hono/node-server` 1.19.15 destroys the socket from a
46
+ drain timer, so the Fastify inject mock socket gets a `destroySoon` shim;
47
+ react-sdk loads jsPDF's ESM-only browser build lazily; react-sdk moves to
48
+ react-router 7.18 and sandbox-console to Vite 6.4 / Vitest 4.
49
+
3
50
  ## 3.0.1
4
51
 
5
52
  ### Patch Changes
package/README.md CHANGED
@@ -176,7 +176,7 @@ Create a resident service and resolve its endpoint:
176
176
  curl -X PUT http://127.0.0.1:4002/api/sandboxes/plugin-weather \
177
177
  -H 'content-type: application/json' \
178
178
  -d '{
179
- "image": "kioko12520/sandbox:0.1.0",
179
+ "image": "kioko12520/sandbox:0.2.0",
180
180
  "entrypoint": ["node", "/root/.agents/.plugin-host/server.js"],
181
181
  "exposePorts": [8080]
182
182
  }'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/microsandbox-service",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "main": "dist/index.mjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "@fastify/sensible": "^6.0.3",
31
31
  "@fastify/swagger": "^9.5.1",
32
32
  "@fastify/swagger-ui": "^5.2.3",
33
- "fastify": "^5.5.0",
33
+ "fastify": "^5.12.6",
34
34
  "microsandbox": "^0.6.2",
35
35
  "zod": "4.6.7"
36
36
  },
@@ -0,0 +1,130 @@
1
+ import fastify, { type FastifyInstance } from "fastify";
2
+ import { registerSandboxRoutes } from "../routes/sandbox";
3
+ import type { RuntimeService } from "../types/runtime-service";
4
+
5
+ const FILE_PATH = "/root/a.txt";
6
+ const CONTENT = "hello";
7
+ const BINARY_BASE64 = Buffer.from([0, 1, 2, 0xff, 0xfe]).toString("base64");
8
+
9
+ function fakeRuntime(): RuntimeService {
10
+ const noop = jest.fn();
11
+ return {
12
+ ensureSandbox: noop,
13
+ startSandbox: noop,
14
+ stopSandbox: noop,
15
+ killSandbox: noop,
16
+ deleteSandbox: noop,
17
+ listSandboxes: noop,
18
+ getSandbox: noop,
19
+ getStatus: noop,
20
+ getEndpoint: noop,
21
+ resolveProxyTarget: noop,
22
+ readFile: jest.fn(async (_sandboxName: string, path: string) => ({
23
+ path,
24
+ content: CONTENT,
25
+ })),
26
+ writeFile: jest.fn(async (_sandboxName: string, path: string) => ({ path })),
27
+ deleteFile: jest.fn(async (_sandboxName: string, path: string) => ({ path })),
28
+ listPath: jest.fn(async (_sandboxName: string, path: string) => ({
29
+ entries: [{ path: `${path}/child.txt`, type: "file" }],
30
+ })),
31
+ findFiles: noop,
32
+ searchInFile: noop,
33
+ replaceInFile: noop,
34
+ uploadFile: jest.fn(async (_sandboxName: string, path: string) => ({ path })),
35
+ downloadFile: jest.fn(async (_sandboxName: string, path: string) => ({
36
+ path,
37
+ contentBase64: BINARY_BASE64,
38
+ })),
39
+ execCommand: noop,
40
+ getSandboxLogs: noop,
41
+ } as unknown as RuntimeService;
42
+ }
43
+
44
+ async function makeApp(): Promise<FastifyInstance> {
45
+ const app = fastify({ logger: false });
46
+ registerSandboxRoutes(app, fakeRuntime());
47
+ await app.ready();
48
+ return app;
49
+ }
50
+
51
+ async function request(method: "GET" | "POST", url: string, payload?: Record<string, unknown>) {
52
+ const app = await makeApp();
53
+ try {
54
+ return await app.inject({ method, url, payload });
55
+ } finally {
56
+ await app.close();
57
+ }
58
+ }
59
+
60
+ describe("sandbox file API contract (microsandbox)", () => {
61
+ it("read returns the canonical envelope", async () => {
62
+ const res = await request("POST", "/api/files/read", {
63
+ sandboxName: "sb",
64
+ path: FILE_PATH,
65
+ });
66
+ expect(res.statusCode).toBe(200);
67
+ expect(res.json()).toEqual({
68
+ success: true,
69
+ data: { path: FILE_PATH, content: CONTENT },
70
+ });
71
+ });
72
+
73
+ it("write returns the canonical envelope", async () => {
74
+ const res = await request("POST", "/api/files/write", {
75
+ sandboxName: "sb",
76
+ path: FILE_PATH,
77
+ content: CONTENT,
78
+ });
79
+ expect(res.json()).toEqual({ success: true, data: { path: FILE_PATH } });
80
+ });
81
+
82
+ it("delete returns the canonical envelope", async () => {
83
+ const res = await request("POST", "/api/files/delete", {
84
+ sandboxName: "sb",
85
+ path: FILE_PATH,
86
+ });
87
+ expect(res.json()).toEqual({ success: true, data: { path: FILE_PATH } });
88
+ });
89
+
90
+ it("list returns the canonical envelope", async () => {
91
+ const res = await request("POST", "/api/files/list", {
92
+ sandboxName: "sb",
93
+ path: "/root",
94
+ });
95
+ expect(res.json()).toEqual({
96
+ success: true,
97
+ data: { entries: [{ path: "/root/child.txt", type: "file" }] },
98
+ });
99
+ });
100
+
101
+ it("upload returns the canonical envelope", async () => {
102
+ const res = await request("POST", "/api/files/upload", {
103
+ sandboxName: "sb",
104
+ path: "/root/blob.bin",
105
+ contentBase64: BINARY_BASE64,
106
+ });
107
+ expect(res.json()).toEqual({
108
+ success: true,
109
+ data: { path: "/root/blob.bin" },
110
+ });
111
+ });
112
+
113
+ it("download returns the canonical binary base64 envelope", async () => {
114
+ const res = await request(
115
+ "GET",
116
+ `/api/files/download?sandboxName=sb&path=${encodeURIComponent("/root/blob.bin")}`
117
+ );
118
+ expect(res.json()).toEqual({
119
+ success: true,
120
+ data: { path: "/root/blob.bin", contentBase64: BINARY_BASE64 },
121
+ });
122
+ });
123
+
124
+ it("rejects malformed delete bodies", async () => {
125
+ const res = await request("POST", "/api/files/delete", {
126
+ sandboxName: "sb",
127
+ });
128
+ expect(res.statusCode).toBe(400);
129
+ });
130
+ });