@ai-matrx/chat 0.7.3 → 0.7.5
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 +16 -0
- package/dist/agents/addressing/agentAddress.d.ts +8 -0
- package/dist/agents/addressing/agentAddress.js +1 -0
- package/dist/agents/addressing/useAgentHref.js +8 -1
- package/dist/agents/components/conversation-history/ConversationHistorySidebar.d.ts +7 -0
- package/dist/agents/components/conversation-history/ConversationHistorySidebar.js +13 -7
- package/dist/agents/components/shared/assistant-message-layout.d.ts +21 -0
- package/dist/agents/components/shared/assistant-message-layout.js +6 -0
- package/dist/agents/hooks/useCreatorOwnershipSync.js +3 -1
- package/dist/agents/redux/conversation-history/thunks.js +2 -1
- package/dist/agents/redux/conversation-list/conversation-row-actions.thunks.d.ts +5 -1
- package/dist/agents/redux/conversation-list/conversation-row-actions.thunks.js +64 -12
- package/dist/agents/redux/execution-system/instance-resources/rendered-artifact-draft.d.ts +23 -0
- package/dist/agents/redux/execution-system/instance-resources/rendered-artifact-draft.js +100 -0
- package/dist/agents/redux/execution-system/instance-user-input/composer-draft.middleware.js +9 -0
- package/dist/agents/redux/execution-system/instance-user-input/useComposerDraftRestore.js +3 -1
- package/dist/agents/redux/execution-system/message-crud/soft-delete-conversation.thunk.js +22 -12
- package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +1 -1
- package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +1 -1
- package/dist/agents/redux/execution-system/thunks/frozen-submission.d.ts +5 -0
- package/dist/agents/redux/execution-system/thunks/frozen-submission.js +2 -1
- package/dist/agents/redux/execution-system/utils/content-prefilter.d.ts +50 -0
- package/dist/agents/redux/execution-system/utils/content-prefilter.js +243 -0
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.d.ts +335 -65
- package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +1909 -224
- package/dist/conversation/hooks/useDomCapturePrint.js +13 -2
- package/dist/conversation/utils/frame-print.js +20 -2
- package/dist/conversation/utils/isolate-for-capture.d.ts +19 -0
- package/dist/conversation/utils/isolate-for-capture.js +55 -0
- package/dist/host/admin-seat.d.ts +19 -0
- package/dist/host/admin-seat.js +8 -0
- package/dist/host/defaults/server-api.d.ts +69 -0
- package/dist/host/defaults/server-api.js +6 -0
- package/dist/host/server/call-api.d.ts +69 -0
- package/dist/host/server/call-api.js +8 -0
- package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +5 -1
- package/package.json +12 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useState, useCallback } from "react";
|
|
3
|
+
import { toast } from "../../host/notify.js";
|
|
3
4
|
function useDomCapturePrint() {
|
|
4
5
|
const captureRef = useRef(null);
|
|
5
6
|
const [isCapturing, setIsCapturing] = useState(false);
|
|
@@ -16,29 +17,39 @@ function useDomCapturePrint() {
|
|
|
16
17
|
setError(null);
|
|
17
18
|
let releaseRenderAll = null;
|
|
18
19
|
let restoreFrames = null;
|
|
20
|
+
let disposeCopy = null;
|
|
21
|
+
const { filename = "ai-response", ...captureOptions } = options;
|
|
22
|
+
const toastId = toast.loading("Building the PDF\u2026");
|
|
19
23
|
try {
|
|
20
24
|
const { renderAllDiagrams } = await import("@ai-matrx/rich-content/mermaid/lazy-draw");
|
|
21
25
|
releaseRenderAll = (await renderAllDiagrams()).release;
|
|
22
26
|
const { framesToPictures } = await import("../utils/frame-print.js");
|
|
23
27
|
restoreFrames = (await framesToPictures(el)).restore;
|
|
28
|
+
const { isolateForCapture } = await import("../utils/isolate-for-capture.js");
|
|
29
|
+
const isolated = await isolateForCapture(el);
|
|
30
|
+
disposeCopy = isolated.dispose;
|
|
24
31
|
const [{ captureDocumentPdf }, { downloadFile }] = await Promise.all([
|
|
25
32
|
import("@ai-matrx/alchemy/operate/capture"),
|
|
26
33
|
import("@ai-matrx/kit/download")
|
|
27
34
|
]);
|
|
28
|
-
const
|
|
29
|
-
const pdf = await captureDocumentPdf(el, {
|
|
35
|
+
const pdf = await captureDocumentPdf(isolated.element, {
|
|
30
36
|
scale: 2,
|
|
37
|
+
imageFormat: "jpeg",
|
|
31
38
|
...captureOptions,
|
|
32
39
|
onProgress: (page, total) => {
|
|
33
40
|
setProgress(Math.round(page / Math.max(total, 1) * 100));
|
|
41
|
+
if (total > 0) toast.loading(`Building the PDF \u2014 page ${Math.min(page + 1, total)} of ${total}`, { id: toastId });
|
|
34
42
|
options.onProgress?.(page, total);
|
|
35
43
|
}
|
|
36
44
|
});
|
|
37
45
|
downloadFile(`${filename}.pdf`, pdf, "application/pdf");
|
|
46
|
+
toast.success(`Downloaded ${filename}.pdf`, { id: toastId });
|
|
38
47
|
} catch (err) {
|
|
39
48
|
const msg = err instanceof Error ? err.message : "PDF export failed";
|
|
40
49
|
setError(msg);
|
|
50
|
+
toast.error(`The PDF could not be made: ${msg}`, { id: toastId });
|
|
41
51
|
} finally {
|
|
52
|
+
disposeCopy?.();
|
|
42
53
|
restoreFrames?.();
|
|
43
54
|
releaseRenderAll?.();
|
|
44
55
|
setIsCapturing(false);
|
|
@@ -6,9 +6,20 @@ function standInFor(text, width, height) {
|
|
|
6
6
|
stand.style.cssText = `display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:${width ? `${width}px` : "100%"};max-width:100%;min-height:${Math.min(Math.max(height, 96), 240)}px;padding:16px;border:1px dashed #94a3b8;border-radius:8px;color:#475569;font:italic 13px/1.4 system-ui,sans-serif;text-align:center;background:#f8fafc`;
|
|
7
7
|
return stand;
|
|
8
8
|
}
|
|
9
|
+
const objectUrls = /* @__PURE__ */ new Set();
|
|
10
|
+
async function compactSrc(src) {
|
|
11
|
+
if (!src.startsWith("data:") || src.length < 64e3) return src;
|
|
12
|
+
try {
|
|
13
|
+
const url = URL.createObjectURL(await (await fetch(src)).blob());
|
|
14
|
+
objectUrls.add(url);
|
|
15
|
+
return url;
|
|
16
|
+
} catch {
|
|
17
|
+
return src;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
9
20
|
async function pictureOf(src, alt, width, height) {
|
|
10
21
|
const img = document.createElement("img");
|
|
11
|
-
img.src = src;
|
|
22
|
+
img.src = await compactSrc(src);
|
|
12
23
|
img.alt = alt;
|
|
13
24
|
img.style.cssText = `display:block;width:${width ? `${width}px` : "100%"};max-width:100%;height:${height ? `${height}px` : "auto"}`;
|
|
14
25
|
await img.decode().catch(() => void 0);
|
|
@@ -76,7 +87,14 @@ async function framesToPictures(root) {
|
|
|
76
87
|
undo.push(swap(element, await pictureOf(src, element.getAttribute("aria-label") || "Picture", width, height || null)));
|
|
77
88
|
})
|
|
78
89
|
]);
|
|
79
|
-
return {
|
|
90
|
+
return {
|
|
91
|
+
restore: () => {
|
|
92
|
+
undo.forEach((fn) => fn());
|
|
93
|
+
objectUrls.forEach((url) => URL.revokeObjectURL(url));
|
|
94
|
+
objectUrls.clear();
|
|
95
|
+
},
|
|
96
|
+
frames: total
|
|
97
|
+
};
|
|
80
98
|
}
|
|
81
99
|
export {
|
|
82
100
|
CANVAS_PRINT_STAND_IN,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A message, alone, for a DOM capture.
|
|
3
|
+
*
|
|
4
|
+
* html2canvas clones the element's WHOLE document before it draws — for a
|
|
5
|
+
* message inside the app that is the entire app page (every conversation turn,
|
|
6
|
+
* every panel, every inline picture as base64): a 91.8 MB clone on 2026-10-08,
|
|
7
|
+
* and Full Print never finished. This puts a copy of just the message into a
|
|
8
|
+
* hidden same-origin frame that carries only the page's stylesheets and theme,
|
|
9
|
+
* so the capture clones a document that holds one message.
|
|
10
|
+
*
|
|
11
|
+
* Run it AFTER the live-surface pre-pass (`framesToPictures`): a copy keeps
|
|
12
|
+
* pictures but not a canvas's pixels or a frame's page.
|
|
13
|
+
*/
|
|
14
|
+
export interface IsolatedCapture {
|
|
15
|
+
/** The copy to capture — the same width the message has on screen. */
|
|
16
|
+
element: HTMLElement;
|
|
17
|
+
dispose: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function isolateForCapture(source: HTMLElement): Promise<IsolatedCapture>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const STYLESHEET_WAIT_MS = 5e3;
|
|
2
|
+
function loaded(link) {
|
|
3
|
+
if (link.sheet) return Promise.resolve();
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
const done = () => resolve();
|
|
6
|
+
link.addEventListener("load", done, { once: true });
|
|
7
|
+
link.addEventListener("error", done, { once: true });
|
|
8
|
+
setTimeout(done, STYLESHEET_WAIT_MS);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
async function isolateForCapture(source) {
|
|
12
|
+
const width = Math.ceil(source.getBoundingClientRect().width) || source.offsetWidth || 768;
|
|
13
|
+
const frame = document.createElement("iframe");
|
|
14
|
+
frame.setAttribute("aria-hidden", "true");
|
|
15
|
+
frame.tabIndex = -1;
|
|
16
|
+
frame.setAttribute("data-matrx-capture-host", "");
|
|
17
|
+
frame.style.cssText = `position:fixed;left:-100000px;top:0;width:${width}px;height:100px;border:0;pointer-events:none`;
|
|
18
|
+
document.body.appendChild(frame);
|
|
19
|
+
const doc = frame.contentDocument;
|
|
20
|
+
if (!doc) {
|
|
21
|
+
frame.remove();
|
|
22
|
+
throw new Error("The PDF could not be prepared (no capture frame).");
|
|
23
|
+
}
|
|
24
|
+
doc.open();
|
|
25
|
+
doc.write("<!DOCTYPE html><html><head></head><body></body></html>");
|
|
26
|
+
doc.close();
|
|
27
|
+
const html = document.documentElement;
|
|
28
|
+
doc.documentElement.className = html.className;
|
|
29
|
+
const htmlStyle = html.getAttribute("style");
|
|
30
|
+
if (htmlStyle) doc.documentElement.setAttribute("style", htmlStyle);
|
|
31
|
+
for (const attr of [...html.attributes]) {
|
|
32
|
+
if (attr.name.startsWith("data-")) doc.documentElement.setAttribute(attr.name, attr.value);
|
|
33
|
+
}
|
|
34
|
+
doc.body.className = document.body.className;
|
|
35
|
+
doc.body.style.margin = "0";
|
|
36
|
+
doc.body.style.width = `${width}px`;
|
|
37
|
+
const links = [];
|
|
38
|
+
for (const node of document.querySelectorAll('link[rel="stylesheet"], style')) {
|
|
39
|
+
const copy = doc.importNode(node, true);
|
|
40
|
+
doc.head.appendChild(copy);
|
|
41
|
+
if (copy.tagName === "LINK") links.push(copy);
|
|
42
|
+
}
|
|
43
|
+
await Promise.all(links.map(loaded));
|
|
44
|
+
const element = doc.importNode(source, true);
|
|
45
|
+
element.style.width = `${width}px`;
|
|
46
|
+
doc.body.appendChild(element);
|
|
47
|
+
await Promise.all(
|
|
48
|
+
[...element.querySelectorAll("img")].map((img) => img.decode().catch(() => void 0))
|
|
49
|
+
);
|
|
50
|
+
await doc.fonts?.ready.catch(() => void 0);
|
|
51
|
+
return { element, dispose: () => frame.remove() };
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
isolateForCapture
|
|
55
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE ADMIN SEAT (Arman: platform admins keep FULL access inside the admin
|
|
3
|
+
* system, and only there; on ordinary user pages an admin is an ordinary
|
|
4
|
+
* person).
|
|
5
|
+
*
|
|
6
|
+
* Open only when BOTH hold:
|
|
7
|
+
* - the request rides the admin lane (`adminLaneOrganizationId()` is non-null
|
|
8
|
+
* only on an admin page — the host decides from the page at call time), and
|
|
9
|
+
* - the host grants admin power (`selectIsAdmin` — matrx-frontend grants it
|
|
10
|
+
* only inside the admin section).
|
|
11
|
+
*
|
|
12
|
+
* The database mirrors the same gate: `is_platform_admin()` is true only when
|
|
13
|
+
* the admin lane is open, and the "may I?" doors (`agx_get_access_level`,
|
|
14
|
+
* `get_resource_access`, `version_list`, `version_restore`) ask
|
|
15
|
+
* `platform.platform_admin_may`, which answers exactly what the admin RLS
|
|
16
|
+
* policies admit. Client surfaces that decide without a DB round-trip (the
|
|
17
|
+
* creator flag, agent addresses, the history creator filter) ask THIS.
|
|
18
|
+
*/
|
|
19
|
+
export declare function adminSeatOpen(state: unknown): boolean;
|
|
@@ -70,6 +70,10 @@ export interface DefaultChatServerTypes {
|
|
|
70
70
|
CompactTurnsResult: Schemas["CompactTurnsResponse"];
|
|
71
71
|
ConversationForkBody: Schemas["ForkRequest"];
|
|
72
72
|
ConversationForkAndRunBody: Schemas["ForkAndRunRequest"];
|
|
73
|
+
ConversationSettingsBody: Schemas["ConversationSettingsUpdate"];
|
|
74
|
+
ConversationSettingsResult: Schemas["ConversationSettingsResponse"];
|
|
75
|
+
ConversationDeleteResult: Schemas["ConversationDeleteResponse"];
|
|
76
|
+
SandboxBindBody: Schemas["SandboxBindRequest"];
|
|
73
77
|
MatrxTransportOptions: {
|
|
74
78
|
expectedErrorStatuses?: readonly number[];
|
|
75
79
|
source?: string;
|
|
@@ -220,6 +224,71 @@ export declare function createDefaultServerApi(host: () => ServerHostView): {
|
|
|
220
224
|
turn_count: number;
|
|
221
225
|
position_range: [number, number];
|
|
222
226
|
}>>>;
|
|
227
|
+
callConversationUpdate: (options: {
|
|
228
|
+
conversationId: string;
|
|
229
|
+
body?: unknown;
|
|
230
|
+
signal?: AbortSignal;
|
|
231
|
+
scopeOverrides?: Partial<DefaultCallScope>;
|
|
232
|
+
onStreamStart?: DefaultApiCallConfig["onStreamStart"];
|
|
233
|
+
onStreamEvent?: DefaultApiCallConfig["onStreamEvent"];
|
|
234
|
+
onStreamComplete?: DefaultApiCallConfig["onStreamComplete"];
|
|
235
|
+
onStreamError?: DefaultApiCallConfig["onStreamError"];
|
|
236
|
+
}) => DefaultServerThunk<Promise<DefaultApiCallResult<{
|
|
237
|
+
conversation_id: string;
|
|
238
|
+
fields: string[];
|
|
239
|
+
title?: string | null;
|
|
240
|
+
status?: string | null;
|
|
241
|
+
exclude_from_kg?: boolean | null;
|
|
242
|
+
}>>>;
|
|
243
|
+
callConversationDelete: (options: {
|
|
244
|
+
conversationId: string;
|
|
245
|
+
body?: unknown;
|
|
246
|
+
signal?: AbortSignal;
|
|
247
|
+
scopeOverrides?: Partial<DefaultCallScope>;
|
|
248
|
+
onStreamStart?: DefaultApiCallConfig["onStreamStart"];
|
|
249
|
+
onStreamEvent?: DefaultApiCallConfig["onStreamEvent"];
|
|
250
|
+
onStreamComplete?: DefaultApiCallConfig["onStreamComplete"];
|
|
251
|
+
onStreamError?: DefaultApiCallConfig["onStreamError"];
|
|
252
|
+
}) => DefaultServerThunk<Promise<DefaultApiCallResult<{
|
|
253
|
+
conversation_id: string;
|
|
254
|
+
deleted: boolean;
|
|
255
|
+
}>>>;
|
|
256
|
+
callConversationSandboxBind: (options: {
|
|
257
|
+
conversationId: string;
|
|
258
|
+
body?: unknown;
|
|
259
|
+
signal?: AbortSignal;
|
|
260
|
+
scopeOverrides?: Partial<DefaultCallScope>;
|
|
261
|
+
onStreamStart?: DefaultApiCallConfig["onStreamStart"];
|
|
262
|
+
onStreamEvent?: DefaultApiCallConfig["onStreamEvent"];
|
|
263
|
+
onStreamComplete?: DefaultApiCallConfig["onStreamComplete"];
|
|
264
|
+
onStreamError?: DefaultApiCallConfig["onStreamError"];
|
|
265
|
+
}) => DefaultServerThunk<Promise<DefaultApiCallResult<{
|
|
266
|
+
conversation_id: string;
|
|
267
|
+
sandbox_instance_id?: string | null;
|
|
268
|
+
sandbox_id?: string | null;
|
|
269
|
+
status?: string | null;
|
|
270
|
+
tier?: string | null;
|
|
271
|
+
armed?: boolean;
|
|
272
|
+
reason?: string | null;
|
|
273
|
+
}>>>;
|
|
274
|
+
callConversationSandboxUnbind: (options: {
|
|
275
|
+
conversationId: string;
|
|
276
|
+
body?: unknown;
|
|
277
|
+
signal?: AbortSignal;
|
|
278
|
+
scopeOverrides?: Partial<DefaultCallScope>;
|
|
279
|
+
onStreamStart?: DefaultApiCallConfig["onStreamStart"];
|
|
280
|
+
onStreamEvent?: DefaultApiCallConfig["onStreamEvent"];
|
|
281
|
+
onStreamComplete?: DefaultApiCallConfig["onStreamComplete"];
|
|
282
|
+
onStreamError?: DefaultApiCallConfig["onStreamError"];
|
|
283
|
+
}) => DefaultServerThunk<Promise<DefaultApiCallResult<{
|
|
284
|
+
conversation_id: string;
|
|
285
|
+
sandbox_instance_id?: string | null;
|
|
286
|
+
sandbox_id?: string | null;
|
|
287
|
+
status?: string | null;
|
|
288
|
+
tier?: string | null;
|
|
289
|
+
armed?: boolean;
|
|
290
|
+
reason?: string | null;
|
|
291
|
+
}>>>;
|
|
223
292
|
createMatrxTransport: (_getState?: AnyGetState, options?: {
|
|
224
293
|
organizationId?: string;
|
|
225
294
|
source?: string;
|
|
@@ -171,6 +171,12 @@ function createDefaultServerApi(host) {
|
|
|
171
171
|
callHideMessages: call("POST", "/cx/conversations/{conversation_id}/messages/hide"),
|
|
172
172
|
callRestoreCompaction: call("POST", "/cx/conversations/{conversation_id}/messages/restore"),
|
|
173
173
|
callCompactTurns: call("POST", "/cx/conversations/{conversation_id}/compact"),
|
|
174
|
+
// THE ADMIN SEAT's write doors for a conversation's own settings, its delete and its
|
|
175
|
+
// sandbox binding (aidream cx_data.py / conversations.py, behind require_owned_conversation).
|
|
176
|
+
callConversationUpdate: call("PATCH", "/cx/conversations/{conversation_id}"),
|
|
177
|
+
callConversationDelete: call("DELETE", "/cx/conversations/{conversation_id}"),
|
|
178
|
+
callConversationSandboxBind: call("PUT", "/ai/conversations/{conversation_id}/sandbox"),
|
|
179
|
+
callConversationSandboxUnbind: call("DELETE", "/ai/conversations/{conversation_id}/sandbox"),
|
|
174
180
|
// matrx-transport
|
|
175
181
|
createMatrxTransport: (_getState, options = {}) => transport(options),
|
|
176
182
|
createMatrxTransportFromTarget: (getState, resolveTarget, options = {}) => createPackageTransport({
|
|
@@ -119,6 +119,71 @@ export declare const callCompactTurns: (options: {
|
|
|
119
119
|
turn_count: number;
|
|
120
120
|
position_range: [number, number];
|
|
121
121
|
}>>>;
|
|
122
|
+
export declare const callConversationUpdate: (options: {
|
|
123
|
+
conversationId: string;
|
|
124
|
+
body?: unknown;
|
|
125
|
+
signal?: AbortSignal;
|
|
126
|
+
scopeOverrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>;
|
|
127
|
+
onStreamStart?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamStart"];
|
|
128
|
+
onStreamEvent?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamEvent"];
|
|
129
|
+
onStreamComplete?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamComplete"];
|
|
130
|
+
onStreamError?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamError"];
|
|
131
|
+
}) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<{
|
|
132
|
+
conversation_id: string;
|
|
133
|
+
fields: string[];
|
|
134
|
+
title?: string | null;
|
|
135
|
+
status?: string | null;
|
|
136
|
+
exclude_from_kg?: boolean | null;
|
|
137
|
+
}>>>;
|
|
138
|
+
export declare const callConversationDelete: (options: {
|
|
139
|
+
conversationId: string;
|
|
140
|
+
body?: unknown;
|
|
141
|
+
signal?: AbortSignal;
|
|
142
|
+
scopeOverrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>;
|
|
143
|
+
onStreamStart?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamStart"];
|
|
144
|
+
onStreamEvent?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamEvent"];
|
|
145
|
+
onStreamComplete?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamComplete"];
|
|
146
|
+
onStreamError?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamError"];
|
|
147
|
+
}) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<{
|
|
148
|
+
conversation_id: string;
|
|
149
|
+
deleted: boolean;
|
|
150
|
+
}>>>;
|
|
151
|
+
export declare const callConversationSandboxBind: (options: {
|
|
152
|
+
conversationId: string;
|
|
153
|
+
body?: unknown;
|
|
154
|
+
signal?: AbortSignal;
|
|
155
|
+
scopeOverrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>;
|
|
156
|
+
onStreamStart?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamStart"];
|
|
157
|
+
onStreamEvent?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamEvent"];
|
|
158
|
+
onStreamComplete?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamComplete"];
|
|
159
|
+
onStreamError?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamError"];
|
|
160
|
+
}) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<{
|
|
161
|
+
conversation_id: string;
|
|
162
|
+
sandbox_instance_id?: string | null;
|
|
163
|
+
sandbox_id?: string | null;
|
|
164
|
+
status?: string | null;
|
|
165
|
+
tier?: string | null;
|
|
166
|
+
armed?: boolean;
|
|
167
|
+
reason?: string | null;
|
|
168
|
+
}>>>;
|
|
169
|
+
export declare const callConversationSandboxUnbind: (options: {
|
|
170
|
+
conversationId: string;
|
|
171
|
+
body?: unknown;
|
|
172
|
+
signal?: AbortSignal;
|
|
173
|
+
scopeOverrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>;
|
|
174
|
+
onStreamStart?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamStart"];
|
|
175
|
+
onStreamEvent?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamEvent"];
|
|
176
|
+
onStreamComplete?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamComplete"];
|
|
177
|
+
onStreamError?: import("../defaults/server-api.js").DefaultApiCallConfig["onStreamError"];
|
|
178
|
+
}) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<{
|
|
179
|
+
conversation_id: string;
|
|
180
|
+
sandbox_instance_id?: string | null;
|
|
181
|
+
sandbox_id?: string | null;
|
|
182
|
+
status?: string | null;
|
|
183
|
+
tier?: string | null;
|
|
184
|
+
armed?: boolean;
|
|
185
|
+
reason?: string | null;
|
|
186
|
+
}>>>;
|
|
122
187
|
export type ApiCallError = ChatServerTypes["ApiCallError"];
|
|
123
188
|
export type ApiCallResult = ChatServerTypes["ApiCallResult"];
|
|
124
189
|
export type CallScope = ChatServerTypes["CallScope"];
|
|
@@ -132,3 +197,7 @@ export type RestoreCompactionResult = ChatServerTypes["RestoreCompactionResult"]
|
|
|
132
197
|
export type CompactTurnsResult = ChatServerTypes["CompactTurnsResult"];
|
|
133
198
|
export type ConversationForkBody = ChatServerTypes["ConversationForkBody"];
|
|
134
199
|
export type ConversationForkAndRunBody = ChatServerTypes["ConversationForkAndRunBody"];
|
|
200
|
+
export type ConversationSettingsBody = ChatServerTypes["ConversationSettingsBody"];
|
|
201
|
+
export type ConversationSettingsResult = ChatServerTypes["ConversationSettingsResult"];
|
|
202
|
+
export type ConversationDeleteResult = ChatServerTypes["ConversationDeleteResult"];
|
|
203
|
+
export type SandboxBindBody = ChatServerTypes["SandboxBindBody"];
|
|
@@ -11,14 +11,22 @@ const callReplaceMessages = forwardServer("callReplaceMessages");
|
|
|
11
11
|
const callHideMessages = forwardServer("callHideMessages");
|
|
12
12
|
const callRestoreCompaction = forwardServer("callRestoreCompaction");
|
|
13
13
|
const callCompactTurns = forwardServer("callCompactTurns");
|
|
14
|
+
const callConversationUpdate = forwardServer("callConversationUpdate");
|
|
15
|
+
const callConversationDelete = forwardServer("callConversationDelete");
|
|
16
|
+
const callConversationSandboxBind = forwardServer("callConversationSandboxBind");
|
|
17
|
+
const callConversationSandboxUnbind = forwardServer("callConversationSandboxUnbind");
|
|
14
18
|
export {
|
|
15
19
|
buildRequestBody,
|
|
16
20
|
callApi,
|
|
17
21
|
callBatchDeleteMessages,
|
|
18
22
|
callCompactTurns,
|
|
23
|
+
callConversationDelete,
|
|
19
24
|
callConversationFork,
|
|
20
25
|
callConversationForkAndRun,
|
|
21
26
|
callConversationMemoryCost,
|
|
27
|
+
callConversationSandboxBind,
|
|
28
|
+
callConversationSandboxUnbind,
|
|
29
|
+
callConversationUpdate,
|
|
22
30
|
callHideMessages,
|
|
23
31
|
callReplaceMessages,
|
|
24
32
|
callRestoreCompaction,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect, useLayoutEffect, useMemo, useCallback, useRef } from "react";
|
|
4
4
|
import { cn } from "@ai-matrx/design-system";
|
|
5
|
+
import { WIDE_FIGURE_HOST_CLASS, WIDE_FIGURE_PROSE_CLIP_CLASS } from "../../agents/components/shared/assistant-message-layout.js";
|
|
5
6
|
import { splitContentIntoBlocksV2 } from "@ai-matrx/rich-content/display/markdown-classification/processors/utils/content-splitter-v2";
|
|
6
7
|
import { renderSettledFromRecord, settledOneShotBlocks } from "@ai-matrx/rich-content/display/chat-markdown/settle-stream-blocks";
|
|
7
8
|
import { expandTextBlocksInList } from "@ai-matrx/rich-content/display/markdown-classification/processors/utils/expand-text-blocks";
|
|
@@ -733,6 +734,9 @@ const EnhancedChatMarkdownInternal = ({
|
|
|
733
734
|
"pt-1 pb-0 px-0 space-y-4 font-sans text-md antialiased leading-relaxed tracking-wide overflow-x-clip min-w-0 break-words",
|
|
734
735
|
// The first block starts flush (no top margin) — app/globals.css.
|
|
735
736
|
"block w-full bg-inherit markdown-flush-start",
|
|
737
|
+
// A wide figure (a rendered web page) inside: the clip edge moves out to its band, prose keeps the column's.
|
|
738
|
+
WIDE_FIGURE_HOST_CLASS,
|
|
739
|
+
WIDE_FIGURE_PROSE_CLIP_CLASS,
|
|
736
740
|
className
|
|
737
741
|
);
|
|
738
742
|
if (hasError) {
|
|
@@ -1001,7 +1005,7 @@ const EnhancedChatMarkdownInternal = ({
|
|
|
1001
1005
|
/* @__PURE__ */ jsx(MarkdownStreamingProvider, { value: !!isStreamActive, children: /* @__PURE__ */ jsx(DocumentNumberingProvider, { source: currentContent, children: /* @__PURE__ */ jsx(MaybeSourceEdit, { source: currentContent, save: isStreamActive ? void 0 : onContentChange ? handleSaveEdit : void 0, children: /* @__PURE__ */ jsxs(
|
|
1002
1006
|
"div",
|
|
1003
1007
|
{
|
|
1004
|
-
className: "mb-1 w-full min-w-0 text-left overflow-x-clip",
|
|
1008
|
+
className: cn("mb-1 w-full min-w-0 text-left overflow-x-clip", WIDE_FIGURE_HOST_CLASS),
|
|
1005
1009
|
"data-matrx-doc-root": "",
|
|
1006
1010
|
"data-block-count": hasUnifiedSpecial ? void 0 : hasDbInterleavedSpecial ? interleavedTextBlockTotal : stableBlocks.length,
|
|
1007
1011
|
"data-blocks-mounted": hasUnifiedSpecial ? void 0 : hasDbInterleavedSpecial ? Math.min(interleavedShown, interleavedTextBlockTotal) : mountedBlockCount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/chat",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "THE one AI Matrx person-to-agent chat system: the full chat (running agents, conversations, tool calls, streaming, context, surfaces, voice) as explicit per-module subpaths @ai-matrx/chat/<domain>/<module> (no wildcards: scripts/public-modules.json) over a host contract (/host, /host/react) whose only required value is a db. One chat, one renderer: the old kernel entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) are retired.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -4666,16 +4666,13 @@
|
|
|
4666
4666
|
"server-only": "^0.0.1",
|
|
4667
4667
|
"uuid": "^14.0.2",
|
|
4668
4668
|
"zod": "^4.6.5",
|
|
4669
|
-
"@ai-matrx/browser-audio": "latest",
|
|
4670
|
-
"@ai-matrx/canvas": "latest",
|
|
4671
|
-
"@ai-matrx/content-ir": "latest",
|
|
4672
4669
|
"@ai-matrx/alchemy": "latest",
|
|
4673
4670
|
"@ai-matrx/associations": "latest",
|
|
4674
|
-
"@ai-matrx/content-ir
|
|
4675
|
-
"@ai-matrx/data": "latest",
|
|
4671
|
+
"@ai-matrx/content-ir": "latest",
|
|
4676
4672
|
"@ai-matrx/agents": "latest",
|
|
4677
|
-
"@ai-matrx/
|
|
4673
|
+
"@ai-matrx/data": "latest",
|
|
4678
4674
|
"@ai-matrx/design-system": "latest",
|
|
4675
|
+
"@ai-matrx/diff": "latest",
|
|
4679
4676
|
"@ai-matrx/icons": "latest",
|
|
4680
4677
|
"@ai-matrx/kit": "latest",
|
|
4681
4678
|
"@ai-matrx/media": "latest",
|
|
@@ -4683,8 +4680,11 @@
|
|
|
4683
4680
|
"@ai-matrx/realtime": "latest",
|
|
4684
4681
|
"@ai-matrx/records": "latest",
|
|
4685
4682
|
"@ai-matrx/records-ui": "latest",
|
|
4686
|
-
"@ai-matrx/rich-
|
|
4687
|
-
"@ai-matrx/
|
|
4683
|
+
"@ai-matrx/rich-editor": "latest",
|
|
4684
|
+
"@ai-matrx/content-ir-react": "latest",
|
|
4685
|
+
"@ai-matrx/canvas": "latest",
|
|
4686
|
+
"@ai-matrx/browser-audio": "latest",
|
|
4687
|
+
"@ai-matrx/rich-content": "latest"
|
|
4688
4688
|
},
|
|
4689
4689
|
"devDependencies": {
|
|
4690
4690
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -4781,7 +4781,8 @@
|
|
|
4781
4781
|
"scripts": {
|
|
4782
4782
|
"build": "pnpm --filter @ai-matrx/rich-editor build && pnpm clean && tsup && node ./scripts/tsc-own.mjs -p tsconfig.build.json && node ./scripts/finish-build.mjs",
|
|
4783
4783
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
4784
|
-
"check:
|
|
4784
|
+
"check:styles": "node ../scripts/check-package-styles.mjs --package chat",
|
|
4785
|
+
"check:package": "pnpm build && pnpm check:styles && node ../scripts/check-exports-agreement.mjs && publint && pnpm verify:tarball && pnpm verify:modules-tarball && pnpm check:front-door:self-test && pnpm check:front-door:canary && pnpm check:host-boundary && pnpm check:no-builder-tier && pnpm check:one-holder && pnpm check:host-doors && pnpm check:no-package-slots && pnpm check:public-surface && pnpm check:side-effects && pnpm check:one-block-engine",
|
|
4785
4786
|
"check:host-boundary": "node ./scripts/check-host-boundary.mjs && node ./scripts/check-host-boundary.mjs --self-test",
|
|
4786
4787
|
"check:host-doors": "node ./scripts/check-host-source-doors.mjs && node ./scripts/check-host-source-doors.mjs --self-test",
|
|
4787
4788
|
"check:no-package-slots": "node ./scripts/check-no-package-slots.mjs && node ./scripts/check-no-package-slots.mjs --self-test",
|
|
@@ -4802,5 +4803,5 @@
|
|
|
4802
4803
|
"check:side-effects": "node ../scripts/check-side-effects-listed.mjs . && node ../scripts/check-side-effects-listed.mjs --self-test",
|
|
4803
4804
|
"check:public-surface": "node ./scripts/sync-public-surface.mjs --check && node ./scripts/sync-public-surface.mjs --self-test"
|
|
4804
4805
|
},
|
|
4805
|
-
"gitHead": "
|
|
4806
|
+
"gitHead": "f454ad2b6bb89fd398ef3fb05603ded30ca95dc0"
|
|
4806
4807
|
}
|