npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aimform/spaces

v0.3.2

Published

Aimform Spaces — general-purpose content model: Spaces, Entities, Blocks, Properties, Views, Files, Connections, and Conversations.

Readme

@aimform/spaces

General-purpose content model — Spaces, Entities, Blocks, Properties, Collections, Views, Files, Connections, and Conversations.

Install

npm install @aimform/spaces @aimform/core

Usage

import { Spaces, Entities, Blocks, Collections, Properties, Views, Files, Connections, Conversations }
  from "@aimform/spaces";

// D1
const spaces = new Spaces({ database: env.DB });
const blocks = new Blocks({ database: env.DB });

// Platform API
const aimform = createAimform({ apiKey: "af_xxx" });
const spaces = new Spaces({ client: aimform.client });
const entities = new Entities({ client: aimform.client });

Spaces

import { Spaces } from "@aimform/spaces";

const spaces = new Spaces({ database: db });
await spaces.list("org_456");
await spaces.get("spc_123");
await spaces.create({ ownerType: "organization", ownerId: "o1", name: "Project", createdByProfileId: "p1" });
await spaces.update("spc_123", { name: "Renamed" });
await spaces.delete("spc_123");
await spaces.getIndex("spc_123");

Spaces docs

Entities

import { Entities } from "@aimform/spaces";

const entities = new Entities({ database: db });
await entities.list("spc_123", { entityType: "task" });
await entities.get("ent_789");
await entities.create({ spaceId: "spc_123", entityType: "task", properties: { title: "Setup CI" }, createdByProfileId: "p1" });
await entities.update("ent_789", { properties: { status: "done" } });
await entities.delete("ent_789");

Entities docs

Blocks

import { Blocks } from "@aimform/spaces";

const blocks = new Blocks({ database: db });
await blocks.list("ent_789");
await blocks.add("ent_789", { blockType: "paragraph", content: "Hello world" });
await blocks.addSource(block.id, { sourceType: "url", sourceUrl: "https://...", excerpt: "...", confidence: "high" });
await blocks.update(block.id, { content: "Updated" });
await blocks.delete(block.id);
await blocks.removeSource(block.id, source.id);

Blocks docs

Collections

import { Collections } from "@aimform/spaces";

const collections = new Collections({ database: db });
await collections.list("spc_123");
await collections.upsert({
  spaceId: "spc_123", entityType: "task",
  renderMode: "record", presentation: "collection",
  displayName: "Tasks", pinned: true, position: 0,
});
await collections.delete("spc_123", "task");

Collections docs

Properties

import { Properties } from "@aimform/spaces";

const properties = new Properties({ database: db });
await properties.list("spc_123", "task");
await properties.create({ spaceId: "spc_123", key: "priority", label: "Priority", valueType: "select" });
await properties.update("prop_1", { label: "Task Priority" });
await properties.delete("prop_1");

Properties docs

Views

import { Views } from "@aimform/spaces";

const views = new Views({ database: db });
await views.list("spc_123");
await views.create({ spaceId: "spc_123", name: "Active Tasks", viewType: "table", entityType: "task" });
await views.update("view_1", { filters: JSON.stringify([{ field: "status", operator: "eq", value: "active" }]) });
await views.delete("view_1");

Views docs

Files

import { Files } from "@aimform/spaces";

const files = new Files({ database: db });
await files.list("org_456");
await files.get("file_1");
await files.put({ orgId: "org_456", r2Key: "reports/q4.pdf", mimeType: "application/pdf", sizeBytes: 1024 });
await files.delete("file_1");
await files.getPresignedUrl("reports/q4.pdf", "application/pdf", 3600);

Files docs

Connections

import { Connections } from "@aimform/spaces";

const connections = new Connections({ database: db });
await connections.list("org_456");
await connections.create({ orgId: "org_456", provider: "xero", credentials: "..." });
await connections.listProviders();
const result = await connections.resolveCapability("org_456", "financial:transactions:read");
await connections.getCanonicalData("conn_1", "financial:transactions:read", { limit: 50 });
await connections.grantAccess("conn_1", "client_1", ["financial:transactions:read"]);
await connections.revoke("conn_1");

Connections docs

Conversations

import { Conversations } from "@aimform/spaces";

const conversations = new Conversations({ database: db });
await conversations.list("org_456", "prof_123");
await conversations.create({ orgId: "org_456", profileId: "prof_123", contextScope: "space:spc_123" });
await conversations.appendMessage("conv_1", { role: "user", content: "Hello" });
const conv = await conversations.get("conv_1");
await conversations.delete("conv_1");

Conversations docs

Creating custom adapters