omnius 1.0.0

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 (60) hide show
  1. package/README.md +4959 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.js +630665 -0
  4. package/dist/launcher.cjs +78 -0
  5. package/dist/postinstall-daemon.cjs +776 -0
  6. package/dist/preinstall.cjs +92 -0
  7. package/dist/scripts/autoresearch-prepare.py +459 -0
  8. package/dist/scripts/autoresearch-train.py +661 -0
  9. package/dist/scripts/crawlee-scraper.py +358 -0
  10. package/dist/scripts/live-nemotron.py +478 -0
  11. package/dist/scripts/live-whisper.py +242 -0
  12. package/dist/scripts/ocr-advanced.py +571 -0
  13. package/dist/scripts/start-moondream.py +112 -0
  14. package/dist/scripts/tor/UPSTREAM-README.md +148 -0
  15. package/dist/scripts/tor/destroy_tor.sh +29 -0
  16. package/dist/scripts/tor/tor_setup.sh +163 -0
  17. package/dist/scripts/transcribe-file.py +63 -0
  18. package/dist/scripts/web_scrape.py +1295 -0
  19. package/npm-shrinkwrap.json +7412 -0
  20. package/package.json +142 -0
  21. package/prompts/agentic/system-large.md +569 -0
  22. package/prompts/agentic/system-medium.md +211 -0
  23. package/prompts/agentic/system-small.md +114 -0
  24. package/prompts/compaction/context-compaction.md +44 -0
  25. package/prompts/personality/level-1-minimal.md +3 -0
  26. package/prompts/personality/level-2-concise.md +3 -0
  27. package/prompts/personality/level-4-explanatory.md +3 -0
  28. package/prompts/personality/level-5-thorough.md +3 -0
  29. package/prompts/personality/level-autist.md +3 -0
  30. package/prompts/personality/level-stark.md +3 -0
  31. package/prompts/runners/dispatcher.md +24 -0
  32. package/prompts/runners/editor.md +44 -0
  33. package/prompts/runners/evaluator.md +30 -0
  34. package/prompts/runners/merge-summary.md +9 -0
  35. package/prompts/runners/normalizer.md +23 -0
  36. package/prompts/runners/planner.md +33 -0
  37. package/prompts/runners/scout.md +39 -0
  38. package/prompts/runners/verifier.md +36 -0
  39. package/prompts/skill-builder/seed-analysis.md +30 -0
  40. package/prompts/skill-builder/skill-expansion.md +76 -0
  41. package/prompts/skill-builder/skill-validation.md +31 -0
  42. package/prompts/templates/analysis.md +14 -0
  43. package/prompts/templates/code-review.md +16 -0
  44. package/prompts/templates/code.md +13 -0
  45. package/prompts/templates/document.md +13 -0
  46. package/prompts/templates/error-diagnosis.md +14 -0
  47. package/prompts/templates/general.md +9 -0
  48. package/prompts/templates/plan.md +15 -0
  49. package/prompts/templates/system.md +16 -0
  50. package/prompts/tui/dmn-gather.md +128 -0
  51. package/prompts/tui/dream-consolidate.md +48 -0
  52. package/prompts/tui/dream-lucid-eval.md +17 -0
  53. package/prompts/tui/dream-lucid-implement.md +14 -0
  54. package/prompts/tui/dream-stages.md +19 -0
  55. package/prompts/tui/emotion-behavioral.md +2 -0
  56. package/prompts/tui/emotion-center.md +12 -0
  57. package/voices/personaplex/OverBarn.pt +0 -0
  58. package/voices/personaplex/clone-voice.py +384 -0
  59. package/voices/personaplex/dequant-loader.py +174 -0
  60. package/voices/personaplex/quantize-weights.py +167 -0
@@ -0,0 +1,242 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ live-whisper.py — Self-contained live transcription worker using openai-whisper.
4
+
5
+ Fallback for transcribe-cli on platforms where faster-whisper / ONNX fails
6
+ (e.g. linux-arm64). Auto-creates a Python venv and installs openai-whisper.
7
+
8
+ Protocol:
9
+ stdin — raw PCM16 audio (16kHz, mono, 16-bit signed LE)
10
+ stdout — JSON lines:
11
+ {"type":"status","message":"Installing dependencies..."}
12
+ {"type":"status","message":"Loading model..."}
13
+ {"type":"ready"}
14
+ {"type":"transcript","text":"hello world","isFinal":false}
15
+ {"type":"transcript","text":"hello world how are you","isFinal":true}
16
+ {"type":"error","message":"..."}
17
+
18
+ Usage:
19
+ arecord -f S16_LE -r 16000 -c 1 -t raw -q - | python3 live-whisper.py --model base
20
+
21
+ Based on the proven ARM-compatible approach from hydra/whisper_asr.
22
+ """
23
+
24
+ import sys
25
+ import os
26
+ import json
27
+ import subprocess
28
+ import importlib
29
+ import struct
30
+ import time
31
+ import threading
32
+ from pathlib import Path
33
+
34
+ # ---------------------------------------------------------------------------
35
+ # Configuration
36
+ # ---------------------------------------------------------------------------
37
+
38
+ SCRIPT_DIR = Path(__file__).resolve().parent
39
+ VENV = SCRIPT_DIR / ".whisper-venv"
40
+ PY = VENV / "bin" / "python"
41
+ PIP = VENV / "bin" / "pip"
42
+
43
+ SAMPLE_RATE = 16000
44
+ CHANNELS = 1
45
+ SAMPLE_WIDTH = 2 # 16-bit
46
+ CHUNK_SECONDS = 3 # Transcribe every N seconds of audio
47
+ WINDOW_SECONDS = 10 # Transcribe last N seconds (sliding window)
48
+
49
+ # ---------------------------------------------------------------------------
50
+ # Output helpers (JSON lines to stdout)
51
+ # ---------------------------------------------------------------------------
52
+
53
+ def emit(event: dict):
54
+ """Write a JSON event to stdout and flush."""
55
+ sys.stdout.write(json.dumps(event) + "\n")
56
+ sys.stdout.flush()
57
+
58
+
59
+ def emit_status(msg: str):
60
+ emit({"type": "status", "message": msg})
61
+
62
+
63
+ def emit_error(msg: str):
64
+ emit({"type": "error", "message": msg})
65
+
66
+
67
+ def emit_transcript(text: str, is_final: bool = False):
68
+ emit({"type": "transcript", "text": text, "isFinal": is_final})
69
+
70
+ # ---------------------------------------------------------------------------
71
+ # Venv bootstrap (inspired by hydra/whisper_asr)
72
+ # ---------------------------------------------------------------------------
73
+
74
+ def _in_venv() -> bool:
75
+ return sys.prefix != sys.base_prefix
76
+
77
+
78
+ def _ensure_venv():
79
+ if VENV.exists():
80
+ return
81
+ emit_status("Creating Python venv for Whisper...")
82
+ import venv
83
+ venv.EnvBuilder(with_pip=True).create(str(VENV))
84
+ # Upgrade pip quietly
85
+ subprocess.check_call(
86
+ [str(PY), "-m", "pip", "install", "--upgrade", "pip"],
87
+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
88
+ )
89
+
90
+
91
+ def _ensure_deps():
92
+ """Check and install missing dependencies."""
93
+ need = []
94
+ try:
95
+ import numpy
96
+ except ImportError:
97
+ need.append("numpy")
98
+ try:
99
+ import whisper
100
+ except ImportError:
101
+ need.append("openai-whisper")
102
+
103
+ if need:
104
+ emit_status(f"Installing: {', '.join(need)}...")
105
+ subprocess.check_call(
106
+ [str(PIP), "install", *need],
107
+ stdout=subprocess.DEVNULL, stderr=subprocess.PIPE,
108
+ )
109
+ # Force reimport
110
+ for mod in ["numpy", "whisper"]:
111
+ if mod in sys.modules:
112
+ del sys.modules[mod]
113
+
114
+ # ---------------------------------------------------------------------------
115
+ # Bootstrap: ensure we're in the venv with deps
116
+ # ---------------------------------------------------------------------------
117
+
118
+ if not _in_venv():
119
+ _ensure_venv()
120
+ # Re-exec this script inside the venv
121
+ os.execv(str(PY), [str(PY)] + sys.argv)
122
+
123
+ _ensure_deps()
124
+
125
+ # Now safe to import
126
+ import numpy as np
127
+
128
+ # ---------------------------------------------------------------------------
129
+ # Main transcription loop
130
+ # ---------------------------------------------------------------------------
131
+
132
+ def main():
133
+ import argparse
134
+ parser = argparse.ArgumentParser(description="Live Whisper transcription worker")
135
+ parser.add_argument("--model", default="base", help="Whisper model size (tiny/base/small/medium/large)")
136
+ parser.add_argument("--chunk-seconds", type=float, default=CHUNK_SECONDS, help="Transcribe interval")
137
+ parser.add_argument("--window-seconds", type=float, default=WINDOW_SECONDS, help="Sliding window size")
138
+ parser.add_argument("--language", default=None, help="Language code (e.g. en, es, fr). Auto-detect if omitted.")
139
+ args = parser.parse_args()
140
+
141
+ import whisper
142
+
143
+ # Load model
144
+ emit_status(f"Loading Whisper {args.model} model...")
145
+ try:
146
+ device = "cpu"
147
+ try:
148
+ import torch
149
+ if torch.cuda.is_available():
150
+ device = "cuda"
151
+ except ImportError:
152
+ pass
153
+
154
+ model = whisper.load_model(args.model, device=device)
155
+ except Exception as e:
156
+ emit_error(f"Failed to load model: {e}")
157
+ sys.exit(1)
158
+
159
+ emit({"type": "ready"})
160
+
161
+ # Audio buffer — accumulates PCM16 as float32 @ 16kHz
162
+ audio_buf = np.zeros(0, dtype=np.float32)
163
+ buf_lock = threading.Lock()
164
+ chunk_bytes = int(args.chunk_seconds * SAMPLE_RATE * SAMPLE_WIDTH)
165
+ window_samples = int(args.window_seconds * SAMPLE_RATE)
166
+ last_text = ""
167
+ running = True
168
+
169
+ def read_stdin():
170
+ """Read PCM16 from stdin in a background thread."""
171
+ nonlocal audio_buf, running
172
+ try:
173
+ while running:
174
+ data = sys.stdin.buffer.read(chunk_bytes)
175
+ if not data:
176
+ break # EOF
177
+ # Convert PCM16 LE to float32 [-1, 1]
178
+ samples = np.frombuffer(data, dtype=np.int16).astype(np.float32) / 32768.0
179
+ with buf_lock:
180
+ audio_buf = np.concatenate([audio_buf, samples])
181
+ except Exception:
182
+ pass
183
+ finally:
184
+ running = False
185
+
186
+ # Start stdin reader thread
187
+ reader = threading.Thread(target=read_stdin, daemon=True)
188
+ reader.start()
189
+
190
+ try:
191
+ while running:
192
+ time.sleep(args.chunk_seconds)
193
+
194
+ with buf_lock:
195
+ if len(audio_buf) < SAMPLE_RATE: # Need at least 1s of audio
196
+ continue
197
+ # Take the last window_seconds of audio
198
+ window = audio_buf[-window_samples:].copy() if len(audio_buf) > window_samples else audio_buf.copy()
199
+
200
+ # Transcribe
201
+ try:
202
+ fp16 = (device == "cuda")
203
+ result = model.transcribe(
204
+ window,
205
+ fp16=fp16,
206
+ language=args.language,
207
+ no_speech_threshold=0.6,
208
+ condition_on_previous_text=False,
209
+ )
210
+ text = result.get("text", "").strip()
211
+ if text and text != last_text:
212
+ last_text = text
213
+ emit_transcript(text, is_final=False)
214
+ except Exception as e:
215
+ emit_error(f"Transcription error: {e}")
216
+
217
+ except KeyboardInterrupt:
218
+ pass
219
+
220
+ # Final transcription of the full buffer
221
+ with buf_lock:
222
+ full_audio = audio_buf.copy()
223
+
224
+ if len(full_audio) >= SAMPLE_RATE:
225
+ try:
226
+ fp16 = (device == "cuda")
227
+ result = model.transcribe(
228
+ full_audio,
229
+ fp16=fp16,
230
+ language=args.language,
231
+ )
232
+ text = result.get("text", "").strip()
233
+ if text:
234
+ emit_transcript(text, is_final=True)
235
+ except Exception:
236
+ pass
237
+
238
+ running = False
239
+
240
+
241
+ if __name__ == "__main__":
242
+ main()