triagent 0.1.0-alpha12 → 0.1.0-alpha13

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.
Files changed (2) hide show
  1. package/package.json +4 -1
  2. package/src/tui/app.tsx +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triagent",
3
- "version": "0.1.0-alpha12",
3
+ "version": "0.1.0-alpha13",
4
4
  "description": "AI-powered Kubernetes debugging agent with terminal UI",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -50,6 +50,8 @@
50
50
  "@opentui/core": "^0.1.72",
51
51
  "@opentui/solid": "^0.1.72",
52
52
  "hono": "^4.6.0",
53
+ "marked": "^17.0.1",
54
+ "marked-terminal": "^7.3.0",
53
55
  "opentui-spinner": "^0.0.6",
54
56
  "solid-js": "1.9.9",
55
57
  "triagent": "^0.1.0-alpha1",
@@ -57,6 +59,7 @@
57
59
  },
58
60
  "devDependencies": {
59
61
  "@types/babel__core": "^7.20.5",
62
+ "@types/marked-terminal": "^6.1.1",
60
63
  "@types/node": "^22.0.0",
61
64
  "bun-types": "^1.2.0",
62
65
  "typescript": "^5.7.0"
package/src/tui/app.tsx CHANGED
@@ -3,9 +3,22 @@ import { render } from "@opentui/solid";
3
3
  import { createSignal, For, Show, onMount } from "solid-js";
4
4
  import { createTextAttributes } from "@opentui/core";
5
5
  import "opentui-spinner/solid";
6
+ import { marked } from "marked";
7
+ import { markedTerminal } from "marked-terminal";
6
8
  import { getDebuggerAgent, buildIncidentPrompt } from "../mastra/index.js";
7
9
  import type { IncidentInput } from "../mastra/agents/debugger.js";
8
10
 
11
+ // Configure marked with terminal renderer
12
+ marked.use(markedTerminal() as any);
13
+
14
+ function renderMarkdown(content: string): string {
15
+ try {
16
+ return marked(content) as string;
17
+ } catch {
18
+ return content;
19
+ }
20
+ }
21
+
9
22
  interface Message {
10
23
  id: string;
11
24
  role: "user" | "assistant" | "tool";
@@ -302,7 +315,7 @@ function App() {
302
315
  Triagent:
303
316
  </text>
304
317
  <text fg="white" wrapMode="word">
305
- {msg.content}
318
+ {renderMarkdown(msg.content)}
306
319
  </text>
307
320
  </box>
308
321
  </Show>