opencode-miniterm 1.0.8 → 1.0.9
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/package.json +1 -1
- package/src/index.ts +9 -7
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -805,7 +805,12 @@ async function processText(part: Part) {
|
|
|
805
805
|
async function processToolUse(part: Part) {
|
|
806
806
|
const toolPart = part as ToolPart;
|
|
807
807
|
const toolName = toolPart.tool || "unknown";
|
|
808
|
-
const toolInput =
|
|
808
|
+
const toolInput =
|
|
809
|
+
toolPart.state.input["description"] ||
|
|
810
|
+
toolPart.state.input["filePath"] ||
|
|
811
|
+
toolPart.state.input["path"] ||
|
|
812
|
+
// TODO: more state.input props...
|
|
813
|
+
"...";
|
|
809
814
|
const toolText = `$ ${toolName}: ${ansi.BRIGHT_BLACK}${toolInput}${ansi.RESET}`;
|
|
810
815
|
|
|
811
816
|
if (state.accumulatedResponse[state.accumulatedResponse.length - 1]?.title === "tool") {
|
|
@@ -835,14 +840,11 @@ async function processDiff(diff: FileDiff[]) {
|
|
|
835
840
|
const newAfter = file.after ?? "";
|
|
836
841
|
const oldAfter = state.lastFileAfter.get(file.file);
|
|
837
842
|
if (newAfter !== oldAfter) {
|
|
838
|
-
const
|
|
839
|
-
const statusIcon = status === "added" ? "A" : status === "modified" ? "M" : "D";
|
|
840
|
-
const statusLabel =
|
|
841
|
-
status === "added" ? "added" : status === "modified" ? "modified" : "deleted";
|
|
843
|
+
const statusIcon = !file.before ? "A" : !file.after ? "D" : "M";
|
|
842
844
|
const addStr = file.additions > 0 ? `${ansi.GREEN}+${file.additions}${ansi.RESET}` : "";
|
|
843
845
|
const delStr = file.deletions > 0 ? `${ansi.RED}-${file.deletions}${ansi.RESET}` : "";
|
|
844
846
|
const stats = [addStr, delStr].filter(Boolean).join(" ");
|
|
845
|
-
const line = `${ansi.BLUE}${statusIcon}${ansi.RESET} ${file.file}
|
|
847
|
+
const line = `${ansi.BLUE}${statusIcon}${ansi.RESET} ${file.file} ${stats}`;
|
|
846
848
|
parts.push(line);
|
|
847
849
|
|
|
848
850
|
state.lastFileAfter.set(file.file, newAfter);
|
|
@@ -876,7 +878,7 @@ async function processTodos(todos: Todo[]) {
|
|
|
876
878
|
state.accumulatedResponse.push({ key: "todo", title: "files", text: todoListText });
|
|
877
879
|
|
|
878
880
|
const cleanTodoText = ansi.stripAnsiCodes(todoListText);
|
|
879
|
-
await writeToLog(`${cleanTodoText}\n
|
|
881
|
+
await writeToLog(`${cleanTodoText}\n`);
|
|
880
882
|
|
|
881
883
|
render(state);
|
|
882
884
|
}
|