@agentproto/corpus-cli 0.1.0-alpha.4 → 0.1.0-alpha.6

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/cli.mjs CHANGED
@@ -1770,6 +1770,32 @@ var CliAgentDistiller = class {
1770
1770
  return parseItems(text);
1771
1771
  }
1772
1772
  };
1773
+ var ANSI = new RegExp(String.fromCharCode(27) + "\\[[0-9;]*m", "g");
1774
+ function plainTextOutput(stdout) {
1775
+ return stdout.replace(ANSI, "");
1776
+ }
1777
+ function parseCodexJsonl(stdout) {
1778
+ let found = null;
1779
+ for (const line of stdout.split("\n")) {
1780
+ const trimmed = line.trim();
1781
+ if (!trimmed.startsWith("{")) continue;
1782
+ let evt;
1783
+ try {
1784
+ evt = JSON.parse(trimmed);
1785
+ } catch {
1786
+ continue;
1787
+ }
1788
+ if (!evt || typeof evt !== "object") continue;
1789
+ const e = evt;
1790
+ const item = e.item;
1791
+ if (item?.type === "agent_message" && typeof item.text === "string") {
1792
+ found = item.text;
1793
+ } else if (e.type === "agent_message" && typeof e.message === "string") {
1794
+ found = e.message;
1795
+ }
1796
+ }
1797
+ return found;
1798
+ }
1773
1799
  var CLAUDE_CODE = {
1774
1800
  id: "claude-code",
1775
1801
  subscriptionBilled: true,
@@ -1783,8 +1809,38 @@ var CLAUDE_CODE = {
1783
1809
  ],
1784
1810
  parseOutput: parseClaudeJsonOutput
1785
1811
  };
1812
+ var GEMINI = {
1813
+ id: "gemini",
1814
+ subscriptionBilled: true,
1815
+ command: "gemini",
1816
+ buildArgs: ({ model }) => [...model ? ["-m", model] : []],
1817
+ parseOutput: plainTextOutput
1818
+ };
1819
+ var CODEX = {
1820
+ id: "codex",
1821
+ subscriptionBilled: true,
1822
+ command: "codex",
1823
+ buildArgs: ({ model }) => [
1824
+ "exec",
1825
+ "--skip-git-repo-check",
1826
+ "--json",
1827
+ ...model ? ["-m", model] : [],
1828
+ "-"
1829
+ ],
1830
+ parseOutput: parseCodexJsonl
1831
+ };
1832
+ var OPENCODE = {
1833
+ id: "opencode",
1834
+ subscriptionBilled: false,
1835
+ command: "opencode",
1836
+ buildArgs: ({ model }) => ["run", ...model ? ["-m", model] : []],
1837
+ parseOutput: plainTextOutput
1838
+ };
1786
1839
  var CLI_ENGINES = {
1787
- [CLAUDE_CODE.id]: CLAUDE_CODE
1840
+ [CLAUDE_CODE.id]: CLAUDE_CODE,
1841
+ [GEMINI.id]: GEMINI,
1842
+ [CODEX.id]: CODEX,
1843
+ [OPENCODE.id]: OPENCODE
1788
1844
  };
1789
1845
  var PRICING = [
1790
1846
  { match: "opus", inPerM: 15, outPerM: 75 },