Skip to content

Package reference

Postgres source adapter + infrastructure storage. Role-scoped read-only execution, owner-identity verification, introspection.

Terminal window
pnpm add @arivie/db-postgres
import { postgresAdapter } from "@arivie/db-postgres";
const adapter = postgresAdapter({
url: process.env.DATABASE_URL!,
readOnlyRole: "arivie_reader",
allowedSchemas: ["public"],
maxConnections: 10,
idleTimeoutMs: 30_000,
});

Key exports:

ExportPurpose
postgresAdapter(opts)Creates a Postgres source adapter
validateExecuteSql(sql)SQL guard (rejects non-SELECT/WITH, DML, DDL)
compileMetricForPostgresMetric-to-SQL compiler
ArivieBoundaryErrorThrown when DB role is not read-only

GitHub push-event trigger channel with HMAC-SHA256 webhook verification.

Terminal window
pnpm add @arivie/github
import { createGithubPushChannel } from "@arivie/github";
const channel = createGithubPushChannel({
webhookSecret: process.env.GITHUB_WEBHOOK_SECRET!,
});
ExportPurpose
githubPushTriggerRaw trigger definition
createGithubPushChannel(config)Configured channel for createArivieServer
GithubPushPayloadEvent payload type (repository, ref, commits)
GithubPushEventFull trigger event type

MCP server exposing Arivie analytics tools to MCP clients (Claude Desktop, Cursor).

Terminal window
pnpm add @arivie/mcp

Subpath exports:

PathExports
@arivie/mcpmakeMcpServer(opts)ask, query, schema, memory tools
@arivie/mcp/nextmakeMcpRouteHandler(mcp) — Next.js App Router adapter
@arivie/mcp/stdiostartStdioServer({ mcp }) — stdio transport

Wraps @mastra/mcp MCPClient as a SourceAdapter so remote MCP servers become named execute_<source> tools.

Terminal window
pnpm add @arivie/source-mcp
import { makeMCPSourceAdapter } from "@arivie/source-mcp";
const { adapter, tools } = makeMCPSourceAdapter({
server: { command: "npx", args: ["-y", "@some/mcp-server"] },
});

Mixpanel Query API source adapter for segmentation analytics.

Terminal window
pnpm add @arivie/source-mixpanel
import { mixpanelAdapter } from "@arivie/source-mixpanel";
const adapter = mixpanelAdapter({
serviceAccount: process.env.MIXPANEL_SERVICE_ACCOUNT!,
projectToken: process.env.MIXPANEL_PROJECT_TOKEN!,
});

Includes compileMetricForMixpanel for metric-to-segmentation-query compilation.


YAML semantic layer: parser, validator, linter, TypeScript codegen.

Terminal window
pnpm add @arivie/semantic
ExportPurpose
parseEntity(yaml)Parse a single entity YAML string
defineEntity(definition)Build an entity in TypeScript
composeSemantic(opts)Build + write a full semantic layer
loadSemanticLayer(dir)Load all entities from a directory
loadSemanticLayerSync(dir)Synchronous variant
lint(layer, opts)Lint a semantic layer
estimateTokens(layer)Estimate token count
codegen(layer)Generate TypeScript declarations

Zod schemas: EntitySchema, MeasureSchema, DimensionSchema, SegmentSchema, JoinSchema, ColumnSchema, CatalogSchema.


Filesystem sandboxes + Mastra workspace factory.

Terminal window
pnpm add @arivie/workspace
ExportPurpose
makeWorkspace(opts)Build workspace + skills processor + optional bash
InProcessSandboxFilesystemLocal filesystem sandbox
DockerSandboxFilesystemDocker-isolated sandbox
VercelSandboxFilesystemVercel Firecracker sandbox
SemanticLayerFilesystemRead-only FS over semantic layer
workspaceBashTool(opts)Opt-in bash tool
resolveWithinRoot(path, root)Path guard utility

React UI — headless hooks and drop-in chat component.

Terminal window
pnpm add @arivie/react
PathExports
@arivie/reactuseAgent, useSchema, useMemory hooks
@arivie/react/chat<ArivieChat>, <ArtifactPane>, <ThreadList>

Embedding providers + chunking/indexing.

Terminal window
pnpm add @arivie/embeddings

Providers: openAIEmbeddings, cohereEmbeddings, voyageEmbeddings.

Chunking: ParagraphChunker, buildIndex, retrieve.