@desplega.ai/agent-fs-just-bash

中文文档
0.18.25发布于 2026/11/12MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3.6万

just-bash-compatible filesystem adapter for agent-fs

原始使用文档

@desplega.ai/agent-fs-just-bash

just-bash compatible filesystem adapter for agent-fs.

import { Bash } from "just-bash";
import { AgentFsFileSystem } from "@desplega.ai/agent-fs-just-bash";

const fs = new AgentFsFileSystem({
  baseUrl: "http://127.0.0.1:7433",
  apiKey: process.env.AGENT_FS_API_KEY,
  orgId: "org_...",
  driveId: "drive_...",
});

const bash = new Bash({ fs, cwd: "/" });
await bash.exec("cat README.md");

The adapter talks to the agent-fs daemon HTTP API. It uses /raw for byte-safe reads and writes, and /ops for ls, stat, rm, cp, and mv.

Supported semantics

  • Files are read and written as raw bytes.
  • Directories are agent-fs prefixes. Empty directories are represented with a hidden .agent-fs-dir marker file that this adapter filters from readdir.
  • appendFile creates files when missing.
  • chmod and utimes verify the path exists, then no-op because agent-fs does not persist POSIX mode or caller-supplied timestamps.
  • Symlink creation is not supported and throws EPERM; lstat is equivalent to stat; realpath returns the normalized virtual path.
  • Hard links are approximated as file copies.

getAllPaths() is synchronous in the just-bash interface, so this adapter returns a local cache of paths discovered through reads, writes, and listings. Call await fs.refreshAllPaths() before shell commands that rely on globbing an already-populated remote drive.

Caching

Shell commands call stat and readdir many times for the same paths. The adapter keeps stat and ls answers for cacheTtlMs (default 5000 ms) and answers a child's stat from its parent's listing when it can. File contents are never cached.

  • The adapter's own writes (writeFile, appendFile, mkdir, rm, cp, mv) drop the entries they change, so they are visible at once.
  • A change made by another client can stay unseen for up to cacheTtlMs. refreshAllPaths(path) drops the entries under path and lists again.
  • cacheTtlMs: 0 turns the cache off. cacheTtlMs: Infinity keeps entries for the life of the instance.
  • Expired entries are dropped as new ones arrive, and each cache holds at most 10,000 paths. Past that, the oldest go first.

版本与发布记录

@desplega.ai/agent-fs-just-bash 共发布 66 个版本,首次发布于 2026/06/05;过去 12 个月发布了 66 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.18.25latest2026/11/12今天
0.18.242026/11/102 天前
0.18.232026/11/084 天前
0.18.222026/11/066 天前
0.18.212026/11/066 天前
0.18.202026/11/056 天前

关于 @desplega.ai/agent-fs-just-bash 的常见问题

@desplega.ai/agent-fs-just-bash 是什么?

just-bash-compatible filesystem adapter for agent-fs

如何安装 @desplega.ai/agent-fs-just-bash?

在项目目录运行 npm install @desplega.ai/agent-fs-just-bash,或使用 pnpm add / yarn add / bun add。

@desplega.ai/agent-fs-just-bash 支持 TypeScript 吗?

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

@desplega.ai/agent-fs-just-bash 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@desplega.ai/agent-fs-just-bash 可以商用吗?

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

@desplega.ai/agent-fs-just-bash 的下载量有多少?

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

@desplega.ai/agent-fs-just-bash 还在维护吗?

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