ai-whisper 0.4.0 → 0.4.2

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.
@@ -4758,7 +4758,7 @@ function acquireCaptureLease(db, collabId, pid, options = {}) {
4758
4758
  acquired_at = excluded.acquired_at`).run(LEASE_ID, collabId, pid, acquiredAt);
4759
4759
  return true;
4760
4760
  });
4761
- return tx();
4761
+ return tx.immediate();
4762
4762
  }
4763
4763
  function releaseCaptureLease(db, collabId) {
4764
4764
  const tx = db.transaction(() => {
@@ -9791,6 +9791,9 @@ ${hint}`,
9791
9791
  autoHandbackFiredFor = accepted.handoffId;
9792
9792
  input.turnCapture?.finishAssistantTurn();
9793
9793
  const turnResult = input.turnCapture?.extractLatestAssistantTurn() ?? { confidence: "low", text: null };
9794
+ console.warn(
9795
+ `[ai-whisper] auto-handback fire: target=${input.currentAgent} handoff=${accepted.handoffId} turnLen=${(turnResult.text ?? "").length} turnConf=${turnResult.confidence}`
9796
+ );
9794
9797
  let clipboardText = null;
9795
9798
  let leaseDegraded = false;
9796
9799
  let interferenceDetected = false;
@@ -9804,10 +9807,23 @@ ${hint}`,
9804
9807
  clipboardText = captureResult.text;
9805
9808
  } else {
9806
9809
  leaseDegraded = true;
9810
+ console.warn(
9811
+ `[ai-whisper] capture lease degraded: target=${input.currentAgent} handoff=${accepted.handoffId} interference=${interferenceDetected} \u2014 /copy was NOT executed; PTY fallback only`
9812
+ );
9807
9813
  }
9814
+ } else {
9815
+ console.warn(
9816
+ `[ai-whisper] capture pipeline returned null: target=${input.currentAgent} handoff=${accepted.handoffId} \u2014 captureHandbackText short-circuited (likely no session claim)`
9817
+ );
9808
9818
  }
9809
- } catch {
9819
+ } catch (err) {
9810
9820
  clipboardText = null;
9821
+ const msg = err instanceof Error ? `${err.message}
9822
+ ${err.stack ?? ""}` : String(err);
9823
+ console.warn(
9824
+ `[ai-whisper] capture pipeline threw (swallowed): target=${input.currentAgent} handoff=${accepted.handoffId}
9825
+ ${msg}`
9826
+ );
9811
9827
  }
9812
9828
  const classification = classifyCapture(turnResult, clipboardText);
9813
9829
  const captureStatus = classification.status;
@@ -10167,12 +10183,16 @@ async function captureHandbackText(input) {
10167
10183
  let acquired = false;
10168
10184
  const deadline = Date.now() + acquireMaxWaitMs;
10169
10185
  for (; ; ) {
10170
- acquired = acquireCaptureLease(
10171
- input.db,
10172
- input.collabId,
10173
- input.pid,
10174
- input.leaseOptions
10175
- );
10186
+ try {
10187
+ acquired = acquireCaptureLease(
10188
+ input.db,
10189
+ input.collabId,
10190
+ input.pid,
10191
+ input.leaseOptions
10192
+ );
10193
+ } catch {
10194
+ acquired = false;
10195
+ }
10176
10196
  if (acquired) break;
10177
10197
  if (Date.now() >= deadline) break;
10178
10198
  await sleep3(acquireBackoffMs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-whisper",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Terminal-first relay for paired AI coding agents (Claude + Codex), driven by structured workflows.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -46,10 +46,10 @@
46
46
  "@types/react": "^19.2.14",
47
47
  "ink-testing-library": "^4.0.0",
48
48
  "@ai-whisper/adapter-claude": "0.0.0",
49
- "@ai-whisper/adapter-codex": "0.0.0",
50
49
  "@ai-whisper/companion-core": "0.0.0",
51
50
  "@ai-whisper/broker": "0.0.0",
52
- "@ai-whisper/shared": "0.0.0"
51
+ "@ai-whisper/shared": "0.0.0",
52
+ "@ai-whisper/adapter-codex": "0.0.0"
53
53
  },
54
54
  "files": [
55
55
  "dist",