Content and AI

Model portable content operations and compose AI-assisted generation through explicit providers, schemas, policy, and application-owned publication workflows.

Approaches

Content contracts

Represent source, normalized metadata, transformation state, and publication intent without binding the domain to a CMS or framework.

Packages

@playstack/content

Frameworks and integrations

Structured AI generation

Validate model input and output against application schemas while keeping provider selection and native clients explicit.

Frameworks and integrations

Content workflows

Carry reviewable operations through events and queues before publishing to application-owned stores, pages, or feeds.

Frameworks and integrations

framework

Next.js

Compose Playstack server contracts, React bindings, SSR handoff, and route adapters at the Next.js application edge.

framework

NestJS

Connect portable Playstack capabilities to dependency injection, guards, decorators, request context, workers, and lifecycle hooks.

integration

Zod

Reuse Zod schemas across Playstack content, React forms, wire validation, and NestJS request boundaries.

integration

BullMQ

Dispatch and process typed Playstack jobs through BullMQ with explicit Redis ownership and native queue access.

integration

Inngest

Dispatch portable Playstack queue jobs through Inngest and serve the generated functions from Next.js, NestJS, or another supported framework.

Package reference

@playstack/content

Keep the content model authoritative

AI can propose, classify, extract, and transform. It should not quietly become the source of publication truth. Playstack keeps application-owned content records at the center and treats model calls as typed operations with observable inputs and outputs.

Validate both sides of generation

ts
import { createAi } from '@playstack/ai'

const ai = createAi({
  persistence,
  events,
  connections,
  rateLimiter,
  entitlements,
  connectionScope: 'account',
  allowPlatformFallback: false,
  providers: [
    {
      id: 'anthropic',
      createModel: (modelId, { apiKey }) => anthropic(modelId, { apiKey }),
    },
  ],
  prices,
  clock,
  ids,
})

const call = await ai.beginCall('anthropic:configured-model', {
  accountId,
  actor: { type: 'system', id: 'article-summary' },
})
// Application-owned helper runs the SDK and maps measured numeric usage.
const result = await summarizeArticleWithSdk(
  call.model,
  articleSummaryInput.parse({ title: article.title, body: article.body }),
)
await ai.completeCall(call, { usage: result.usage })
const summary = articleSummaryOutput.parse(result.value)

The SDK and application own generation and input/output validation. Playstack owns the selected account/actor context, policy preflight and reported usage. System calls use account-scoped credentials and a separate system rate-limit policy. The application maps known, partial or unknown usage instead of replacing missing tokens with zero; raw provider payloads do not become accounting records. Keep provider execution failures separate from accounting failures, and reconcile crashes before a terminal report. The call/model stays server-owned and is never serialized. See AI accounting.

Publish through explicit workflow steps

ts
await contentWorkflow.enqueue('article.prepare', {
  contentId: article.id,
  revision: article.revision,
})

A worker can enrich metadata, request human review, and publish the accepted revision to a site or feed. Idempotency keys include the content revision so a retry cannot publish an obsolete generation over a newer edit.

Go

Playstack Pro tag
OriginsPricingBlogChangelogStatus

© 2026 Playstack. All rights reserved.

With OSS

By

Commune Software