ai-whisper 0.1.2 → 0.1.3

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.
@@ -1702,7 +1702,32 @@ function listActiveCollabSummaries(db, input) {
1702
1702
  OR EXISTS (SELECT 1 FROM workflows w
1703
1703
  WHERE w.collab_id = c.collab_id AND w.status = 'running')`).all(cutoff);
1704
1704
  const out = [];
1705
+ const seen = /* @__PURE__ */ new Set();
1705
1706
  for (const e of eligible) {
1707
+ out.push(buildCollabSummary(db, e.collabId));
1708
+ seen.add(e.collabId);
1709
+ }
1710
+ const minResults = input.minResults ?? 3;
1711
+ if (out.length < minResults) {
1712
+ const finished = db.prepare(`SELECT collab_id AS collabId, MAX(created_at) AS lastCreated
1713
+ FROM workflows
1714
+ WHERE status IN ('done','halted','canceled')
1715
+ GROUP BY collab_id
1716
+ ORDER BY lastCreated DESC, collab_id DESC`).all();
1717
+ for (const f of finished) {
1718
+ if (out.length >= minResults)
1719
+ break;
1720
+ if (seen.has(f.collabId))
1721
+ continue;
1722
+ out.push(buildCollabSummary(db, f.collabId));
1723
+ seen.add(f.collabId);
1724
+ }
1725
+ }
1726
+ return out;
1727
+ }
1728
+ function buildCollabSummary(db, collabId2) {
1729
+ {
1730
+ const e = { collabId: collabId2 };
1706
1731
  const collab2 = db.prepare(`SELECT display_name AS displayName, workspace_root AS workspaceRoot
1707
1732
  FROM collab WHERE collab_id = ?`).get(e.collabId);
1708
1733
  const wf = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1756,7 +1781,7 @@ function listActiveCollabSummaries(db, input) {
1756
1781
  FROM relay_handoff
1757
1782
  WHERE collab_id = ? AND workflow_id IS NULL`).get(e.collabId);
1758
1783
  const runLastAct = runLastActRow?.lastAct ?? "";
1759
- out.push({
1784
+ return {
1760
1785
  collabId: e.collabId,
1761
1786
  label,
1762
1787
  workflowId: wf?.workflowId ?? null,
@@ -1775,9 +1800,8 @@ function listActiveCollabSummaries(db, input) {
1775
1800
  },
1776
1801
  sessions,
1777
1802
  lastActivityAt: runLastAct
1778
- });
1803
+ };
1779
1804
  }
1780
- return out;
1781
1805
  }
1782
1806
  function listWorkflowsForCollab(db, collabId2) {
1783
1807
  const rows = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1735,7 +1735,32 @@ function listActiveCollabSummaries(db, input) {
1735
1735
  OR EXISTS (SELECT 1 FROM workflows w
1736
1736
  WHERE w.collab_id = c.collab_id AND w.status = 'running')`).all(cutoff);
1737
1737
  const out = [];
1738
+ const seen = /* @__PURE__ */ new Set();
1738
1739
  for (const e of eligible) {
1740
+ out.push(buildCollabSummary(db, e.collabId));
1741
+ seen.add(e.collabId);
1742
+ }
1743
+ const minResults = input.minResults ?? 3;
1744
+ if (out.length < minResults) {
1745
+ const finished = db.prepare(`SELECT collab_id AS collabId, MAX(created_at) AS lastCreated
1746
+ FROM workflows
1747
+ WHERE status IN ('done','halted','canceled')
1748
+ GROUP BY collab_id
1749
+ ORDER BY lastCreated DESC, collab_id DESC`).all();
1750
+ for (const f of finished) {
1751
+ if (out.length >= minResults)
1752
+ break;
1753
+ if (seen.has(f.collabId))
1754
+ continue;
1755
+ out.push(buildCollabSummary(db, f.collabId));
1756
+ seen.add(f.collabId);
1757
+ }
1758
+ }
1759
+ return out;
1760
+ }
1761
+ function buildCollabSummary(db, collabId) {
1762
+ {
1763
+ const e = { collabId };
1739
1764
  const collab = db.prepare(`SELECT display_name AS displayName, workspace_root AS workspaceRoot
1740
1765
  FROM collab WHERE collab_id = ?`).get(e.collabId);
1741
1766
  const wf = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1789,7 +1814,7 @@ function listActiveCollabSummaries(db, input) {
1789
1814
  FROM relay_handoff
1790
1815
  WHERE collab_id = ? AND workflow_id IS NULL`).get(e.collabId);
1791
1816
  const runLastAct = runLastActRow?.lastAct ?? "";
1792
- out.push({
1817
+ return {
1793
1818
  collabId: e.collabId,
1794
1819
  label,
1795
1820
  workflowId: wf?.workflowId ?? null,
@@ -1808,9 +1833,8 @@ function listActiveCollabSummaries(db, input) {
1808
1833
  },
1809
1834
  sessions,
1810
1835
  lastActivityAt: runLastAct
1811
- });
1836
+ };
1812
1837
  }
1813
- return out;
1814
1838
  }
1815
1839
  function listWorkflowsForCollab(db, collabId) {
1816
1840
  const rows = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1705,7 +1705,32 @@ function listActiveCollabSummaries(db, input) {
1705
1705
  OR EXISTS (SELECT 1 FROM workflows w
1706
1706
  WHERE w.collab_id = c.collab_id AND w.status = 'running')`).all(cutoff);
1707
1707
  const out = [];
1708
+ const seen = /* @__PURE__ */ new Set();
1708
1709
  for (const e of eligible) {
1710
+ out.push(buildCollabSummary(db, e.collabId));
1711
+ seen.add(e.collabId);
1712
+ }
1713
+ const minResults = input.minResults ?? 3;
1714
+ if (out.length < minResults) {
1715
+ const finished = db.prepare(`SELECT collab_id AS collabId, MAX(created_at) AS lastCreated
1716
+ FROM workflows
1717
+ WHERE status IN ('done','halted','canceled')
1718
+ GROUP BY collab_id
1719
+ ORDER BY lastCreated DESC, collab_id DESC`).all();
1720
+ for (const f of finished) {
1721
+ if (out.length >= minResults)
1722
+ break;
1723
+ if (seen.has(f.collabId))
1724
+ continue;
1725
+ out.push(buildCollabSummary(db, f.collabId));
1726
+ seen.add(f.collabId);
1727
+ }
1728
+ }
1729
+ return out;
1730
+ }
1731
+ function buildCollabSummary(db, collabId2) {
1732
+ {
1733
+ const e = { collabId: collabId2 };
1709
1734
  const collab = db.prepare(`SELECT display_name AS displayName, workspace_root AS workspaceRoot
1710
1735
  FROM collab WHERE collab_id = ?`).get(e.collabId);
1711
1736
  const wf = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1759,7 +1784,7 @@ function listActiveCollabSummaries(db, input) {
1759
1784
  FROM relay_handoff
1760
1785
  WHERE collab_id = ? AND workflow_id IS NULL`).get(e.collabId);
1761
1786
  const runLastAct = runLastActRow?.lastAct ?? "";
1762
- out.push({
1787
+ return {
1763
1788
  collabId: e.collabId,
1764
1789
  label,
1765
1790
  workflowId: wf?.workflowId ?? null,
@@ -1778,9 +1803,8 @@ function listActiveCollabSummaries(db, input) {
1778
1803
  },
1779
1804
  sessions,
1780
1805
  lastActivityAt: runLastAct
1781
- });
1806
+ };
1782
1807
  }
1783
- return out;
1784
1808
  }
1785
1809
  function listWorkflowsForCollab(db, collabId2) {
1786
1810
  const rows = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -5076,7 +5100,9 @@ function computeLiveness(snap) {
5076
5100
  let why = null;
5077
5101
  let stuck = false;
5078
5102
  let liveOverride = null;
5079
- if (terminal === "halted" || terminal === "canceled") {
5103
+ if (terminal === "done") {
5104
+ return { stuck: false, why: null, liveText: "done" };
5105
+ } else if (terminal === "halted" || terminal === "canceled") {
5080
5106
  stuck = true;
5081
5107
  why = snap.workflow?.haltReason ? `${terminal}: ${snap.workflow.haltReason}` : `workflow ${terminal}`;
5082
5108
  } else if (chainStatus === "escalated" || chainStatus === "abandoned") {
@@ -1775,7 +1775,32 @@ function listActiveCollabSummaries(db, input) {
1775
1775
  OR EXISTS (SELECT 1 FROM workflows w
1776
1776
  WHERE w.collab_id = c.collab_id AND w.status = 'running')`).all(cutoff);
1777
1777
  const out = [];
1778
+ const seen = /* @__PURE__ */ new Set();
1778
1779
  for (const e of eligible) {
1780
+ out.push(buildCollabSummary(db, e.collabId));
1781
+ seen.add(e.collabId);
1782
+ }
1783
+ const minResults = input.minResults ?? 3;
1784
+ if (out.length < minResults) {
1785
+ const finished = db.prepare(`SELECT collab_id AS collabId, MAX(created_at) AS lastCreated
1786
+ FROM workflows
1787
+ WHERE status IN ('done','halted','canceled')
1788
+ GROUP BY collab_id
1789
+ ORDER BY lastCreated DESC, collab_id DESC`).all();
1790
+ for (const f of finished) {
1791
+ if (out.length >= minResults)
1792
+ break;
1793
+ if (seen.has(f.collabId))
1794
+ continue;
1795
+ out.push(buildCollabSummary(db, f.collabId));
1796
+ seen.add(f.collabId);
1797
+ }
1798
+ }
1799
+ return out;
1800
+ }
1801
+ function buildCollabSummary(db, collabId) {
1802
+ {
1803
+ const e = { collabId };
1779
1804
  const collab = db.prepare(`SELECT display_name AS displayName, workspace_root AS workspaceRoot
1780
1805
  FROM collab WHERE collab_id = ?`).get(e.collabId);
1781
1806
  const wf = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -1829,7 +1854,7 @@ function listActiveCollabSummaries(db, input) {
1829
1854
  FROM relay_handoff
1830
1855
  WHERE collab_id = ? AND workflow_id IS NULL`).get(e.collabId);
1831
1856
  const runLastAct = runLastActRow?.lastAct ?? "";
1832
- out.push({
1857
+ return {
1833
1858
  collabId: e.collabId,
1834
1859
  label,
1835
1860
  workflowId: wf?.workflowId ?? null,
@@ -1848,9 +1873,8 @@ function listActiveCollabSummaries(db, input) {
1848
1873
  },
1849
1874
  sessions,
1850
1875
  lastActivityAt: runLastAct
1851
- });
1876
+ };
1852
1877
  }
1853
- return out;
1854
1878
  }
1855
1879
  function listWorkflowsForCollab(db, collabId) {
1856
1880
  const rows = db.prepare(`SELECT workflow_id AS workflowId, workflow_type AS workflowType,
@@ -9165,7 +9189,9 @@ function computeLiveness(snap) {
9165
9189
  let why = null;
9166
9190
  let stuck = false;
9167
9191
  let liveOverride = null;
9168
- if (terminal === "halted" || terminal === "canceled") {
9192
+ if (terminal === "done") {
9193
+ return { stuck: false, why: null, liveText: "done" };
9194
+ } else if (terminal === "halted" || terminal === "canceled") {
9169
9195
  stuck = true;
9170
9196
  why = snap.workflow?.haltReason ? `${terminal}: ${snap.workflow.haltReason}` : `workflow ${terminal}`;
9171
9197
  } else if (chainStatus === "escalated" || chainStatus === "abandoned") {
@@ -9946,6 +9972,8 @@ function createDashboardRuntime(input) {
9946
9972
  let lastSig = null;
9947
9973
  let renderCount = 0;
9948
9974
  let recycles = 0;
9975
+ let lastRenderedMode = "wall";
9976
+ let clearCount = 0;
9949
9977
  const recycleEvery = Math.max(1, input.__recycleEveryRenders ?? 750);
9950
9978
  function toPhaseRuns(raw) {
9951
9979
  return raw.map((p) => ({
@@ -10151,6 +10179,11 @@ function createDashboardRuntime(input) {
10151
10179
  lastSig = pendingSig;
10152
10180
  renderCount += 1;
10153
10181
  const full = createElement2(DashboardApp, { node: el, onKey: handleKey });
10182
+ if (mode !== lastRenderedMode) {
10183
+ ink.clear();
10184
+ clearCount += 1;
10185
+ lastRenderedMode = mode;
10186
+ }
10154
10187
  if (renderCount % recycleEvery === 0) {
10155
10188
  ink.unmount();
10156
10189
  ink = render2(full, inkOptions);
@@ -10260,7 +10293,8 @@ function createDashboardRuntime(input) {
10260
10293
  lastError: lastPollError
10261
10294
  }),
10262
10295
  __renderCount: () => renderCount,
10263
- __recycles: () => recycles
10296
+ __recycles: () => recycles,
10297
+ __clears: () => clearCount
10264
10298
  };
10265
10299
  }
10266
10300
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-whisper",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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": {
@@ -30,10 +30,10 @@
30
30
  "@types/react": "^19.2.14",
31
31
  "ink-testing-library": "^4.0.0",
32
32
  "@ai-whisper/adapter-claude": "0.0.0",
33
- "@ai-whisper/broker": "0.0.0",
34
- "@ai-whisper/companion-core": "0.0.0",
35
33
  "@ai-whisper/shared": "0.0.0",
36
- "@ai-whisper/adapter-codex": "0.0.0"
34
+ "@ai-whisper/adapter-codex": "0.0.0",
35
+ "@ai-whisper/companion-core": "0.0.0",
36
+ "@ai-whisper/broker": "0.0.0"
37
37
  },
38
38
  "files": [
39
39
  "dist",