omnius 1.0.416 → 1.0.417

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/dist/index.js CHANGED
@@ -603131,25 +603131,29 @@ function liveDashboardRotationActionFromClick(snapshot, lineText, col) {
603131
603131
  }
603132
603132
  function pushDashboardWrapped(lines, value2, width) {
603133
603133
  const contentWidth = Math.max(10, width - 2);
603134
- const words = stripDashboardAnsi(value2).replace(/\s+/g, " ").trim().split(" ").filter(Boolean);
603134
+ const normalized = stripDashboardAnsi(value2).replace(/\s+/g, " ").trimEnd();
603135
+ const leading = normalized.match(/^ */)?.[0] ?? "";
603136
+ const words = normalized.slice(leading.length).trimStart().split(" ").filter(Boolean);
603135
603137
  if (words.length === 0) {
603136
603138
  lines.push(`│${" ".repeat(contentWidth)}│`);
603137
603139
  return;
603138
603140
  }
603139
- let current = "";
603141
+ let current = leading;
603140
603142
  for (const word2 of words) {
603141
- if (!current) {
603142
- current = word2.length > contentWidth ? word2.slice(0, contentWidth) : word2;
603143
+ if (current === leading) {
603144
+ const available = Math.max(1, contentWidth - leading.length);
603145
+ current = `${leading}${word2.length > available ? word2.slice(0, available) : word2}`;
603143
603146
  continue;
603144
603147
  }
603145
603148
  if (current.length + 1 + word2.length <= contentWidth) {
603146
603149
  current += ` ${word2}`;
603147
603150
  } else {
603148
603151
  lines.push(`│${truncateCell(` ${current}`, contentWidth)}│`);
603149
- current = word2.length > contentWidth ? word2.slice(0, contentWidth) : word2;
603152
+ const available = Math.max(1, contentWidth - leading.length);
603153
+ current = `${leading}${word2.length > available ? word2.slice(0, available) : word2}`;
603150
603154
  }
603151
603155
  }
603152
- if (current) lines.push(`│${truncateCell(` ${current}`, contentWidth)}│`);
603156
+ if (current.trim()) lines.push(`│${truncateCell(` ${current}`, contentWidth)}│`);
603153
603157
  }
603154
603158
  function isAudioFailureText(value2) {
603155
603159
  const text2 = String(value2 ?? "").trim();
@@ -603159,6 +603163,9 @@ function isAudioFailureText(value2) {
603159
603163
  function sanitizeLiveAudioError(value2) {
603160
603164
  const text2 = String(value2 ?? "").trim();
603161
603165
  if (!text2) return "";
603166
+ if (/No live input signal detected after probing \d+ audio source/i.test(text2)) {
603167
+ return "No clear live input signal on selected audio input.";
603168
+ }
603162
603169
  if (/transcribe-cli module:\s*No module named ['"]?transcribe_cli/i.test(text2) || /No module named ['"]?transcribe_cli/i.test(text2)) {
603163
603170
  const parts = text2.split(/\s*\|\s*/g).map((part) => part.trim()).filter((part) => part && !/transcribe-cli module:\s*No module named ['"]?transcribe_cli/i.test(part) && !/No module named ['"]?transcribe_cli/i.test(part));
603164
603171
  const preserved = parts.join(" | ").trim();
@@ -603541,6 +603548,104 @@ function cameraClassificationsSummary(camera, maxChars = 220) {
603541
603548
  });
603542
603549
  return trimOneLine(items.join("; "), maxChars);
603543
603550
  }
603551
+ function cameraClassPriority(kind) {
603552
+ if (kind === "face" || kind === "identity") return 0;
603553
+ if (kind === "segment") return 1;
603554
+ if (kind === "object") return 2;
603555
+ if (kind === "track") return 3;
603556
+ if (kind === "clip") return 4;
603557
+ return 5;
603558
+ }
603559
+ function groupedDashboardClassifications(camera, kinds) {
603560
+ const wanted = new Set(kinds);
603561
+ const grouped = /* @__PURE__ */ new Map();
603562
+ for (const item of camera.classifications ?? []) {
603563
+ if (!wanted.has(item.kind)) continue;
603564
+ const label = trimOneLine(item.label || item.kind, 64) || item.kind;
603565
+ const key = `${item.kind}:${label.toLowerCase()}`;
603566
+ const existing = grouped.get(key);
603567
+ const count = Math.max(1, item.count);
603568
+ if (!existing) {
603569
+ grouped.set(key, {
603570
+ kind: item.kind,
603571
+ label,
603572
+ count,
603573
+ confidence: item.confidence
603574
+ });
603575
+ continue;
603576
+ }
603577
+ existing.count += count;
603578
+ if (item.confidence !== void 0) {
603579
+ existing.confidence = existing.confidence === void 0 ? item.confidence : Math.max(existing.confidence, item.confidence);
603580
+ }
603581
+ }
603582
+ return [...grouped.values()].sort((a2, b) => {
603583
+ const priority = cameraClassPriority(a2.kind) - cameraClassPriority(b.kind);
603584
+ if (priority !== 0) return priority;
603585
+ return (b.confidence ?? 0) - (a2.confidence ?? 0) || b.count - a2.count || a2.label.localeCompare(b.label);
603586
+ });
603587
+ }
603588
+ function formatDashboardClassList(groups, maxItems = 6) {
603589
+ return groups.slice(0, maxItems).map((group) => {
603590
+ const count = group.count > 1 ? ` x${group.count}` : "";
603591
+ const confidence2 = group.confidence !== void 0 ? ` ${group.confidence.toFixed(2)}` : "";
603592
+ return `${group.label}${count}${confidence2}`;
603593
+ }).join("; ");
603594
+ }
603595
+ function cleanCameraSummaryForDashboard(value2) {
603596
+ const raw = String(value2 ?? "").trim();
603597
+ if (!raw) return "";
603598
+ const withoutClip = raw.split(/\s+\|\s+clip:/i)[0] ?? raw;
603599
+ return trimOneLine(
603600
+ withoutClip.replace(/\b(?:mask|crop)=\S+/gi, "").replace(/\bbbox=\[[^\]]*\]/gi, "").replace(/\s{2,}/g, " "),
603601
+ 220
603602
+ );
603603
+ }
603604
+ function formatClipDashboardSummary(value2) {
603605
+ const text2 = String(value2 ?? "").trim();
603606
+ if (!text2) return "";
603607
+ const clipText = text2.match(/\bclip:\s*([\s\S]+)$/i)?.[1] ?? text2;
603608
+ const parsed = parseJsonObjectFromText(clipText);
603609
+ if (!parsed) return /\bclip:\s*/i.test(text2) ? `clip: ${trimOneLine(clipText, 120)}` : "";
603610
+ const matches = Array.isArray(parsed["matches"]) ? parsed["matches"] : [];
603611
+ if (matches.length > 0) {
603612
+ const labels = matches.slice(0, 4).map((match) => {
603613
+ const label = trimOneLine(match["label"] ?? match["name"] ?? match["title"] ?? match["id"] ?? "match", 48);
603614
+ const score = boundedConfidence(match["score"] ?? match["similarity"] ?? match["confidence"]);
603615
+ return `${label || "match"}${score !== void 0 ? ` ${score.toFixed(2)}` : ""}`;
603616
+ });
603617
+ return `clip: ${labels.join("; ")}`;
603618
+ }
603619
+ const recognized = Math.max(0, Number(parsed["recognized_count"] ?? 0));
603620
+ const extra = parsed["extra_labels"];
603621
+ if (Array.isArray(extra) && extra.length > 0) {
603622
+ return `clip: extra labels ${extra.slice(0, 4).map((entry) => trimOneLine(entry, 36)).join("; ")}`;
603623
+ }
603624
+ if (typeof extra === "string" && extra.trim()) return `clip: ${trimOneLine(extra, 120)}`;
603625
+ return recognized > 0 ? `clip: ${recognized} recognized match(es)` : "clip: no visual-memory matches";
603626
+ }
603627
+ function formatAudioAnalysisDashboardSummary(value2) {
603628
+ const text2 = String(value2 ?? "").trim();
603629
+ if (!text2) return "";
603630
+ const parsed = parseJsonObjectFromText(text2);
603631
+ const classifications = Array.isArray(parsed?.["classifications"]) ? parsed["classifications"] : [];
603632
+ if (classifications.length > 0) {
603633
+ return `sound classes: ${classifications.slice(0, 4).map((entry) => {
603634
+ const label = trimOneLine(entry["class"] ?? entry["label"] ?? entry["name"] ?? "sound", 44);
603635
+ const score = boundedConfidence(entry["score"] ?? entry["confidence"]);
603636
+ return `${label || "sound"}${score !== void 0 ? ` ${score.toFixed(2)}` : ""}`;
603637
+ }).join("; ")}`;
603638
+ }
603639
+ return `sound: ${trimOneLine(text2.replace(/\{[\s\S]*$/, ""), 140) || trimOneLine(text2, 140)}`;
603640
+ }
603641
+ function formatCameraRotationDashboard(camera) {
603642
+ const orientation = camera.orientation;
603643
+ const rotation = orientation?.rotation ?? camera.rotation ?? 0;
603644
+ const base3 = formatCameraRotation(rotation);
603645
+ if (!orientation) return base3;
603646
+ const confidence2 = orientation.confidence !== void 0 ? ` ${orientation.confidence.toFixed(2)}` : "";
603647
+ return `${base3} (${orientation.source}${confidence2})`;
603648
+ }
603544
603649
  function cameraPaneBadge(camera) {
603545
603650
  const classifications = camera.classifications ?? [];
603546
603651
  const faceCount = classifications.filter((item) => item.kind === "face" || item.kind === "identity").reduce((sum, item) => sum + Math.max(1, item.count), 0);
@@ -603559,7 +603664,44 @@ function cameraPaneBadge(camera) {
603559
603664
  }
603560
603665
  function cameraSnapshotSummary(camera) {
603561
603666
  if (camera.error) return `error: ${trimOneLine(camera.error, 160)}`;
603562
- return camera.summary || (camera.classifications?.length ? `classifications: ${cameraClassificationsSummary(camera)}` : "") || summarizeInference(camera.inference);
603667
+ return cleanCameraSummaryForDashboard(camera.summary) || (camera.classifications?.length ? `classifications: ${cameraClassificationsSummary(camera)}` : "") || summarizeInference(camera.inference);
603668
+ }
603669
+ function cameraDashboardObservationLines(camera, now2, isLast) {
603670
+ const age = Math.max(0, Math.round((now2 - camera.updatedAt) / 1e3));
603671
+ const root = isLast ? "└─" : "├─";
603672
+ const stem = isLast ? " " : "│ ";
603673
+ const lines = [
603674
+ `${root} ${compactSourceId(camera.source)} age=${age}s rotation=${formatCameraRotationDashboard(camera)}`
603675
+ ];
603676
+ if (camera.error) {
603677
+ lines.push(`${stem}└─ error: ${trimOneLine(camera.error, 180)}`);
603678
+ return lines;
603679
+ }
603680
+ const faces = formatDashboardClassList(groupedDashboardClassifications(camera, ["face", "identity"]), 4);
603681
+ const segments = formatDashboardClassList(groupedDashboardClassifications(camera, ["segment"]), 6);
603682
+ const objects = formatDashboardClassList(groupedDashboardClassifications(camera, ["object"]), 6);
603683
+ const tracks = formatDashboardClassList(groupedDashboardClassifications(camera, ["track"]), 4);
603684
+ const triggers = formatDashboardClassList(groupedDashboardClassifications(camera, ["trigger"]), 3);
603685
+ const clip3 = formatClipDashboardSummary(camera.summary) || formatDashboardClassList(groupedDashboardClassifications(camera, ["clip"]), 4);
603686
+ const summary = cameraSnapshotSummary(camera);
603687
+ const includeSummary = summary && !summary.startsWith("classifications:") && !(objects && /^objects:/i.test(summary)) && !(segments && /^segments?:/i.test(summary));
603688
+ const detailLines = [
603689
+ faces ? `faces: ${faces}` : "",
603690
+ segments ? `segments: ${segments}` : "",
603691
+ objects ? `objects: ${objects}` : "",
603692
+ tracks ? `tracks: ${tracks}` : "",
603693
+ triggers ? `triggers: ${triggers}` : "",
603694
+ includeSummary ? summary : "",
603695
+ clip3,
603696
+ camera.framePath ? `frame: ${camera.displayPath || camera.framePath}` : "",
603697
+ camera.orientation?.evidence ? `orientation: ${trimOneLine(camera.orientation.evidence, 120)}` : ""
603698
+ ].filter(Boolean);
603699
+ const last2 = Math.max(0, detailLines.length - 1);
603700
+ detailLines.forEach((detail, index) => {
603701
+ lines.push(`${stem}${index === last2 ? "└─" : "├─"} ${detail}`);
603702
+ });
603703
+ if (detailLines.length === 0) lines.push(`${stem}└─ preview pending`);
603704
+ return lines;
603563
603705
  }
603564
603706
  function formatLiveDashboardFromSnapshot(snapshot, opts = {}) {
603565
603707
  const width = Math.max(60, opts.width ?? 100);
@@ -603599,35 +603741,27 @@ function formatLiveDashboardFromSnapshot(snapshot, opts = {}) {
603599
603741
  lines.push(`├${horizontal}┤`);
603600
603742
  lines.push(`│${truncateCell(" camera observations", width - 2)}│`);
603601
603743
  }
603602
- for (const camera of cameras) {
603603
- const age = Math.max(0, Math.round((now2 - camera.updatedAt) / 1e3));
603604
- const rotation = camera.orientation ? formatCameraRotation(camera.orientation.rotation) : "upright/no correction";
603605
- const classifications = cameraClassificationsSummary(camera);
603606
- const detailLines = [
603607
- `${compactSourceId(camera.source)} age=${age}s rotation=${rotation}`,
603608
- classifications ? `classifications: ${classifications}` : "",
603609
- cameraSnapshotSummary(camera),
603610
- camera.framePath ? `frame: ${camera.displayPath || camera.framePath}` : "",
603611
- camera.orientation?.evidence ? `orientation: ${trimOneLine(camera.orientation.evidence, 120)}` : ""
603612
- ].filter(Boolean);
603613
- for (const detail of detailLines.length ? detailLines : ["preview pending"]) {
603744
+ cameras.forEach((camera, index) => {
603745
+ const detailLines = cameraDashboardObservationLines(camera, now2, index === cameras.length - 1);
603746
+ for (const detail of detailLines) {
603614
603747
  pushDashboardWrapped(lines, detail, width);
603615
603748
  }
603616
- }
603749
+ });
603617
603750
  if (snapshot.audio) {
603618
603751
  lines.push(`├${horizontal}┤`);
603752
+ lines.push(`│${truncateCell(" audio monitor", width - 2)}│`);
603619
603753
  const transcriptFailure = isAudioFailureText(snapshot.audio.transcript) ? snapshot.audio.transcript : "";
603620
603754
  const transcript = transcriptFailure ? "" : snapshot.audio.transcript;
603621
603755
  const audioError = sanitizeLiveAudioError([snapshot.audio.error, transcriptFailure].filter(Boolean).join(" | "));
603622
603756
  const audioBits = [
603623
- `audio input=${snapshot.audio.input || snapshot.config.selectedAudioInput || "none"}`,
603624
- snapshot.audio.activity ? `activity ${snapshot.audio.activity.waveform} rms=${snapshot.audio.activity.rmsDb.toFixed(1)}dB active=${Math.round(snapshot.audio.activity.activeRatio * 100)}%` : "",
603625
- audioError ? `error=${trimOneLine(audioError, 120)}` : "",
603626
- transcript ? `asr${snapshot.audio.asrBackend ? `(${snapshot.audio.asrBackend})` : ""}=${trimOneLine(transcript, 120)}` : "",
603627
- snapshot.audio.intake ? `intake=${snapshot.audio.intake.intendedForAgent ? "for-agent" : "ambient"} conf=${snapshot.audio.intake.confidence.toFixed(2)} ${snapshot.audio.intake.action}` : "",
603628
- snapshot.audio.analysis ? `sound=${trimOneLine(snapshot.audio.analysis, 120)}` : ""
603757
+ `├─ input: ${snapshot.audio.input || snapshot.config.selectedAudioInput || "none"}`,
603758
+ snapshot.audio.activity ? `│ ├─ activity: ${snapshot.audio.activity.waveform} rms=${snapshot.audio.activity.rmsDb.toFixed(1)}dB active=${Math.round(snapshot.audio.activity.activeRatio * 100)}%` : "",
603759
+ audioError ? `│ ├─ error: ${trimOneLine(audioError, 140)}` : "",
603760
+ transcript ? `│ ├─ asr${snapshot.audio.asrBackend ? ` (${snapshot.audio.asrBackend})` : ""}: ${trimOneLine(transcript, 140)}` : "",
603761
+ snapshot.audio.intake ? `│ ├─ intake: ${snapshot.audio.intake.intendedForAgent ? "for-agent" : "ambient"} conf=${snapshot.audio.intake.confidence.toFixed(2)} action=${snapshot.audio.intake.action}` : "",
603762
+ snapshot.audio.analysis ? `│ └─ ${formatAudioAnalysisDashboardSummary(snapshot.audio.analysis)}` : ""
603629
603763
  ].filter(Boolean);
603630
- for (const item of audioBits.slice(0, 6)) lines.push(`│${truncateCell(` ${item}`, width - 2)}│`);
603764
+ for (const item of audioBits.slice(0, 6)) pushDashboardWrapped(lines, item, width);
603631
603765
  }
603632
603766
  lines.push(`╰${horizontal}╯`);
603633
603767
  return lines;
@@ -604977,7 +605111,8 @@ var init_live_sensors = __esm({
604977
605111
  clipSummary = await this.recognizeFrameObjects(preview.framePath, source, sampledAt, { emit: false });
604978
605112
  const current = this.snapshot.cameras?.[source];
604979
605113
  if (current) {
604980
- current.summary = [current.summary, clipSummary ? `clip: ${trimOneLine(clipSummary, 160)}` : ""].filter(Boolean).join(" | ");
605114
+ const clipLine = formatClipDashboardSummary(clipSummary);
605115
+ current.summary = [cleanCameraSummaryForDashboard(current.summary), clipLine].filter(Boolean).join(" | ");
604981
605116
  current.classifications = mergeCameraClassifications(
604982
605117
  current.classifications,
604983
605118
  classificationsFromClipSummary(clipSummary, sampledAt, preview.framePath)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.416",
3
+ "version": "1.0.417",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.416",
9
+ "version": "1.0.417",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.416",
3
+ "version": "1.0.417",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",