Independent Project Not affiliated with, sponsored by, or endorsed by the Watch Tower Bible and Tract Society or Jehovah's Witnesses.
jw-agent-toolkit
ES

Package · Library

jw-core

El núcleo determinístico

El corazón del toolkit. Todo lo demás depende de jw-core, y jw-core no depende de nada del workspace. Aquí viven los clientes HTTP que hablan con jw.org, los parsers determinísticos que convierten HTML/JSON/EPUB/JWPUB en modelos Pydantic, los writers que generan .jwpub y .jwlibrary nativos para JW Library, los providers de ASR (Deepgram, Whisper, Omnilingual 1672 idiomas via venv Python 3.12, whisperX diarizado F64) y traducción (NLLB-200 CC-BY-NC con preservación de refs), los schemas Pydantic de sws2apps/organized-app, el voiceprint store opt-in (F64.7) y la infraestructura compartida: cache SQLite con TTL, throttle por host, telemetría opt-in y autenticación JWT.

Features

What it does, in detail.

01

Clientes HTTP

CDNClient (búsqueda + JWT), WOLClient (capítulos, texto diario, fetch arbitrario, cross-refs), MediatorClient (idiomas + finder), PubMediaClient (descargas), TopicIndexClient (guía de investigación), WeblangClient (catálogo de idiomas). Todos opcionalmente con cache + throttle + telemetría.

02

Parsers + Writers determinísticos

Parsers: parse_reference (multiidioma), Article, DailyText, Verse, StudyNote + CrossReference, TopicIndex, Epub, JWPUB descifrado (F5.5), .jwlibrary backup (F19) y wol_url (F58.4: BibleRef.from_wol_url, port del lado JS F56.5). Writers: jwpub builder (F50, simétrico al descifrador) y jw_library_backup writer (F52, cierra el read-write loop con JW Library nativo).

03

Modelos Pydantic + schemas organized-app

Modelos propios: BibleRef · Verse · StudyNote · Article · Epub · JwpubMetadata · LanguageMetadata. F51 portó verbatim los schemas de sws2apps/organized-app (MIT) — PersonType, SchedWeekType, WeekType, AssignmentCode, MeetingAttendanceType, FieldServiceGroupType, UserFieldServiceMonthlyReportType — con envelope CRDT Timestamped[T].

04

Audio: ASR + TTS multi-provider (F34 + F53 + F64)

ASR providers con auto-routing por idioma: Deepgram (~16 idiomas, streaming), faster-whisper (local), Omnilingual ASR (1672 idiomas via venv Python 3.12 dedicado, F53), whisperX (F64, word-level timestamps + diarización pyannote, opt-in via extras [asr-whisperx]). DiarizedSegment + DiarizedResult extienden TranscriptionResult sin breaking. Speakers (F64.7): VoiceprintStore sqlite con Fernet opt-in JW_VOICEPRINT_KEY + SpeakerNameMapper cosine sim — mapea speaker_id → nombre real opt-in. TTS: Kokoro · Edge · System · ElevenLabs · Piper · XTTSv2 · F5. Routers F55.1 escogen el mejor disponible.

05

Traducción NLLB-200 con preservación de refs (F54)

translate_preserving_references() enmascara cada cita bíblica antes del modelo y la restaura en el idioma destino — cero alucinación numérica. NLLBProvider con CTranslate2 INT8 (200 idiomas, CC-BY-NC). is_commercial_safe=False chequeable a runtime; el router F55.1 filtra estructuralmente.

06

Infraestructura Fase 9 + crypto compartido

DiskCache (SQLite + TTL + WAL) · TokenBucket throttle · Telemetry opt-in · JWTManager · factory unificado de clientes. F50 añadió jwpub_crypto: XOR_KEY, compute_key_iv, encrypt_blob (nuevo), decrypt_blob — una sola fuente de verdad compartida por parser y writer JWPUB.

07

Multimodal end-to-end (F68 talk-lab · F69 broadcasting/visual · F70 image-quote · F71 book-camera)

talk_lab/: coach de oratoria local-first con WhisperX F64 + prosodia + 6 counsel points TOML es/en/pt, SVG timeline (report_to_svg) y F31 PDF export (talklab_to_studysheet + export_talk_lab_pdf). broadcasting/visual/: sampler de frames + VLM captioning + CLIP + RRF + OCR de frames vía F70 (enrich_frames_with_ocr). verification/image_quote/: VLM + OCR + RAG + NLI F39 con default_rag_retriever (env JW_IMAGE_QUOTE_STORE_PATH) y default_nli adapter sobre F39; engine.use_real_defaults=True. book_camera/: classifier procedural (verse / question / Watchtower paragraph / plain) + suggested_actions (read_aloud/open_in_jw_library/open_in_wol/show_answer).

08

ML predictivo + voz familiar (F72 doctrinal-drift · F76 family-voice-clone)

drift/: análisis diacrónico con partition_by_era + DBSCAN cosine en numpy puro + cluster_alignment + significance (minor/moderate/major). Nota Prov 4:18 trilingüe SIEMPRE inyectada. Wire-up F49 Second Brain con chunks_from_brain() y SVG drift timeline (drift_to_svg). audio/voice_clone/: TTS con voz familiar consentida + license gate 3 capas (deny list nombres + consent activo + non-commercial 5 regex) + FakeVoiceProvider determinista. Cifrado opt-in Fernet en encryption.py (JW_VOICE_KEY): encrypt_weights / decrypt_to_tempfile / generate_key. Audit hook emit_trace=fn compatible F43.

In practice

Four lines.
Verifiable result.

Resolver una cita y obtener su URL canónica en wol.jw.org.

python · jw-core
from jw_core import parse_reference

ref = parse_reference("Juan 3:16")
ref.display()             # 'John 3:16'
ref.wol_url(lang="es")    # 'https://wol.jw.org/es/wol/b/r4/...'
ref.book.code             # 'JHN'
ref.chapter, ref.verses   # (3, [16])

Public API

What the module exports.

Resumen de los símbolos principales. La exhaustive reference covers each one with signature, parameters, and examples.

  • parse_reference · translate_preserving_references
  • BibleRef · Verse · StudyNote · CrossReference
  • parsers.wol_url.parse_wol_url · BibleRef.from_wol_url
  • CDNClient · WOLClient · MediatorClient · PubMediaClient
  • writers.jwpub.JwpubBuilder · writers.jw_library_backup.write_backup
  • audio.transcription.get_asr_provider · OmnilingualProvider · WhisperXProvider
  • audio.speakers.VoiceprintStore · SpeakerNameMapper · DiarizedSegment
  • audio.voice_clone.{synthesize_with_voice, registry, encryption.{encrypt_weights, decrypt_to_tempfile}}
  • talk_lab.{analyze_recording, svg.report_to_svg, pdf_export.export_talk_lab_pdf}
  • broadcasting.visual.{indexer, search.hybrid_search, ocr_frame.enrich_frames_with_ocr}
  • verification.image_quote.{verify_image_quote, factories.{default_rag_retriever, default_nli}}
  • book_camera.{analyze_capture, classify_content}
  • drift.{analyze_doctrinal_drift, brain_source.chunks_from_brain, svg.drift_to_svg}
  • translation_providers.get_translation_provider · NLLBProvider
  • models_organized.PersonType · SchedWeekType · WeekType
  • DiskCache · Throttler · Telemetry · JWTManager