import { LoonFSClient } from "@loonfs/sdk/server";
 
const client = new LoonFSClient({
  environment: "https://your-loonfs-host.example",
  token: "YOUR_TOKEN",
});
const actor = { id: "agent", kind: "service" as const };
 
for (const file of files) {
  const target = `/deal-room/${file.name}`;
  // upload
  await client.files.upload({
    namespace_id: "acme",
    path: target,
    bytes: new Uint8Array(await file.arrayBuffer()),
    actor,
    commit_id: crypto.randomUUID(),
  });
}
renderUploads(files);
import { LoonFS, LoonFSClient } from "@loonfs/sdk/server";
 
const client = new LoonFSClient({
  environment: "https://your-loonfs-host.example",
  token: "YOUR_TOKEN",
});
const actor = { id: "agent", kind: "service" as const };
const operations: LoonFS.FilesystemOperation[] = [
  { kind: "create_directory", path: "/deal-room/reports" },
  { kind: "create_directory", path: "/deal-room/contracts" },
  { kind: "move_path", from_path: "/deal-room/q4.md", to_path: "/deal-room/reports/q4.md" },
  { kind: "move_path", from_path: "/deal-room/q3.md", to_path: "/deal-room/reports/q3.md" },
  { kind: "move_path", from_path: "/deal-room/nda.pdf", to_path: "/deal-room/contracts/nda.pdf" },
];
 
// organize
await client.commits.create({
  namespace_id: "acme",
  actor,
  commit_id: crypto.randomUUID(),
  operations,
  message: "Organize deal room",
});
 
const page = await client.files.list({
  namespace_id: "acme",
  path: "/deal-room",
});
import { LoonFSClient } from "@loonfs/sdk/server";
 
const client = new LoonFSClient({
  environment: "https://your-loonfs-host.example",
  token: "YOUR_TOKEN",
});
const start = 0;
 
// changes
const feed = await client.changes.list({
  namespace_id: "acme",
  after_seq: start,
});
for (const change of feed.changes)
  render(change.commit_id, change.message);
 
const latest = feed.changes.at(-1);
console.log(latest?.committed_by, latest?.committed_at_ms);
localhost:3000
Add files or type a message…
acme / deal-room
DEAL ROOM
inbox
reports
contracts
Change history
acme / deal-room