cert-coach-web 0.1.0 → 0.1.2
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/AGENTS.md +4 -2
- package/README.md +15 -4
- package/engine/core/cert-core.mjs +6 -1
- package/engine/extractor.js +1 -1
- package/engine/scripts/export_private.ps1 +8 -6
- package/package.json +4 -3
- package/web/public/app.js +77 -1013
- package/web/public/index.html +1 -1
- package/web/public/spa-api.js +33 -0
- package/web/public/spa-chat.js +181 -0
- package/web/public/spa-dom.js +89 -0
- package/web/public/spa-logic.js +20 -0
- package/web/public/spa-mermaid.js +54 -0
- package/web/public/spa-question.js +206 -0
- package/web/public/spa-render.js +107 -0
- package/web/public/spa-store.js +100 -0
- package/web/public/spa-ui.js +62 -0
- package/web/public/spa-views.js +279 -0
- package/web/public/styles.css +1 -0
- package/web/server/chat.mjs +74 -4
- package/web/server/http.mjs +7 -2
package/web/server/http.mjs
CHANGED
|
@@ -383,8 +383,13 @@ export function createStudyServer({ root, loop, token = "", chat = null, runtime
|
|
|
383
383
|
if (method === "GET" && url.pathname === "/preview.js") {
|
|
384
384
|
return sendFile(res, path.join(PUBLIC, "preview.js"), "text/javascript; charset=utf-8");
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
// Serve any top-level module in web/public: /app.js, /spa-logic.js,
|
|
387
|
+
// /spa-render.js, /spa-store.js, ... The pattern forbids slashes and dots
|
|
388
|
+
// except the trailing .js, so it cannot escape PUBLIC.
|
|
389
|
+
if (method === "GET" && /^\/[a-z0-9-]+\.js$/.test(url.pathname)) {
|
|
390
|
+
const name = url.pathname.slice(1);
|
|
391
|
+
const file = path.join(PUBLIC, name);
|
|
392
|
+
if (fs.existsSync(file)) return sendFile(res, file, "text/javascript; charset=utf-8");
|
|
388
393
|
}
|
|
389
394
|
if (method === "GET" && url.pathname === "/styles.css") {
|
|
390
395
|
return sendFile(res, path.join(PUBLIC, "styles.css"), "text/css; charset=utf-8");
|