@mrquake/quakecode-cli 0.64.4 → 0.64.7

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.
@@ -0,0 +1,9 @@
1
+ import { type Component } from "@mariozechner/pi-tui";
2
+ export declare class SessionTabsComponent implements Component {
3
+ private getSessionLabel;
4
+ private getDisplayName;
5
+ constructor(getSessionLabel: () => string, getDisplayName: () => string);
6
+ invalidate(): void;
7
+ render(width: number): string[];
8
+ }
9
+ //# sourceMappingURL=session-tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-tabs.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAkBpE,qBAAa,oBAAqB,YAAW,SAAS;IAEpD,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,cAAc;IAFvB,YACS,eAAe,EAAE,MAAM,MAAM,EAC7B,cAAc,EAAE,MAAM,MAAM,EACjC;IAEJ,UAAU,IAAI,IAAI,CAAG;IAErB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAiB9B;CACD","sourcesContent":["import { type Component, visibleWidth } from \"@mariozechner/pi-tui\";\nimport { theme } from \"../theme/theme.js\";\n\nfunction truncateText(text: string, maxWidth: number): string {\n\tif (maxWidth <= 0) return \"\";\n\tlet out = text;\n\twhile (visibleWidth(out) > maxWidth && out.length > 0) {\n\t\tout = out.slice(0, -1);\n\t}\n\tif (visibleWidth(text) > maxWidth && maxWidth >= 1) {\n\t\twhile (visibleWidth(`${out}…`) > maxWidth && out.length > 0) {\n\t\t\tout = out.slice(0, -1);\n\t\t}\n\t\treturn `${out}…`;\n\t}\n\treturn out;\n}\n\nexport class SessionTabsComponent implements Component {\n\tconstructor(\n\t\tprivate getSessionLabel: () => string,\n\t\tprivate getDisplayName: () => string,\n\t) {}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tconst chrome = theme.fg(\"dim\", \"▌\");\n\t\tconst appIcon = theme.bold(theme.fg(\"accent\", \"◆\"));\n\t\tconst appChip = theme.bg(\"userMessageBg\", ` ${appIcon} ${this.getDisplayName()} `);\n\t\tconst plusChip = theme.bg(\"userMessageBg\", ` ${theme.bold(theme.fg(\"accent\", \"+\"))} `);\n\n\t\tconst rawLabel = `:: ${this.getSessionLabel()}`;\n\t\tconst reservedWidth = visibleWidth(appChip) + visibleWidth(plusChip) + 6;\n\t\tconst maxTabWidth = Math.max(12, width - reservedWidth);\n\t\tconst label = truncateText(rawLabel, Math.max(4, maxTabWidth - 6));\n\t\tconst tabInner = ` ${theme.bold(label)} ${theme.fg(\"muted\", \"×\")} `;\n\t\tconst tabChip = theme.bg(\"selectedBg\", tabInner);\n\n\t\tconst left = `${chrome}${appChip} ${tabChip}`;\n\t\tconst gap = Math.max(1, width - visibleWidth(left) - visibleWidth(plusChip) - 1);\n\t\tconst line = `${left}${\" \".repeat(gap)}${plusChip}`;\n\t\treturn [line];\n\t}\n}\n"]}
@@ -0,0 +1,43 @@
1
+ import { visibleWidth } from "@mariozechner/pi-tui";
2
+ import { theme } from "../theme/theme.js";
3
+ function truncateText(text, maxWidth) {
4
+ if (maxWidth <= 0)
5
+ return "";
6
+ let out = text;
7
+ while (visibleWidth(out) > maxWidth && out.length > 0) {
8
+ out = out.slice(0, -1);
9
+ }
10
+ if (visibleWidth(text) > maxWidth && maxWidth >= 1) {
11
+ while (visibleWidth(`${out}…`) > maxWidth && out.length > 0) {
12
+ out = out.slice(0, -1);
13
+ }
14
+ return `${out}…`;
15
+ }
16
+ return out;
17
+ }
18
+ export class SessionTabsComponent {
19
+ getSessionLabel;
20
+ getDisplayName;
21
+ constructor(getSessionLabel, getDisplayName) {
22
+ this.getSessionLabel = getSessionLabel;
23
+ this.getDisplayName = getDisplayName;
24
+ }
25
+ invalidate() { }
26
+ render(width) {
27
+ const chrome = theme.fg("dim", "▌");
28
+ const appIcon = theme.bold(theme.fg("accent", "◆"));
29
+ const appChip = theme.bg("userMessageBg", ` ${appIcon} ${this.getDisplayName()} `);
30
+ const plusChip = theme.bg("userMessageBg", ` ${theme.bold(theme.fg("accent", "+"))} `);
31
+ const rawLabel = `:: ${this.getSessionLabel()}`;
32
+ const reservedWidth = visibleWidth(appChip) + visibleWidth(plusChip) + 6;
33
+ const maxTabWidth = Math.max(12, width - reservedWidth);
34
+ const label = truncateText(rawLabel, Math.max(4, maxTabWidth - 6));
35
+ const tabInner = ` ${theme.bold(label)} ${theme.fg("muted", "×")} `;
36
+ const tabChip = theme.bg("selectedBg", tabInner);
37
+ const left = `${chrome}${appChip} ${tabChip}`;
38
+ const gap = Math.max(1, width - visibleWidth(left) - visibleWidth(plusChip) - 1);
39
+ const line = `${left}${" ".repeat(gap)}${plusChip}`;
40
+ return [line];
41
+ }
42
+ }
43
+ //# sourceMappingURL=session-tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-tabs.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-tabs.ts"],"names":[],"mappings":"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","sourcesContent":["import { type Component, visibleWidth } from \"@mariozechner/pi-tui\";\nimport { theme } from \"../theme/theme.js\";\n\nfunction truncateText(text: string, maxWidth: number): string {\n\tif (maxWidth <= 0) return \"\";\n\tlet out = text;\n\twhile (visibleWidth(out) > maxWidth && out.length > 0) {\n\t\tout = out.slice(0, -1);\n\t}\n\tif (visibleWidth(text) > maxWidth && maxWidth >= 1) {\n\t\twhile (visibleWidth(`${out}…`) > maxWidth && out.length > 0) {\n\t\t\tout = out.slice(0, -1);\n\t\t}\n\t\treturn `${out}…`;\n\t}\n\treturn out;\n}\n\nexport class SessionTabsComponent implements Component {\n\tconstructor(\n\t\tprivate getSessionLabel: () => string,\n\t\tprivate getDisplayName: () => string,\n\t) {}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tconst chrome = theme.fg(\"dim\", \"▌\");\n\t\tconst appIcon = theme.bold(theme.fg(\"accent\", \"◆\"));\n\t\tconst appChip = theme.bg(\"userMessageBg\", ` ${appIcon} ${this.getDisplayName()} `);\n\t\tconst plusChip = theme.bg(\"userMessageBg\", ` ${theme.bold(theme.fg(\"accent\", \"+\"))} `);\n\n\t\tconst rawLabel = `:: ${this.getSessionLabel()}`;\n\t\tconst reservedWidth = visibleWidth(appChip) + visibleWidth(plusChip) + 6;\n\t\tconst maxTabWidth = Math.max(12, width - reservedWidth);\n\t\tconst label = truncateText(rawLabel, Math.max(4, maxTabWidth - 6));\n\t\tconst tabInner = ` ${theme.bold(label)} ${theme.fg(\"muted\", \"×\")} `;\n\t\tconst tabChip = theme.bg(\"selectedBg\", tabInner);\n\n\t\tconst left = `${chrome}${appChip} ${tabChip}`;\n\t\tconst gap = Math.max(1, width - visibleWidth(left) - visibleWidth(plusChip) - 1);\n\t\tconst line = `${left}${\" \".repeat(gap)}${plusChip}`;\n\t\treturn [line];\n\t}\n}\n"]}
@@ -3,6 +3,8 @@ import { Container, type MarkdownTheme } from "@mariozechner/pi-tui";
3
3
  * Component that renders a user message
4
4
  */
5
5
  export declare class UserMessageComponent extends Container {
6
+ private text;
7
+ private markdownTheme;
6
8
  constructor(text: string, markdownTheme?: MarkdownTheme);
7
9
  render(width: number): string[];
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,KAAK,aAAa,EAAU,MAAM,sBAAsB,CAAC;AAOvF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAS1E;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CASvC;CACD","sourcesContent":["import { Container, Markdown, type MarkdownTheme, Spacer } from \"@mariozechner/pi-tui\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(\n\t\t\tnew Markdown(text, 0, 0, markdownTheme, {\n\t\t\t\tbgColor: (text: string) => theme.bg(\"userMessageBg\", text),\n\t\t\t\tcolor: (text: string) => theme.fg(\"userMessageText\", text),\n\t\t\t}),\n\t\t);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END + OSC133_ZONE_FINAL;\n\t\treturn lines;\n\t}\n}\n"]}
1
+ {"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,KAAK,aAAa,EAAgB,MAAM,sBAAsB,CAAC;AAO7F;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,aAAa,CAAgB;IAErC,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAyB1E;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CASvC;CACD","sourcesContent":["import { Container, Markdown, type MarkdownTheme, Spacer, Text } from \"@mariozechner/pi-tui\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tprivate text: string;\n\tprivate markdownTheme: MarkdownTheme;\n\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.text = text;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.addChild(new Spacer(1));\n\t\t\n\t\t// Create an inner component that adds the prompt symbol to the rendered markdown lines\n\t\tconst md = new Markdown(text, 0, 0, markdownTheme);\n\t\tthis.addChild({\n\t\t\tinvalidate: () => md.invalidate(),\n\t\t\trender: (width: number) => {\n\t\t\t\tconst prompt = theme.bold(theme.fg(\"accent\", \"› \"));\n\t\t\t\tconst promptWidth = 2; // '› ' visible width\n\t\t\t\t\n\t\t\t\t// Render markdown with remaining width\n\t\t\t\tconst lines = md.render(Math.max(1, width - promptWidth));\n\t\t\t\t\n\t\t\t\tif (lines.length === 0) return lines;\n\t\t\t\t\n\t\t\t\treturn lines.map((line, i) => {\n\t\t\t\t\tconst prefix = i === 0 ? prompt : \" \";\n\t\t\t\t\treturn `${prefix}${line}`;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END + OSC133_ZONE_FINAL;\n\t\treturn lines;\n\t}\n}\n"]}
@@ -7,13 +7,30 @@ const OSC133_ZONE_FINAL = "\x1b]133;C\x07";
7
7
  * Component that renders a user message
8
8
  */
9
9
  export class UserMessageComponent extends Container {
10
+ text;
11
+ markdownTheme;
10
12
  constructor(text, markdownTheme = getMarkdownTheme()) {
11
13
  super();
14
+ this.text = text;
15
+ this.markdownTheme = markdownTheme;
12
16
  this.addChild(new Spacer(1));
13
- this.addChild(new Markdown(text, 0, 0, markdownTheme, {
14
- bgColor: (text) => theme.bg("userMessageBg", text),
15
- color: (text) => theme.fg("userMessageText", text),
16
- }));
17
+ // Create an inner component that adds the prompt symbol to the rendered markdown lines
18
+ const md = new Markdown(text, 0, 0, markdownTheme);
19
+ this.addChild({
20
+ invalidate: () => md.invalidate(),
21
+ render: (width) => {
22
+ const prompt = theme.bold(theme.fg("accent", "› "));
23
+ const promptWidth = 2; // '› ' visible width
24
+ // Render markdown with remaining width
25
+ const lines = md.render(Math.max(1, width - promptWidth));
26
+ if (lines.length === 0)
27
+ return lines;
28
+ return lines.map((line, i) => {
29
+ const prefix = i === 0 ? prompt : " ";
30
+ return `${prefix}${line}`;
31
+ });
32
+ }
33
+ });
17
34
  }
18
35
  render(width) {
19
36
  const lines = super.render(width);
@@ -1 +1 @@
1
- {"version":3,"file":"user-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAsB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAClD,YAAY,IAAY,EAAE,aAAa,GAAkB,gBAAgB,EAAE,EAAE;QAC5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,CACZ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE;YACvC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;YAC1D,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC;SAC1D,CAAC,CACF,CAAC;IAAA,CACF;IAEQ,MAAM,CAAC,KAAa,EAAY;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACd,CAAC;QAED,KAAK,CAAC,CAAC,CAAC,GAAG,iBAAiB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,GAAG,iBAAiB,CAAC;QACxF,OAAO,KAAK,CAAC;IAAA,CACb;CACD","sourcesContent":["import { Container, Markdown, type MarkdownTheme, Spacer } from \"@mariozechner/pi-tui\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(\n\t\t\tnew Markdown(text, 0, 0, markdownTheme, {\n\t\t\t\tbgColor: (text: string) => theme.bg(\"userMessageBg\", text),\n\t\t\t\tcolor: (text: string) => theme.fg(\"userMessageText\", text),\n\t\t\t}),\n\t\t);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END + OSC133_ZONE_FINAL;\n\t\treturn lines;\n\t}\n}\n"]}
1
+ {"version":3,"file":"user-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAsB,MAAM,EAAQ,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,IAAI,CAAS;IACb,aAAa,CAAgB;IAErC,YAAY,IAAY,EAAE,aAAa,GAAkB,gBAAgB,EAAE,EAAE;QAC5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7B,uFAAuF;QACvF,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,CAAC;YACb,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE;YACjC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAI,CAAC,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,uBAAqB;gBAE5C,uCAAuC;gBACvC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC;gBAE1D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;oBAAE,OAAO,KAAK,CAAC;gBAErC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC7B,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;oBACvC,OAAO,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;gBAAA,CAC1B,CAAC,CAAC;YAAA,CACH;SACD,CAAC,CAAC;IAAA,CACH;IAEQ,MAAM,CAAC,KAAa,EAAY;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACd,CAAC;QAED,KAAK,CAAC,CAAC,CAAC,GAAG,iBAAiB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,GAAG,iBAAiB,CAAC;QACxF,OAAO,KAAK,CAAC;IAAA,CACb;CACD","sourcesContent":["import { Container, Markdown, type MarkdownTheme, Spacer, Text } from \"@mariozechner/pi-tui\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\n/**\n * Component that renders a user message\n */\nexport class UserMessageComponent extends Container {\n\tprivate text: string;\n\tprivate markdownTheme: MarkdownTheme;\n\n\tconstructor(text: string, markdownTheme: MarkdownTheme = getMarkdownTheme()) {\n\t\tsuper();\n\t\tthis.text = text;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.addChild(new Spacer(1));\n\t\t\n\t\t// Create an inner component that adds the prompt symbol to the rendered markdown lines\n\t\tconst md = new Markdown(text, 0, 0, markdownTheme);\n\t\tthis.addChild({\n\t\t\tinvalidate: () => md.invalidate(),\n\t\t\trender: (width: number) => {\n\t\t\t\tconst prompt = theme.bold(theme.fg(\"accent\", \"› \"));\n\t\t\t\tconst promptWidth = 2; // '› ' visible width\n\t\t\t\t\n\t\t\t\t// Render markdown with remaining width\n\t\t\t\tconst lines = md.render(Math.max(1, width - promptWidth));\n\t\t\t\t\n\t\t\t\tif (lines.length === 0) return lines;\n\t\t\t\t\n\t\t\t\treturn lines.map((line, i) => {\n\t\t\t\t\tconst prefix = i === 0 ? prompt : \" \";\n\t\t\t\t\treturn `${prefix}${line}`;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst lines = super.render(width);\n\t\tif (lines.length === 0) {\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END + OSC133_ZONE_FINAL;\n\t\treturn lines;\n\t}\n}\n"]}
@@ -87,9 +87,7 @@ export declare class InteractiveMode {
87
87
  private getBuiltInCommandConflictDiagnostics;
88
88
  private setupAutocomplete;
89
89
  init(): Promise<void>;
90
- /**
91
- * Update terminal title with session name and cwd.
92
- */
90
+ private getSessionTabLabel;
93
91
  private updateTerminalTitle;
94
92
  /**
95
93
  * Run the interactive mode. This is the main entry point.