@agnishc/edb-compact-tools 0.10.5 â 0.10.6
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/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/src/index.ts +33 -17
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -35,24 +35,26 @@ const TOOL_EXECUTION_PATCH_SYMBOL = Symbol.for("edb-compact-tools.tool-execution
|
|
|
35
35
|
const USER_MESSAGE_PATCH_SYMBOL = Symbol.for("edb-compact-tools.user-message-patch");
|
|
36
36
|
const ASSISTANT_MESSAGE_PATCH_SYMBOL = Symbol.for("edb-compact-tools.assistant-message-patch");
|
|
37
37
|
const USER_MESSAGE_MARKER_SYMBOL = Symbol.for("edb-compact-tools.user-message-marker");
|
|
38
|
+
const ASSISTANT_MESSAGE_MARKER_SYMBOL = Symbol.for("edb-compact-tools.assistant-message-marker");
|
|
38
39
|
const USER_MESSAGE_EMOJIS = [
|
|
39
|
-
"â¨",
|
|
40
|
-
"đ",
|
|
41
|
-
"đ§ ",
|
|
42
|
-
"âĄ",
|
|
43
|
-
"đĨ",
|
|
44
|
-
"đŋ",
|
|
45
|
-
"đ",
|
|
46
|
-
"đ",
|
|
47
|
-
"đ ī¸",
|
|
48
|
-
"đ¯",
|
|
49
40
|
"đĻ",
|
|
50
41
|
"đ",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
42
|
+
"đ¸",
|
|
43
|
+
"đģ",
|
|
44
|
+
"đŧ",
|
|
45
|
+
"đ¨",
|
|
46
|
+
"đĻĨ",
|
|
47
|
+
"đĻ",
|
|
48
|
+
"đĻĢ",
|
|
49
|
+
"đĻ",
|
|
50
|
+
"đĻŠ",
|
|
51
|
+
"đĻ",
|
|
52
|
+
"đ°",
|
|
53
|
+
"đĸ",
|
|
54
|
+
"đĻ",
|
|
55
|
+
"đĻ",
|
|
55
56
|
];
|
|
57
|
+
const ASSISTANT_MESSAGE_EMOJIS = ["đ¤", "đ§ ", "đĻž", "đ¸", "đĄ"];
|
|
56
58
|
let activeTheme: CompactTheme | undefined;
|
|
57
59
|
const OSC133_ZONE_START = "\x1b]133;A\x07";
|
|
58
60
|
const OSC133_ZONE_END = "\x1b]133;B\x07";
|
|
@@ -367,8 +369,13 @@ function frameUserMessage(lines: string[], width: number, theme: CompactTheme, m
|
|
|
367
369
|
return frameMessage(lines, width, theme, markerText, "accent", "error");
|
|
368
370
|
}
|
|
369
371
|
|
|
370
|
-
function
|
|
371
|
-
return
|
|
372
|
+
function randomAssistantMessageMarker(): string {
|
|
373
|
+
return ASSISTANT_MESSAGE_EMOJIS[Math.floor(Math.random() * ASSISTANT_MESSAGE_EMOJIS.length)] ?? "đ¤";
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function _frameAssistantMessage(lines: string[], width: number, theme: CompactTheme): string[] {
|
|
377
|
+
const marker = randomAssistantMessageMarker();
|
|
378
|
+
return frameMessage(lines, width, theme, marker, "border", "toolTitle");
|
|
372
379
|
}
|
|
373
380
|
|
|
374
381
|
function installGenericToolRendererPatch(pi: ExtensionAPI): void {
|
|
@@ -446,7 +453,16 @@ function installMessageRenderers(pi: ExtensionAPI): void {
|
|
|
446
453
|
const rendered = originalRender.call(this, Math.max(1, width - 3));
|
|
447
454
|
if (this?.hasToolCalls || rendered.length === 0) return rendered;
|
|
448
455
|
const frameWidth = Math.max(1, width - 1);
|
|
449
|
-
|
|
456
|
+
if (!this[ASSISTANT_MESSAGE_MARKER_SYMBOL])
|
|
457
|
+
this[ASSISTANT_MESSAGE_MARKER_SYMBOL] = randomAssistantMessageMarker();
|
|
458
|
+
return frameMessage(
|
|
459
|
+
rendered,
|
|
460
|
+
frameWidth,
|
|
461
|
+
activeTheme ?? fallbackTheme(),
|
|
462
|
+
this[ASSISTANT_MESSAGE_MARKER_SYMBOL],
|
|
463
|
+
"border",
|
|
464
|
+
"toolTitle",
|
|
465
|
+
);
|
|
450
466
|
};
|
|
451
467
|
assistantProto[ASSISTANT_MESSAGE_PATCH_SYMBOL] = { originalRender };
|
|
452
468
|
}
|