@spencer-kit/coder-studio 0.4.6 → 0.4.8
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 +16 -0
- package/dist/esm/bin.mjs +2647 -875
- package/dist/esm/bin.mjs.map +4 -4
- package/dist/esm/server-runner.mjs +2619 -847
- package/dist/esm/server-runner.mjs.map +4 -4
- package/dist/web/assets/components-D5qT9_xF.css +1 -0
- package/dist/web/assets/components-DmD8Ga_M.js +109 -0
- package/dist/web/assets/components-DmD8Ga_M.js.map +1 -0
- package/dist/web/assets/{main-DZPwC4NB.js → main-C9Cqb7HD.js} +2 -2
- package/dist/web/assets/{main-DZPwC4NB.js.map → main-C9Cqb7HD.js.map} +1 -1
- package/dist/web/assets/{ui-preview-BzE9924q.js → ui-preview-DOaeyhSh.js} +2 -2
- package/dist/web/assets/{ui-preview-BzE9924q.js.map → ui-preview-DOaeyhSh.js.map} +1 -1
- package/dist/web/index.html +3 -3
- package/dist/web/ui-preview.html +3 -3
- package/package.json +3 -3
- package/src/update-worker.test.ts +25 -12
- package/dist/web/assets/components-BGEBLvHB.css +0 -1
- package/dist/web/assets/components-BuRmXlh8.js +0 -109
- package/dist/web/assets/components-BuRmXlh8.js.map +0 -1
package/dist/web/index.html
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
<meta name="description" content="Coder Studio - Agent-First Development Environment" />
|
|
7
7
|
<title>Coder Studio</title>
|
|
8
8
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
9
|
-
<script type="module" crossorigin src="/assets/main-
|
|
9
|
+
<script type="module" crossorigin src="/assets/main-C9Cqb7HD.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-CpWojdLp.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/monaco-editor-VTbRDH-J.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/xterm-BVlcrOZ1.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/components-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/components-DmD8Ga_M.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/monaco-editor-Br_kD0ds.css">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/xterm-BrP-ENHg.css">
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/components-
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/components-D5qT9_xF.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
package/dist/web/ui-preview.html
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Coder Studio UI Preview</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/ui-preview-
|
|
7
|
+
<script type="module" crossorigin src="/assets/ui-preview-DOaeyhSh.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-CpWojdLp.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/monaco-editor-VTbRDH-J.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/xterm-BVlcrOZ1.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/components-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/components-DmD8Ga_M.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/monaco-editor-Br_kD0ds.css">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/xterm-BrP-ENHg.css">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/components-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/components-D5qT9_xF.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spencer-kit/coder-studio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deploy once, code everywhere. Browser-based AI coding workspace for Claude Code and Codex.",
|
|
6
6
|
"main": "./dist/esm/index.mjs",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@types/ws": "^8.18.1",
|
|
50
50
|
"tsx": "^4.21.0",
|
|
51
51
|
"vitest": "^4.1.5",
|
|
52
|
-
"@coder-studio/
|
|
53
|
-
"@coder-studio/
|
|
52
|
+
"@coder-studio/core": "0.0.1",
|
|
53
|
+
"@coder-studio/server": "0.0.1"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=24.0.0"
|
|
@@ -4,6 +4,12 @@ import { join } from "node:path";
|
|
|
4
4
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { runRestartHandoff, runUpdateWorker } from "./update-worker.js";
|
|
6
6
|
|
|
7
|
+
type UpdateWorkerDeps = NonNullable<Parameters<typeof runUpdateWorker>[1]>;
|
|
8
|
+
type RestartHandoffDeps = NonNullable<Parameters<typeof runRestartHandoff>[1]>;
|
|
9
|
+
type RunCommandMock = NonNullable<UpdateWorkerDeps["runCommand"]>;
|
|
10
|
+
type SpawnDetachedProcessMock = NonNullable<UpdateWorkerDeps["spawnDetachedProcess"]>;
|
|
11
|
+
type WaitForProcessExitMock = NonNullable<RestartHandoffDeps["waitForProcessExit"]>;
|
|
12
|
+
|
|
7
13
|
describe("update-worker", () => {
|
|
8
14
|
const tempDirs: string[] = [];
|
|
9
15
|
|
|
@@ -31,8 +37,8 @@ describe("update-worker", () => {
|
|
|
31
37
|
|
|
32
38
|
it("writes restarting state and spawns a detached restart handoff after install success", async () => {
|
|
33
39
|
const env = createEnv();
|
|
34
|
-
const runCommand = vi.fn(async () => {});
|
|
35
|
-
const spawnDetachedProcess = vi.fn(async () => {});
|
|
40
|
+
const runCommand = vi.fn<RunCommandMock>(async () => {});
|
|
41
|
+
const spawnDetachedProcess = vi.fn<SpawnDetachedProcessMock>(async () => {});
|
|
36
42
|
|
|
37
43
|
await runUpdateWorker(env, {
|
|
38
44
|
runCommand,
|
|
@@ -61,7 +67,7 @@ describe("update-worker", () => {
|
|
|
61
67
|
|
|
62
68
|
it("falls back to manual_required on permission-related install errors", async () => {
|
|
63
69
|
const env = createEnv();
|
|
64
|
-
const runCommand = vi.fn(async () => {
|
|
70
|
+
const runCommand = vi.fn<RunCommandMock>(async () => {
|
|
65
71
|
throw new Error("npm install failed with EACCES");
|
|
66
72
|
});
|
|
67
73
|
|
|
@@ -82,8 +88,10 @@ describe("update-worker", () => {
|
|
|
82
88
|
|
|
83
89
|
it("marks restart failures with manual restart guidance", async () => {
|
|
84
90
|
const env = createEnv();
|
|
85
|
-
const runCommand = vi
|
|
86
|
-
|
|
91
|
+
const runCommand = vi
|
|
92
|
+
.fn<RunCommandMock>()
|
|
93
|
+
.mockRejectedValueOnce(new Error("pm2 restart failed"));
|
|
94
|
+
const waitForProcessExit = vi.fn<WaitForProcessExitMock>(async () => {});
|
|
87
95
|
|
|
88
96
|
await runRestartHandoff(env, {
|
|
89
97
|
runCommand,
|
|
@@ -105,8 +113,8 @@ describe("update-worker", () => {
|
|
|
105
113
|
|
|
106
114
|
it("sanitizes pm2 and runtime override env before invoking install and restart commands", async () => {
|
|
107
115
|
const env = createEnv();
|
|
108
|
-
const runCommand = vi.fn(async () => {});
|
|
109
|
-
const spawnDetachedProcess = vi.fn(async () => {});
|
|
116
|
+
const runCommand = vi.fn<RunCommandMock>(async () => {});
|
|
117
|
+
const spawnDetachedProcess = vi.fn<SpawnDetachedProcessMock>(async () => {});
|
|
110
118
|
const originalEnv = {
|
|
111
119
|
PM2_HOME: process.env.PM2_HOME,
|
|
112
120
|
PM2_PROGRAMMATIC: process.env.PM2_PROGRAMMATIC,
|
|
@@ -150,8 +158,12 @@ describe("update-worker", () => {
|
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
160
|
|
|
153
|
-
for (const
|
|
154
|
-
|
|
161
|
+
for (const [, , options] of runCommand.mock.calls) {
|
|
162
|
+
expect(options).toBeDefined();
|
|
163
|
+
if (!options) {
|
|
164
|
+
throw new Error("Expected runCommand to receive an options object");
|
|
165
|
+
}
|
|
166
|
+
|
|
155
167
|
expect(options.env?.PM2_HOME).toBe("/tmp/custom-pm2-home");
|
|
156
168
|
expect(options.env?.PM2_PROGRAMMATIC).toBeUndefined();
|
|
157
169
|
expect(options.env?.PM2_JSON_PROCESSING).toBeUndefined();
|
|
@@ -165,7 +177,8 @@ describe("update-worker", () => {
|
|
|
165
177
|
expect(options.env?.pm_id).toBeUndefined();
|
|
166
178
|
}
|
|
167
179
|
|
|
168
|
-
const
|
|
180
|
+
const handoffCall = spawnDetachedProcess.mock.calls[0];
|
|
181
|
+
const handoffEnv = handoffCall?.[2];
|
|
169
182
|
expect(handoffEnv?.PM2_HOME).toBe("/tmp/custom-pm2-home");
|
|
170
183
|
expect(handoffEnv?.PM2_PROGRAMMATIC).toBeUndefined();
|
|
171
184
|
expect(handoffEnv?.PM2_JSON_PROCESSING).toBeUndefined();
|
|
@@ -180,8 +193,8 @@ describe("update-worker", () => {
|
|
|
180
193
|
|
|
181
194
|
it("waits for the install worker to exit before running the restart command", async () => {
|
|
182
195
|
const env = createEnv();
|
|
183
|
-
const waitForProcessExit = vi.fn(async () => {});
|
|
184
|
-
const runCommand = vi.fn(async () => {});
|
|
196
|
+
const waitForProcessExit = vi.fn<WaitForProcessExitMock>(async () => {});
|
|
197
|
+
const runCommand = vi.fn<RunCommandMock>(async () => {});
|
|
185
198
|
|
|
186
199
|
await runRestartHandoff(env, {
|
|
187
200
|
runCommand,
|