@danhachuel/thunderbolt 0.4.97 → 0.4.99

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.
@@ -120,7 +120,11 @@ def _safe_metadata(value: Any, *, key: str = "") -> Any:
120
120
 
121
121
 
122
122
  def _history() -> list[dict[str, Any]]:
123
- saved = storage.read_json(NOTIFICATIONS_FILE, [])
123
+ try:
124
+ saved = storage.read_json(NOTIFICATIONS_FILE, [])
125
+ except PermissionError:
126
+ # Um lock ou ficheiro sem permissões não deve interromper a interface.
127
+ return []
124
128
  if not isinstance(saved, list):
125
129
  return []
126
130
  return [item for item in saved if isinstance(item, dict)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.97",
3
+ "version": "0.4.99",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
package/scripts/cli.mjs CHANGED
@@ -201,7 +201,16 @@ const proxy = http.createServer((request, response) => {
201
201
  path: `${requestUrl.pathname}${requestUrl.search}`,
202
202
  headers: { ...request.headers, host: `127.0.0.1:${backendPort}` },
203
203
  }, (upstreamResponse) => {
204
- response.writeHead(upstreamResponse.statusCode || 502, upstreamResponse.headers);
204
+ const responseHeaders = { ...upstreamResponse.headers };
205
+ // Streamlit entrega HTML/JS de uma instância local que pode mudar após
206
+ // uma atualização via npx. Não permitir que o browser reaproveite uma
207
+ // página ou bundle da instância anterior.
208
+ delete responseHeaders.etag;
209
+ delete responseHeaders["last-modified"];
210
+ responseHeaders["cache-control"] = "no-store, no-cache, must-revalidate, max-age=0";
211
+ responseHeaders.pragma = "no-cache";
212
+ responseHeaders.expires = "0";
213
+ response.writeHead(upstreamResponse.statusCode || 502, responseHeaders);
205
214
  upstreamResponse.pipe(response);
206
215
  });
207
216
  upstream.on("error", (error) => {