mini-coder 0.5.9 → 0.5.11

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/src/ui.ts CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  appendMessage,
27
27
  createUiMessage,
28
28
  createUiTodoMessage,
29
+ type UiInfoFormat,
29
30
  } from "./session.ts";
30
31
  import type { Theme } from "./theme.ts";
31
32
  import {
@@ -660,9 +661,14 @@ function appendUiMessage(
660
661
  *
661
662
  * @param text - Display text to append.
662
663
  * @param state - Application state.
664
+ * @param format - Optional rich-text format hint for the content.
663
665
  */
664
- function appendInfoMessage(text: string, state: AppState): void {
665
- appendUiMessage(createUiMessage(text), state);
666
+ function appendInfoMessage(
667
+ text: string,
668
+ state: AppState,
669
+ format?: UiInfoFormat,
670
+ ): void {
671
+ appendUiMessage(createUiMessage(text, format), state);
666
672
  }
667
673
 
668
674
  /**
@@ -1,49 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { isEmptyUserContent, stripSkillFrontmatter } from "./agent.ts";
3
-
4
- describe("ui/agent", () => {
5
- test("stripSkillFrontmatter removes frontmatter and keeps the skill body", () => {
6
- const content = [
7
- "---",
8
- "name: code-review",
9
- 'description: "Review code for issues"',
10
- "---",
11
- "# Review Checklist",
12
- "- Find bugs",
13
- "",
14
- ].join("\n");
15
-
16
- expect(stripSkillFrontmatter(content)).toBe(
17
- "# Review Checklist\n- Find bugs\n",
18
- );
19
- });
20
-
21
- test("stripSkillFrontmatter leaves content without frontmatter unchanged", () => {
22
- expect(stripSkillFrontmatter("# Skill\nUse this carefully\n")).toBe(
23
- "# Skill\nUse this carefully\n",
24
- );
25
- });
26
-
27
- test("isEmptyUserContent returns true for empty text-only content", () => {
28
- expect(isEmptyUserContent(" \n\t")).toBe(true);
29
- expect(
30
- isEmptyUserContent([
31
- { type: "text", text: " " },
32
- { type: "text", text: "\n" },
33
- ]),
34
- ).toBe(true);
35
- });
36
-
37
- test("isEmptyUserContent returns false when multipart content includes an image", () => {
38
- expect(
39
- isEmptyUserContent([
40
- { type: "text", text: " " },
41
- {
42
- type: "image",
43
- data: Buffer.from("fake-png-data").toString("base64"),
44
- mimeType: "image/png",
45
- },
46
- ]),
47
- ).toBe(false);
48
- });
49
- });