SocialluxSociallux
Toggle navigation menu
Docs navigationv

Docs

Primitive Library

Authoritative list of system primitives grouped by namespace. This page is generated from live API metadata so descriptions, inputs, and outputs stay aligned with the backend registry.

Access

2 primitives
access.grant

grant

Issue an access grant on a record (atom/verb/lexeme/pixel). The grant widens access for actors matching its rule. Caller must be able to manage the subject.

BETA

Inputs: 9 · Outputs: 1

access.revoke

revoke

Revoke (soft-delete) an access grant. Caller must be the grant issuer or a manager of the subject record.

BETA

Inputs: 1 · Outputs: 2

Array

11 primitives
array.concat

concat

Concatenate an array of arrays into a single new array.

BETA

Inputs: 1 · Outputs: 1

array.contains

contains

Check whether an array contains a value using primitive equality.

BETA

Inputs: 2 · Outputs: 1

array.create

create

Return a new array from provided items. Supports mixed literals and pre-resolved values.

BETA

Inputs: 1 · Outputs: 1

array.filter

filter

Filter an array of objects by a value at a key path. With `contains` (case-insensitive substring) or `equals` (exact). An empty/absent criterion returns the array unchanged, so a blank query is a no-op.

BETA

Inputs: 4 · Outputs: 1

array.filterNullish

filterNullish

Return a new array without null and undefined values.

BETA

Inputs: 1 · Outputs: 1

array.length

length

Return the length of an array.

BETA

Inputs: 1 · Outputs: 1

array.project

project

Project each element of an array into a new object by mapping output keys to source path(s), with first-present fallback and defaults. Lets a read verb shape an atom list into display rows.

BETA

Inputs: 2 · Outputs: 1

array.push

push

Return a new array with a single value or multiple items appended to the end.

BETA

Inputs: 2 · Outputs: 1

array.remove

remove

Return a new array with one element removed by value or by index.

BETA

Inputs: 3 · Outputs: 1

array.sort

sort

Sort an array of objects or primitive values by one or more key paths.

BETA

Inputs: 2 · Outputs: 1

array.unique

unique

Return a new array with duplicate values removed, preserving first-seen order.

BETA

Inputs: 1 · Outputs: 1

Atom

23 primitives
atom.appendDataField

appendDataField

System primitive that appends a single FieldEntry to an atom's data map. Fails if the field name already exists (use a separate update primitive to overwrite).

BETA

Inputs: 6 · Outputs: 2

atom.assignLexeme

assignLexeme

System primitive that assigns one lexeme to an existing atom. Idempotent: already-assigned lexemes are no-ops.

BETA

Inputs: 2 · Outputs: 3

atom.create

create

System primitive that creates an atom with optional initial data, lexemeIds, and visibility.

BETA

Inputs: 4 · Outputs: 2

atom.delete

delete

System primitive that soft-deletes one atom.

BETA

Inputs: 1 · Outputs: 1

atom.findByDataCriteria

findByDataCriteria

List atoms by top-level data field presence and optional primitive value equality.

BETA

Inputs: 9 · Outputs: 2

atom.findOrCreate

findOrCreate

Idempotently return the caller's own atom matching `matchData`, creating it from `data`/`lexemeIds` when absent. Concurrent duplicate creates collapse to a single atom via the owner+namespace+slug partial unique index.

BETA

Inputs: 5 · Outputs: 3

atom.findOrCreateDataField

findOrCreateDataField

Create a data field when missing, otherwise update it, while reusing append/update primitive behavior.

BETA

Inputs: 6 · Outputs: 5

atom.getDataField

getDataField

System primitive that returns one top-level atom.data field value without requiring full-atom handling in composed verbs.

BETA

Inputs: 3 · Outputs: 4

atom.list

list

System primitive that queries atoms visible to the authenticated user. Supports filtering by lexeme, scope, visibility, and organization. Returns a paginated array of serialized atoms.

BETA

Inputs: 8 · Outputs: 2

atom.listShares

listShares

System primitive that lists share grants for one atom.

BETA

Inputs: 1 · Outputs: 1

atom.query

query

System primitive that queries atoms with constrained matcher filters and caller-selected sort.

BETA

Inputs: 11 · Outputs: 2

atom.read

read

System primitive that reads a single atom and returns the public-safe serialized shape.

BETA

Inputs: 1 · Outputs: 1

atom.removeDataField

removeDataField

System primitive that removes one field key from an atom data map.

BETA

Inputs: 2 · Outputs: 3

atom.restore

restore

System primitive that restores a soft-deleted atom.

BETA

Inputs: 1 · Outputs: 1

atom.setNestedDataField

setNestedDataField

Sets a nested FieldEntry under atom.data using a string[] path. Missing intermediate object entries are created automatically.

BETA

Inputs: 4 · Outputs: 4

atom.setPublic

setPublic

System primitive that toggles atom-level isPublic.

BETA

Inputs: 2 · Outputs: 1

atom.share

share

System primitive that adds or updates one atom share grant.

BETA

Inputs: 3 · Outputs: 1

atom.snapshot

snapshot

Sandbox-only primitive that clones an existing atom into the current sandbox session. Used by the verb editor's Test Run panel so a preview verb can mutate a copy of real (PRD) data without touching the original. The clone is owned by the caller, stamped with the sandbox marker, and carries the source atom id and version for diff display.

BETA

Inputs: 1 · Outputs: 2

atom.transferOwnership

transferOwnership

System primitive that transfers atom ownership to a user or organization atom.

BETA

Inputs: 3 · Outputs: 1

atom.unassignLexeme

unassignLexeme

System primitive that removes one lexeme subscription from an atom.

BETA

Inputs: 2 · Outputs: 2

atom.unshare

unshare

System primitive that removes one atom share grant.

BETA

Inputs: 2 · Outputs: 2

atom.updateDataField

updateDataField

System primitive that overwrites an existing FieldEntry on an atom data map.

BETA

Inputs: 7 · Outputs: 3

atom.updateDataFields

updateDataFields

System primitive that writes a bag of top-level atom.data fields by delegating each key to atom.findOrCreateDataField. This is a sequential loop and not a single-document atomic update across all keys.

BETA

Inputs: 5 · Outputs: 3

Audit

1 primitive
audit.match

match

Pure predicate: evaluates a matcher expression against a candidate object and returns whether it matched.

BETA

Inputs: 2 · Outputs: 1

Collection

10 primitives
collection.addMember

addMember

Create a collection membership atom for (collectionRef, targetType, targetId).

BETA

Inputs: 3 · Outputs: 2

collection.archive

archive

Soft-archive a collection by setting data.archived=true.

BETA

Inputs: 1 · Outputs: 1

collection.create

create

Create a collection atom subscribed to system.lexeme.collection.

BETA

Inputs: 10 · Outputs: 1

collection.list

list

List collections visible to the caller, including personal and organization-visible collections.

BETA

Inputs: 5 · Outputs: 2

collection.read

read

Read one collection by atom id.

BETA

Inputs: 1 · Outputs: 1

collection.unassigned

unassigned

List visible records of one targetType that have no active collection membership.

BETA

Inputs: 5 · Outputs: 3

collection.update

update

Update mutable collection fields by collection id.

BETA

Inputs: 10 · Outputs: 1

Data

14 primitives
data.coalesce

coalesce

Return the first non-null and non-undefined value from an array.

BETA

Inputs: 1 · Outputs: 1

data.fromJson

fromJson

Parse JSON text into a value.

BETA

Inputs: 1 · Outputs: 1

data.merge

merge

Shallow merge right object onto left object.

BETA

Inputs: 2 · Outputs: 1

data.omit

omit

Return a shallow object excluding requested keys.

BETA

Inputs: 2 · Outputs: 1

data.pick

pick

Return a shallow object containing only requested keys.

BETA

Inputs: 2 · Outputs: 1

data.toJson

toJson

Serialize a value to JSON text.

BETA

Inputs: 2 · Outputs: 1

data.validateArrayElements

validateArrayElements

Validate that every element in an array matches a selected built-in validator.

BETA

Inputs: 2 · Outputs: 2

data.validateEnum

validateEnum

Validate that a value is included in an allowed primitive-value set.

BETA

Inputs: 2 · Outputs: 2

data.validateObjectShape

validateObjectShape

Validate object key shape against requiredKeys and allowedKeys constraints.

BETA

Inputs: 3 · Outputs: 2

data.validatePattern

validatePattern

Validate that a string matches a provided regular expression.

BETA

Inputs: 3 · Outputs: 2

data.validateRange

validateRange

Validate that a numeric value is within optional min/max bounds.

BETA

Inputs: 3 · Outputs: 2

data.validateRequired

validateRequired

Validate that a value is present (not null/undefined), with optional empty-string allowance.

BETA

Inputs: 2 · Outputs: 2

data.validateStringLength

validateStringLength

Validate that a string length is within optional min/max bounds.

BETA

Inputs: 3 · Outputs: 2

data.validateType

validateType

Validate that a value matches an expected primitive classifier.

BETA

Inputs: 2 · Outputs: 2

Lexeme

15 primitives
lexeme.addField

addField

System primitive that appends one field definition.

BETA

Inputs: 6 · Outputs: 2

lexeme.create

create

System primitive that creates a lexeme.

BETA

Inputs: 5 · Outputs: 1

lexeme.delete

delete

System primitive that soft-deletes a lexeme.

BETA

Inputs: 1 · Outputs: 1

lexeme.list

list

System primitive that returns lexemes visible to the caller.

BETA

Inputs: 6 · Outputs: 2

lexeme.listAtoms

listAtoms

System primitive that lists atoms for a readable lexeme.

BETA

Inputs: 8 · Outputs: 2

lexeme.listShares

listShares

System primitive that lists share grants for one lexeme.

BETA

Inputs: 1 · Outputs: 1

lexeme.read

read

System primitive that reads one lexeme by id.

BETA

Inputs: 1 · Outputs: 1

lexeme.removeField

removeField

System primitive that removes one lexeme field definition.

BETA

Inputs: 2 · Outputs: 2

lexeme.restore

restore

System primitive that restores a soft-deleted lexeme.

BETA

Inputs: 1 · Outputs: 1

lexeme.setCategory

setCategory

System primitive that assigns or clears top-level lexeme category reference.

BETA

Inputs: 2 · Outputs: 1

lexeme.share

share

System primitive that adds or updates a lexeme share grant.

BETA

Inputs: 3 · Outputs: 1

lexeme.snapshot

snapshot

Sandbox-only primitive that clones an existing lexeme into the current sandbox session. Used by the verb editor's Test Run panel so a preview verb can mutate a copy of real (PRD) lexeme data without touching the original. The clone is owned by the caller, stamped with the sandbox marker, and carries the source lexeme id and version for diff display.

BETA

Inputs: 1 · Outputs: 2

lexeme.transferOwnership

transferOwnership

System primitive that transfers lexeme ownership to a user or organization atom.

BETA

Inputs: 3 · Outputs: 1

lexeme.unshare

unshare

System primitive that removes a lexeme share grant.

BETA

Inputs: 2 · Outputs: 2

lexeme.update

update

System primitive that updates lexeme top-level attributes.

BETA

Inputs: 4 · Outputs: 1

Logic

6 primitives
logic.and

and

Return true when all values are truthy.

BETA

Inputs: 1 · Outputs: 1

logic.assert

assert

Throw a typed error when condition is not strictly true.

BETA

Inputs: 4 · Outputs: 1

logic.equals

equals

Deep equality for primitives, arrays, and plain objects.

BETA

Inputs: 3 · Outputs: 1

logic.if

if

Pick thenValue or elseValue based on condition truthiness.

BETA

Inputs: 3 · Outputs: 1

logic.not

not

Return logical negation of a value.

BETA

Inputs: 1 · Outputs: 1

logic.or

or

Return true when any value is truthy.

BETA

Inputs: 1 · Outputs: 1

Math

9 primitives
math.abs

abs

Return absolute value.

BETA

Inputs: 1 · Outputs: 1

math.add

add

Sum an array of numbers.

BETA

Inputs: 1 · Outputs: 1

math.clamp

clamp

Clamp a value within inclusive min and max bounds.

BETA

Inputs: 3 · Outputs: 1

math.divide

divide

Divide a by b.

BETA

Inputs: 2 · Outputs: 1

math.max

max

Return the maximum value from a non-empty number array.

BETA

Inputs: 1 · Outputs: 1

math.min

min

Return the minimum value from a non-empty number array.

BETA

Inputs: 1 · Outputs: 1

math.multiply

multiply

Multiply an array of numbers.

BETA

Inputs: 1 · Outputs: 1

math.round

round

Round a value to a precision using round, floor, or ceil mode.

BETA

Inputs: 3 · Outputs: 1

math.subtract

subtract

Subtract b from a.

BETA

Inputs: 2 · Outputs: 1

Object

8 primitives
object.create

create

Create a plain object from key/value entries, rejecting duplicate keys.

BETA

Inputs: 1 · Outputs: 1

object.entries

entries

Return top-level own entries of a plain object.

BETA

Inputs: 1 · Outputs: 1

object.has

has

Check whether a plain object has a top-level own key.

BETA

Inputs: 2 · Outputs: 1

object.keys

keys

Return top-level own keys of a plain object.

BETA

Inputs: 1 · Outputs: 1

object.merge

merge

Merge an array of plain objects with configurable conflict handling.

BETA

Inputs: 2 · Outputs: 1

object.omit

omit

Return a shallow object excluding requested keys, similar to data.omit.

BETA

Inputs: 2 · Outputs: 1

object.pick

pick

Return a shallow object containing only requested keys, similar to data.pick.

BETA

Inputs: 2 · Outputs: 1

object.set

set

Return a new plain object with a top-level key set to a value.

BETA

Inputs: 3 · Outputs: 1

Permission

5 primitives
permission.assertCurrentUserHas

assertCurrentUserHas

Advisory permission check for the current user based on a license atom. Returns allowed=false instead of throwing for negative checks.

BETA

Inputs: 2 · Outputs: 3

permission.assertOrgRole

assertOrgRole

Assert that the current user has the required effective role for an organization.

BETA

Inputs: 2 · Outputs: 3

permission.findCurrentUserLicenseAtom

findCurrentUserLicenseAtom

Finds the current user's license atom through the standard atom list/read path and returns a serialized atom or null.

BETA

Inputs: 2 · Outputs: 1

permission.grantOrgRole

grantOrgRole

Grant an org role by creating (or reusing) an active org-role-grant atom.

BETA

Inputs: 3 · Outputs: 5

permission.revokeOrgRole

revokeOrgRole

Revoke an active org role grant for a user in an organization.

BETA

Inputs: 3 · Outputs: 5

Pixel

8 primitives
pixel.create

create

System primitive that creates a pixel contract.

BETA

Inputs: 5 · Outputs: 1

pixel.list

list

System primitive that returns pixels visible to the caller.

BETA

Inputs: 6 · Outputs: 2

pixel.listShares

listShares

System primitive that lists share grants for one pixel.

BETA

Inputs: 1 · Outputs: 1

pixel.read

read

System primitive that reads one pixel by id.

BETA

Inputs: 1 · Outputs: 1

pixel.setCategory

setCategory

System primitive that assigns or clears top-level pixel category reference.

BETA

Inputs: 2 · Outputs: 1

pixel.transferOwnership

transferOwnership

System primitive that transfers pixel ownership to a user or organization atom.

BETA

Inputs: 3 · Outputs: 1

pixel.update

update

System primitive that updates a pixel contract.

BETA

Inputs: 7 · Outputs: 1

pixel.validate

validate

Validate a pixel contract without saving or changing any platform data.

BETA

Inputs: 1 · Outputs: 2

Secret

4 primitives
secret.decrypt

decrypt

Admin-only: decrypts a sensitive-field envelope under a specified owner KEK. Prefer secret.reveal for application use.

BETA

Inputs: 2 · Outputs: 1

secret.encrypt

encrypt

Encrypts a JSON value into a sensitive-field envelope (SOCIALLUX_THEORY §13).

BETA

Inputs: 2 · Outputs: 1

secret.reveal

reveal

Authorizes and decrypts a single sensitive field on a single atom. Emits a `secret.revealed` audit event.

BETA

Inputs: 2 · Outputs: 3

secret.rewrap

rewrap

Re-wraps every sensitive envelope on an atom under a new owner KEK without re-encrypting ciphertext (SOCIALLUX_THEORY §13.3).

BETA

Inputs: 3 · Outputs: 2

String

9 primitives
string.concat

concat

Join an array of values into a single string with an optional separator.

BETA

Inputs: 2 · Outputs: 1

string.format

format

Substitute {{key}} placeholders in a template with values from a provided object.

BETA

Inputs: 2 · Outputs: 1

string.includes

includes

Check whether text includes, starts with, or ends with search text.

BETA

Inputs: 3 · Outputs: 1

string.length

length

Return the character length of text.

BETA

Inputs: 1 · Outputs: 1

string.lower

lower

Convert text to lowercase.

BETA

Inputs: 1 · Outputs: 1

string.replace

replace

Perform literal find-and-replace on a string.

BETA

Inputs: 4 · Outputs: 2

string.split

split

Split text into an array using a literal separator.

BETA

Inputs: 3 · Outputs: 1

string.trim

trim

Trim leading and trailing whitespace from text.

BETA

Inputs: 1 · Outputs: 1

string.upper

upper

Convert text to uppercase.

BETA

Inputs: 1 · Outputs: 1

Surface

2 primitives
surface.extract

extract

Extract a permission-trimmed surface.v1 manifest for a collection within an organization.

BETA

Inputs: 5 · Outputs: 16

surface.publish

publish

Publish a stable surface snapshot atom with canonical manifest hash and previous snapshot link.

BETA

Inputs: 5 · Outputs: 1

Time

5 primitives
time.add

add

Add a time amount to an instant.

BETA

Inputs: 3 · Outputs: 1

time.compare

compare

Compare two instants and return -1, 0, or 1.

BETA

Inputs: 2 · Outputs: 1

time.diff

diff

Return signed time delta from one instant to another.

BETA

Inputs: 3 · Outputs: 1

time.format

format

Format an instant as ISO, unix, date, or time output.

BETA

Inputs: 2 · Outputs: 1

time.now

now

Return the current instant in ISO or unix formats.

BETA

Inputs: 1 · Outputs: 1

Trigger

1 primitive
trigger.fire

fire

Fire a single trigger atom against an originating AuditEvent, applying matcher/self-loop/depth guards.

BETA

Inputs: 2 · Outputs: 1

User

5 primitives
user.findByEmail

findByEmail

System primitive that looks up a share-target user by email.

BETA

Inputs: 1 · Outputs: 1

user.findById

findById

System primitive that looks up a share-target user by ObjectId.

BETA

Inputs: 1 · Outputs: 1

user.listOrganizationMembers

listOrganizationMembers

System primitive that lists organization members and effective org roles.

BETA

Inputs: 1 · Outputs: 2

user.me

me

System primitive that returns auth/me-equivalent user context.

BETA

Inputs: 0 · Outputs: 1

user.whoami

whoami

System primitive that returns a summary of the calling user.

BETA

Inputs: 0 · Outputs: 1

Value

2 primitives
value.isEmpty

isEmpty

Return true for null/undefined/empty string/empty array/empty object.

BETA

Inputs: 1 · Outputs: 1

value.typeOf

typeOf

Return a normalized type discriminator.

BETA

Inputs: 1 · Outputs: 1

Verb

8 primitives
verb.contract

contract

Returns a developer-facing contract for a verb: how to call it, the inputs it needs, the output shape, and an example invocation.

BETA

Inputs: 1 · Outputs: 3

verb.create

create

System primitive that creates a user-authored verb definition.

BETA

Inputs: 1 · Outputs: 1

verb.list

list

System primitive that returns verbs visible to the caller.

BETA

Inputs: 6 · Outputs: 2

verb.listShares

listShares

System primitive that lists share grants for one verb.

BETA

Inputs: 1 · Outputs: 1

verb.read

read

System primitive that reads one verb by id.

BETA

Inputs: 1 · Outputs: 1

verb.setCategory

setCategory

System primitive that assigns or clears top-level verb category reference.

BETA

Inputs: 2 · Outputs: 1

verb.transferOwnership

transferOwnership

System primitive that transfers verb ownership to a user or organization atom.

BETA

Inputs: 3 · Outputs: 1

verb.update

update

System primitive that updates a user-authored verb definition.

BETA

Inputs: 2 · Outputs: 1