pandrator-manager 0.9.1__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.
Files changed (78) hide show
  1. pandrator_manager-0.9.1/LICENSE +21 -0
  2. pandrator_manager-0.9.1/PKG-INFO +357 -0
  3. pandrator_manager-0.9.1/README.md +324 -0
  4. pandrator_manager-0.9.1/__init__.py +36 -0
  5. pandrator_manager-0.9.1/api/__init__.py +6 -0
  6. pandrator_manager-0.9.1/api/app.py +1797 -0
  7. pandrator_manager-0.9.1/api/openapi.py +254 -0
  8. pandrator_manager-0.9.1/api/schemas.py +92 -0
  9. pandrator_manager-0.9.1/application.py +450 -0
  10. pandrator_manager-0.9.1/artifacts/__init__.py +6 -0
  11. pandrator_manager-0.9.1/artifacts/download.py +181 -0
  12. pandrator_manager-0.9.1/artifacts/extract.py +93 -0
  13. pandrator_manager-0.9.1/auth/__init__.py +25 -0
  14. pandrator_manager-0.9.1/auth/automation.py +552 -0
  15. pandrator_manager-0.9.1/auth/credentials.py +432 -0
  16. pandrator_manager-0.9.1/autostart.py +250 -0
  17. pandrator_manager-0.9.1/cli.py +672 -0
  18. pandrator_manager-0.9.1/client.py +595 -0
  19. pandrator_manager-0.9.1/compat.py +19 -0
  20. pandrator_manager-0.9.1/components/__init__.py +6 -0
  21. pandrator_manager-0.9.1/components/builtin.py +659 -0
  22. pandrator_manager-0.9.1/components/catalog.py +780 -0
  23. pandrator_manager-0.9.1/components/crispasr.py +114 -0
  24. pandrator_manager-0.9.1/components/host.py +358 -0
  25. pandrator_manager-0.9.1/components/registry.py +238 -0
  26. pandrator_manager-0.9.1/components/runtime_bootstrap.py +334 -0
  27. pandrator_manager-0.9.1/components/slots.py +39 -0
  28. pandrator_manager-0.9.1/context.py +243 -0
  29. pandrator_manager-0.9.1/daemon.py +506 -0
  30. pandrator_manager-0.9.1/doctor.py +702 -0
  31. pandrator_manager-0.9.1/environments/__init__.py +13 -0
  32. pandrator_manager-0.9.1/environments/bootstrap.py +390 -0
  33. pandrator_manager-0.9.1/environments/pixi.py +112 -0
  34. pandrator_manager-0.9.1/errors.py +66 -0
  35. pandrator_manager-0.9.1/launcher.py +975 -0
  36. pandrator_manager-0.9.1/legacy.py +948 -0
  37. pandrator_manager-0.9.1/legacy_data.py +474 -0
  38. pandrator_manager-0.9.1/lifecycle.py +394 -0
  39. pandrator_manager-0.9.1/models.py +518 -0
  40. pandrator_manager-0.9.1/network.py +316 -0
  41. pandrator_manager-0.9.1/operations/__init__.py +6 -0
  42. pandrator_manager-0.9.1/operations/engine.py +554 -0
  43. pandrator_manager-0.9.1/operations/handlers.py +1785 -0
  44. pandrator_manager-0.9.1/pandrator_manager.egg-info/PKG-INFO +357 -0
  45. pandrator_manager-0.9.1/pandrator_manager.egg-info/SOURCES.txt +97 -0
  46. pandrator_manager-0.9.1/pandrator_manager.egg-info/dependency_links.txt +1 -0
  47. pandrator_manager-0.9.1/pandrator_manager.egg-info/entry_points.txt +5 -0
  48. pandrator_manager-0.9.1/pandrator_manager.egg-info/requires.txt +21 -0
  49. pandrator_manager-0.9.1/pandrator_manager.egg-info/top_level.txt +1 -0
  50. pandrator_manager-0.9.1/planning.py +355 -0
  51. pandrator_manager-0.9.1/preflight.py +384 -0
  52. pandrator_manager-0.9.1/processes/__init__.py +12 -0
  53. pandrator_manager-0.9.1/processes/identity.py +58 -0
  54. pandrator_manager-0.9.1/processes/runner.py +236 -0
  55. pandrator_manager-0.9.1/pyproject.toml +101 -0
  56. pandrator_manager-0.9.1/recovery_ui/__init__.py +1 -0
  57. pandrator_manager-0.9.1/recovery_ui/static/app.js +2141 -0
  58. pandrator_manager-0.9.1/recovery_ui/static/index.html +632 -0
  59. pandrator_manager-0.9.1/recovery_ui/static/styles.css +1488 -0
  60. pandrator_manager-0.9.1/releases/__init__.py +62 -0
  61. pandrator_manager-0.9.1/releases/authority.py +257 -0
  62. pandrator_manager-0.9.1/releases/bundles.py +178 -0
  63. pandrator_manager-0.9.1/releases/discovery.py +130 -0
  64. pandrator_manager-0.9.1/releases/handoff.py +1336 -0
  65. pandrator_manager-0.9.1/releases/models.py +175 -0
  66. pandrator_manager-0.9.1/releases/planning.py +419 -0
  67. pandrator_manager-0.9.1/releases/slots.py +319 -0
  68. pandrator_manager-0.9.1/releases/trust.py +236 -0
  69. pandrator_manager-0.9.1/runtime_specs.py +622 -0
  70. pandrator_manager-0.9.1/setup.cfg +4 -0
  71. pandrator_manager-0.9.1/state/__init__.py +5 -0
  72. pandrator_manager-0.9.1/state/migrations.py +292 -0
  73. pandrator_manager-0.9.1/state/store.py +1694 -0
  74. pandrator_manager-0.9.1/supervisor/__init__.py +5 -0
  75. pandrator_manager-0.9.1/supervisor/runtime.py +793 -0
  76. pandrator_manager-0.9.1/tray/__init__.py +211 -0
  77. pandrator_manager-0.9.1/uninstall.py +1568 -0
  78. pandrator_manager-0.9.1/workspace_selection.py +456 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Lukasz Liniewicz and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,357 @@
1
+ Metadata-Version: 2.4
2
+ Name: pandrator-manager
3
+ Version: 0.9.1
4
+ Summary: Per-user installation, update, repair, and runtime manager for Pandrator
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/lukaszliniewicz/Pandrator
7
+ Project-URL: Documentation, https://github.com/lukaszliniewicz/Pandrator/tree/main/pandrator_manager
8
+ Project-URL: Repository, https://github.com/lukaszliniewicz/Pandrator
9
+ Project-URL: Issues, https://github.com/lukaszliniewicz/Pandrator/issues
10
+ Project-URL: Releases, https://github.com/lukaszliniewicz/Pandrator/releases
11
+ Requires-Python: <3.13,>=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: certifi>=2024.8
15
+ Requires-Dist: cryptography<46,>=43
16
+ Requires-Dist: dulwich<1,>=0.22
17
+ Requires-Dist: flask<4,>=3.1
18
+ Requires-Dist: packaging<26,>=24
19
+ Requires-Dist: psutil<8,>=6
20
+ Requires-Dist: pydantic<3,>=2.10
21
+ Requires-Dist: requests<3,>=2.32
22
+ Requires-Dist: waitress<4,>=3.0
23
+ Provides-Extra: tray
24
+ Requires-Dist: Pillow<13,>=10; extra == "tray"
25
+ Requires-Dist: pystray<1,>=0.19; extra == "tray"
26
+ Provides-Extra: build
27
+ Requires-Dist: build<2,>=1.2; extra == "build"
28
+ Requires-Dist: PyInstaller==6.20.0; extra == "build"
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest<9,>=8.3; extra == "dev"
31
+ Requires-Dist: ruff==0.16.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # Pandrator Manager
35
+
36
+ `pandrator-manager` is Pandrator's Qt-free, per-user installation, update,
37
+ repair, removal, and runtime control plane. It runs independently of the
38
+ Pandrator application, browser, and optional tray client, and exposes an
39
+ authenticated loopback API plus a standalone setup/recovery WebUI. Explicit
40
+ private-network and HTTPS-ingress profiles support headless servers and GPU
41
+ pods without changing the loopback-only default.
42
+
43
+ The current release is 0.9.1. For most users, the easiest installation is the
44
+ Windows executable or Linux AppImage on the
45
+ [Pandrator 0.6.1 release page](https://github.com/lukaszliniewicz/Pandrator/releases/tag/v.0.6.1).
46
+ These packages include their own runtime and do not require a suitable system
47
+ Python.
48
+
49
+ ## Safety and ownership
50
+
51
+ - One Manager instance controls one explicit workspace.
52
+ - Install, update, repair, removal, and runtime changes show an exact plan
53
+ before they run.
54
+ - The Manager checks disk space, paths, ports, downloads, and other
55
+ prerequisites before changing the installation.
56
+ - Components are staged and validated before becoming active. A failed
57
+ activation returns to the previous working slot.
58
+ - The Manager stops only processes it can identify and removes only paths it
59
+ owns.
60
+ - User data is separate from replaceable runtimes and is preserved by default.
61
+ - The optional tray is only a client. Closing it does not stop the Manager,
62
+ Pandrator, or a running service.
63
+ - Product updates are checked against project-signed manifests and artifact
64
+ hashes.
65
+
66
+ The Windows executable is not Authenticode-signed and may produce an
67
+ **Unknown publisher** or SmartScreen warning. Verify its release checksum when
68
+ you download it.
69
+
70
+ ## Installation
71
+
72
+ The native packages are the recommended installation:
73
+
74
+ - Windows:
75
+ [PandratorManager-0.9.1-windows-x86_64.exe](https://github.com/lukaszliniewicz/Pandrator/releases/download/v.0.6.1/PandratorManager-0.9.1-windows-x86_64.exe)
76
+ - Linux:
77
+ [PandratorManager-0.9.1-x86_64.AppImage](https://github.com/lukaszliniewicz/Pandrator/releases/download/v.0.6.1/PandratorManager-0.9.1-x86_64.AppImage)
78
+
79
+ If you already have Python 3.11 or 3.12, install the Manager as an isolated
80
+ command-line tool:
81
+
82
+ ```bash
83
+ pipx install pandrator-manager
84
+ # or
85
+ uv tool install pandrator-manager
86
+ ```
87
+
88
+ Use `pandrator-manager[tray]` instead if you want the optional desktop tray.
89
+ For a downloaded wheel, replace the package name with its local path.
90
+
91
+ For development from this checkout:
92
+
93
+ ```bash
94
+ python -m pip install -e ./pandrator_manager
95
+ ```
96
+
97
+ A normal Python package installation does not enable autostart, launch a
98
+ daemon, download a component, or request elevation.
99
+
100
+ ### Installation location
101
+
102
+ On its first interactive desktop launch, the native Windows or Linux launcher
103
+ opens the operating system's folder chooser. Select the **parent directory**;
104
+ the managed installation is created as `<selected directory>/Pandrator`.
105
+ Cancelling the chooser makes no installation changes.
106
+
107
+ The launcher stores the canonical parent directory in the user's platform
108
+ configuration directory and reuses it on later launcher, CLI, and optional
109
+ tray runs. The installed stable launcher also identifies its own workspace,
110
+ while autostart, manager handoff, and every component operation carry that
111
+ workspace explicitly. This prevents a later component installation from
112
+ silently returning to the home directory.
113
+
114
+ Use `--choose-workspace` to reopen the chooser, or select a location
115
+ non-interactively:
116
+
117
+ ```bash
118
+ PandratorManager-x86_64.AppImage setup --workspace /path/to/parent
119
+ PandratorManager-0.9.1-windows-x86_64.exe setup --workspace D:\path\to\parent
120
+ ```
121
+
122
+ `--workspace` takes precedence over `PANDRATOR_WORKSPACE`, which takes
123
+ precedence over launcher discovery and the remembered preference. Headless
124
+ deployments should pass one of those explicit values; `--no-open` never opens
125
+ a native dialog. The launcher can also reuse the workspace preference written
126
+ by older Pandrator installers.
127
+
128
+ ## Basic use
129
+
130
+ ```bash
131
+ pandrator-manager --workspace /path/to/workspace start-manager
132
+ pandrator-manager --workspace /path/to/workspace status
133
+ pandrator-manager --workspace /path/to/workspace list
134
+ pandrator-manager --workspace /path/to/workspace open --recovery
135
+ ```
136
+
137
+ The mutation grammar is plan first, then execute the same action only when the
138
+ component reports it as supported:
139
+
140
+ ```bash
141
+ pandrator-manager --workspace /path/to/workspace plan \
142
+ --kind ACTION --component ID[:COMPUTE[:QUANTIZATION]]
143
+ pandrator-manager --workspace /path/to/workspace ACTION \
144
+ --component ID[:COMPUTE[:QUANTIZATION]] --yes --wait
145
+ ```
146
+
147
+ The first command is read-only. The action is available only when the
148
+ Manager's component definition has a supported recipe; see
149
+ [Current component coverage](#current-component-coverage).
150
+
151
+ Runtime and recovery examples:
152
+
153
+ ```bash
154
+ pandrator-manager --workspace /path/to/workspace runtime-start tts.xtts
155
+ pandrator-manager --workspace /path/to/workspace operations --active
156
+ pandrator-manager --workspace /path/to/workspace cancel OPERATION_ID
157
+ pandrator-manager --workspace /path/to/workspace doctor
158
+ pandrator-manager --workspace /path/to/workspace autostart enable
159
+ ```
160
+
161
+ Use `--json` for automation. The manager API and operation records are
162
+ versioned; clients should use stable component and service IDs rather than
163
+ persisting transient loopback ports.
164
+
165
+ ## Headless and remote deployment
166
+
167
+ The native launcher can prepare exact workstation-facing URLs for both
168
+ setup/recovery and Pandrator:
169
+
170
+ ```bash
171
+ pandrator-manager-launcher setup \
172
+ --workspace /srv/pandrator \
173
+ --remote-setup-url https://setup.example.test \
174
+ --remote-pandrator-url https://pandrator.example.test \
175
+ --trusted-proxy-hops 1 \
176
+ --no-open
177
+ ```
178
+
179
+ The command still prints a short-lived, one-use recovery URL when
180
+ `--no-open` is used. HTTPS mode expects an operated reverse proxy or ingress
181
+ and binds to `127.0.0.1` by default. For a pod ingress in another network
182
+ namespace, add `--network-bind-host 0.0.0.0` and restrict access with the
183
+ platform's network policy.
184
+
185
+ The URL token is only a bootstrap credential. After exchange, the browser
186
+ receives a revocable, HTTP-only authorization that survives manager restarts
187
+ and ordinary updates; only its SHA-256 digest is stored in manager state.
188
+ Loopback and HTTPS authorizations use a 30-day inactivity window and a 90-day
189
+ absolute limit. Trusted private HTTP offers a remembered-browser choice with a
190
+ 7-day inactivity window and 30-day absolute limit, or a browser-session-only
191
+ authorization. Reloading the page renews CSRF state without requiring another
192
+ launch URL. The recovery header can sign out the current browser or forget all
193
+ authorized browsers.
194
+
195
+ For a trusted LAN or VPN without TLS, use exact
196
+ `http://server:port` URLs and `--allow-insecure-private-network`. The public
197
+ and listening ports must match, forwarded headers are not trusted, and an
198
+ owner password must be initialized locally because the manager will not
199
+ accept password submission over remote plain HTTP. `PANDRATOR_OWNER_PASSWORD`
200
+ is supported as a one-time deployment secret for first startup; it is
201
+ consumed from the environment and is not persisted or forwarded to backend
202
+ workers.
203
+
204
+ The remote setup manager controls only its own host and workspace; it is not a
205
+ multi-host controller. The normal Pandrator WebUI keeps host mutations local
206
+ by default. A deliberately administered single-owner deployment may set
207
+ `PANDRATOR_ALLOW_REMOTE_MANAGER_MUTATIONS=1`, while the recovery UI remains
208
+ the recommended remote installation and repair surface.
209
+
210
+ ### MCP recovery enrollment
211
+
212
+ Pandrator MCP normally reaches Manager through the authenticated application
213
+ proxy. This keeps the permanent Manager client bearer on the managed host.
214
+
215
+ An operator who needs app-down remote diagnostics or recovery may expose the
216
+ Manager's separately bounded HTTPS recovery origin and enroll a distinct MCP
217
+ credential:
218
+
219
+ ```bash
220
+ pandrator-mcp target add production \
221
+ --mode external \
222
+ --origin https://pandrator.example \
223
+ --recovery-origin https://recovery.pandrator.example \
224
+ --scope app.read \
225
+ --scope manager.read \
226
+ --recovery-scope manager.read \
227
+ --recovery-scope manager.runtime
228
+
229
+ pandrator-mcp target login production
230
+ pandrator-mcp target pin production
231
+ pandrator-mcp target login production --manager-recovery
232
+ pandrator-mcp doctor --target production
233
+ ```
234
+
235
+ Open the one-use Manager recovery URL first so the enrollment approval opens
236
+ in an authorized browser. The approval page shows the client, both canonical
237
+ origins, requested scopes, and expiry. The issued recovery credential is
238
+ audience- and instance-bound, expires after at most 30 days, is rate-limited
239
+ per client, and is stored directly in the workstation's OS keyring.
240
+
241
+ Direct automation is disabled unless Manager is configured with an exact
242
+ HTTPS recovery origin. It cannot use the permanent local bearer, change
243
+ network settings, access arbitrary files, or bypass native plans and
244
+ confirmations. Application and recovery clients can be revoked independently
245
+ through their owner-authorized client-administration APIs.
246
+
247
+ The local workspace owner can inspect and revoke recovery clients without
248
+ copying the permanent Manager bearer out of the host:
249
+
250
+ ```bash
251
+ pandrator-manager --workspace /srv/pandrator automation-client list
252
+ pandrator-manager --workspace /srv/pandrator automation-client revoke CLIENT_ID --yes
253
+ ```
254
+
255
+ The recovery browser offers the same owner operation. After server-side
256
+ revocation, delete the controller's separate keyring value with
257
+ `pandrator-mcp target logout production --manager-recovery --yes`.
258
+
259
+ For a pod, persist both the Pandrator data root and the Manager workspace/state
260
+ and restrict a cross-namespace `--network-bind-host 0.0.0.0` listener with
261
+ platform network policy. Losing either state volume changes the identity that
262
+ the MCP pins and requires deliberate re-enrollment.
263
+
264
+ The complete workstation, LAN, external-server, pod, and agent-host setup is in
265
+ the
266
+ [Pandrator MCP guide](https://github.com/lukaszliniewicz/Pandrator/tree/main/pandrator_mcp).
267
+
268
+ ## Legacy import, releases, and uninstall
269
+
270
+ Inspect legacy state without changing it:
271
+
272
+ ```bash
273
+ pandrator-manager --workspace /path/to/workspace legacy
274
+ pandrator-manager --workspace /path/to/workspace legacy-import --yes
275
+ ```
276
+
277
+ The first command only inspects the older installation. Import keeps unknown
278
+ files in place, can be repeated safely, and refuses to proceed if the inspected
279
+ source changes before confirmation. Use `--json` for automation.
280
+
281
+ Inspect accepted release slots or review a signed release:
282
+
283
+ ```bash
284
+ pandrator-manager --workspace /path/to/workspace releases
285
+ pandrator-manager --workspace /path/to/workspace release-plan \
286
+ --manifest /path/to/release-manifest.json
287
+ pandrator-manager --workspace /path/to/workspace release-update \
288
+ --manifest /path/to/release-manifest.json --yes --wait
289
+ ```
290
+
291
+ These commands verify the embedded trust policy, platform/architecture,
292
+ artifact length and SHA-256, release sequence, compatible manager version,
293
+ and signing-key rotation. Callers cannot replace the project's trusted key
294
+ with an arbitrary one.
295
+
296
+ Uninstall first emits a reviewable plan:
297
+
298
+ ```bash
299
+ pandrator-manager --workspace /path/to/workspace uninstall
300
+ pandrator-manager --workspace /path/to/workspace uninstall \
301
+ --preserve-data --yes --wait
302
+ pandrator-manager --workspace /path/to/workspace uninstall \
303
+ --export-data /new/path/pandrator-data.zip --preserve-data --yes --wait
304
+ pandrator-manager --workspace /path/to/workspace uninstall \
305
+ --purge-data --yes --wait
306
+ ```
307
+
308
+ Preservation is the default. Export refuses to overwrite an existing
309
+ destination and verifies the ZIP before removal. Purge has a distinct
310
+ destructive confirmation. The launcher performs final cleanup after the
311
+ Manager exits and removes only files owned by the selected installation.
312
+
313
+ ## Surfaces
314
+
315
+ - The Pandrator WebUI shows provider installation and runtime actions where
316
+ they are relevant.
317
+ - The manager recovery WebUI works before Pandrator is installed and while it
318
+ is stopped or unhealthy.
319
+ - The CLI provides recovery and automation parity.
320
+ - `pandrator-tray` provides convenience actions only and is never required.
321
+
322
+ The tray extra is never a daemon dependency. `pandrator-tray --check` reports
323
+ whether a usable desktop backend exists; on headless Linux it returns
324
+ `unavailable: No graphical desktop session is available.` without importing
325
+ an X11 backend or creating the requested workspace. Quitting or losing the
326
+ tray does not stop any managed process.
327
+
328
+ ## Current component coverage
329
+
330
+ The Manager installs, updates, starts, stops, repairs, and removes the current
331
+ component catalogue:
332
+
333
+ - Kokoro supports CPU, CUDA, ROCm on supported modern AMD hardware, and Metal.
334
+ - VoxCPM currently requires CUDA.
335
+ - CrispASR offers Whisper, Parakeet, and MOSS choices; MOSS diarization with Q8
336
+ precision is the default.
337
+ - Qwen3 TTS defaults to the 1.7B model. Automatic hardware selection sends
338
+ unsupported or older AMD hardware to the CPU path.
339
+ - XTTS inference is available, but XTTS fine-tuning is not currently offered
340
+ by the Manager.
341
+
342
+ Pandrator and source-backed engines are downloaded into staging, checked, and
343
+ activated side by side. Manager updates use the project-signed release
344
+ channel.
345
+
346
+ ## Getting help
347
+
348
+ Use [GitHub Issues](https://github.com/lukaszliniewicz/Pandrator/issues) for
349
+ problems or suggestions. Include the operating system, workspace layout,
350
+ action you attempted, and logs with secrets removed.
351
+
352
+ ## License
353
+
354
+ Pandrator Manager is released under the
355
+ [MIT License](https://github.com/lukaszliniewicz/Pandrator/blob/main/LICENSE).
356
+ Third-party runtimes, services, and models retain their own licences and usage
357
+ conditions.