@ai-matrx/chat 0.3.9 → 0.3.15

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 (35) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/agent-copy/export.d.ts +10 -2
  3. package/dist/agent-copy/export.js +3 -2
  4. package/dist/agents/components/context-items/bodies/WebpageBody.js +3 -8
  5. package/dist/agents/components/debug/SandboxFileViewer.js +1 -3
  6. package/dist/agents/components/inputs/smart-input/composer/ComposerMenu.js +16 -2
  7. package/dist/agents/components/live-run/LiveRunDisplay.d.ts +7 -1
  8. package/dist/agents/components/live-run/LiveRunDisplay.js +10 -3
  9. package/dist/agents/components/messages-display/TranscriptIntegrityCopyButton.js +5 -11
  10. package/dist/agents/components/messages-display/user/UserActionBar.js +3 -18
  11. package/dist/agents/constants/system-agent-registry.d.ts +0 -3
  12. package/dist/agents/constants/system-agent-registry.js +0 -3
  13. package/dist/agents/hooks/useFloatingAgentRun.d.ts +19 -0
  14. package/dist/agents/hooks/useFloatingAgentRun.js +32 -9
  15. package/dist/agents/prompt-preview/PromptPreviewContent.js +1 -7
  16. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +14 -0
  17. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.js +30 -0
  18. package/dist/agents/redux/execution-system/client-capabilities/desktop-native.provider.js +10 -1
  19. package/dist/agents/redux/execution-system/message-crud/refetch-single-message.thunk.js +5 -0
  20. package/dist/agents/redux/execution-system/thunks/process-stream.js +2 -2
  21. package/dist/agents/redux/execution-system/utils/stream-block-accumulator.d.ts +14 -0
  22. package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +28 -0
  23. package/dist/context/sources/scopes.d.ts +1 -1
  24. package/dist/host/db-types.d.ts +1859 -831
  25. package/dist/host/ui-slots.d.ts +3 -0
  26. package/dist/host/ui-slots.js +2 -0
  27. package/dist/host/window-openers.d.ts +2 -0
  28. package/dist/surfaces/manifests/chat.manifest.js +3 -1
  29. package/dist/ui/mandates-storage/mandateStorage.d.ts +15 -0
  30. package/dist/ui/mandates-storage/shortcutStorage.d.ts +3 -0
  31. package/dist/utils/rich-editor/in-place/caret-handoff.js +2 -1
  32. package/dist/voice-agent/components/VoiceDebugPanel.js +3 -9
  33. package/dist/window-panels/windows/agents/LiveRunWindow.d.ts +3 -1
  34. package/dist/window-panels/windows/agents/LiveRunWindow.js +5 -2
  35. package/package.json +5 -5
@@ -321,6 +321,15 @@ class StreamBlockAccumulator {
321
321
  * to be a different typed block (see the bare-JSON duplication note there).
322
322
  */
323
323
  currentBlockEmitted = false;
324
+ /**
325
+ * THE DATA KEEPS ITS KINDS. A JSON wrapper that holds kinds is drawn as its
326
+ * kinds plus a residual (A7) — the residual is the wrapper's data WITH ITS
327
+ * KINDS REMOVED, so it is a display projection, never the answer. Every
328
+ * such split remembers the bytes it was cut from, keyed by its first block
329
+ * index, so data capture (`deriveAnswerDataText`) reads what the model wrote.
330
+ * Live only; a rewind forgets every split at or past its boundary.
331
+ */
332
+ wrapperSplits = /* @__PURE__ */ new Map();
324
333
  subState = { kind: "none" };
325
334
  /**
326
335
  * URL + label for the current `audio` block. The accumulator's single-line
@@ -524,7 +533,19 @@ ${this.pendingLineFragment}` : this.pendingLineFragment
524
533
  * the local streaming state so the replacement provider attempt cannot
525
534
  * concatenate onto or resurrect the failed attempt.
526
535
  */
536
+ /** The source bytes behind every live A7 wrapper split (see `wrapperSplits`). */
537
+ getWrapperSplitSources() {
538
+ return [...this.wrapperSplits.values()].map((split) => ({
539
+ blockIds: split.indices.map((i) => `client_block_${i}`),
540
+ source: split.source
541
+ }));
542
+ }
527
543
  rewindToBlockCount(blockCount) {
544
+ for (const [start, split] of this.wrapperSplits) {
545
+ if (start >= blockCount || split.indices.some((i) => i >= blockCount)) {
546
+ this.wrapperSplits.delete(start);
547
+ }
548
+ }
528
549
  this.irDisposeAll();
529
550
  this.currentBlockIndex = Math.max(0, blockCount);
530
551
  this.currentBlockType = "text";
@@ -1769,6 +1790,9 @@ ${this.currentBlockContent}
1769
1790
  const containerMetadata = genericXml || recoveredXmlContainer ? { genericXmlContainer: true } : void 0;
1770
1791
  let emitted = 0;
1771
1792
  let followsKind = false;
1793
+ const splitStart = this.currentBlockIndex;
1794
+ const splitIndices = [];
1795
+ const isWrapperSplit = pieces.some((piece) => piece.type === "residual");
1772
1796
  for (const piece of pieces) {
1773
1797
  if (piece.type === "chrome") continue;
1774
1798
  const isKind = piece.type === "kind";
@@ -1788,9 +1812,13 @@ ${this.currentBlockContent}
1788
1812
  metadata: asJson ? withIrEnvelope(content, void 0) : containerMetadata
1789
1813
  };
1790
1814
  dispatch(this.upsertAction({ requestId: this.requestId, block }));
1815
+ splitIndices.push(this.currentBlockIndex);
1791
1816
  emitted++;
1792
1817
  this.emitCount++;
1793
1818
  }
1819
+ if (isWrapperSplit && emitted > 0) {
1820
+ this.wrapperSplits.set(splitStart, { indices: splitIndices, source: recoverySource });
1821
+ }
1794
1822
  this.currentBlockEmitted = emitted > 0;
1795
1823
  return emitted > 0;
1796
1824
  }
@@ -20,7 +20,7 @@ import type { ComponentType } from "react";
20
20
  import type { AssociationSourceEdge, AssociationTargetEdge } from "@ai-matrx/associations";
21
21
  import type { ChatDatabase, Json } from "../../host/db-types.js";
22
22
  import { type AnyComponent, type AnyFn } from "../../host/registered-source.js";
23
- export type ContextItemRow = ChatDatabase["context"]["Tables"]["context_items"]["Row"];
23
+ export type ContextItemRow = ChatDatabase["deprecated"]["Tables"]["context_items"]["Row"];
24
24
  export type ContextItemValueType = ChatDatabase["public"]["Enums"]["context_value_type"];
25
25
  export type ContextValueType = ContextItemValueType;
26
26
  export interface ScopeNode {