zerochat 7.12.0__tar.gz → 8.0.0__tar.gz

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.
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: zerochat
3
+ Version: 8.0.0
4
+ Summary: Private local web client for AI models, tools and MCP services
5
+ Author: Alberto Alday
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://albalday.github.io/zerochat/
8
+ Project-URL: Repository, https://github.com/albalday/zerochat
9
+ Project-URL: Issues, https://github.com/albalday/zerochat/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ # ZeroChat
24
+
25
+ ZeroChat es un cliente web de uso personal para conversar con modelos de IA, consultar documentos y utilizar herramientas. Esta documentación corresponde a la serie **8.x**, que consolida las funcionalidades existentes. El desarrollo de nuevas funcionalidades queda en pausa por el momento.
26
+
27
+ La interfaz se sirve como archivos estáticos: `zerochat.html` necesita sus módulos `js/` y `css/`. El historial y la configuración se guardan en el navegador; no se sincronizan automáticamente entre dispositivos. Los proveedores remotos reciben el contenido incluido en las peticiones, y las herramientas web pueden utilizar servicios intermediarios. Almacenamiento local no significa privacidad absoluta.
28
+
29
+ *English:* ZeroChat is a web client for personal use: chatting with AI models, consulting documents and using tools. This documentation covers the **8.x** series, which consolidates existing features. New feature development is paused for now.
30
+
31
+ The interface is served as static files: `zerochat.html` needs its `js/` and `css/` modules. History and settings are stored in the browser, without automatic cross-device sync. Remote providers receive content included in requests, and web tools may use intermediary services. Local storage does not mean absolute privacy.
32
+
33
+ ## Características principales / Main features
34
+
35
+ - **Perfiles:** OpenAI y APIs de chat compatibles, Ollama, OpenRouter, Claude y Gemini. La visión, las herramientas y el razonamiento dependen del modelo y del adaptador.
36
+ - **WebLLM:** inferencia en el navegador con WebGPU, tras descargar un modelo. Necesita hardware compatible y memoria suficiente.
37
+ - **Documentos:** adjuntos y colecciones RAG con extracción local y búsqueda léxica mediante Orama; sin embeddings. Los fragmentos recuperados se envían al modelo elegido. La extracción de PDF tiene límites y no incluye OCR general.
38
+ - **Herramientas:** JavaScript aislado, búsqueda y lectura web, gráficos, planes y puntos de control. El backend opcional añade archivos, comandos, diagnósticos, automatización de navegador y servicios MCP.
39
+ - **Historial y diagnóstico:** ramas de conversación, exportación JSON y Markdown, impresión a PDF, métricas de contexto y revisión de peticiones antes del envío.
40
+
41
+ *English:*
42
+
43
+ - **Profiles:** OpenAI and compatible chat APIs, Ollama, OpenRouter, Claude and Gemini. Vision, tools and reasoning depend on the model and adapter.
44
+ - **WebLLM:** browser inference through WebGPU after downloading a model. Requires compatible hardware and enough memory.
45
+ - **Documents:** attachments and RAG collections with local extraction and Orama lexical search, without embeddings. Retrieved passages are sent to the selected model. PDF extraction has limitations and no general OCR.
46
+ - **Tools:** isolated JavaScript, web search and retrieval, charts, plans and checkpoints. The optional backend adds files, commands, diagnostics, browser automation and MCP services.
47
+ - **History and diagnostics:** conversation branches, JSON and Markdown export, printing to PDF, context metrics and request inspection before sending.
48
+
49
+ ## Inicio rápido / Quick start
50
+
51
+ Abre [ZeroChat en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), crea un perfil, introduce la URL y la clave si corresponde, consulta los modelos con **Query** y guarda. El perfil **Espejo** permite probar la interfaz sin inferencia. Para WebLLM, prepara un modelo del catálogo.
52
+
53
+ *English:* Open [ZeroChat on GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), create a profile, enter the URL and key where required, query models with **Query**, and save. **Mirror** lets you try the interface without inference. For WebLLM, prepare a catalogue model.
54
+
55
+ Para añadir herramientas del equipo, instala y ejecuta el backend con Python. / To add computer tools, install and run the Python backend:
56
+
57
+ ```bash
58
+ pip install zerochat
59
+ zerochat
60
+ ```
61
+
62
+ También puedes descargar el script y ejecutarlo. / You can also download and run the script:
63
+
64
+ ```bash
65
+ curl -sL https://albalday.github.io/zerochat/zerochat.py -o zerochat.py
66
+ python3 zerochat.py
67
+ ```
68
+
69
+ Fuera del repositorio de desarrollo, ambos modos abren la interfaz de GitHub Pages. Crean `~/zerochat/` para configuración y servicios, con `.venv/` para dependencias MCP Python. Mantén el proceso abierto y usa su enlace de arranque para autenticar la conexión local. Revisa **Ajustes → MCP** y **Permisos** antes de habilitar herramientas: los comandos actúan con los permisos del proceso local y detenerlos no deshace cambios.
70
+
71
+ Borrar `~/zerochat/` elimina ese estado y los MCP gestionados, no el ejecutable, los archivos modificados fuera de esa carpeta ni los datos del navegador. Exporta las conversaciones y perfiles que quieras conservar; sus copias no incluyen las colecciones RAG ni los modelos descargados. El cifrado predeterminado de perfiles utiliza una clave integrada conocida: trata las copias como archivos sensibles.
72
+
73
+ *English:* Outside the development repository, both modes open the GitHub Pages interface. They create `~/zerochat/` for configuration and services, with `.venv/` for Python MCP dependencies. Keep the process running and use its startup link to authenticate the local connection. Review **Settings → MCP** and **Permissions** before enabling tools: commands run with the local process permissions, and stopping them does not undo changes.
74
+
75
+ Deleting `~/zerochat/` removes that state and managed MCP services, not the executable, files changed elsewhere or browser data. Export conversations and profiles you want to keep; these backups do not include RAG collections or downloaded models. Default profile encryption uses a known built-in key: treat backups as sensitive files.
76
+
77
+ ## Documentación y ayuda / Documentation and help
78
+
79
+ - [Ayuda de ZeroChat 8.x — Español](https://albalday.github.io/zerochat/help/index.html)
80
+ - [ZeroChat 8.x help — English](https://albalday.github.io/zerochat/help/en/index.html)
81
+
82
+ Las guías explican configuración, uso y límites. Los informes conservan su versión y fecha de revisión originales; no son una certificación de 8.x ni una promesa de nuevas funcionalidades.
83
+
84
+ *English:* The guides explain setup, usage and limits. Reports retain their original reviewed version and date; they are not an 8.x certification or a promise of new features.
85
+
86
+ ## Desarrollo / Development
87
+
88
+ Trabaja en `dev`. Para instalar dependencias y ejecutar las pruebas del proyecto: / Work on `dev`. To install dependencies and run the project tests:
89
+
90
+ ```bash
91
+ npm install
92
+ npm test
93
+ ```
94
+
95
+ Dentro del repositorio, `python3 zerochat.py` sirve la interfaz local de desarrollo. Si modificas `py/`, reconstruye `zerochat.py` con `npm run build:backend`. La web carga directamente sus módulos, sin un bundle de aplicación.
96
+
97
+ *English:* Inside the repository, `python3 zerochat.py` serves the local development interface. After changing `py/`, rebuild `zerochat.py` with `npm run build:backend`. The web app loads its modules directly, without an application bundle.
98
+
99
+ Las normas y validaciones se describen en [`AGENTS.md`](./AGENTS.md) y [`tests/README.md`](./tests/README.md).
100
+
101
+ *English:* See those files for the applicable development rules and validation.
@@ -0,0 +1,79 @@
1
+ # ZeroChat
2
+
3
+ ZeroChat es un cliente web de uso personal para conversar con modelos de IA, consultar documentos y utilizar herramientas. Esta documentación corresponde a la serie **8.x**, que consolida las funcionalidades existentes. El desarrollo de nuevas funcionalidades queda en pausa por el momento.
4
+
5
+ La interfaz se sirve como archivos estáticos: `zerochat.html` necesita sus módulos `js/` y `css/`. El historial y la configuración se guardan en el navegador; no se sincronizan automáticamente entre dispositivos. Los proveedores remotos reciben el contenido incluido en las peticiones, y las herramientas web pueden utilizar servicios intermediarios. Almacenamiento local no significa privacidad absoluta.
6
+
7
+ *English:* ZeroChat is a web client for personal use: chatting with AI models, consulting documents and using tools. This documentation covers the **8.x** series, which consolidates existing features. New feature development is paused for now.
8
+
9
+ The interface is served as static files: `zerochat.html` needs its `js/` and `css/` modules. History and settings are stored in the browser, without automatic cross-device sync. Remote providers receive content included in requests, and web tools may use intermediary services. Local storage does not mean absolute privacy.
10
+
11
+ ## Características principales / Main features
12
+
13
+ - **Perfiles:** OpenAI y APIs de chat compatibles, Ollama, OpenRouter, Claude y Gemini. La visión, las herramientas y el razonamiento dependen del modelo y del adaptador.
14
+ - **WebLLM:** inferencia en el navegador con WebGPU, tras descargar un modelo. Necesita hardware compatible y memoria suficiente.
15
+ - **Documentos:** adjuntos y colecciones RAG con extracción local y búsqueda léxica mediante Orama; sin embeddings. Los fragmentos recuperados se envían al modelo elegido. La extracción de PDF tiene límites y no incluye OCR general.
16
+ - **Herramientas:** JavaScript aislado, búsqueda y lectura web, gráficos, planes y puntos de control. El backend opcional añade archivos, comandos, diagnósticos, automatización de navegador y servicios MCP.
17
+ - **Historial y diagnóstico:** ramas de conversación, exportación JSON y Markdown, impresión a PDF, métricas de contexto y revisión de peticiones antes del envío.
18
+
19
+ *English:*
20
+
21
+ - **Profiles:** OpenAI and compatible chat APIs, Ollama, OpenRouter, Claude and Gemini. Vision, tools and reasoning depend on the model and adapter.
22
+ - **WebLLM:** browser inference through WebGPU after downloading a model. Requires compatible hardware and enough memory.
23
+ - **Documents:** attachments and RAG collections with local extraction and Orama lexical search, without embeddings. Retrieved passages are sent to the selected model. PDF extraction has limitations and no general OCR.
24
+ - **Tools:** isolated JavaScript, web search and retrieval, charts, plans and checkpoints. The optional backend adds files, commands, diagnostics, browser automation and MCP services.
25
+ - **History and diagnostics:** conversation branches, JSON and Markdown export, printing to PDF, context metrics and request inspection before sending.
26
+
27
+ ## Inicio rápido / Quick start
28
+
29
+ Abre [ZeroChat en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), crea un perfil, introduce la URL y la clave si corresponde, consulta los modelos con **Query** y guarda. El perfil **Espejo** permite probar la interfaz sin inferencia. Para WebLLM, prepara un modelo del catálogo.
30
+
31
+ *English:* Open [ZeroChat on GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), create a profile, enter the URL and key where required, query models with **Query**, and save. **Mirror** lets you try the interface without inference. For WebLLM, prepare a catalogue model.
32
+
33
+ Para añadir herramientas del equipo, instala y ejecuta el backend con Python. / To add computer tools, install and run the Python backend:
34
+
35
+ ```bash
36
+ pip install zerochat
37
+ zerochat
38
+ ```
39
+
40
+ También puedes descargar el script y ejecutarlo. / You can also download and run the script:
41
+
42
+ ```bash
43
+ curl -sL https://albalday.github.io/zerochat/zerochat.py -o zerochat.py
44
+ python3 zerochat.py
45
+ ```
46
+
47
+ Fuera del repositorio de desarrollo, ambos modos abren la interfaz de GitHub Pages. Crean `~/zerochat/` para configuración y servicios, con `.venv/` para dependencias MCP Python. Mantén el proceso abierto y usa su enlace de arranque para autenticar la conexión local. Revisa **Ajustes → MCP** y **Permisos** antes de habilitar herramientas: los comandos actúan con los permisos del proceso local y detenerlos no deshace cambios.
48
+
49
+ Borrar `~/zerochat/` elimina ese estado y los MCP gestionados, no el ejecutable, los archivos modificados fuera de esa carpeta ni los datos del navegador. Exporta las conversaciones y perfiles que quieras conservar; sus copias no incluyen las colecciones RAG ni los modelos descargados. El cifrado predeterminado de perfiles utiliza una clave integrada conocida: trata las copias como archivos sensibles.
50
+
51
+ *English:* Outside the development repository, both modes open the GitHub Pages interface. They create `~/zerochat/` for configuration and services, with `.venv/` for Python MCP dependencies. Keep the process running and use its startup link to authenticate the local connection. Review **Settings → MCP** and **Permissions** before enabling tools: commands run with the local process permissions, and stopping them does not undo changes.
52
+
53
+ Deleting `~/zerochat/` removes that state and managed MCP services, not the executable, files changed elsewhere or browser data. Export conversations and profiles you want to keep; these backups do not include RAG collections or downloaded models. Default profile encryption uses a known built-in key: treat backups as sensitive files.
54
+
55
+ ## Documentación y ayuda / Documentation and help
56
+
57
+ - [Ayuda de ZeroChat 8.x — Español](https://albalday.github.io/zerochat/help/index.html)
58
+ - [ZeroChat 8.x help — English](https://albalday.github.io/zerochat/help/en/index.html)
59
+
60
+ Las guías explican configuración, uso y límites. Los informes conservan su versión y fecha de revisión originales; no son una certificación de 8.x ni una promesa de nuevas funcionalidades.
61
+
62
+ *English:* The guides explain setup, usage and limits. Reports retain their original reviewed version and date; they are not an 8.x certification or a promise of new features.
63
+
64
+ ## Desarrollo / Development
65
+
66
+ Trabaja en `dev`. Para instalar dependencias y ejecutar las pruebas del proyecto: / Work on `dev`. To install dependencies and run the project tests:
67
+
68
+ ```bash
69
+ npm install
70
+ npm test
71
+ ```
72
+
73
+ Dentro del repositorio, `python3 zerochat.py` sirve la interfaz local de desarrollo. Si modificas `py/`, reconstruye `zerochat.py` con `npm run build:backend`. La web carga directamente sus módulos, sin un bundle de aplicación.
74
+
75
+ *English:* Inside the repository, `python3 zerochat.py` serves the local development interface. After changing `py/`, rebuild `zerochat.py` with `npm run build:backend`. The web app loads its modules directly, without an application bundle.
76
+
77
+ Las normas y validaciones se describen en [`AGENTS.md`](./AGENTS.md) y [`tests/README.md`](./tests/README.md).
78
+
79
+ *English:* See those files for the applicable development rules and validation.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "zerochat"
7
- version = "7.12.0"
7
+ version = "8.0.0"
8
8
  description = "Private local web client for AI models, tools and MCP services"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: zerochat
3
+ Version: 8.0.0
4
+ Summary: Private local web client for AI models, tools and MCP services
5
+ Author: Alberto Alday
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://albalday.github.io/zerochat/
8
+ Project-URL: Repository, https://github.com/albalday/zerochat
9
+ Project-URL: Issues, https://github.com/albalday/zerochat/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ # ZeroChat
24
+
25
+ ZeroChat es un cliente web de uso personal para conversar con modelos de IA, consultar documentos y utilizar herramientas. Esta documentación corresponde a la serie **8.x**, que consolida las funcionalidades existentes. El desarrollo de nuevas funcionalidades queda en pausa por el momento.
26
+
27
+ La interfaz se sirve como archivos estáticos: `zerochat.html` necesita sus módulos `js/` y `css/`. El historial y la configuración se guardan en el navegador; no se sincronizan automáticamente entre dispositivos. Los proveedores remotos reciben el contenido incluido en las peticiones, y las herramientas web pueden utilizar servicios intermediarios. Almacenamiento local no significa privacidad absoluta.
28
+
29
+ *English:* ZeroChat is a web client for personal use: chatting with AI models, consulting documents and using tools. This documentation covers the **8.x** series, which consolidates existing features. New feature development is paused for now.
30
+
31
+ The interface is served as static files: `zerochat.html` needs its `js/` and `css/` modules. History and settings are stored in the browser, without automatic cross-device sync. Remote providers receive content included in requests, and web tools may use intermediary services. Local storage does not mean absolute privacy.
32
+
33
+ ## Características principales / Main features
34
+
35
+ - **Perfiles:** OpenAI y APIs de chat compatibles, Ollama, OpenRouter, Claude y Gemini. La visión, las herramientas y el razonamiento dependen del modelo y del adaptador.
36
+ - **WebLLM:** inferencia en el navegador con WebGPU, tras descargar un modelo. Necesita hardware compatible y memoria suficiente.
37
+ - **Documentos:** adjuntos y colecciones RAG con extracción local y búsqueda léxica mediante Orama; sin embeddings. Los fragmentos recuperados se envían al modelo elegido. La extracción de PDF tiene límites y no incluye OCR general.
38
+ - **Herramientas:** JavaScript aislado, búsqueda y lectura web, gráficos, planes y puntos de control. El backend opcional añade archivos, comandos, diagnósticos, automatización de navegador y servicios MCP.
39
+ - **Historial y diagnóstico:** ramas de conversación, exportación JSON y Markdown, impresión a PDF, métricas de contexto y revisión de peticiones antes del envío.
40
+
41
+ *English:*
42
+
43
+ - **Profiles:** OpenAI and compatible chat APIs, Ollama, OpenRouter, Claude and Gemini. Vision, tools and reasoning depend on the model and adapter.
44
+ - **WebLLM:** browser inference through WebGPU after downloading a model. Requires compatible hardware and enough memory.
45
+ - **Documents:** attachments and RAG collections with local extraction and Orama lexical search, without embeddings. Retrieved passages are sent to the selected model. PDF extraction has limitations and no general OCR.
46
+ - **Tools:** isolated JavaScript, web search and retrieval, charts, plans and checkpoints. The optional backend adds files, commands, diagnostics, browser automation and MCP services.
47
+ - **History and diagnostics:** conversation branches, JSON and Markdown export, printing to PDF, context metrics and request inspection before sending.
48
+
49
+ ## Inicio rápido / Quick start
50
+
51
+ Abre [ZeroChat en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), crea un perfil, introduce la URL y la clave si corresponde, consulta los modelos con **Query** y guarda. El perfil **Espejo** permite probar la interfaz sin inferencia. Para WebLLM, prepara un modelo del catálogo.
52
+
53
+ *English:* Open [ZeroChat on GitHub Pages](https://albalday.github.io/zerochat/zerochat.html), create a profile, enter the URL and key where required, query models with **Query**, and save. **Mirror** lets you try the interface without inference. For WebLLM, prepare a catalogue model.
54
+
55
+ Para añadir herramientas del equipo, instala y ejecuta el backend con Python. / To add computer tools, install and run the Python backend:
56
+
57
+ ```bash
58
+ pip install zerochat
59
+ zerochat
60
+ ```
61
+
62
+ También puedes descargar el script y ejecutarlo. / You can also download and run the script:
63
+
64
+ ```bash
65
+ curl -sL https://albalday.github.io/zerochat/zerochat.py -o zerochat.py
66
+ python3 zerochat.py
67
+ ```
68
+
69
+ Fuera del repositorio de desarrollo, ambos modos abren la interfaz de GitHub Pages. Crean `~/zerochat/` para configuración y servicios, con `.venv/` para dependencias MCP Python. Mantén el proceso abierto y usa su enlace de arranque para autenticar la conexión local. Revisa **Ajustes → MCP** y **Permisos** antes de habilitar herramientas: los comandos actúan con los permisos del proceso local y detenerlos no deshace cambios.
70
+
71
+ Borrar `~/zerochat/` elimina ese estado y los MCP gestionados, no el ejecutable, los archivos modificados fuera de esa carpeta ni los datos del navegador. Exporta las conversaciones y perfiles que quieras conservar; sus copias no incluyen las colecciones RAG ni los modelos descargados. El cifrado predeterminado de perfiles utiliza una clave integrada conocida: trata las copias como archivos sensibles.
72
+
73
+ *English:* Outside the development repository, both modes open the GitHub Pages interface. They create `~/zerochat/` for configuration and services, with `.venv/` for Python MCP dependencies. Keep the process running and use its startup link to authenticate the local connection. Review **Settings → MCP** and **Permissions** before enabling tools: commands run with the local process permissions, and stopping them does not undo changes.
74
+
75
+ Deleting `~/zerochat/` removes that state and managed MCP services, not the executable, files changed elsewhere or browser data. Export conversations and profiles you want to keep; these backups do not include RAG collections or downloaded models. Default profile encryption uses a known built-in key: treat backups as sensitive files.
76
+
77
+ ## Documentación y ayuda / Documentation and help
78
+
79
+ - [Ayuda de ZeroChat 8.x — Español](https://albalday.github.io/zerochat/help/index.html)
80
+ - [ZeroChat 8.x help — English](https://albalday.github.io/zerochat/help/en/index.html)
81
+
82
+ Las guías explican configuración, uso y límites. Los informes conservan su versión y fecha de revisión originales; no son una certificación de 8.x ni una promesa de nuevas funcionalidades.
83
+
84
+ *English:* The guides explain setup, usage and limits. Reports retain their original reviewed version and date; they are not an 8.x certification or a promise of new features.
85
+
86
+ ## Desarrollo / Development
87
+
88
+ Trabaja en `dev`. Para instalar dependencias y ejecutar las pruebas del proyecto: / Work on `dev`. To install dependencies and run the project tests:
89
+
90
+ ```bash
91
+ npm install
92
+ npm test
93
+ ```
94
+
95
+ Dentro del repositorio, `python3 zerochat.py` sirve la interfaz local de desarrollo. Si modificas `py/`, reconstruye `zerochat.py` con `npm run build:backend`. La web carga directamente sus módulos, sin un bundle de aplicación.
96
+
97
+ *English:* Inside the repository, `python3 zerochat.py` serves the local development interface. After changing `py/`, rebuild `zerochat.py` with `npm run build:backend`. The web app loads its modules directly, without an application bundle.
98
+
99
+ Las normas y validaciones se describen en [`AGENTS.md`](./AGENTS.md) y [`tests/README.md`](./tests/README.md).
100
+
101
+ *English:* See those files for the applicable development rules and validation.
@@ -42,7 +42,7 @@ import webbrowser
42
42
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
43
43
  from pathlib import Path
44
44
 
45
- SOURCE_BACKEND_VERSION = "7.12.0"
45
+ SOURCE_BACKEND_VERSION = "8.0.0"
46
46
 
47
47
  def _read_source_version(filename: str) -> str | None:
48
48
  """Lee la versión de un archivo del repositorio cuando se ejecuta desde fuentes."""
@@ -100,164 +100,95 @@ CONSOLE_STATUS_IDLE_SECONDS = 8.0
100
100
  CONSOLE_CONTROL = None
101
101
  NOTICES: list[str] = []
102
102
  NOTICES_LOCK = threading.Lock()
103
-
104
- def format_uptime(seconds: float) -> str:
105
- """Devuelve una duración breve y estable para la línea de estado de consola."""
106
- total = max(0, int(seconds))
107
- hours, remainder = divmod(total, 3600)
108
- minutes, secs = divmod(remainder, 60)
109
- return f"{hours:02d}:{minutes:02d}:{secs:02d}"
110
-
111
-
112
103
  class ConsoleControl:
113
- """Atajos de consola y línea de estado, solo para terminales interactivos."""
104
+ """Muestra una sola línea de ayuda tras un periodo de inactividad en consola."""
114
105
  def __init__(self, server: ThreadingHTTPServer, parser: argparse.ArgumentParser, target_url: str | None = None):
115
106
  self.server = server
116
107
  self.parser = parser
117
108
  self.target_url = target_url
118
- self.started_at = time.monotonic()
119
- self.last_activity = self.started_at
120
- self.stop_event = threading.Event()
109
+ self.last_activity = time.monotonic()
121
110
  self.lock = threading.Lock()
122
- self.status_visible = False
123
- self.enabled = bool(getattr(sys.stdin, "isatty", lambda: False)() and getattr(sys.stdout, "isatty", lambda: False)())
124
- self._threads: list[threading.Thread] = []
125
- self._terminal_fd: int | None = None
126
- self._terminal_state = None
111
+ self.enabled = bool(getattr(sys.stdout, "isatty", lambda: False)())
112
+ self._keyboard_enabled = bool(getattr(sys.stdin, "isatty", lambda: False)())
113
+ self._idle_timer: threading.Timer | None = None
114
+ self._keyboard_stop = threading.Event()
115
+ self._keyboard_thread: threading.Thread | None = None
116
+ self._timer_generation = 0
127
117
  self._closed = False
128
118
 
129
119
  def start(self):
130
- if not self.enabled:
131
- return
132
- if os.name != "nt":
133
- try:
134
- import termios
135
- import tty
136
- self._terminal_fd = sys.stdin.fileno()
137
- self._terminal_state = termios.tcgetattr(self._terminal_fd)
138
- tty.setcbreak(self._terminal_fd)
139
- except (OSError, ValueError):
140
- self._restore_terminal()
141
- self.enabled = False
142
- return
143
- self._threads = [
144
- threading.Thread(target=self._status_loop, name="zerochat-console-status", daemon=True),
145
- threading.Thread(target=self._keyboard_loop, name="zerochat-console-input", daemon=True),
146
- ]
147
- for thread in self._threads:
148
- thread.start()
120
+ if self.enabled:
121
+ self._reset_idle_timer()
122
+ if self._keyboard_enabled:
123
+ self._keyboard_thread = threading.Thread(target=self._keyboard_loop, name="zerochat-console-input", daemon=True)
124
+ self._keyboard_thread.start()
149
125
 
150
126
  def close(self):
151
- if self._closed:
152
- return
153
- self._closed = True
154
- self.stop_event.set()
155
- for thread in self._threads:
156
- if thread is not threading.current_thread():
157
- thread.join(timeout=1.0)
158
- self._restore_terminal()
159
- self.clear_status(final=True)
160
-
161
- def _restore_terminal(self):
162
- if self._terminal_fd is None or self._terminal_state is None:
163
- return
164
- try:
165
- import termios
166
- termios.tcsetattr(self._terminal_fd, termios.TCSADRAIN, self._terminal_state)
167
- except OSError:
168
- pass
169
- finally:
170
- self._terminal_fd = None
171
- self._terminal_state = None
172
-
173
- def clear_status(self, *, final: bool = False):
174
- if not self.enabled:
175
- return
176
127
  with self.lock:
177
- if self.status_visible:
178
- sys.stdout.write("\r\033[2K")
179
- self.status_visible = False
180
- if final:
181
- sys.stdout.write("\r\n")
182
- sys.stdout.flush()
128
+ self._closed = True
129
+ self._keyboard_stop.set()
130
+ if self._idle_timer:
131
+ self._idle_timer.cancel()
132
+ self._idle_timer = None
183
133
 
184
- def log(self, message: str, *, flush: bool = True):
134
+ def _reset_idle_timer(self):
185
135
  with self.lock:
186
- if self.enabled and self.status_visible:
187
- sys.stdout.write("\r\033[2K")
188
- self.status_visible = False
189
- print(message, flush=flush)
136
+ if self._closed:
137
+ return
190
138
  self.last_activity = time.monotonic()
191
-
192
- def show_help(self):
139
+ self._timer_generation += 1
140
+ if self._idle_timer:
141
+ self._idle_timer.cancel()
142
+ generation = self._timer_generation
143
+ self._idle_timer = threading.Timer(CONSOLE_STATUS_IDLE_SECONDS, self._show_commands_once, args=(generation,))
144
+ self._idle_timer.daemon = True
145
+ self._idle_timer.start()
146
+
147
+ def _show_commands_once(self, generation: int):
193
148
  with self.lock:
194
- if self.status_visible:
195
- sys.stdout.write("\r\033[2K")
196
- self.status_visible = False
149
+ if self._closed or generation != self._timer_generation:
150
+ return
197
151
  commands = "[h] ayuda · [n] Navegador"
198
152
  if get_notices():
199
153
  commands += " · [i] información"
200
- print(f"\nComandos de consola: {commands} · [x] salir ordenadamente\n", flush=True)
201
- print(self.parser.format_help().rstrip(), flush=True)
202
- self.last_activity = time.monotonic()
154
+ print(f"Comandos de consola: {commands} · [x] salir ordenadamente", flush=True)
155
+ self._idle_timer = None
156
+
157
+ def log(self, message: str, *, flush: bool = True):
158
+ print(message, flush=flush)
159
+ if self.enabled:
160
+ self._reset_idle_timer()
161
+
162
+ def show_help(self):
163
+ print(self.parser.format_help().rstrip(), flush=True)
203
164
 
204
165
  def show_notices(self):
205
166
  notices = get_notices()
206
167
  if not notices:
207
168
  return
208
- with self.lock:
209
- if self.status_visible:
210
- sys.stdout.write("\r\033[2K")
211
- self.status_visible = False
212
- print("\nInformación:", flush=True)
213
- for notice in notices:
214
- print(f"- {notice}", flush=True)
215
- print(flush=True)
216
- self.last_activity = time.monotonic()
217
-
218
- def _render_status(self):
219
- if not self.enabled:
220
- return
221
- uptime = format_uptime(time.monotonic() - self.started_at)
222
- with self.lock:
223
- if time.monotonic() - self.last_activity < CONSOLE_STATUS_IDLE_SECONDS:
224
- return
225
- commands = "[h] ayuda · [n] Navegador"
226
- if get_notices():
227
- commands += " · [i] información"
228
- sys.stdout.write(f"\r\033[2KZeroChat activo {uptime} · {commands} · [x] salir")
229
- sys.stdout.flush()
230
- self.status_visible = True
169
+ print("Información:", flush=True)
170
+ for notice in notices:
171
+ print(f"- {notice}", flush=True)
231
172
 
232
- def _status_loop(self):
233
- while not self.stop_event.wait(1.0):
234
- self._render_status()
235
-
236
- def _handle_key(self, key: str):
237
- if key.lower() == "h":
173
+ def _handle_command(self, command: str):
174
+ key = command.strip().lower()
175
+ if key == "h":
238
176
  self.show_help()
239
- elif key.lower() == "n":
240
- if self.target_url:
241
- launch_browser(self.target_url)
242
- elif key.lower() == "i":
177
+ elif key == "n" and self.target_url:
178
+ launch_browser(self.target_url)
179
+ elif key == "i":
243
180
  self.show_notices()
244
- elif key.lower() == "x":
181
+ elif key == "x":
245
182
  self.log(f"[{time.strftime('%H:%M:%S')}] Deteniendo servidor ZeroChat...")
246
183
  stop_zerochat_server(self.server)
247
184
 
248
185
  def _keyboard_loop(self):
249
- if os.name == "nt":
250
- import msvcrt
251
- while not self.stop_event.wait(0.05):
252
- if msvcrt.kbhit():
253
- self._handle_key(msvcrt.getwch())
254
- return
255
-
256
- import select
257
- while not self.stop_event.is_set():
258
- ready, _, _ = select.select([sys.stdin], [], [], 0.1)
259
- if ready:
260
- self._handle_key(sys.stdin.read(1))
186
+ """Lee comandos normales terminados con Intro, sin alterar el terminal."""
187
+ while not self._keyboard_stop.is_set():
188
+ line = sys.stdin.readline()
189
+ if not line:
190
+ return
191
+ self._handle_command(line)
261
192
 
262
193
 
263
194
  def console_log(message: str, *, flush: bool = True):
zerochat-7.12.0/PKG-INFO DELETED
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zerochat
3
- Version: 7.12.0
4
- Summary: Private local web client for AI models, tools and MCP services
5
- Author: Alberto Alday
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://albalday.github.io/zerochat/
8
- Project-URL: Repository, https://github.com/albalday/zerochat
9
- Project-URL: Issues, https://github.com/albalday/zerochat/issues
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Environment :: Web Environment
12
- Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Requires-Python: >=3.10
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Dynamic: license-file
22
-
23
- # ZeroChat
24
-
25
- ZeroChat es un cliente web universal para interactuar con modelos de inteligencia artificial y agentes de forma privada, rápida y sin intermediarios.
26
-
27
- Funciona de forma estática en el navegador (servido por GitHub Pages o directamente desde local en un único archivo HTML), almacenando tus conversaciones, configuraciones y datos de forma segura en tu propio dispositivo (IndexedDB).
28
-
29
- ## Características principales
30
-
31
- - **Multi-proveedor y modelos locales**: compatible con APIs estándar (OpenAI, Anthropic Claude, Google Gemini, OpenRouter) y motores locales (Ollama, LM Studio, vLLM, WebLLM con WebGPU directo en el navegador).
32
- - **Herramientas y MCP (Model Context Protocol)**: soporte para agentes, herramientas de búsqueda/cálculo y servidores MCP locales coordinados mediante `zerochat.py`.
33
- - **Conocimiento local (RAG)**: carga de documentos y recuperación contextual procesada íntegramente en el navegador.
34
- - **Privacidad absoluta**: tus claves API y datos viajan directamente de tu navegador al proveedor seleccionado, sin servidores puente de terceros.
35
- - **Sin necesidad de empaquetado**: distribuible de forma universal y ligera.
36
-
37
- ## Inicio rápido
38
-
39
- - **Uso web directo**: abre [zerochat.html en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html).
40
- - **Servidor local con herramientas MCP**:
41
- ```bash
42
- python3 zerochat.py
43
- ```
44
- Inicia el asistente local, crea `~/zerochat/.venv` para los MCP y abre la interfaz web en tu navegador.
45
- - **Instalación con PyPI**:
46
- ```bash
47
- pip install zerochat
48
- zerochat
49
- ```
50
- Es la vía recomendada para instalar el servidor local desde PyPI. Igual que con la descarga directa, crea `~/zerochat/` para el estado y los MCP; la interfaz se carga desde GitHub Pages.
51
-
52
- En ambos modos, `~/zerochat/` contiene configuración, token, servicios MCP y sus dependencias Python en `.venv/`. Borrar ese directorio elimina el estado local y los MCP, sin desinstalar el ejecutable de PyPI ni el archivo descargado.
53
-
54
- Las publicaciones se realizan desde el repositorio oficial mediante GitHub Actions y PyPI Trusted Publishing.
55
-
56
- ## Documentación y Ayuda
57
-
58
- Para consultar guías paso a paso, configuración de modelos, perfiles y agentes:
59
-
60
- - 📖 **[Centro de Ayuda de ZeroChat (Español)](https://albalday.github.io/zerochat/help/index.html)**
61
- - 📖 **[ZeroChat Documentation & Help (English)](https://albalday.github.io/zerochat/help/en/index.html)**
62
-
63
- ## Desarrollo
64
-
65
- Para ejecutar las pruebas del proyecto:
66
-
67
- ```bash
68
- npm install
69
- npm test
70
- ```
71
-
72
- Consulta [`AGENTS.md`](./AGENTS.md) para conocer las normas de desarrollo y arquitectura, y [`tests/README.md`](./tests/README.md) para la suite de pruebas.
zerochat-7.12.0/README.md DELETED
@@ -1,50 +0,0 @@
1
- # ZeroChat
2
-
3
- ZeroChat es un cliente web universal para interactuar con modelos de inteligencia artificial y agentes de forma privada, rápida y sin intermediarios.
4
-
5
- Funciona de forma estática en el navegador (servido por GitHub Pages o directamente desde local en un único archivo HTML), almacenando tus conversaciones, configuraciones y datos de forma segura en tu propio dispositivo (IndexedDB).
6
-
7
- ## Características principales
8
-
9
- - **Multi-proveedor y modelos locales**: compatible con APIs estándar (OpenAI, Anthropic Claude, Google Gemini, OpenRouter) y motores locales (Ollama, LM Studio, vLLM, WebLLM con WebGPU directo en el navegador).
10
- - **Herramientas y MCP (Model Context Protocol)**: soporte para agentes, herramientas de búsqueda/cálculo y servidores MCP locales coordinados mediante `zerochat.py`.
11
- - **Conocimiento local (RAG)**: carga de documentos y recuperación contextual procesada íntegramente en el navegador.
12
- - **Privacidad absoluta**: tus claves API y datos viajan directamente de tu navegador al proveedor seleccionado, sin servidores puente de terceros.
13
- - **Sin necesidad de empaquetado**: distribuible de forma universal y ligera.
14
-
15
- ## Inicio rápido
16
-
17
- - **Uso web directo**: abre [zerochat.html en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html).
18
- - **Servidor local con herramientas MCP**:
19
- ```bash
20
- python3 zerochat.py
21
- ```
22
- Inicia el asistente local, crea `~/zerochat/.venv` para los MCP y abre la interfaz web en tu navegador.
23
- - **Instalación con PyPI**:
24
- ```bash
25
- pip install zerochat
26
- zerochat
27
- ```
28
- Es la vía recomendada para instalar el servidor local desde PyPI. Igual que con la descarga directa, crea `~/zerochat/` para el estado y los MCP; la interfaz se carga desde GitHub Pages.
29
-
30
- En ambos modos, `~/zerochat/` contiene configuración, token, servicios MCP y sus dependencias Python en `.venv/`. Borrar ese directorio elimina el estado local y los MCP, sin desinstalar el ejecutable de PyPI ni el archivo descargado.
31
-
32
- Las publicaciones se realizan desde el repositorio oficial mediante GitHub Actions y PyPI Trusted Publishing.
33
-
34
- ## Documentación y Ayuda
35
-
36
- Para consultar guías paso a paso, configuración de modelos, perfiles y agentes:
37
-
38
- - 📖 **[Centro de Ayuda de ZeroChat (Español)](https://albalday.github.io/zerochat/help/index.html)**
39
- - 📖 **[ZeroChat Documentation & Help (English)](https://albalday.github.io/zerochat/help/en/index.html)**
40
-
41
- ## Desarrollo
42
-
43
- Para ejecutar las pruebas del proyecto:
44
-
45
- ```bash
46
- npm install
47
- npm test
48
- ```
49
-
50
- Consulta [`AGENTS.md`](./AGENTS.md) para conocer las normas de desarrollo y arquitectura, y [`tests/README.md`](./tests/README.md) para la suite de pruebas.
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zerochat
3
- Version: 7.12.0
4
- Summary: Private local web client for AI models, tools and MCP services
5
- Author: Alberto Alday
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://albalday.github.io/zerochat/
8
- Project-URL: Repository, https://github.com/albalday/zerochat
9
- Project-URL: Issues, https://github.com/albalday/zerochat/issues
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Environment :: Web Environment
12
- Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Requires-Python: >=3.10
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Dynamic: license-file
22
-
23
- # ZeroChat
24
-
25
- ZeroChat es un cliente web universal para interactuar con modelos de inteligencia artificial y agentes de forma privada, rápida y sin intermediarios.
26
-
27
- Funciona de forma estática en el navegador (servido por GitHub Pages o directamente desde local en un único archivo HTML), almacenando tus conversaciones, configuraciones y datos de forma segura en tu propio dispositivo (IndexedDB).
28
-
29
- ## Características principales
30
-
31
- - **Multi-proveedor y modelos locales**: compatible con APIs estándar (OpenAI, Anthropic Claude, Google Gemini, OpenRouter) y motores locales (Ollama, LM Studio, vLLM, WebLLM con WebGPU directo en el navegador).
32
- - **Herramientas y MCP (Model Context Protocol)**: soporte para agentes, herramientas de búsqueda/cálculo y servidores MCP locales coordinados mediante `zerochat.py`.
33
- - **Conocimiento local (RAG)**: carga de documentos y recuperación contextual procesada íntegramente en el navegador.
34
- - **Privacidad absoluta**: tus claves API y datos viajan directamente de tu navegador al proveedor seleccionado, sin servidores puente de terceros.
35
- - **Sin necesidad de empaquetado**: distribuible de forma universal y ligera.
36
-
37
- ## Inicio rápido
38
-
39
- - **Uso web directo**: abre [zerochat.html en GitHub Pages](https://albalday.github.io/zerochat/zerochat.html).
40
- - **Servidor local con herramientas MCP**:
41
- ```bash
42
- python3 zerochat.py
43
- ```
44
- Inicia el asistente local, crea `~/zerochat/.venv` para los MCP y abre la interfaz web en tu navegador.
45
- - **Instalación con PyPI**:
46
- ```bash
47
- pip install zerochat
48
- zerochat
49
- ```
50
- Es la vía recomendada para instalar el servidor local desde PyPI. Igual que con la descarga directa, crea `~/zerochat/` para el estado y los MCP; la interfaz se carga desde GitHub Pages.
51
-
52
- En ambos modos, `~/zerochat/` contiene configuración, token, servicios MCP y sus dependencias Python en `.venv/`. Borrar ese directorio elimina el estado local y los MCP, sin desinstalar el ejecutable de PyPI ni el archivo descargado.
53
-
54
- Las publicaciones se realizan desde el repositorio oficial mediante GitHub Actions y PyPI Trusted Publishing.
55
-
56
- ## Documentación y Ayuda
57
-
58
- Para consultar guías paso a paso, configuración de modelos, perfiles y agentes:
59
-
60
- - 📖 **[Centro de Ayuda de ZeroChat (Español)](https://albalday.github.io/zerochat/help/index.html)**
61
- - 📖 **[ZeroChat Documentation & Help (English)](https://albalday.github.io/zerochat/help/en/index.html)**
62
-
63
- ## Desarrollo
64
-
65
- Para ejecutar las pruebas del proyecto:
66
-
67
- ```bash
68
- npm install
69
- npm test
70
- ```
71
-
72
- Consulta [`AGENTS.md`](./AGENTS.md) para conocer las normas de desarrollo y arquitectura, y [`tests/README.md`](./tests/README.md) para la suite de pruebas.
File without changes
File without changes