@0dai-dev/cli 3.2.3 → 3.2.4

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.
Files changed (2) hide show
  1. package/bin/0dai.js +41 -15
  2. package/package.json +1 -1
package/bin/0dai.js CHANGED
@@ -1599,31 +1599,57 @@ async function cmdAuthStatus() {
1599
1599
  }
1600
1600
 
1601
1601
  async function cmdFeedbackPush(target) {
1602
- const ai = path.join(target, "ai", "feedback");
1603
- const reports = [];
1602
+ const fbDir = path.join(target, "ai", "feedback");
1603
+ const items = [];
1604
+
1605
+ // Collect from report JSON files
1604
1606
  try {
1605
- for (const f of fs.readdirSync(ai)) {
1607
+ for (const f of fs.readdirSync(fbDir)) {
1606
1608
  if (f.endsWith("-report.json") || (f.endsWith(".json") && f.match(/^\d{8}/))) {
1607
1609
  try {
1608
- const d = JSON.parse(fs.readFileSync(path.join(ai, f), "utf8"));
1609
- if (d.project || d.verdict) reports.push(d);
1610
+ const d = JSON.parse(fs.readFileSync(path.join(fbDir, f), "utf8"));
1611
+ if (d.project || d.verdict) items.push({ type: "report", data: d, file: f });
1610
1612
  } catch {}
1611
1613
  }
1612
1614
  }
1613
1615
  } catch {}
1614
1616
 
1615
- if (!reports.length) { log("no feedback reports found"); return; }
1617
+ // Collect from operational.jsonl (feedback log entries)
1618
+ const jsonlPath = path.join(fbDir, "operational.jsonl");
1619
+ try {
1620
+ if (fs.existsSync(jsonlPath)) {
1621
+ const lines = fs.readFileSync(jsonlPath, "utf8").trim().split("\n").filter(Boolean);
1622
+ for (const line of lines) {
1623
+ try { items.push({ type: "log", data: JSON.parse(line) }); } catch {}
1624
+ }
1625
+ }
1626
+ } catch {}
1627
+
1628
+ if (!items.length) {
1629
+ log("no feedback found");
1630
+ console.log(` ${D}Log feedback first: 0dai feedback log --type suggestion --detail '...'${R}`);
1631
+ return;
1632
+ }
1616
1633
 
1617
- // Send each report via API
1618
- for (const report of reports) {
1619
- log(`pushing: ${report.project || "?"} (${report.verdict || "?"})`);
1620
- const result = await apiCall("/v1/feedback", { report });
1621
- if (result.received) {
1622
- log(`received${result.issue ? `: ${result.issue}` : ""}`);
1623
- if (result.bonus) log(`${T}bonus:${R} ${result.bonus}`);
1624
- } else {
1625
- log(`error: ${result.error || "unknown"}`);
1634
+ // Push all items
1635
+ const report = {
1636
+ project: path.basename(target),
1637
+ entries: items.map(i => i.data),
1638
+ count: items.length,
1639
+ submitted_at: new Date().toISOString(),
1640
+ };
1641
+ log(`pushing ${items.length} feedback item(s)...`);
1642
+ const result = await apiCall("/v1/feedback", { report });
1643
+ if (result.received) {
1644
+ log(`received${result.issue ? `: ${result.issue}` : ""}`);
1645
+ if (result.bonus) log(`${T}bonus:${R} ${result.bonus}`);
1646
+ // Archive pushed entries
1647
+ if (fs.existsSync(jsonlPath)) {
1648
+ const archivePath = path.join(fbDir, `pushed-${Date.now()}.jsonl`);
1649
+ fs.renameSync(jsonlPath, archivePath);
1626
1650
  }
1651
+ } else {
1652
+ log(`error: ${result.error || "unknown"}`);
1627
1653
  }
1628
1654
  }
1629
1655
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0dai-dev/cli",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "One config layer for 5 AI agent CLIs — Claude Code, Codex, OpenCode, Gemini, Aider",
5
5
  "bin": {
6
6
  "0dai": "./bin/0dai.js"