@danhachuel/thunderbolt 0.5.24 → 0.5.25
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 +21 -0
- package/app/main.py +1 -17
- package/hermes_ui/media_providers.py +2 -6
- package/package.json +6 -40
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.5.17
|
|
4
|
+
|
|
5
|
+
Removidos da secção Imagem e Video IA os selectores de provider principal de imagem, provider principal de vídeo e a checkbox de pool de vídeo externo. A ordem dos pools passa a ser definida pelos campos de Prioridade nos próprios cartões.
|
|
6
|
+
|
|
7
|
+
## 0.5.16
|
|
8
|
+
|
|
9
|
+
Adicionado um handler SIGINT no entry point do Streamlit que encerra o processo de forma controlada antes do handler de shutdown do Streamlit chamar `click.secho`, eliminando o caminho que provocava `LookupError: unknown encoding: utf-16-le` ao pressionar Ctrl+C no Windows.
|
|
10
|
+
|
|
11
|
+
## 0.5.15 (normalizado pelo npm para 0.5.15)
|
|
12
|
+
|
|
13
|
+
Aplicada a correcção definitiva do caminho de saída do Click no Windows, com shim UTF-8 carregado antes do Streamlit e teste de regressão para stdout com encoding `utf-16-le`.
|
|
14
|
+
|
|
15
|
+
## 0.5.09 (normalizado pelo npm para 0.5.9)
|
|
16
|
+
|
|
17
|
+
Adicionado um shim de compatibilidade que intercepta a escrita de saída do Click antes do carregamento do Streamlit e grava directamente em UTF-8, evitando o caminho nativo que volta a procurar `utf-16-le` durante o shutdown do Windows. Incluídos testes com um console simulado em `utf-16-le`.
|
|
18
|
+
|
|
19
|
+
## 0.5.08 (normalizado pelo npm para 0.5.8)
|
|
20
|
+
|
|
21
|
+
Corrigido o erro `LookupError: unknown encoding: utf-16-le` que podia ocorrer durante o shutdown do Streamlit no Windows. O launcher Node agora materializa as variáveis de encoding e `CLICK_NO_WIN_CONSOLE` no processo pai antes de iniciar Python; os workers de automação e pipeline também aplicam as mesmas definições antes dos imports restantes.
|
package/app/main.py
CHANGED
|
@@ -7285,22 +7285,6 @@ def render_media_provider_cards(settings: dict[str, Any], *, embedded: bool = Fa
|
|
|
7285
7285
|
with st.expander("Imagem e Video IA", expanded=False):
|
|
7286
7286
|
full_ia_labels = ", ".join(media_provider_definition(code).label for code in FULL_IA_VIDEO_PROVIDER_CODES)
|
|
7287
7287
|
st.caption(f"Configure providers de imagem e vídeo em cartões independentes. O router usa apenas o pool correspondente e faz failover entre providers activos. Pool Full IA: {full_ia_labels}.")
|
|
7288
|
-
image_cards = [card for card in cards if card.get("supports_image")]
|
|
7289
|
-
video_cards = [card for card in cards if card.get("supports_video")]
|
|
7290
|
-
selector_cols = st.columns(3)
|
|
7291
|
-
image_options = [""] + [str(card.get("id")) for card in image_cards]
|
|
7292
|
-
video_options = [""] + [str(card.get("id")) for card in video_cards]
|
|
7293
|
-
with selector_cols[0]:
|
|
7294
|
-
image_active_id = st.selectbox("Provider principal de imagem", image_options, index=image_options.index(str(settings.get(MEDIA_IMAGE_ACTIVE_CARD_KEY) or "")) if str(settings.get(MEDIA_IMAGE_ACTIVE_CARD_KEY) or "") in image_options else 0, format_func=lambda value: "Automático / primeiro activo" if not value else next((media_provider_definition(card.get("provider")).label for card in image_cards if str(card.get("id")) == value), value), key="media_image_active_selector")
|
|
7295
|
-
with selector_cols[1]:
|
|
7296
|
-
video_active_id = st.selectbox("Provider principal de vídeo", video_options, index=video_options.index(str(settings.get(MEDIA_VIDEO_ACTIVE_CARD_KEY) or "")) if str(settings.get(MEDIA_VIDEO_ACTIVE_CARD_KEY) or "") in video_options else 0, format_func=lambda value: "Não usar pool externo" if not value else next((media_provider_definition(card.get("provider")).label for card in video_cards if str(card.get("id")) == value), value), key="media_video_active_selector")
|
|
7297
|
-
with selector_cols[2]:
|
|
7298
|
-
video_pool_enabled = st.checkbox("Usar pool de vídeo externo", value=bool(settings.get("media_video_pool_enabled", False)), key="media_video_pool_enabled_ui")
|
|
7299
|
-
if st.button("Salvar selecção dos pools", use_container_width=True, key="save_media_pool_selection") if not embedded else st.form_submit_button("Salvar selecção dos pools", use_container_width=True, key="save_media_pool_selection"):
|
|
7300
|
-
settings["media_video_pool_enabled"] = bool(video_pool_enabled)
|
|
7301
|
-
_persist_media_cards(settings, cards, image_active_id, video_active_id)
|
|
7302
|
-
st.success("Selecção dos pools guardada.")
|
|
7303
|
-
st.rerun()
|
|
7304
7288
|
for index in range(len(cards)):
|
|
7305
7289
|
_render_media_provider_card(settings, cards, index, embedded=embedded)
|
|
7306
7290
|
st.divider()
|
|
@@ -7310,7 +7294,7 @@ def render_media_provider_cards(settings: dict[str, Any], *, embedded: bool = Fa
|
|
|
7310
7294
|
add_clicked = st.form_submit_button("Adicionar provider de imagem/vídeo", use_container_width=True, key="add_media_provider_card") if embedded else st.button("Adicionar provider de imagem/vídeo", use_container_width=True, key="add_media_provider_card")
|
|
7311
7295
|
if add_clicked:
|
|
7312
7296
|
cards.append(new_media_card(provider_to_add, card_id=f"media-{provider_to_add}-{uuid.uuid4().hex[:8]}"))
|
|
7313
|
-
_persist_media_cards(settings, cards,
|
|
7297
|
+
_persist_media_cards(settings, cards, str(settings.get(MEDIA_IMAGE_ACTIVE_CARD_KEY) or ""), str(settings.get(MEDIA_VIDEO_ACTIVE_CARD_KEY) or ""))
|
|
7314
7298
|
st.success("Novo provider de imagem/vídeo adicionado.")
|
|
7315
7299
|
st.rerun()
|
|
7316
7300
|
|
|
@@ -346,13 +346,9 @@ def apply_media_provider_cards_to_settings(settings: Mapping[str, Any], cards: l
|
|
|
346
346
|
def media_cards_for_pool(settings: Mapping[str, Any], pool: str, *, thumbnail_only: bool = False) -> list[dict[str, Any]]:
|
|
347
347
|
migrated, _ = ensure_media_provider_cards(settings)
|
|
348
348
|
capability = "supports_image" if pool == "image" else "supports_video" if pool == "video" else "supports_text"
|
|
349
|
-
active_key = MEDIA_IMAGE_ACTIVE_CARD_KEY if pool == "image" else MEDIA_VIDEO_ACTIVE_CARD_KEY if pool == "video" else ""
|
|
350
|
-
active_id = str(migrated.get(active_key) or "")
|
|
351
349
|
cards = [dict(item) for item in migrated.get(MEDIA_CARDS_KEY, []) if item.get("enabled", True) and item.get(capability)]
|
|
352
350
|
if pool == "image" and not thumbnail_only:
|
|
353
351
|
cards = [card for card in cards if not card.get("thumbnail_only")]
|
|
354
|
-
# A prioridade é o contrato
|
|
355
|
-
|
|
356
|
-
# ignorar uma escolha explícita do utilizador por causa de estado antigo.
|
|
357
|
-
cards.sort(key=lambda card: (int(card.get("priority", 0)), 0 if str(card.get("id")) == active_id else 1))
|
|
352
|
+
# A prioridade definida no próprio cartão é o contrato do failover.
|
|
353
|
+
cards.sort(key=lambda card: int(card.get("priority", 0)))
|
|
358
354
|
return cards
|
package/package.json
CHANGED
|
@@ -1,47 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danhachuel/thunderbolt",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.25",
|
|
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",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"bin": {
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"app/influencers_ui.py",
|
|
14
|
-
"app/modules/**/*.py",
|
|
15
|
-
"hermes_ui/*.py",
|
|
16
|
-
"integrations/*.py",
|
|
17
|
-
"integrations/data/*.json",
|
|
18
|
-
"scripts/*.mjs",
|
|
19
|
-
"scripts/*.py",
|
|
20
|
-
"seed/prompt_masters/**/*.md",
|
|
21
|
-
"seed/blueprints/**/*.json",
|
|
22
|
-
"seed/blueprints/**/*.md",
|
|
23
|
-
"seed/skills/*.md",
|
|
24
|
-
"seed/skills/*.py",
|
|
25
|
-
"seed/references/*.md",
|
|
26
|
-
"seed/references/*.sql",
|
|
27
|
-
"README.md",
|
|
28
|
-
"MANUAL-INSTALACAO.md",
|
|
29
|
-
"THIRD-PARTY-NOTICES.md",
|
|
30
|
-
"requirements.txt",
|
|
31
|
-
"sitecustomize.py",
|
|
32
|
-
"package.json",
|
|
33
|
-
".streamlit/config.toml"
|
|
34
|
-
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"postinstall": "node scripts/npx-cache-compat.mjs",
|
|
37
|
-
"start": "node scripts/cli.mjs",
|
|
38
|
-
"check": "node scripts/cli.mjs --check",
|
|
39
|
-
"pack:check": "npm pack --dry-run"
|
|
40
|
-
},
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
43
|
-
},
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=18"
|
|
46
|
-
}
|
|
8
|
+
"bin": {"thunderbolt": "scripts/cli.mjs"},
|
|
9
|
+
"files": ["app/main.py", "app/influencers_ui.py", "app/modules/**/*.py", "hermes_ui/*.py", "integrations/*.py", "integrations/data/*.json", "scripts/*.mjs", "scripts/*.py", "seed/prompt_masters/**/*.md", "seed/blueprints/**/*.json", "seed/blueprints/**/*.md", "seed/skills/*.md", "seed/skills/*.py", "seed/references/*.md", "seed/references/*.sql", "README.md", "CHANGELOG.md", "MANUAL-INSTALACAO.md", "THIRD-PARTY-NOTICES.md", "requirements.txt", "sitecustomize.py", "package.json", ".streamlit/config.toml"],
|
|
10
|
+
"scripts": {"postinstall": "node scripts/npx-cache-compat.mjs", "start": "node scripts/cli.mjs", "check": "node scripts/cli.mjs --check", "pack:check": "npm pack --dry-run"},
|
|
11
|
+
"publishConfig": {"access": "public"},
|
|
12
|
+
"engines": {"node": ">=18"}
|
|
47
13
|
}
|