@livx.cc/agentx 0.96.15 → 0.96.16

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.
@@ -92,6 +92,14 @@ func playbackEnvNow() -> Float {
92
92
  let inFmt = input.outputFormat(forBus: 0)
93
93
  let decim = max(1, Int(inFmt.sampleRate / 16000))
94
94
  let out = FileHandle.standardOutput
95
+ FileHandle.standardError.write("input format: \(inFmt.sampleRate)Hz \(inFmt.channelCount)ch decim=\(decim)\n".data(using: .utf8)!)
96
+
97
+ // Diagnostic (stderr → surfaced only under DEBUG=VoiceIO): log from INSIDE the tap, throttled to ~once
98
+ // every 2s of audio. A GCD/runloop timer can't be used — AVAudioEngine+VPIO blocks background-queue
99
+ // timers in this process. If these lines appear → the tap fires (rms tells silence vs signal); if NONE
100
+ // appear → the CoreAudio input tap never fires (device/format dead) = no audio can reach STT.
101
+ var diagTaps = 0
102
+ var diagAcc = 0 // frames since last log (×decim ≈ input samples) → throttle by input sample rate
95
103
 
96
104
  input.installTap(onBus: 0, bufferSize: 2048, format: inFmt) { buf, _ in
97
105
  guard let ch = buf.floatChannelData else { return }
@@ -141,6 +149,11 @@ input.installTap(onBus: 0, bufferSize: 2048, format: inFmt) { buf, _ in
141
149
  let gate = gateEnabled && audible && rms < threshold // user speech must clearly dominate the expected residue
142
150
  gateLock.unlock()
143
151
  if gate { for k in 0..<pcm.count { pcm[k] = 0 } } // keep the stream's timing — send silence, not nothing
152
+ diagTaps += 1; diagAcc += n
153
+ if diagAcc >= Int(inFmt.sampleRate) * 2 { // ~every 2s of input audio
154
+ FileHandle.standardError.write("tap: \(diagTaps) firings/2s, rms=\(Int(rms)), gate=\(gate)\n".data(using: .utf8)!)
155
+ diagTaps = 0; diagAcc = 0
156
+ }
144
157
  pcm.withUnsafeBufferPointer { p in
145
158
  out.write(Data(buffer: p))
146
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/agentx",
3
- "version": "0.96.15",
3
+ "version": "0.96.16",
4
4
  "description": "Edge-native AI agent runtime — drives a virtual filesystem via any LLM (ai.libx.js). Same bytes run in node, browser, or edge.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",