@agentproto/corpus-cli 0.1.0-alpha.5 → 0.1.0
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 +59 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/ports/index.d.ts +16 -2
- package/dist/ports/index.mjs +59 -1
- package/dist/ports/index.mjs.map +1 -1
- package/dist/specs/resources/aip-52/draft/ADAPTER.md +193 -0
- package/package.json +3 -3
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 },
|
|
@@ -2386,6 +2442,7 @@ var SseMcpClient = class {
|
|
|
2386
2442
|
this.opts = opts;
|
|
2387
2443
|
this.base = new URL(opts.endpoint);
|
|
2388
2444
|
}
|
|
2445
|
+
opts;
|
|
2389
2446
|
id = 0;
|
|
2390
2447
|
messagesUrl;
|
|
2391
2448
|
pending = /* @__PURE__ */ new Map();
|
|
@@ -2515,6 +2572,7 @@ var McpSink = class {
|
|
|
2515
2572
|
this.config = config;
|
|
2516
2573
|
this.client = client;
|
|
2517
2574
|
}
|
|
2575
|
+
config;
|
|
2518
2576
|
client;
|
|
2519
2577
|
async ensure() {
|
|
2520
2578
|
if (!this.client) {
|