opencode-miniterm 1.0.7 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-miniterm",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A small front-end terminal UI for OpenCode",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
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 = toolPart.state.input["description"] || toolPart.state.input["filePath"] || {};
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 status = !file.before ? "added" : !file.after ? "deleted" : "modified";
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} (${statusLabel}) ${stats}`;
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\n`);
881
+ await writeToLog(`${cleanTodoText}\n`);
880
882
 
881
883
  render(state);
882
884
  }
package/src/render.ts CHANGED
@@ -269,6 +269,7 @@ export function wrapText(text: string, width: number): string[] {
269
269
 
270
270
  addWord(word, wordVisibleLength);
271
271
  atLineStart = false;
272
+ lineIndent = "";
272
273
  }
273
274
  }
274
275
 
@@ -346,8 +346,8 @@ describe("wrapText", () => {
346
346
  });
347
347
 
348
348
  it("should preserve indents", () => {
349
- const result = wrapText("line1\n line2\n line3", 20);
350
- expect(result).toEqual([" line1", " line2", " line3"]);
349
+ const result = wrapText("line1\n line2 extra\n line3", 20);
350
+ expect(result).toEqual([" line1", " line2 extra", " line3"]);
351
351
  });
352
352
  });
353
353