mixdog 0.9.64 → 0.9.66

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 (36) hide show
  1. package/package.json +1 -1
  2. package/src/app.mjs +2 -2
  3. package/src/cli.mjs +1 -1
  4. package/src/repl.mjs +72 -6
  5. package/src/runtime/agent/orchestrator/session/context-utils.mjs +76 -21
  6. package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +45 -4
  7. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +11 -1
  8. package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +36 -13
  9. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +79 -18
  10. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +4 -0
  11. package/src/runtime/agent/orchestrator/session/store.mjs +37 -2
  12. package/src/runtime/shared/turn-snapshot.mjs +184 -0
  13. package/src/session-runtime/context-status.mjs +2 -1
  14. package/src/session-runtime/provider-request-tools.mjs +6 -0
  15. package/src/session-runtime/runtime-core.mjs +4 -0
  16. package/src/session-runtime/session-turn-api.mjs +7 -0
  17. package/src/session-runtime/tool-catalog-schema.mjs +5 -1
  18. package/src/tui/App.jsx +1 -1
  19. package/src/tui/app/transcript-window.mjs +16 -0
  20. package/src/tui/app/use-transcript-window.mjs +36 -1
  21. package/src/tui/components/Markdown.jsx +15 -1
  22. package/src/tui/components/Message.jsx +1 -1
  23. package/src/tui/components/PromptInput.jsx +7 -0
  24. package/src/tui/dist/index.mjs +431 -81
  25. package/src/tui/engine/frame-batched-store.mjs +5 -3
  26. package/src/tui/engine/live-share.mjs +100 -0
  27. package/src/tui/engine/render-timing.mjs +28 -0
  28. package/src/tui/engine/session-api-ext.mjs +10 -0
  29. package/src/tui/engine/tui-steering-persist.mjs +25 -4
  30. package/src/tui/engine.mjs +36 -1
  31. package/src/tui/index.jsx +11 -3
  32. package/src/tui/markdown/measure-rendered-rows.mjs +28 -16
  33. package/src/tui/markdown/render-ansi.mjs +34 -1
  34. package/src/tui/markdown/stream-fence.mjs +44 -7
  35. package/src/tui/markdown/streaming-markdown.mjs +95 -27
  36. package/src/ui/stream-finalize.mjs +45 -0
@@ -80,6 +80,14 @@ export function Markdown({ children, themeEpoch = 0, trimPartialFences = false,
80
80
  );
81
81
  }
82
82
 
83
+ const StableMarkdownChunk = React.memo(function StableMarkdownChunk({
84
+ text,
85
+ themeEpoch,
86
+ columns,
87
+ }) {
88
+ return <Markdown themeEpoch={themeEpoch} columns={columns}>{text}</Markdown>;
89
+ });
90
+
83
91
  export function StreamingMarkdown({ children, themeEpoch = 0, columns, streamKey }) {
84
92
  const parts = resolveStreamingMarkdownParts(children, streamKey);
85
93
  if (parts.plain) {
@@ -89,9 +97,15 @@ export function StreamingMarkdown({ children, themeEpoch = 0, columns, streamKey
89
97
  // identical visible text directly.
90
98
  return <Text color={theme.text} wrap="wrap">{parts.unstableForRender}</Text>;
91
99
  }
100
+ const stableChunks = parts.stableChunks?.length
101
+ ? parts.stableChunks
102
+ : parts.stablePrefix ? [parts.stablePrefix] : [];
92
103
  return (
93
104
  <Box flexDirection="column" gap={1}>
94
- {parts.stablePrefix ? <Markdown themeEpoch={themeEpoch} columns={columns}>{parts.stablePrefix}</Markdown> : null}
105
+ {stableChunks.map((text, index) => (
106
+ <StableMarkdownChunk key={`stable-${index}`} text={text}
107
+ themeEpoch={themeEpoch} columns={columns} />
108
+ ))}
95
109
  {parts.unstableSuffix
96
110
  ? <Markdown themeEpoch={themeEpoch} columns={columns} trimPartialFences>{parts.unstableForRender}</Markdown>
97
111
  : null}
@@ -50,7 +50,7 @@ export const AssistantMessage = React.memo(function AssistantMessage({
50
50
 
51
51
  const bodyWidth = assistantBodyWidth(columns);
52
52
  const renderText = streaming && streamingWindowRows > 0
53
- ? windowPlainStreamingText(text, bodyWidth, streamingWindowRows)
53
+ ? windowPlainStreamingText(text, bodyWidth, streamingWindowRows, assistantId)
54
54
  : text;
55
55
  return (
56
56
  <Box flexDirection="row" marginTop={1}>
@@ -126,6 +126,7 @@ export function PromptInput({
126
126
  // that node's REAL laid-out position + our caret col/row — no external
127
127
  // absolute-coordinate guessing, so it never drifts).
128
128
  const boxRef = useRef(null);
129
+ const inkRootRef = useRef(null);
129
130
  const cursorEnabledRef = useRef(false); // latest enabled state, read by the anchor fn at render time
130
131
  const contentWidthRef = useRef(80);
131
132
  const preferredColumnRef = useRef(null);
@@ -154,9 +155,15 @@ export function PromptInput({
154
155
  // (slower) rendering, never a crash.
155
156
  const flushThrottleRef = useRef({ lastAt: 0, timer: null });
156
157
  const flushImmediate = () => {
158
+ const cachedRoot = inkRootRef.current;
159
+ if (typeof cachedRoot?.onImmediateRender === 'function') {
160
+ cachedRoot.onImmediateRender();
161
+ return;
162
+ }
157
163
  let node = boxRef.current;
158
164
  for (let i = 0; node && i < 64; i++) {
159
165
  if (node.nodeName === 'ink-root') {
166
+ inkRootRef.current = node;
160
167
  if (typeof node.onImmediateRender === 'function') node.onImmediateRender();
161
168
  return;
162
169
  }