@ai-matrx/files

中文文档
0.1.25发布于 2026/10/28MITTypeScriptESM + CJS近 30 天下载 2.8万

Everything about stored AI Matrx files: upload (buffered + resumable with progress), list, durable preview/download URLs, bytes, share links, rename/move/copy, delete/restore, the durable-ref engine (resolve, blob cache, cookie session, heal) — every call

原始使用文档

@ai-matrx/files

Everything about stored AI Matrx files: upload (simple or resumable, with progress), list, preview and download URLs, bytes, share links, rename / move / copy, delete and restore — every call in an organization. Framework-free core, optional React hooks.

import { createFiles } from "@ai-matrx/files";

const files = createFiles({
  credentials: () => ({ kind: "user", accessToken: session.access_token }),
  organizationId: activeOrganizationId, // a value or a getter
});

const { fileId } = await files.upload(file, { folderPath: "Reports", onProgress });
const rows = await files.list({ folderPath: "Reports" });
const { inline, download } = files.urls(fileId); // durable, never expire
const blob = await files.download(fileId);
const link = await files.createShareLink(fileId); // link.url opens publicly
await files.delete(fileId); // archive
await files.restore(fileId);
EntryWhat
@ai-matrx/filescreateFiles + everything below except /tus internals and /react
@ai-matrx/files/clientThe durable-ref engine alone: resolve, blobs, cookie session, heal
@ai-matrx/files/tusResumable transport (tus-js-client loads on the first send)
@ai-matrx/files/reactFilesProvider, useFiles, useFileUpload, useFileList

Identity: credentials takes any @ai-matrx/api credentials setting (a credential, a getter or a port). @ai-matrx/auth's session port plugs in there unchanged.

Viewers and players live in @ai-matrx/media; generic database doors in @ai-matrx/data.

版本与发布记录

@ai-matrx/files 共发布 28 个版本,首次发布于 2026/10/11;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.1.25latest2026/10/288 天前
0.1.242026/10/2512 天前
0.1.232026/10/2413 天前
0.1.222026/10/2313 天前
0.1.212026/10/2314 天前
0.1.202026/10/2314 天前

其他发布通道:bootstrap → 0.0.0。

关于 @ai-matrx/files 的常见问题

@ai-matrx/files 是什么?

Everything about stored AI Matrx files: upload (buffered + resumable with progress), list, durable preview/download URLs, bytes, share links, rename/move/copy, delete/restore, the durable-ref engine (resolve, blob cache, cookie session, heal) — every call

如何安装 @ai-matrx/files?

在项目目录运行 npm install @ai-matrx/files,或使用 pnpm add / yarn add / bun add。

@ai-matrx/files 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ai-matrx/files 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ai-matrx/files 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ai-matrx/files 可以商用吗?

@ai-matrx/files 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ai-matrx/files 的下载量有多少?

根据 npm 官方下载统计,@ai-matrx/files 在 2026/10/05 – 2026/11/03 这 30 天内被下载 28,278 次,日均约 943 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-matrx/files 还在维护吗?

最新版本 0.1.25 发布于 2026/10/28(8 天前);至今共发布 28 个版本,其中过去 12 个月发布了 28 个;首次发布于 2026/10/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。