@ai-matrx/chat 0.2.7 → 0.2.8
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 +9 -0
- package/dist/agent-copy/export.d.ts +9 -0
- package/dist/agent-copy/export.js +13 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-matrx/chat
|
|
2
2
|
|
|
3
|
+
## 0.2.8 — 2026-10-07
|
|
4
|
+
|
|
5
|
+
ALC-19: the one file-download door.
|
|
6
|
+
|
|
7
|
+
- `agent-copy/export`: `downloadFile` revokes its object URL after 1 s (Safari cancels a save revoked in the
|
|
8
|
+
click's tick); new `downloadUrl(url, filename, { newTab? })` saves a file that already has a URL (data:, blob:,
|
|
9
|
+
remote) — the hand-built anchor + `.download =` is gone from every host.
|
|
10
|
+
- Consumer action: replace hand-built `URL.createObjectURL` + anchor downloads with `downloadFile` / `downloadUrl`.
|
|
11
|
+
|
|
3
12
|
## 0.2.7 — 2026-10-06
|
|
4
13
|
### Re-sync before matrx-frontend consumes the published package (P27)
|
|
5
14
|
|
|
@@ -22,6 +22,15 @@ export interface ExportItem {
|
|
|
22
22
|
onSelect?: () => void | Promise<void>;
|
|
23
23
|
}
|
|
24
24
|
export declare function downloadFile(filename: string, content: BlobPart, mime: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Save a file that already has a URL (a data: or blob: URL, or a remote URL the browser may
|
|
27
|
+
* download). Same-origin and data/blob URLs are saved under `filename`; a cross-origin remote
|
|
28
|
+
* URL is handed to the browser, which may ignore the name. `newTab` opens it in a new tab
|
|
29
|
+
* (noopener) as the cross-origin fallback.
|
|
30
|
+
*/
|
|
31
|
+
export declare function downloadUrl(url: string, filename: string, options?: {
|
|
32
|
+
newTab?: boolean;
|
|
33
|
+
}): void;
|
|
25
34
|
/** Sanitized `base-2026-07-27.ext` filename. */
|
|
26
35
|
export declare function exportFilename(base: string, extension: string): string;
|
|
27
36
|
export declare function jsonExportItem(data: unknown | (() => unknown), label?: string): ExportItem;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
function downloadFile(filename, content, mime) {
|
|
2
2
|
const blob = new Blob([content], { type: mime });
|
|
3
3
|
const url = URL.createObjectURL(blob);
|
|
4
|
+
clickDownloadAnchor(url, filename);
|
|
5
|
+
setTimeout(() => URL.revokeObjectURL(url), 1e3);
|
|
6
|
+
}
|
|
7
|
+
function downloadUrl(url, filename, options = {}) {
|
|
8
|
+
clickDownloadAnchor(url, filename, options.newTab);
|
|
9
|
+
}
|
|
10
|
+
function clickDownloadAnchor(href, filename, newTab = false) {
|
|
4
11
|
const anchor = document.createElement("a");
|
|
5
|
-
anchor.href =
|
|
12
|
+
anchor.href = href;
|
|
6
13
|
anchor.download = filename;
|
|
14
|
+
if (newTab) {
|
|
15
|
+
anchor.target = "_blank";
|
|
16
|
+
anchor.rel = "noopener noreferrer";
|
|
17
|
+
}
|
|
7
18
|
document.body.appendChild(anchor);
|
|
8
19
|
anchor.click();
|
|
9
20
|
document.body.removeChild(anchor);
|
|
10
|
-
URL.revokeObjectURL(url);
|
|
11
21
|
}
|
|
12
22
|
function exportFilename(base, extension) {
|
|
13
23
|
const slug = base.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
|
|
@@ -81,6 +91,7 @@ function csvExportItem(rows, label = "CSV", columns) {
|
|
|
81
91
|
export {
|
|
82
92
|
csvExportItem,
|
|
83
93
|
downloadFile,
|
|
94
|
+
downloadUrl,
|
|
84
95
|
exportFilename,
|
|
85
96
|
jsonExportItem,
|
|
86
97
|
rowsToCsv,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/chat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
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 per-module subpaths @ai-matrx/chat/<domain>/<module> over a host contract (/host, /host/react) whose only required value is a db; plus the kernel compatibility entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) until P28.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -202,23 +202,23 @@
|
|
|
202
202
|
"uuid": "^14.0.2",
|
|
203
203
|
"zod": "^4.6.5",
|
|
204
204
|
"@ai-matrx/agents": "latest",
|
|
205
|
-
"@ai-matrx/alchemy": "latest",
|
|
206
|
-
"@ai-matrx/associations": "latest",
|
|
207
205
|
"@ai-matrx/browser-audio": "latest",
|
|
208
206
|
"@ai-matrx/canvas": "latest",
|
|
209
207
|
"@ai-matrx/content-ir": "latest",
|
|
210
208
|
"@ai-matrx/content-ir-react": "latest",
|
|
211
209
|
"@ai-matrx/data": "latest",
|
|
212
|
-
"@ai-matrx/diff": "latest",
|
|
213
210
|
"@ai-matrx/design-system": "latest",
|
|
211
|
+
"@ai-matrx/diff": "latest",
|
|
214
212
|
"@ai-matrx/icons": "latest",
|
|
215
213
|
"@ai-matrx/kit": "latest",
|
|
216
|
-
"@ai-matrx/media": "latest",
|
|
217
214
|
"@ai-matrx/print": "latest",
|
|
218
215
|
"@ai-matrx/realtime": "latest",
|
|
219
216
|
"@ai-matrx/records": "latest",
|
|
220
217
|
"@ai-matrx/records-ui": "latest",
|
|
221
|
-
"@ai-matrx/tap-target": "latest"
|
|
218
|
+
"@ai-matrx/tap-target": "latest",
|
|
219
|
+
"@ai-matrx/alchemy": "latest",
|
|
220
|
+
"@ai-matrx/associations": "latest",
|
|
221
|
+
"@ai-matrx/media": "latest"
|
|
222
222
|
},
|
|
223
223
|
"devDependencies": {
|
|
224
224
|
"@arethetypeswrong/cli": "^0.18.5",
|