omnius 1.0.419 → 1.0.420

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
@@ -696639,9 +696639,23 @@ function buildRealtimeVoiceMessages(turns, maxMessages = MAX_REALTIME_MODEL_MESS
696639
696639
  dynamic.push(turn);
696640
696640
  }
696641
696641
  }
696642
- if (latestSnapshot) dynamic.push(latestSnapshot);
696642
+ if (latestSnapshot) {
696643
+ let lastUserIdx = -1;
696644
+ for (let i2 = dynamic.length - 1; i2 >= 0; i2--) {
696645
+ if (dynamic[i2].role === "user") {
696646
+ lastUserIdx = i2;
696647
+ break;
696648
+ }
696649
+ }
696650
+ if (lastUserIdx >= 0) dynamic.splice(lastUserIdx, 0, latestSnapshot);
696651
+ else dynamic.push(latestSnapshot);
696652
+ }
696643
696653
  const available = Math.max(0, maxMessages - pinned.length);
696644
- return [...pinned, ...dynamic.slice(-available)];
696654
+ let windowed = dynamic.slice(-available);
696655
+ if (latestSnapshot && available > 0 && !windowed.includes(latestSnapshot)) {
696656
+ windowed = [latestSnapshot, ...windowed.slice(-(available - 1))];
696657
+ }
696658
+ return [...pinned, ...windowed];
696645
696659
  }
696646
696660
  var VAD_SILENCE_MS, MAX_SEGMENT_MS, SUMMARY_INJECTION_INTERVAL, MAX_CONTEXT_TURNS, MAX_REALTIME_MODEL_MESSAGES, CONTEXT_SNAPSHOT_PREFIX, MAX_VOICE_REPLY_CHARS, AGENT_ECHO_WINDOW_MS, AGENT_ECHO_SIMILARITY, SYSTEM_PROMPT2, MIN_SIGNAL_SCORE, NOISE_ONLY_RE, VoiceChatSession;
696647
696661
  var init_voicechat = __esm({
@@ -696659,7 +696673,9 @@ var init_voicechat = __esm({
696659
696673
  SYSTEM_PROMPT2 = `You are a voice assistant having a live spoken conversation. Keep responses extremely brief — 1-2 sentences max. You're speaking aloud, not writing. Be conversational, direct, and helpful. Don't use markdown or formatting — just natural speech.
696660
696674
 
696661
696675
  Rules:
696662
- - Live perception: each turn you may receive a read-only "Context snapshot" system message containing what the camera currently sees (objects, people, classifications, recent visual events) and what is currently heard (sound scene, recent sounds, transcripts). Treat it as your own live sight and hearing. When the user asks what you see, who is there, or what you hear, answer directly from that snapshot. If the snapshot is missing or stale, say you can't see/hear clearly right now — do not invent observations.
696676
+ - ALWAYS answer the user's most recent message directly. The live context snapshot is background perception never the topic. Do not describe cameras, feeds, or surroundings unless the user's latest message asks about them.
696677
+ - Never repeat your previous answer. If you already described the scene, don't describe it again unless explicitly asked again — respond to what the user just said.
696678
+ - Live perception: each turn you may receive a read-only "Context snapshot" system message containing what the camera currently sees (objects, people, classifications, recent visual events) and what is currently heard (sound scene, recent sounds, transcripts). Treat it as your own live sight and hearing. When the user asks what you SEE, answer from the camera fields; when the user asks what you HEAR, answer from the audio/sound fields. If the snapshot is missing or stale, say you can't see/hear clearly right now — do not invent observations.
696663
696679
  - Never invent environment facts (cwd, OS, specs, repo state). If you need a precise fact from the main agent, request a tool by outputting on a single line EXACTLY one JSON object: {"tool": string, "args": object} and nothing else. Then wait for the tool result before answering.
696664
696680
  - You may also request to relay a user task to the main agent by emitting {"tool":"voice_to_main","args":{"message":"...","start":true}}.
696665
696681
  - Prefer tools for factual queries; otherwise, answer directly with a short reply.
@@ -697015,6 +697031,19 @@ ${toolOutput}` });
697015
697031
  this.context.push({ role: "system", content: `You have tools. Use them. ${this.toolCatalogNote}` });
697016
697032
  response = await this.streamOllamaInference(this.abortController.signal);
697017
697033
  }
697034
+ if (this.lastAgentSpeech?.text && response.trim()) {
697035
+ const prevTokens = comparableTokens(this.lastAgentSpeech.text);
697036
+ const nextTokens = comparableTokens(stripToolJsonLines(response));
697037
+ const similarity3 = jaccardSimilarity(prevTokens, nextTokens);
697038
+ if (similarity3 >= 0.8 && nextTokens.length >= 8) {
697039
+ this.context.push({
697040
+ role: "system",
697041
+ content: `Your draft reply repeats your previous answer. Do NOT describe the scene or cameras again. Respond directly and briefly to the user's latest message: "${truncateForLog(lastUser ?? "", 200)}"`
697042
+ });
697043
+ const retry = await this.streamOllamaInference(this.abortController.signal);
697044
+ if (retry.trim()) response = retry;
697045
+ }
697046
+ }
697018
697047
  if (response.trim()) {
697019
697048
  const reply = extractVoiceModelReply(stripToolJsonLines(response.trim()));
697020
697049
  const finalSpoken = reply.text;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.419",
3
+ "version": "1.0.420",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.419",
9
+ "version": "1.0.420",
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.419",
3
+ "version": "1.0.420",
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",