codex-agent-view 0.3.2 → 0.4.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.
- package/.codex-plugin/plugin.json +4 -5
- package/README.ko.md +287 -0
- package/README.md +52 -327
- package/bin/codex-agent-view.mjs +113 -15
- package/package.json +4 -2
- package/public/app.js +34 -13
- package/public/index.html +1 -1
- package/scripts/auto-start-monitor.mjs +89 -0
- package/scripts/send-hook.mjs +67 -4
- package/skills/codex-agent-view/SKILL.md +29 -2
- package/skills/show-agents/SKILL.md +64 -0
- package/skills/show-agents/agents/openai.yaml +6 -0
- package/src/runtime/config.mjs +15 -0
- package/src/runtime/server.mjs +24 -8
package/src/runtime/server.mjs
CHANGED
|
@@ -126,6 +126,19 @@ export async function startMonitorServer({
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
if (
|
|
130
|
+
request.method === "POST" &&
|
|
131
|
+
requestUrl.pathname === "/api/internal/shutdown"
|
|
132
|
+
) {
|
|
133
|
+
response.once("finish", () => {
|
|
134
|
+
queueMicrotask(() => {
|
|
135
|
+
void close().catch(() => {});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
sendJson(response, 202, { status: "shutting_down" });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
129
142
|
const asset = request.method === "GET" ? STATIC_FILES.get(requestUrl.pathname) : null;
|
|
130
143
|
if (asset) {
|
|
131
144
|
const body = await readFile(fileURLToPath(asset.url));
|
|
@@ -181,16 +194,19 @@ export async function startMonitorServer({
|
|
|
181
194
|
throw error;
|
|
182
195
|
}
|
|
183
196
|
|
|
184
|
-
let
|
|
197
|
+
let closePromise = null;
|
|
185
198
|
async function close() {
|
|
186
|
-
if (
|
|
187
|
-
return;
|
|
199
|
+
if (closePromise) {
|
|
200
|
+
return closePromise;
|
|
188
201
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
closePromise = (async () => {
|
|
203
|
+
await new Promise((resolve, reject) => {
|
|
204
|
+
server.close((error) => (error ? reject(error) : resolve()));
|
|
205
|
+
server.closeIdleConnections?.();
|
|
206
|
+
});
|
|
207
|
+
await removeRuntimeInfo(token, env);
|
|
208
|
+
})();
|
|
209
|
+
return closePromise;
|
|
194
210
|
}
|
|
195
211
|
|
|
196
212
|
return {
|