pi-claude-code-ui 1.0.75 → 1.0.76
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/extensions/index.ts +10 -1
- package/package.json +1 -1
package/extensions/index.ts
CHANGED
|
@@ -1494,6 +1494,15 @@ function hasInlineMathMarkers(text: string): boolean {
|
|
|
1494
1494
|
return text.includes("\\(") || text.includes("$");
|
|
1495
1495
|
}
|
|
1496
1496
|
|
|
1497
|
+
// Magic Context prefixes live assistant text with §N§ while the response is
|
|
1498
|
+
// streaming and removes that metadata on message_end. Keep the transient tag
|
|
1499
|
+
// out of the display without mutating the message used by context management.
|
|
1500
|
+
const MAGIC_CONTEXT_TAG_LINE_PREFIX = /(^|\r?\n)[ \t]*(?:§\d+§[ \t]*)+/g;
|
|
1501
|
+
|
|
1502
|
+
function stripTransientMagicContextTags(text: string): string {
|
|
1503
|
+
return text.replace(MAGIC_CONTEXT_TAG_LINE_PREFIX, "$1");
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1497
1506
|
function replaceInlineMath(text: string): string {
|
|
1498
1507
|
if (!hasInlineMathMarkers(text)) return text;
|
|
1499
1508
|
const withParens = text.replace(/\\\(([\s\S]*?)\\\)/g, (_match, body: string) => {
|
|
@@ -1702,7 +1711,7 @@ class DottedParagraph {
|
|
|
1702
1711
|
|
|
1703
1712
|
constructor(text: string, markdownTheme: MarkdownThemeLike) {
|
|
1704
1713
|
this.markdownTheme = copySafeMarkdownTheme(markdownTheme);
|
|
1705
|
-
this.segments = buildParagraphSegments(text, this.markdownTheme);
|
|
1714
|
+
this.segments = buildParagraphSegments(stripTransientMagicContextTags(text), this.markdownTheme);
|
|
1706
1715
|
}
|
|
1707
1716
|
|
|
1708
1717
|
invalidate(): void {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-claude-code-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.76",
|
|
4
4
|
"description": "Claude Code-style grouped tool rows for pi with Ctrl+O/Ctrl+Shift+O previews, math rendering, and consistent built-in, MCP, and custom tool rendering",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|