@runtypelabs/persona 4.29.1 → 4.29.2
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/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/approval-ui.d.cts +1 -1
- package/dist/approval-ui.d.ts +1 -1
- package/dist/artifacts-ui.d.cts +2 -2
- package/dist/artifacts-ui.d.ts +2 -2
- package/dist/{chunk-DGlFKA0r.js → chunk-B2HCRERn.js} +1 -1
- package/dist/{chunk-BcLIgi1h.js → chunk-Car1mORT.js} +1 -1
- package/dist/chunk-DrpuvY5W.js +1 -0
- package/dist/client-history.js +1 -1
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/{composer-input-B0P4OtNi.d.cts → composer-input-C3Xh1Qzj.d.cts} +1 -1
- package/dist/{composer-input-B0P4OtNi.d.ts → composer-input-C3Xh1Qzj.d.ts} +1 -1
- package/dist/{context-mention-manager-DmLI_RM6.d.cts → context-mention-manager-BsEiGObk.d.cts} +1 -1
- package/dist/{context-mention-manager-DmLI_RM6.d.ts → context-mention-manager-BsEiGObk.d.ts} +1 -1
- package/dist/context-mentions-inline.d.cts +2 -2
- package/dist/context-mentions-inline.d.ts +2 -2
- package/dist/context-mentions.d.cts +3 -3
- package/dist/context-mentions.d.ts +3 -3
- package/dist/{defaults-DVo1wbZs.d.cts → defaults-DN-L67ak.d.cts} +1 -1
- package/dist/{defaults-DVo1wbZs.d.ts → defaults-DN-L67ak.d.ts} +1 -1
- package/dist/event-stream-view.d.cts +1 -1
- package/dist/event-stream-view.d.ts +1 -1
- package/dist/{fallback-speech-engine-BMnlmKnY.d.cts → fallback-speech-engine-Cph8FTux.d.cts} +1 -1
- package/dist/{fallback-speech-engine-BMnlmKnY.d.ts → fallback-speech-engine-Cph8FTux.d.ts} +1 -1
- package/dist/forms-ui.d.cts +2 -2
- package/dist/forms-ui.d.ts +2 -2
- package/dist/history-view.d.cts +1 -1
- package/dist/history-view.d.ts +1 -1
- package/dist/index.cjs +51 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +37 -37
- package/dist/index.js.map +1 -1
- package/dist/{markdown-parsers-loader-CeovcyYf.d.cts → markdown-parsers-loader-C4Xze-Jw.d.cts} +1 -1
- package/dist/{markdown-parsers-loader-CeovcyYf.d.ts → markdown-parsers-loader-C4Xze-Jw.d.ts} +1 -1
- package/dist/{preview-Bkb4UrQC.d.cts → preview-m9QlqsZi.d.cts} +2 -2
- package/dist/{preview-Bkb4UrQC.d.ts → preview-m9QlqsZi.d.ts} +2 -2
- package/dist/{session-iLyKipoM.d.cts → session-BtvvmWnw.d.cts} +6 -6
- package/dist/{session-iLyKipoM.d.ts → session-BtvvmWnw.d.ts} +6 -6
- package/dist/session-reconnect.d.cts +2 -2
- package/dist/session-reconnect.d.ts +2 -2
- package/dist/smart-dom-reader.d.cts +1 -1
- package/dist/smart-dom-reader.d.ts +1 -1
- package/dist/theme-editor-preview.cjs +54 -54
- package/dist/theme-editor-preview.d.cts +1 -1
- package/dist/theme-editor-preview.d.ts +1 -1
- package/dist/theme-editor-preview.js +35 -35
- package/dist/theme-editor.d.cts +2 -2
- package/dist/theme-editor.d.ts +2 -2
- package/dist/theme-reference.d.cts +2 -2
- package/dist/theme-reference.d.ts +2 -2
- package/dist/{types-BuDirJkQ.d.cts → types-DL-oBHE1.d.cts} +6 -0
- package/dist/{types-BuDirJkQ.d.ts → types-DL-oBHE1.d.ts} +6 -0
- package/dist/voice-client-tools.d.cts +1 -1
- package/dist/voice-client-tools.d.ts +1 -1
- package/dist/voice-runtime.cjs +1 -1
- package/dist/voice-runtime.d.cts +2 -2
- package/dist/voice-runtime.d.ts +2 -2
- package/dist/voice-runtime.js +1 -1
- package/dist/voice-worklet-player.d.cts +2 -2
- package/dist/voice-worklet-player.d.ts +2 -2
- package/dist/{webmcp-runtime-entry-CXLjRt1k.d.cts → webmcp-runtime-entry-T6SU_TlL.d.cts} +1 -1
- package/dist/{webmcp-runtime-entry-CXLjRt1k.d.ts → webmcp-runtime-entry-T6SU_TlL.d.ts} +1 -1
- package/dist/webmcp-runtime.d.cts +1 -1
- package/dist/webmcp-runtime.d.ts +1 -1
- package/package.json +1 -1
- package/src/generated/runtype-openapi-contract.ts +6 -0
- package/src/session.test.ts +23 -0
- package/src/session.ts +35 -17
- package/src/ui.scroll.test.ts +7 -2
- package/src/ui.stream-replay.test.ts +86 -0
- package/src/ui.streaming-coalescing.test.ts +183 -0
- package/src/ui.ts +120 -106
- package/src/ui.typing-indicator.test.ts +21 -0
- package/src/utils/message-fingerprint.test.ts +9 -0
- package/src/utils/message-fingerprint.ts +18 -5
- package/src/utils/morph.ts +10 -0
- package/dist/chunk-Csks3Qw1.js +0 -1
|
@@ -35,6 +35,23 @@ export type MessageCacheEntry = {
|
|
|
35
35
|
|
|
36
36
|
export type MessageCache = Map<string, MessageCacheEntry>;
|
|
37
37
|
|
|
38
|
+
// Every render pass fingerprints every message, so re-stringifying tool args
|
|
39
|
+
// each time would cost O(total args bytes) per pass. Streaming replaces the
|
|
40
|
+
// args object rather than mutating it, so the length is memoized per object.
|
|
41
|
+
const argsLengths = new WeakMap<object, number>();
|
|
42
|
+
|
|
43
|
+
function argsLength(args: unknown): number {
|
|
44
|
+
if (typeof args === "string") return args.length;
|
|
45
|
+
if (!args) return 0;
|
|
46
|
+
if (typeof args !== "object") return JSON.stringify(args)?.length ?? 0;
|
|
47
|
+
let length = argsLengths.get(args);
|
|
48
|
+
if (length === undefined) {
|
|
49
|
+
length = JSON.stringify(args)?.length ?? 0;
|
|
50
|
+
argsLengths.set(args, length);
|
|
51
|
+
}
|
|
52
|
+
return length;
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
/**
|
|
39
56
|
* Compute a fast fingerprint for a message to detect changes.
|
|
40
57
|
* Uses string concatenation with a delimiter rather than JSON.stringify for performance.
|
|
@@ -62,11 +79,7 @@ export function computeMessageFingerprint(
|
|
|
62
79
|
message.toolCall?.name ?? "",
|
|
63
80
|
message.toolCall?.chunks?.length ?? 0,
|
|
64
81
|
message.toolCall?.chunks?.[message.toolCall.chunks.length - 1]?.slice(-32) ?? "",
|
|
65
|
-
|
|
66
|
-
? message.toolCall.args.length
|
|
67
|
-
: message.toolCall?.args
|
|
68
|
-
? JSON.stringify(message.toolCall.args).length
|
|
69
|
-
: 0,
|
|
82
|
+
argsLength(message.toolCall?.args),
|
|
70
83
|
message.reasoning?.chunks?.length ?? 0,
|
|
71
84
|
message.reasoning?.chunks?.[message.reasoning.chunks.length - 1]?.length ?? 0,
|
|
72
85
|
message.reasoning?.chunks?.[message.reasoning.chunks.length - 1]?.slice(-32) ?? "",
|
package/src/utils/morph.ts
CHANGED
|
@@ -24,6 +24,16 @@ export const morphMessages = (
|
|
|
24
24
|
beforeNodeMorphed(oldNode: Node, newNode: Node): boolean | void {
|
|
25
25
|
if (!(oldNode instanceof HTMLElement)) return;
|
|
26
26
|
|
|
27
|
+
// Render passes stand in an unchanged transcript row with an empty
|
|
28
|
+
// `data-persona-reuse` stub: keep the live row as is.
|
|
29
|
+
if (
|
|
30
|
+
newNode instanceof HTMLElement &&
|
|
31
|
+
newNode.hasAttribute("data-persona-reuse") &&
|
|
32
|
+
oldNode.id === newNode.id
|
|
33
|
+
) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
// Preserve typing indicator dots to maintain animation continuity
|
|
28
38
|
// Also preserve elements with data-preserve-animation attribute for custom loading indicators
|
|
29
39
|
if (preserveTypingAnimation) {
|
package/dist/chunk-Csks3Qw1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=`4.29.1`;export{e as t};
|