### Run Northline Example Source: https://docs.sixb.ai/examples Commands to start the Northline reference project using Bun. ```bash bun --filter @sixb/example-northline dev ``` ```bash cd examples/northline bun run dev ``` -------------------------------- ### Install Sixb core Source: https://docs.sixb.ai/fundamentals/manual-install Install the core runtime and in-memory providers using bun. ```bash bun add @sixb/core ``` -------------------------------- ### Install smolvm Binary Source: https://docs.sixb.ai/sandboxes/smolvm Download and install the required smolvm binary to the host system. ```bash curl -sSL https://smolmachines.com/install.sh | bash ``` -------------------------------- ### POST /auth/sign-in Source: https://docs.sixb.ai/server Starts the authentication flow. ```APIDOC ## POST /auth/sign-in ### Description Initiates the authentication flow. ### Method POST ### Endpoint /auth/sign-in ``` -------------------------------- ### sixb.startOntologyMaintenance() Source: https://docs.sixb.ai/runtime Starts outbox recovery and bounded retention processes. ```APIDOC ## sixb.startOntologyMaintenance() ### Description Starts outbox recovery and bounded retention. Returns a stop handle. ### Signature `const maintenance = await sixb.startOntologyMaintenance()` ``` -------------------------------- ### Bootstrap runtime with async setup Source: https://docs.sixb.ai/fundamentals/project-structure Perform asynchronous tasks like seeding or migrations before returning the runtime instance. ```ts // async entry: seed before returning the runtime export const sixb = bootstrap() async function bootstrap() { const runtime = await createSixb({ id: "my-sixb-app" /* ...providers */ }) await seedCustomers(runtime) return runtime } ``` -------------------------------- ### Scaffold a new Sixb project Source: https://docs.sixb.ai/get-started Initialize a new project, navigate to the directory, and install dependencies using Bun. ```bash bun create sixb my-app cd my-app bun install ``` -------------------------------- ### Run development server Source: https://docs.sixb.ai/apps Starts the application in development mode with automatic rebuilds on file changes. ```BASH bun sixb dev ``` -------------------------------- ### Start the Sixb development server Source: https://docs.sixb.ai/get-started Launch the local development environment to host the runtime, workers, and interfaces. ```bash bun run dev ``` -------------------------------- ### Start Workflow Runs Source: https://docs.sixb.ai/workflows Initiate workflow runs using the sixb.workflows API or by requesting a run via ID. Note that all start methods are asynchronous and queue the job. ```typescript const result = await sixb.workflows.request(invoiceReminder, { input: { invoice: { objectTypeId: "Invoice", primaryId: "inv-001" }, }, }) console.log(result.runId, result.created) ``` ```typescript await sixb.requestWorkflowRun({ workflowId: "invoice-reminder", input: { invoice: { objectTypeId: "Invoice", primaryId: "inv-001" }, }, }) ``` -------------------------------- ### Start Apple Container Runtime Source: https://docs.sixb.ai/sandboxes/apple-container Command to initialize the Apple Container system on a compatible macOS device. ```bash container system start ``` -------------------------------- ### sixb.startScheduler() Source: https://docs.sixb.ai/runtime Starts the scheduler to process discovered schedules. ```APIDOC ## sixb.startScheduler() ### Description Starts the scheduler for discovered `schedules/`. ### Signature `await sixb.startScheduler()` ``` -------------------------------- ### Initialize Local Sandbox Factory Source: https://docs.sixb.ai/sandboxes/local Basic setup for integrating the local sandbox factory into a Sixb instance. ```ts import { createSixb } from "@sixb/core" import { LocalSandboxFactory } from "@sixb/sandboxes-local" createSixb({ sandboxes: new LocalSandboxFactory() }) ``` -------------------------------- ### Configure Sandbox Providers Source: https://docs.sixb.ai/sandboxes Examples of wiring different sandbox factory implementations into the Sixb core configuration. ```typescript import { createSixb } from "@sixb/core" import { LocalSandboxFactory } from "@sixb/sandboxes-local" export const sixb = await createSixb({ // ...broker, storage, queues, ontology, agents sandboxes: new LocalSandboxFactory(), }) ``` ```typescript import { SmolvmSandboxFactory } from "@sixb/sandboxes-smolvm" createSixb({ sandboxes: new SmolvmSandboxFactory() }) ``` ```typescript import { VercelSandboxFactory } from "@sixb/sandboxes-vercel" createSixb({ sandboxes: new VercelSandboxFactory() }) ``` ```typescript import { AppleContainerSandboxFactory } from "@sixb/sandboxes-apple-container" createSixb({ sandboxes: new AppleContainerSandboxFactory() }) ``` -------------------------------- ### Install Vercel Sandbox Provider Source: https://docs.sixb.ai/sandboxes/vercel Add the provider package to your project dependencies. ```bash bun add @sixb/sandboxes-vercel ``` -------------------------------- ### Configure Sandbox from Snapshot or Image Source: https://docs.sixb.ai/sandboxes/vercel Initialize a sandbox using a pre-existing snapshot or a custom Vercel Container Registry image to avoid runtime installation overhead. ```ts // Start from a Vercel Sandbox snapshot new VercelSandboxFactory({ snapshotId: "snp_...", }) // Or start from a VCR image new VercelSandboxFactory({ image: "sixb-agent:v1", }) ``` -------------------------------- ### Install Tailwind CSS dependencies Source: https://docs.sixb.ai/apps Required CLI installation for projects utilizing Tailwind features. ```BASH bun add tailwindcss @tailwindcss/cli ``` -------------------------------- ### Run database migrations Source: https://docs.sixb.ai/deployment Commands to perform database migrations and start the API without automatic migration. ```bash sixb db migrate sixb api --no-migrate # or SIXB_SKIP_MIGRATION=1 ``` -------------------------------- ### Project Directory Structure Source: https://docs.sixb.ai/rules Example of the expected project structure for automatic rule discovery. ```text your-project/ ontology/ invoice.ts project.ts rules/ business-health.ts sixb.config.ts ``` -------------------------------- ### Start Atlas Admin UI Source: https://docs.sixb.ai/deployment Command to launch the Atlas admin UI in a production environment, pointing it to the public API origin. ```bash sixb atlas --api-public-origin https://api.acme.example.com ``` -------------------------------- ### Select definitions for authorization Source: https://docs.sixb.ai/auth/authorization Examples of using capability builders with single definitions, lists, or breadth selectors from the every namespace. ```typescript can.access(applications.atlas) ``` ```typescript can.view(Invoice) ``` ```typescript can.view([Customer, Invoice]) ``` ```typescript can.view(every.object()) ``` ```typescript can.edit(every.object()) ``` ```typescript can.append(every.object()) ``` ```typescript can.view(every.dataset()) ``` ```typescript can.apply(every.action()) ``` ```typescript can.run(every.workflow()) ``` ```typescript can.run(every.sync()) ``` ```typescript can.run(every.pipeline()) ``` ```typescript can.run(every.agent()) ``` ```typescript can.access(every.application()) ``` ```typescript can.view(every.object().except([Customer])) ``` -------------------------------- ### Embed the Sixb server Source: https://docs.sixb.ai/server Initialize and start the Sixb server by passing an existing runtime instance and configuration for network and browser access. ```typescript import { createSixb } from "@sixb/core" import { createSixbServer } from "@sixb/server" const sixb = await createSixb() const server = createSixbServer({ sixb, port: 3000, host: "0.0.0.0", browser: { publicOrigin: "https://api.acme.example", allowedOrigins: [ { origin: "https://atlas.acme.example", audience: "atlas" }, { origin: "https://app.acme.example", audience: "app" }, ], }, }) await server.start() // API at http://0.0.0.0:3000 // OpenAPI at http://0.0.0.0:3000/docs await server.stop() ``` -------------------------------- ### Perform end-to-end client-server testing Source: https://docs.sixb.ai/testing Start a SixbServer instance and use the typed client to verify that HTTP requests match runtime behavior. ```typescript import { afterAll, beforeAll, expect, test } from "bun:test" import { client } from "@sixb/client" import { objects } from "@sixb/client/query" import { SixbServer } from "@sixb/server" let server: SixbServer beforeAll(async () => { // ...build and seed sixb, then pick a free port... const baseUrl = `http://127.0.0.1:${port}` server = new SixbServer({ sixb, host: "127.0.0.1", port, quiet: true, browser: { publicOrigin: baseUrl, allowedOrigins: [{ origin: baseUrl, audience: "atlas" }], }, }) await server.start() client.setConfig({ baseUrl }) }) afterAll(async () => { await server?.stop() }) test("list() returns the same objects as the server runtime", async () => { const viaHttp = await objects(Project) .query() .where((project) => project.p.status.eq("active")) .list() const viaRuntime = await sixb .objects(Project) .query() .where((project) => project.p.status.eq("active")) .list() expect(viaHttp.objects.map((o) => o.primaryId)).toEqual( viaRuntime.objects.map((o) => o.primaryId) ) }) ``` -------------------------------- ### Manage Runtime Lifecycle Source: https://docs.sixb.ai/runtime Starts the scheduler and ontology maintenance, then cleans up resources during shutdown. ```typescript await sixb.startScheduler() const maintenance = await sixb.startOntologyMaintenance() // ... on shutdown await sixb.stopScheduler() await maintenance.stop() ``` -------------------------------- ### Perform collection operations Source: https://docs.sixb.ai/objects Examples of upserting, fetching, and listing objects within a collection. ```typescript const invoices = sixb.objects(Invoice) // Create or update by primary id await invoices.upsert({ properties: { id: "inv-001", number: "2026-001", amount: 4200, currency: "EUR", status: "sent" }, }) // Read one const invoice = await invoices.get("inv-001") // Browse the type const page = await invoices.list({ limit: 25, orderBy: "updatedAt", order: "desc" }) ``` -------------------------------- ### GET /api/agent-runs/:runId Source: https://docs.sixb.ai/agents/running-and-streaming Get the current status of a run. ```APIDOC ## GET /api/agent-runs/:runId ### Description Get a run's status. ### Method GET ### Endpoint /api/agent-runs/:runId ### Parameters #### Path Parameters - **runId** (string) - Required - The ID of the run. ``` -------------------------------- ### Build and serve production app Source: https://docs.sixb.ai/apps Commands to compile the project and launch the production application. ```BASH bun run build bun sixb app ``` -------------------------------- ### GET /api/project Source: https://docs.sixb.ai/agents/tools-and-gateway Retrieves project information. ```APIDOC ## GET /api/project ### Description Retrieves project information. ### Method GET ### Endpoint /api/project ``` -------------------------------- ### GET /ws/logs Source: https://docs.sixb.ai/server Connects to a WebSocket stream for run logs. ```APIDOC ## GET /ws/logs ### Description Establishes a WebSocket connection to stream run logs. ### Method GET ### Endpoint /ws/logs ``` -------------------------------- ### GET /ready Source: https://docs.sixb.ai/server Checks if the storage is reachable and the schema is current. ```APIDOC ## GET /ready ### Description Returns 503 when the runtime must leave traffic, indicating storage is unreachable or schema is outdated. ### Method GET ### Endpoint /ready ``` -------------------------------- ### Minimal Production Topology Configuration Source: https://docs.sixb.ai/deployment Environment variables and process commands for a standard multi-role deployment. ```bash export SIXB_API_PUBLIC_ORIGIN=https://api.acme.example.com export SIXB_ATLAS_PUBLIC_ORIGIN=https://atlas.acme.example.com sixb api # HTTP/WS API sixb atlas # admin UI sixb orchestrator # event -> queue dispatch sixb scheduler # cron schedule triggers sixb rules # rule evaluation sixb worker-group # all registered queue workers ``` -------------------------------- ### GET /api/agent-threads/:threadId/runs Source: https://docs.sixb.ai/agents/running-and-streaming List all runs associated with a thread. ```APIDOC ## GET /api/agent-threads/:threadId/runs ### Description List a thread's runs. ### Method GET ### Endpoint /api/agent-threads/:threadId/runs ### Parameters #### Path Parameters - **threadId** (string) - Required - The ID of the thread. ``` -------------------------------- ### GET /api/agent-threads/:threadId Source: https://docs.sixb.ai/agents/running-and-streaming Retrieve a specific thread by its ID. ```APIDOC ## GET /api/agent-threads/:threadId ### Description Get a thread. ### Method GET ### Endpoint /api/agent-threads/:threadId ### Parameters #### Path Parameters - **threadId** (string) - Required - The ID of the thread. ``` -------------------------------- ### GET /api/agents/:agentId Source: https://docs.sixb.ai/agents/running-and-streaming Retrieve details for a specific agent. ```APIDOC ## GET /api/agents/:agentId ### Description Get one agent. ### Method GET ### Endpoint /api/agents/:agentId ### Parameters #### Path Parameters - **agentId** (string) - Required - The ID of the agent. ``` -------------------------------- ### Initialize Sixb production instance Source: https://docs.sixb.ai/infrastructure Configures a Sixb instance with PostgreSQL, DuckLake, S3, Redis, and BullMQ. Requires environment variables for database and connection strings. ```typescript import { createSixb } from "@sixb/core" import { PostgresStorage } from "@sixb/pg" import { DuckLakeStorage } from "@sixb/ducklake" import { S3BlobStorage } from "@sixb/blob-s3" import { RedisBroker } from "@sixb/broker-redis" import { BullMqQueues } from "@sixb/queues-bullmq" export const sixb = await createSixb({ id: "acme-corp", storage: new PostgresStorage({ connectionString: process.env.DATABASE_URL! }), lakeStorage: new DuckLakeStorage({ catalog: { type: "postgres", host: "localhost", database: "lake", user: "sixb", password: "secret" }, dataPath: "s3://acme-lake/data", }), blobStorage: new S3BlobStorage({ bucket: "acme-lake", region: "us-east-1", basePath: "sixb" }), broker: new RedisBroker({ connection: { url: "redis://localhost:6379" } }), queues: new BullMqQueues({ connection: "redis://localhost:6379" }), }) ``` -------------------------------- ### GET /api/agents Source: https://docs.sixb.ai/agents/running-and-streaming List all agents available for the user to run. ```APIDOC ## GET /api/agents ### Description List agents you can run. ### Method GET ### Endpoint /api/agents ``` -------------------------------- ### GET /api/auth/sessions Source: https://docs.sixb.ai/auth/authentication Retrieves a list of the user's active sessions. ```APIDOC ## GET /api/auth/sessions ### Description Lists all active sessions for the authenticated user. ### Method GET ### Endpoint /api/auth/sessions ``` -------------------------------- ### Initialize SmolvmSandboxFactory configurations Source: https://docs.sixb.ai/sandboxes/smolvm Various ways to instantiate the sandbox factory, ranging from default settings to custom image sources and resource allocations. ```ts new SmolvmSandboxFactory() ``` ```ts new SmolvmSandboxFactory({ image: "/opt/sixb/agent.tar" }) ``` ```ts new SmolvmSandboxFactory({ image: "node:22", registryHosts: ["ghcr.io", "pkg-containers.githubusercontent.com"], }) ``` ```ts new SmolvmSandboxFactory({ image: null, overlayGiB: 8 }) ``` -------------------------------- ### GET /api/agent-threads/:threadId/messages Source: https://docs.sixb.ai/agents/running-and-streaming List all messages within a specific thread. ```APIDOC ## GET /api/agent-threads/:threadId/messages ### Description List a thread's messages. ### Method GET ### Endpoint /api/agent-threads/:threadId/messages ### Parameters #### Path Parameters - **threadId** (string) - Required - The ID of the thread. ``` -------------------------------- ### Link Vercel Project for Local Development Source: https://docs.sixb.ai/sandboxes/vercel Prepare the local environment by linking the Vercel project and pulling environment variables. ```bash vercel link vercel env pull .env.local ``` -------------------------------- ### GET /api/agent-threads Source: https://docs.sixb.ai/agents/running-and-streaming List threads, optionally filtered by agentId or status. ```APIDOC ## GET /api/agent-threads ### Description List threads (filter by agentId, status). ### Method GET ### Endpoint /api/agent-threads ### Parameters #### Query Parameters - **agentId** (string) - Optional - Filter by agent ID. - **status** (string) - Optional - Filter by status (active or archived). ``` -------------------------------- ### GET /auth/callback Source: https://docs.sixb.ai/server Completes the authentication flow and mints an httpOnly session cookie. ```APIDOC ## GET /auth/callback ### Description Completes the authentication flow and sets the httpOnly session cookie. ### Method GET ### Endpoint /auth/callback ``` -------------------------------- ### Configure global styles and theme tokens Source: https://docs.sixb.ai/apps Import Sixb UI globals and override CSS variables to customize the application theme. ```CSS @import "@sixb/ui/globals.css"; @source "./**/*.{ts,tsx}"; :root { --background: #f5f6f2; --foreground: #172018; --primary: #1f7a5a; --primary-foreground: #ffffff; --ring: #1f7a5a; } ``` -------------------------------- ### Project structure for connector discovery Source: https://docs.sixb.ai/data/connectors Standard directory layout for automatic connector discovery by the Sixb runtime. ```txt your-project/ connectors/ acme-erp.ts datasets/ erp.ts syncs/ erp.ts sixb.config.ts ``` -------------------------------- ### GET /api/events Source: https://docs.sixb.ai/events HTTP endpoint to query events, scoped by caller authorization. ```APIDOC ## GET /api/events ### Description The server exposes the event log over HTTP. Results are authorization-scoped. ### Method GET ### Endpoint /api/events ### Query Parameters - **topic** (string) - Optional - One topic from EVENT_TOPICS - **type** (string) - Optional - One type from EVENT_TYPES - **afterCursor** (string) - Optional - Page forward from a cursor - **limit** (number) - Optional - Max events to return ### Response - **count** (number) - Number of events returned - **events** (array) - List of events ### Example ```bash curl "http://localhost:3000/api/events?type=object.updated&limit=50" ``` ``` -------------------------------- ### GET /api/agent-threads/:threadId/messages/:messageId/files/content Source: https://docs.sixb.ai/agents/running-and-streaming Downloads the bytes of a file attached to a message. ```APIDOC ## GET /api/agent-threads/:threadId/messages/:messageId/files/content ### Description Downloads the file content associated with a specific message attachment. ### Method GET ### Endpoint /api/agent-threads/:threadId/messages/:messageId/files/content ``` -------------------------------- ### new SmolvmSandboxFactory(options) Source: https://docs.sixb.ai/sandboxes/smolvm Initializes a new factory for creating sandboxes with specific configuration options. ```APIDOC ## new SmolvmSandboxFactory(options) ### Description Initializes a new factory instance for creating sandboxes. Options define the environment, binary path, storage limits, and default network policies. ### Parameters - **image** (string | null) - Optional - A path to a local archive, a registry reference, or null for a bare machine. - **bin** (string) - Optional - The smolvm binary name or absolute path. Default: "smolvm". - **storageGiB** (number) - Optional - Storage limit for OCI layers and container data. Default: 20. - **overlayGiB** (number) - Optional - Persistent rootfs changes limit. Default: 2. - **registryHosts** (string[]) - Optional - Registry hosts added to restricted policies for image pulling. - **env** (Record) - Optional - Default environment variables merged into every sandbox. - **timeout** (number) - Optional - Default per-command timeout in milliseconds. - **network** (SandboxNetworkPolicy) - Optional - Default network policy. Default: { mode: "none" }. ``` -------------------------------- ### GET /api/agent-threads/:threadId/messages/:messageId/files/content Source: https://docs.sixb.ai/agents/running-and-streaming Download a file attached to a specific message. ```APIDOC ## GET /api/agent-threads/:threadId/messages/:messageId/files/content ### Description Download a file attached to a message. ### Method GET ### Endpoint /api/agent-threads/:threadId/messages/:messageId/files/content ### Parameters #### Path Parameters - **threadId** (string) - Required - The ID of the thread. - **messageId** (string) - Required - The ID of the message. ``` -------------------------------- ### createSixb(config) Source: https://docs.sixb.ai/data/datasets Initializes the Sixb instance and registers datasets for the project. ```APIDOC ## createSixb(config) ### Description Initializes the Sixb instance. Datasets can be discovered automatically from the `datasets/` directory or registered explicitly via the configuration object. ### Parameters - **config** (Object) - Required - Configuration object. - **datasets** (Dataset[]) - Optional - An array of dataset definitions to register. ``` -------------------------------- ### Run projection worker Source: https://docs.sixb.ai/data/projections Command to start a separate projection worker process. ```bash sixb worker projection ``` -------------------------------- ### Project Directory Structure Source: https://docs.sixb.ai/data/syncs Recommended file organization for a Sixb project including the syncs directory. ```txt your-project/ connectors/ acme-erp.ts datasets/ erp.ts schedules/ erp.ts syncs/ erp.ts sixb.config.ts ``` -------------------------------- ### GET /api/workflow-interventions Source: https://docs.sixb.ai/workflows/interventions List interventions with optional filtering by status, workflow identifiers, and timestamps. ```APIDOC ## GET /api/workflow-interventions ### Description List interventions. Filter by status, workflowId, workflowRunId, nodeRunId, interventionId, and requestedAfter / requestedBefore. ### Method GET ### Endpoint /api/workflow-interventions ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by intervention status - **workflowId** (string) - Optional - Filter by workflow ID - **workflowRunId** (string) - Optional - Filter by workflow run ID - **nodeRunId** (string) - Optional - Filter by node run ID - **interventionId** (string) - Optional - Filter by intervention ID - **requestedAfter** (string) - Optional - Filter by start timestamp - **requestedBefore** (string) - Optional - Filter by end timestamp ``` -------------------------------- ### Initialize ObjectSet and fetch instances Source: https://docs.sixb.ai/objects Demonstrates how to initialize an ObjectSet for a specific type and perform basic retrieval operations. ```typescript const invoices = sixb.objects(Invoice) const invoice = await invoices.get("inv-001") const handle = invoices.byId("inv-001") ``` -------------------------------- ### GET /api/status Source: https://docs.sixb.ai/server Reports the status of the cached outbox, retry, cleanup, and maintenance state. ```APIDOC ## GET /api/status ### Description Reports the system status; returns 'degraded' if maintenance or background tasks are failing, without removing the API from traffic. ### Method GET ### Endpoint /api/status ``` -------------------------------- ### Bootstrap Sixb Browser Client Source: https://docs.sixb.ai/client Initializes the browser client and handles authentication sessions. Ensure this is only used for standalone app bootstrapping. ```typescript import { configureSixbBrowserClient, readSixbBrowserRuntimeConfig, requireSixbBrowserAuthSession, } from "@sixb/client/browser" const config = readSixbBrowserRuntimeConfig({ audience: "app" }) const browserClient = configureSixbBrowserClient(config) if (config.auth.enabled) { await requireSixbBrowserAuthSession(config, browserClient) } if (import.meta.hot) { import.meta.hot.dispose(() => browserClient.dispose()) } ``` -------------------------------- ### GET /health Source: https://docs.sixb.ai/server Checks if the API process is alive and able to serve HTTP requests. ```APIDOC ## GET /health ### Description Returns 200 while the process is alive and can serve HTTP. ### Method GET ### Endpoint /health ``` -------------------------------- ### GET /api/agent-runs/:runId Source: https://docs.sixb.ai/agents/running-and-streaming Retrieves the current status and details of a specific agent run. ```APIDOC ## GET /api/agent-runs/:runId ### Description Returns the run record, including status (queued, running, succeeded, failed, cancelled), usage statistics, and finish reason. ### Method GET ### Endpoint /api/agent-runs/:runId ``` -------------------------------- ### Initialize Default Vercel Sandbox Source: https://docs.sixb.ai/sandboxes/vercel Configures a standard sandbox with defined command and session timeouts. ```ts new VercelSandboxFactory({ timeout: 30_000, sessionTimeoutMs: 10 * 60_000, }) ``` -------------------------------- ### GET /api/object-types Source: https://docs.sixb.ai/agents/tools-and-gateway Retrieves a list of object types or a specific object type by ID. ```APIDOC ## GET /api/object-types ### Description Retrieves a list of object types. ### Method GET ### Endpoint /api/object-types ## GET /api/object-types/:id ### Description Retrieves a specific object type by ID. ### Method GET ### Endpoint /api/object-types/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the object type. ``` -------------------------------- ### createSixb Source: https://docs.sixb.ai/data/connectors Initializes the Sixb runtime and registers connectors. ```APIDOC ## createSixb(options) ### Description Initializes the Sixb application. Connectors can be discovered automatically from the `connectors/` directory or registered explicitly via the `connectors` array. ### Parameters - **connectors** (Array) - Optional - A list of connector definitions to register with the runtime. ``` -------------------------------- ### Project Directory Structure Source: https://docs.sixb.ai/workflows Standard project layout for automatic discovery of actions, ontology, and workflows. ```text your-project/ actions/ send-reminder.ts ontology/ invoice.ts workflows/ invoice-reminder.ts sixb.config.ts ``` -------------------------------- ### Run worker group Source: https://docs.sixb.ai/deployment Starts multiple worker types within a single process. ```bash sixb worker-group ``` -------------------------------- ### Cron expression examples Source: https://docs.sixb.ai/schedules Common cron patterns supported by the 5-field expression format. ```text 0 8 * * * every day at 08:00 */5 * * * * every 5 minutes 0 9-17 * * 1-5 every hour, 09:00–17:00, Mon–Fri 0 0 1 * * midnight on the 1st of each month ``` -------------------------------- ### get(id) Source: https://docs.sixb.ai/objects/crud Reads a single object by its primary id. Returns the object or null if it does not exist. ```APIDOC ## get(id) ### Description Reads a single object by its primary id. Returns the object, or null if none exists. ### Parameters - **id** (string) - Required - The primary id of the object to retrieve. ### Response - **primaryId** (string) - The object's primary id - **objectTypeId** (string) - The object type id - **properties** (typed) - Property values inferred from the ontology - **createdAt** (Date) - When the object was first written - **updatedAt** (Date) - When the object was last written ``` -------------------------------- ### Initialize smolvm Sandbox Source: https://docs.sixb.ai/sandboxes/smolvm Configure the Sixb core to use the SmolvmSandboxFactory for agent execution. ```ts import { createSixb } from "@sixb/core" import { SmolvmSandboxFactory } from "@sixb/sandboxes-smolvm" createSixb({ sandboxes: new SmolvmSandboxFactory() }) ``` -------------------------------- ### Configure Sixb Runtime with Vercel Sandbox Source: https://docs.sixb.ai/sandboxes/vercel Initialize the Sixb runtime using the VercelSandboxFactory with custom timeout settings. ```ts import { createSixb } from "@sixb/core" import { VercelSandboxFactory } from "@sixb/sandboxes-vercel" export const sixb = createSixb({ // ...storage, broker, queues, ontology, agents sandboxes: new VercelSandboxFactory({ timeout: 30_000, // default per-command timeout sessionTimeoutMs: 10 * 60_000, // Vercel VM lifetime }), }) ``` -------------------------------- ### Run Workflow Worker in Production Source: https://docs.sixb.ai/workflows Command to start a dedicated worker process for executing workflows. ```bash sixb worker workflow ``` -------------------------------- ### Project structure for security definitions Source: https://docs.sixb.ai/auth/authorization Recommended directory layout for organizing groups, roles, and policies under the security folder. ```txt your-project/ ontology/ invoice.ts customer.ts actions/ sendReminder.ts security/ groups/ team-members.ts finance-admins.ts roles/ billing-access.ts policies/ member-administration.ts sixb.config.ts ``` -------------------------------- ### Configure minimal Sixb instance Source: https://docs.sixb.ai/fundamentals/manual-install Initialize Sixb with in-memory providers in a sixb.config.ts file. ```typescript import { createSixb, InMemoryBlobStorage, InMemoryBroker, InMemoryLakeStorage, InMemoryQueues, InMemoryStorage, } from "@sixb/core" export const sixb = await createSixb({ id: "acme-corp", broker: new InMemoryBroker(), storage: new InMemoryStorage(), lakeStorage: new InMemoryLakeStorage(), blobStorage: new InMemoryBlobStorage(), queues: new InMemoryQueues(), }) ``` -------------------------------- ### GET /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/latest Source: https://docs.sixb.ai/objects/telemetry Retrieves the most recent telemetry point for a specific object property. ```APIDOC ## GET /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/latest ### Description Returns the most recent telemetry point for the specified object property. ### Method GET ### Endpoint /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/latest ``` -------------------------------- ### GET /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/history Source: https://docs.sixb.ai/objects/telemetry Retrieves the historical telemetry data for a specific object property. ```APIDOC ## GET /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/history ### Description Reads historical telemetry points for a given object property within a specified time range. ### Method GET ### Endpoint /api/objects/:objectTypeId/:objectId/telemetry/:propertyId/history ### Parameters #### Query Parameters - **from** (string) - Optional - Inclusive lower bound on timestamp. - **to** (string) - Optional - Inclusive upper bound on timestamp. - **order** (string) - Optional - Sort order, "asc" or "desc". - **limit** (number) - Optional - Maximum number of points to return. ``` -------------------------------- ### Configure the Sixb instance Source: https://docs.sixb.ai/agents Initialize the Sixb instance with a sandbox factory, which is required for the agent's bash tool functionality. ```typescript import { createSixb } from "@sixb/core" import { SmolvmSandboxFactory } from "@sixb/sandboxes-smolvm" export const sixb = createSixb({ id: "acme-corp", // ...storage, broker, queues sandboxes: new SmolvmSandboxFactory(), }) ``` -------------------------------- ### Cross-build and deploy agent image Source: https://docs.sixb.ai/sandboxes/smolvm Builds an image for a specific platform and copies the resulting archive to a remote server. ```bash bun run agent:image --platform linux/amd64 # Built agent image -> ~/.cache/sixb/smolvm/sixb-agent-amd64.tar scp ~/.cache/sixb/smolvm/sixb-agent-amd64.tar server:/opt/sixb/agent.tar ``` -------------------------------- ### Project directory structure Source: https://docs.sixb.ai/data/pipelines Standard directory layout for Sixb projects where pipelines are discovered automatically. ```txt your-project/ datasets/ erp.ts syncs/ erp.ts pipelines/ invoice-reporting.ts projections/ invoices.ts sixb.config.ts ``` -------------------------------- ### sixb.as(context) Source: https://docs.sixb.ai/runtime Derives a principal-scoped SDK from the runtime. ```APIDOC ## sixb.as(context) ### Description Derives a principal-scoped SDK from the runtime. The scoped surface is default-deny; operations run only when the authorization context's grants cover them. ### Parameters - **context** (Object) - Required - The authorization context used to scope the SDK. ``` -------------------------------- ### Configure the Sixb runtime entry Source: https://docs.sixb.ai/fundamentals/project-structure Define the runtime instance by exporting the result of createSixb() from sixb.config.ts. ```ts import { LocalBlobStorage } from "@sixb/blob-local" import { createSixb, InMemoryBroker, InMemoryQueues } from "@sixb/core" import { LocalLakeStorage } from "@sixb/lake-local" import { SqliteStorage } from "@sixb/sqlite" export const sixb = createSixb({ id: "my-sixb-app", broker: new InMemoryBroker(), storage: new SqliteStorage({ path: ".sixb" }), lakeStorage: new LocalLakeStorage({ path: ".sixb/lake" }), blobStorage: new LocalBlobStorage({ basePath: ".sixb" }), queues: new InMemoryQueues(), }) ``` -------------------------------- ### Compare list and query usage Source: https://docs.sixb.ai/objects/crud Demonstrates the difference between a storage-level list scan and a property-based query. ```ts // Storage browse: recent records, no property filter const recent = await invoices.list({ orderBy: "updatedAt", order: "desc", limit: 20 }) // Query: filter by a property value (status is filterable in the ontology) const overdue = await invoices .query() .where((i) => i.p.status.eq("overdue")) .limit(10) .list() ``` -------------------------------- ### GET /api/workflow-interventions/:interventionId Source: https://docs.sixb.ai/workflows/interventions Retrieve a single intervention record including input data and default response values. ```APIDOC ## GET /api/workflow-interventions/:interventionId ### Description Get one record, including input and defaultResponse. ### Method GET ### Endpoint /api/workflow-interventions/:interventionId ### Parameters #### Path Parameters - **interventionId** (string) - Required - The unique identifier of the intervention ``` -------------------------------- ### Explain query execution Source: https://docs.sixb.ai/objects/querying.md Use formatExplanation to render a structured explanation tree of the query for logging or testing purposes. ```ts console.log(query.formatExplanation()) ``` -------------------------------- ### Querying objects with filters and sorting Source: https://docs.sixb.ai/objects/querying.md Demonstrates a basic query chain to filter projects by status, order by deadline, and limit results. ```ts const { objects } = await sixb .objects(Project) .query() .where((project) => project.p.status.eq("active")) .orderBy(Project.p.deadline, "asc") .limit(25) .list() ``` -------------------------------- ### Invalid unit error message Source: https://docs.sixb.ai/ontology/units-and-semantics Example of the error message returned when an invalid unit is provided for a telemetry property. ```txt [Sixb] Invalid unit 'millibar' for Facility.temperature (Temperature) ``` -------------------------------- ### explain() and formatExplanation() Source: https://docs.sixb.ai/objects/querying.md Provides diagnostic information about the query execution plan. ```APIDOC ## explain() / formatExplanation() ### Description `explain()` returns a structured explanation tree of the query. `formatExplanation()` renders this tree as a human-readable string suitable for logs or testing. ``` -------------------------------- ### VercelSandboxFactory Constructor Source: https://docs.sixb.ai/sandboxes/vercel Initializes a new Vercel sandbox factory with specific configuration options. ```APIDOC ## new VercelSandboxFactory(options) ### Description Creates a new instance of the Vercel sandbox factory with the provided configuration options. ### Parameters - **timeout** (number) - Optional - Default per-command timeout in milliseconds. - **sessionTimeoutMs** (number) - Optional - Vercel sandbox session lifetime in milliseconds. - **runtime** (string) - Optional - Stock Vercel runtime: 'node26', 'node24', 'node22', or 'python3.13'. - **image** (string) - Optional - Vercel Container Registry image reference. - **snapshotId** (string) - Optional - Existing Vercel Sandbox snapshot to boot from. - **resources** (object) - Optional - Vercel resources, e.g., { vcpus: number }. - **env** (object) - Optional - Environment variables merged into every sandbox command. - **credentials** (object) - Optional - Explicit Vercel { token, teamId, projectId } for non-OIDC environments. - **persistent** (boolean) - Optional - Defaults to false; set true only if you intentionally want Vercel snapshots. ``` -------------------------------- ### GET /ws/events Source: https://docs.sixb.ai/server Connects to a WebSocket stream of domain events. Clients can subscribe to specific topics, event types, and object types. ```APIDOC ## GET /ws/events ### Description Establishes a WebSocket connection to stream domain events. Upon connection, the server sends a 'connected' control frame. Clients can send 'subscribe' messages to filter the stream. ### Method GET ### Endpoint /ws/events ### Request Example (Subscription Message) { "type": "subscribe", "topic": "objects", "types": ["object.created", "object.updated"], "objectTypeId": "Invoice", "limit": 100 } ```