mini-coder 0.0.23 → 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/mc.js +42 -6
- package/package.json +3 -2
package/dist/mc.js
CHANGED
|
@@ -1367,6 +1367,8 @@ function buildShellSummaryParts(opts) {
|
|
|
1367
1367
|
function shouldPreviewShellStdout(opts) {
|
|
1368
1368
|
if (opts.stdoutLines === 0)
|
|
1369
1369
|
return false;
|
|
1370
|
+
if (opts.stdoutSingleLine !== null && opts.stderrLines === 0)
|
|
1371
|
+
return false;
|
|
1370
1372
|
if (!opts.success || opts.stderrLines > 0)
|
|
1371
1373
|
return true;
|
|
1372
1374
|
return opts.stdoutSingleLine === null;
|
|
@@ -1514,6 +1516,7 @@ function renderWebContentResult(result, opts) {
|
|
|
1514
1516
|
function renderMcpResult(result, opts) {
|
|
1515
1517
|
const content = Array.isArray(result) ? result : [result];
|
|
1516
1518
|
const maxBlocks = opts?.verboseOutput ? content.length : 5;
|
|
1519
|
+
let rendered = false;
|
|
1517
1520
|
for (const block of content.slice(0, maxBlocks)) {
|
|
1518
1521
|
if (block?.type === "text" && block.text) {
|
|
1519
1522
|
const maxLines = opts?.verboseOutput ? Number.POSITIVE_INFINITY : 6;
|
|
@@ -1521,9 +1524,10 @@ function renderMcpResult(result, opts) {
|
|
|
1521
1524
|
`).slice(0, maxLines);
|
|
1522
1525
|
for (const line of lines)
|
|
1523
1526
|
writeln(` ${c4.dim("\u2502")} ${line}`);
|
|
1527
|
+
rendered = true;
|
|
1524
1528
|
}
|
|
1525
1529
|
}
|
|
1526
|
-
return
|
|
1530
|
+
return rendered;
|
|
1527
1531
|
}
|
|
1528
1532
|
var TOOL_RESULT_RENDERERS = {
|
|
1529
1533
|
shell: renderShellResult,
|
|
@@ -1553,6 +1557,10 @@ function toolGlyph(name) {
|
|
|
1553
1557
|
return G.read;
|
|
1554
1558
|
if (name === "listSkills")
|
|
1555
1559
|
return G.search;
|
|
1560
|
+
if (name === "webSearch")
|
|
1561
|
+
return G.search;
|
|
1562
|
+
if (name === "webContent")
|
|
1563
|
+
return G.read;
|
|
1556
1564
|
if (name.startsWith("mcp_"))
|
|
1557
1565
|
return G.mcp;
|
|
1558
1566
|
return G.info;
|
|
@@ -1580,6 +1588,17 @@ function buildToolCallLine(name, args) {
|
|
|
1580
1588
|
const skillName = typeof a.name === "string" ? a.name : "";
|
|
1581
1589
|
return `${G.read} ${c5.dim("read skill")}${skillName ? ` ${skillName}` : ""}`;
|
|
1582
1590
|
}
|
|
1591
|
+
if (name === "webSearch") {
|
|
1592
|
+
const query = typeof a.query === "string" ? a.query : "";
|
|
1593
|
+
const short = query.length > 60 ? `${query.slice(0, 57)}\u2026` : query;
|
|
1594
|
+
return `${G.search} ${c5.dim("search")}${short ? ` ${short}` : ""}`;
|
|
1595
|
+
}
|
|
1596
|
+
if (name === "webContent") {
|
|
1597
|
+
const urls = Array.isArray(a.urls) ? a.urls : [];
|
|
1598
|
+
const label = urls.length === 1 ? String(urls[0]) : `${urls.length} url${urls.length !== 1 ? "s" : ""}`;
|
|
1599
|
+
const short = label.length > 60 ? `${label.slice(0, 57)}\u2026` : label;
|
|
1600
|
+
return `${G.read} ${c5.dim("fetch")} ${short}`;
|
|
1601
|
+
}
|
|
1583
1602
|
if (name.startsWith("mcp_")) {
|
|
1584
1603
|
return `${G.mcp} ${c5.dim(name)}`;
|
|
1585
1604
|
}
|
|
@@ -1621,6 +1640,8 @@ async function renderTurn(events, spinner, opts) {
|
|
|
1621
1640
|
let contextTokens = 0;
|
|
1622
1641
|
let newMessages = [];
|
|
1623
1642
|
const startedToolCalls = new Set;
|
|
1643
|
+
const toolCallInfo = new Map;
|
|
1644
|
+
let parallelCallCount = 0;
|
|
1624
1645
|
let renderedVisibleOutput = false;
|
|
1625
1646
|
let reasoningComputed = false;
|
|
1626
1647
|
let reasoningText = "";
|
|
@@ -1657,11 +1678,19 @@ async function renderTurn(events, spinner, opts) {
|
|
|
1657
1678
|
if (startedToolCalls.has(event.toolCallId)) {
|
|
1658
1679
|
break;
|
|
1659
1680
|
}
|
|
1681
|
+
const isConsecutiveToolCall = startedToolCalls.size > 0 && toolCallInfo.size > 0;
|
|
1660
1682
|
startedToolCalls.add(event.toolCallId);
|
|
1683
|
+
toolCallInfo.set(event.toolCallId, {
|
|
1684
|
+
toolName: event.toolName,
|
|
1685
|
+
label: buildToolCallLine(event.toolName, event.args)
|
|
1686
|
+
});
|
|
1687
|
+
if (toolCallInfo.size > 1) {
|
|
1688
|
+
parallelCallCount = toolCallInfo.size;
|
|
1689
|
+
}
|
|
1661
1690
|
liveReasoning.finish();
|
|
1662
1691
|
content.flushOpenContent();
|
|
1663
1692
|
spinner.stop();
|
|
1664
|
-
if (renderedVisibleOutput)
|
|
1693
|
+
if (renderedVisibleOutput && !isConsecutiveToolCall)
|
|
1665
1694
|
writeln();
|
|
1666
1695
|
renderToolCall(event.toolName, event.args);
|
|
1667
1696
|
renderedVisibleOutput = true;
|
|
@@ -1670,8 +1699,15 @@ async function renderTurn(events, spinner, opts) {
|
|
|
1670
1699
|
}
|
|
1671
1700
|
case "tool-result": {
|
|
1672
1701
|
startedToolCalls.delete(event.toolCallId);
|
|
1702
|
+
const callInfo = toolCallInfo.get(event.toolCallId);
|
|
1703
|
+
toolCallInfo.delete(event.toolCallId);
|
|
1673
1704
|
liveReasoning.finish();
|
|
1674
1705
|
spinner.stop();
|
|
1706
|
+
if (parallelCallCount > 1 && callInfo) {
|
|
1707
|
+
writeln(` ${c6.dim("\u21B3")} ${callInfo.label}`);
|
|
1708
|
+
}
|
|
1709
|
+
if (toolCallInfo.size === 0)
|
|
1710
|
+
parallelCallCount = 0;
|
|
1675
1711
|
renderToolResult(event.toolName, event.result, event.isError, {
|
|
1676
1712
|
verboseOutput
|
|
1677
1713
|
});
|
|
@@ -1725,7 +1761,7 @@ async function renderTurn(events, spinner, opts) {
|
|
|
1725
1761
|
|
|
1726
1762
|
// src/cli/output.ts
|
|
1727
1763
|
var HOME = homedir3();
|
|
1728
|
-
var PACKAGE_VERSION = "0.0
|
|
1764
|
+
var PACKAGE_VERSION = "0.1.0";
|
|
1729
1765
|
function tildePath(p) {
|
|
1730
1766
|
return p.startsWith(HOME) ? `~${p.slice(HOME.length)}` : p;
|
|
1731
1767
|
}
|
|
@@ -6482,7 +6518,7 @@ function parseArgs(argv) {
|
|
|
6482
6518
|
const args = {
|
|
6483
6519
|
model: null,
|
|
6484
6520
|
sessionId: null,
|
|
6485
|
-
|
|
6521
|
+
list: false,
|
|
6486
6522
|
resumeLast: false,
|
|
6487
6523
|
prompt: null,
|
|
6488
6524
|
cwd: process.cwd(),
|
|
@@ -6509,7 +6545,7 @@ function parseArgs(argv) {
|
|
|
6509
6545
|
break;
|
|
6510
6546
|
case "--list":
|
|
6511
6547
|
case "-l":
|
|
6512
|
-
args.
|
|
6548
|
+
args.list = true;
|
|
6513
6549
|
break;
|
|
6514
6550
|
case "--cwd":
|
|
6515
6551
|
args.cwd = argv[++i] ?? process.cwd();
|
|
@@ -7603,7 +7639,7 @@ async function main() {
|
|
|
7603
7639
|
printHelp();
|
|
7604
7640
|
process.exit(0);
|
|
7605
7641
|
}
|
|
7606
|
-
if (args.
|
|
7642
|
+
if (args.list) {
|
|
7607
7643
|
printSessionList();
|
|
7608
7644
|
process.exit(0);
|
|
7609
7645
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini-coder",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "A small, fast CLI coding agent",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"knip": "knip",
|
|
18
18
|
"test": "bun test --only-failures",
|
|
19
19
|
"test:verbose": "bun test",
|
|
20
|
-
"jscpd": "jscpd src"
|
|
20
|
+
"jscpd": "jscpd src",
|
|
21
|
+
"ui-oneshot": "bun scripts/ui-oneshot.ts"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"@ai-sdk/anthropic": "^3.0.60",
|