diff --git a/.gitignore b/.gitignore index 4905cf4fd..f45a336d0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,11 +17,6 @@ core/lib/* executor/lib/* coverage .DS_store -docs-src/api.md -docs-src/typedoc -docs-src/_book -docs-src/.next -docs-src/pages/jsdoc host/dist host/build @@ -66,7 +61,12 @@ rust-executor/CUSTOM_DENO_SNAPSHOT.bin rust-executor/test_data .npmrc -docs-src/ +docs-src/out +docs-src/api.md +docs-src/typedoc +docs-src/_book +docs-src/.next +docs-src/pages/jsdoc .worktrees/ CUSTOM_DENO_SNAPSHOT.bin waker-bridge/package-lock.json diff --git a/docs-src/next.config.js b/docs-src/next.config.js new file mode 100644 index 000000000..394191848 --- /dev/null +++ b/docs-src/next.config.js @@ -0,0 +1,9 @@ +const withNextra = require("nextra")({ + theme: "nextra-theme-docs", + themeConfig: "./theme.config.tsx", +}); + +module.exports = withNextra({ + images: { unoptimized: true }, + output: "export", +}); diff --git a/docs-src/package.json b/docs-src/package.json index b0ce7d7b3..3a2bfb6c7 100644 --- a/docs-src/package.json +++ b/docs-src/package.json @@ -6,13 +6,13 @@ "scripts": { "dev": "next dev", "start": "next start", - "build": "pnpm run typedoc && next build", + "build": "pnpm run typedoc && next build && rm -rf ../docs && mv out ../docs", "typedoc": "typedoc --options typedoc.json ../core/src" }, "dependencies": { "next": "^13.0.6", - "nextra": "latest", - "nextra-theme-docs": "latest", + "nextra": "^2.13.4", + "nextra-theme-docs": "^2.13.4", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/docs-src/pages/developer-guides/batch-operations.mdx b/docs-src/pages/developer-guides/batch-operations.mdx index a3257f4d7..669402f9f 100644 --- a/docs-src/pages/developer-guides/batch-operations.mdx +++ b/docs-src/pages/developer-guides/batch-operations.mdx @@ -1,7 +1,7 @@ # Batch Operations ## Overview -Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This feature is particularly useful when you need to perform multiple related changes that should either all succeed or all fail together, or when you want to optimize performance by reducing the number of internal engine updates (SurrealDB indexing, and Prolog inference if activated) and network operations. +Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This is useful when you need to perform multiple related changes that should either all succeed or all fail together, and when you want to optimize performance by reducing internal engine updates (SurrealDB indexing, and Prolog inference if activated) and network operations. ## Key Benefits @@ -16,107 +16,150 @@ Batch operations in AD4M allow you to group multiple perspective mutations into - Batches network operations for shared perspectives - Improves overall system responsiveness when making multiple changes -## Using Batch Operations +## Using Transactions -### Basic Usage with PerspectiveProxy +The recommended way to use batch operations is `Ad4mModel.transaction()`, which creates a batch, runs your callback, and commits only on success: ```typescript -// Create a new batch -const batchId = await perspective.createBatch(); +await Ad4mModel.transaction(perspective, async (tx) => { + const recipe = await Recipe.create(perspective, { name: "Cake" }, { batchId: tx.batchId }); -try { - // Add multiple links in the batch - await perspective.add(link1, 'shared', batchId); - await perspective.add(link2, 'shared', batchId); - - // Remove a link in the same batch - await perspective.remove(oldLink, batchId); - - // Update a link in the batch - await perspective.update(existingLink, newLink, batchId); - - // Commit all changes atomically - const result = await perspective.commitBatch(batchId); - console.log('Added:', result.additions.length); - console.log('Removed:', result.removals.length); -} catch (error) { - // If any operation fails, none of the changes are applied - console.error('Batch operation failed:', error); -} + const comment = new Comment(perspective); + comment.body = "Looks great!"; + await comment.save(tx.batchId); + + // Relation methods also accept batchId + await recipe.addComments(comment, tx.batchId); +}); +// All operations commit together, or none do if an error is thrown ``` -### Using Batches with Ad4mModel +If any operation inside the callback throws, the batch is never committed and no changes are persisted. + +### Complex Data Models + +When your application needs to maintain relationships between multiple entities: ```typescript -// Create a batch for model operations -const batchId = await perspective.createBatch(); +await Ad4mModel.transaction(perspective, async (tx) => { + const userProfile = await UserProfile.create(perspective, { name: "Alice" }, { batchId: tx.batchId }); + const userSettings = await UserSettings.create(perspective, { theme: "dark" }, { batchId: tx.batchId }); -try { - // Create a new model instance - const recipe = new Recipe(perspective); - recipe.title = "Chocolate Cake"; - recipe.ingredients = ["Sugar", "Flour", "Cocoa"]; - await recipe.save(batchId); + for (const preference of userPreferences) { + await preference.save(tx.batchId); + } +}); +``` - // Update another model in the same batch - const existingRecipe = await Recipe.findAll(perspective)[0]; - existingRecipe.title = "Updated Title"; - await existingRecipe.update(batchId); +### Bulk Operations - // Delete a model in the batch - await anotherRecipe.delete(batchId); +When performing operations on multiple items: - // Commit all model changes together - await perspective.commitBatch(batchId); -} catch (error) { - console.error('Model batch operations failed:', error); -} +```typescript +await Ad4mModel.transaction(perspective, async (tx) => { + for (const task of tasks) { + task.status = 'completed'; + await task.save(tx.batchId); + } +}); ``` -## When to Use Batch Operations +### State Transitions + +When an operation requires multiple coordinated changes: -### 1. Complex Data Models -When your application needs to maintain relationships between multiple entities: ```typescript -const batchId = await perspective.createBatch(); +await Ad4mModel.transaction(perspective, async (tx) => { + await sourceList.removeTask(task, tx.batchId); + await targetList.addTask(task, tx.batchId); + task.status = 'moved'; + await task.save(tx.batchId); +}); +``` -// Create a user profile with related entities -await userProfile.save(batchId); -await userSettings.save(batchId); -for (const preference of userPreferences) { - await preference.save(batchId); -} +### Creating Related Subjects -await perspective.commitBatch(batchId); +```typescript +await Ad4mModel.transaction(perspective, async (tx) => { + // Create main subject + const post = await BlogPost.create(perspective, { title: "My First Post" }, { batchId: tx.batchId }); + + // Create related subjects + const comments = initialComments.map(text => { + const c = new Comment(perspective); + c.content = text; + c.postId = post.id; + return c; + }); + + // Save all related subjects in the same transaction + await Promise.all(comments.map(c => c.save(tx.batchId))); +}); ``` -### 2. Bulk Operations -When performing operations on multiple items: +### Validation Before Commit + +Validate data before any writes — if validation fails, the thrown error prevents commit: + ```typescript -const batchId = await perspective.createBatch(); +await Ad4mModel.transaction(perspective, async (tx) => { + // Validate all ingredients first + for (const ingredient of ingredients) { + if (!await validateIngredient(ingredient)) { + throw new Error(`Invalid ingredient: ${ingredient}`); + } + } -// Bulk status update -for (const task of tasks) { - task.status = 'completed'; - await task.update(batchId); -} + // If all valid, proceed with updates + recipe.ingredients = ingredients; + await recipe.save(tx.batchId); -await perspective.commitBatch(batchId); + // Create ingredient references + for (const ingredient of ingredients) { + const ref = new IngredientReference(perspective); + ref.recipeId = recipe.id; + ref.ingredientId = ingredient.id; + await ref.save(tx.batchId); + } +}); +// Nothing is persisted if validation threw ``` -### 3. State Transitions -When an operation requires multiple coordinated changes: +## Advanced: Manual Batch Control + +For lower-level control (e.g. mixing model operations with raw link operations), you can manage batches directly via `PerspectiveProxy`: + ```typescript const batchId = await perspective.createBatch(); -// Moving a task between lists -await sourceList.removeTask(task, batchId); -await targetList.addTask(task, batchId); -await task.updateStatus('moved', batchId); +try { + // Add multiple links in the batch + await perspective.add(link1, 'shared', batchId); + await perspective.add(link2, 'shared', batchId); + + // Remove a link in the same batch + await perspective.remove(oldLink, batchId); + + // Update a link in the batch + await perspective.update(existingLink, newLink, batchId); -await perspective.commitBatch(batchId); + // Model operations also accept batchId + const recipe = new Recipe(perspective); + recipe.title = "Chocolate Cake"; + await recipe.save(batchId); + + // Commit all changes atomically + const result = await perspective.commitBatch(batchId); + console.log('Added:', result.additions.length); + console.log('Removed:', result.removals.length); +} catch (error) { + // If any operation fails, none of the changes are applied + console.error('Batch operation failed:', error); +} ``` +Under the hood, `Ad4mModel.transaction()` calls `createBatch()` and `commitBatch()` for you. + ## Technical Details ### Batch Storage @@ -135,32 +178,15 @@ await perspective.commitBatch(batchId); ## Best Practices -1. **Batch Size** - - Keep batches focused on related operations - - Avoid extremely large batches that could impact memory usage - - Consider splitting very large operations into multiple smaller batches - -2. **Error Handling** - ```typescript - const batchId = await perspective.createBatch(); - try { - // Perform batch operations - await perspective.commitBatch(batchId); - } catch (error) { - // Handle errors appropriately - // No changes will be persisted - } - ``` - -3. **Resource Management** - - Commit or abandon batches in a timely manner - - Don't keep batches open longer than necessary - - Consider using async/await patterns for better control flow - -4. **Testing** - - Test both successful and failed batch scenarios - - Verify data consistency after batch operations - - Include edge cases in your test suite +1. **Prefer `transaction()`**: Use `Ad4mModel.transaction()` over manual `createBatch()`/`commitBatch()` — if the callback throws, the batch is not committed and no changes are persisted. + +2. **Batch Size**: Keep batches focused on related operations. Avoid extremely large batches that could impact memory usage — split very large operations into multiple smaller batches. + +3. **Error Handling**: With `transaction()`, errors thrown inside the callback automatically prevent commit. With manual batches, wrap operations in try/catch. + +4. **Resource Management**: Don't keep batches open longer than necessary. With `transaction()` this is handled for you. + +5. **Testing**: Test both successful and failed batch scenarios. Verify data consistency after batch operations. ## Limitations and Considerations @@ -176,73 +202,26 @@ await perspective.commitBatch(batchId); - For shared perspectives, ensure stable network connectivity before committing large batches - Consider implementing retry logic for network-related failures -## Examples +## Migration Guide + +Existing code using manual `createBatch()`/`commitBatch()` will continue to work. To modernize: -### Complex Subject Creation ```typescript +// Before: manual batch management const batchId = await perspective.createBatch(); +try { + await recipe.save(batchId); + await comment.save(batchId); + await perspective.commitBatch(batchId); +} catch (error) { + console.error(error); +} -// Create main subject -const post = new BlogPost(perspective); -post.title = "My First Post"; -await post.save(batchId); - -// Create related subjects -const comments = initialComments.map(comment => { - const c = new Comment(perspective); - c.content = comment; - c.postId = post.baseExpression; - return c; +// After: transaction() handles it +await Ad4mModel.transaction(perspective, async (tx) => { + await recipe.save(tx.batchId); + await comment.save(tx.batchId); }); - -// Save all related subjects in the same batch -await Promise.all(comments.map(c => c.save(batchId))); - -// Commit everything together -await perspective.commitBatch(batchId); ``` -### Batch Processing with Validation -```typescript -async function updateRecipeWithIngredients(recipe, ingredients) { - const batchId = await perspective.createBatch(); - - try { - // Validate all ingredients first - for (const ingredient of ingredients) { - if (!await validateIngredient(ingredient)) { - throw new Error(`Invalid ingredient: ${ingredient}`); - } - } - - // If all valid, proceed with updates - recipe.ingredients = ingredients; - await recipe.update(batchId); - - // Create ingredient references - for (const ingredient of ingredients) { - const ref = new IngredientReference(perspective); - ref.recipeId = recipe.baseExpression; - ref.ingredientId = ingredient.id; - await ref.save(batchId); - } - - await perspective.commitBatch(batchId); - } catch (error) { - // No changes are persisted if any operation fails - throw new Error(`Failed to update recipe: ${error.message}`); - } -} -``` - -## Migration Guide - -Existing code will continue to work without modification. To adopt batch operations: - -1. Identify groups of related operations in your code -2. Create a batch using `perspective.createBatch()` -3. Add the `batchId` parameter to your operations -4. Wrap operations in try/catch blocks -5. Commit the batch when all operations are complete - -No schema changes or data migration is required to use this feature. \ No newline at end of file +No schema changes or data migration is required. diff --git a/docs-src/pages/developer-guides/hooks.mdx b/docs-src/pages/developer-guides/hooks.mdx index 0593788ee..e260aba3f 100644 --- a/docs-src/pages/developer-guides/hooks.mdx +++ b/docs-src/pages/developer-guides/hooks.mdx @@ -147,37 +147,40 @@ function PerspectivesList({ client }) { } ``` -## useModel +## useLiveQuery -Provides a convenient way to query and subscribe to AD4M models with pagination support. +Provides reactive, live-updating access to AD4M model data with support for collections, single instances, pagination, and parent-scoped queries. Replaces the previous `useModel` hook. + +### Collection Mode (default) ```typescript -import { useModel } from '@coasys/ad4m-react-hooks'; +import { useLiveQuery } from '@coasys/ad4m-react-hooks'; import { Todo } from './models/Todo'; function TodoList({ perspective }) { - const { entries, loading, error, totalCount, loadMore } = useModel({ + const { data, loading, error, totalCount, loadMore } = useLiveQuery( + Todo, perspective, - model: Todo, - query: { /* optional query parameters */ }, - pageSize: 10, // Optional - enables pagination - preserveReferences: true // Optional - improves rendering performance - }); + { + query: { where: { status: "active" } }, + pageSize: 10, + } + ); if (error) return
Error: {error}
; - if (loading && entries.length === 0) return
Loading...
; + if (loading && data.length === 0) return
Loading...
; return (

Todos ({totalCount})

- {entries.map(todo => ( -
+ {data.map(todo => ( +

{todo.title}

{todo.description}

))} - {entries.length < totalCount && ( + {data.length < totalCount && ( @@ -187,6 +190,86 @@ function TodoList({ perspective }) { } ``` +### Single-Instance Mode + +When you provide `id` in options, the hook returns a single item instead of an array: + +```typescript +function TodoDetail({ perspective, todoId }) { + const { data: todo, loading, error } = useLiveQuery( + Todo, + perspective, + { id: todoId } + ); + + if (loading) return
Loading...
; + if (error) return
Error: {error}
; + if (!todo) return
Not found
; + + return

{todo.title}

; +} +``` + +### Parent-Scoped Queries + +Filter results to children of a specific parent: + +```typescript +function RecipeComments({ perspective, recipe }) { + const { data: comments } = useLiveQuery( + Comment, + perspective, + { + parent: { model: Recipe, id: recipe.id } + } + ); + + return ( +
    + {comments.map(c =>
  • {c.body}
  • )} +
+ ); +} +``` + +### Return Types + +**Collection mode** (`LiveCollectionResult`): +- `data: T[]` — Array of model instances +- `loading: boolean` — Whether a query is in progress +- `error: string` — Error message if any +- `totalCount: number` — Total matching items (for pagination) +- `loadMore: () => void` — Load next page + +**Single-instance mode** (`LiveInstanceResult`): +- `data: T | null` — The model instance or null +- `loading: boolean` +- `error: string` + +### Vue Usage + +The Vue hook has the same API but returns Vue `Ref`-wrapped values and accepts `ComputedRef` for the perspective parameter: + +```typescript +import { useLiveQuery } from '@coasys/ad4m-vue-hooks'; + +const { data, loading, error, totalCount, loadMore } = useLiveQuery( + Todo, + perspective, // Can be a ComputedRef + { pageSize: 10 } +); + +// data.value is T[] (collection) or T | null (single-instance) +``` + +The Vue hook automatically re-subscribes when the perspective ref changes, and cleans up subscriptions on unmount. + +### Important Notes + +- **Registration**: Call `.register(perspective)` once at app startup (e.g., `await Recipe.register(perspective)`) — the hook does **not** register models automatically. Use the concrete generated class, not the `@Model` decorator. +- **Cleanup**: Subscriptions are automatically disposed on component unmount. +- **String model support**: You can pass a model class name string instead of a class for dynamic/generic use cases. + ## Best Practices 1. **Always handle loading and error states** @@ -221,14 +304,7 @@ function TodoList({ perspective }) { 5. **Use TypeScript for better type safety** ```typescript - interface TodoSubject { - id: string; - title: string; - description: string; - } - - const { entries } = useSubjects({ - perspective, - subject: 'Todo' - }); + // useLiveQuery is fully typed — generics are inferred from the model class + const { data } = useLiveQuery(Todo, perspective); + // data is Todo[] with full autocomplete ``` diff --git a/docs-src/pages/developer-guides/model-classes.mdx b/docs-src/pages/developer-guides/model-classes.mdx index 15ef406e6..8ee504b7c 100644 --- a/docs-src/pages/developer-guides/model-classes.mdx +++ b/docs-src/pages/developer-guides/model-classes.mdx @@ -1,35 +1,46 @@ import { Tab, Tabs } from "nextra-theme-docs"; +import { Callout } from "nextra/components"; # Model Classes in AD4M -Model classes in AD4M provide a way to define, store, and query structured data in your application. Let's start with a simple example that we'll build upon: +Model classes in AD4M provide a way to define, store, and query structured data in your application. They follow familiar ORM conventions (ActiveRecord-style) and generate SHACL schemas automatically. ## Quick Start There are two ways to create model classes in AD4M: -### Option 1: Using Decorators (Traditional) +### Option 1: Using Decorators (Recommended) ```typescript -import { Ad4mModel, ModelOptions, Property } from '@coasys/ad4m'; +import { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m'; -@ModelOptions({ name: "Recipe" }) +@Model({ name: "Recipe" }) class Recipe extends Ad4mModel { - @Property({ - through: "recipe://name", - resolveLanguage: "literal" - }) + @Property({ through: "recipe://name" }) name: string = ""; + + @HasMany({ through: "recipe://ingredient" }) + ingredients: string[] = []; } +// Register the model with a perspective (once at app startup) +await Recipe.register(perspective); + // Using the model const recipe = new Recipe(perspective); recipe.name = "Chocolate Cake"; +recipe.ingredients = ["flour", "sugar", "cocoa"]; await recipe.save(); // Reading it back const recipes = await Recipe.findAll(perspective); console.log(recipes[0].name); // "Chocolate Cake" + +// Or use the static create shorthand +const cake = await Recipe.create(perspective, { + name: "Chocolate Cake", + ingredients: ["flour", "sugar", "cocoa"] +}); ``` ### Option 2: From JSON Schema (Dynamic) @@ -70,128 +81,226 @@ recipe.difficulty = 3; await recipe.save(); ``` -Before using any model class, register it with your perspective: +Register your model before use: ```typescript -await perspective.ensureSDNASubjectClass(Recipe); +await Recipe.register(perspective); ``` + + Always register your model classes with the perspective before use (typically once at app startup). + This installs the SHACL schema so that all consumers (JS, Rust, MCP, CLI) can discover and work with your model's shape. + + ## Basic Concepts ### Properties -Properties are the basic building blocks of your models. They can be required or optional: +Properties are the basic building blocks of your models. They are **optional by default** — no link is created in the graph until you explicitly set a value. ```typescript -@ModelOptions({ name: "Recipe" }) +@Model({ name: "Recipe" }) class Recipe extends Ad4mModel { - // Required property - @Property({ - through: "recipe://name", - resolveLanguage: "literal" - }) + // Optional property (default) — only stored when explicitly set + @Property({ through: "recipe://name" }) name: string = ""; - // Optional property - @Optional({ - through: "recipe://description", - resolveLanguage: "literal" - }) + // Optional property — same behavior + @Property({ through: "recipe://description" }) description?: string; + + // Required property — a placeholder link is created on save + @Property({ through: "recipe://category", required: true }) + category: string = ""; + + // Read-only computed property — `through` acts as the SHACL predicate + // identifier; the actual value comes from the custom `getter` expression. + @ReadOnly({ + through: "recipe://rating", + getter: `math::mean(->link[WHERE predicate = 'recipe://user_rating'].out.uri)` + }) + averageRating: number = 0; } ``` -### Collections + + `@Property` smart defaults: `required: false`, `readOnly: false`, `resolveLanguage: "literal"`. + You only need to specify `through` in the common case. + -Collections represent one-to-many relationships: + + **`through` on computed properties**: Even when using a custom `getter`, `through` is still required — it serves as the SHACL predicate identifier in the generated shape, making the property discoverable by other consumers (MCP, CLI, other apps). No link is written at this predicate; the value is entirely derived from the getter expression. + -```typescript -@ModelOptions({ name: "Recipe" }) -class Recipe extends Ad4mModel { - @Property({ - through: "recipe://name", - resolveLanguage: "literal" - }) - name: string = ""; +#### All property options - @Collection({ through: "recipe://ingredient" }) - ingredients: string[] = []; -} +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `through` | `string` | *(required)* | Predicate URI for the link | +| `required` | `boolean` | `false` | If true, a placeholder link is created on save even if the value is empty | +| `readOnly` | `boolean` | `false` | Prevents updates after creation | +| `resolveLanguage` | `string` | `"literal"` | Language used to resolve the stored value. Use `"literal"` for simple values, or a Language address for richer content | +| `initial` | `any` | — | Default value written on creation. When `required: true` with no `initial`, the framework uses a sentinel value (`"literal://string:uninitialized"`) | +| `local` | `boolean` | `false` | Store locally only — not synced to the network. Useful for user preferences or draft state | +| `getter` | `string` | — | Raw SurrealQL expression for computed values. `Base` is replaced with the instance's node ID at query time. Mutually exclusive with regular storage | +| `transform` | `(value: any) => any` | — | Post-retrieval transformation function, called after the value is hydrated | -// Using collections -const recipe = new Recipe(perspective); -recipe.name = "Chocolate Cake"; -recipe.ingredients = ["flour", "sugar", "cocoa"]; -await recipe.save(); +You can also use the `@Optional` decorator as an alias for `@Property` with `required: false` (the default), if you want to be explicit: + +```typescript +@Optional({ through: "recipe://description" }) +description?: string; ``` -## Working with Models +#### The `getter` option in detail -### Creating & Saving +The `getter` option accepts a raw SurrealQL expression. The framework wraps it as: +```sql +SELECT ({getter}) AS value FROM node WHERE uri = {instanceId} +``` + +Use `Base` as a placeholder for the current instance's node — it gets replaced at query time: ```typescript -// Create new instance -const recipe = new Recipe(perspective); -recipe.name = "Chocolate Cake"; -await recipe.save(); +@ReadOnly({ + through: "recipe://rating", + getter: `math::mean(Base->link[WHERE predicate = 'recipe://user_rating'].out.uri)` +}) +averageRating: number = 0; +``` -// Create with specific ID -const recipe = new Recipe(perspective, "recipe://chocolate-cake"); -await recipe.save(); +#### The `transform` option + +Apply a transformation after a value is retrieved from the graph: + +```typescript +@Property({ + through: "recipe://tags_raw", + transform: (value) => typeof value === 'string' ? value.split(',') : value +}) +tags: string[] = []; ``` -### Reading & Updating +### Relations + +Relations represent associations between models. AD4M provides four relation decorators that make the relationship semantics explicit: ```typescript -// Get by ID -const recipe = new Recipe(perspective, existingId); -await recipe.get(); +import { + Ad4mModel, Model, Property, + HasMany, HasOne, BelongsToOne, BelongsToMany +} from '@coasys/ad4m'; + +@Model({ name: "Comment" }) +class Comment extends Ad4mModel { + @Property({ through: "comment://body" }) + body: string = ""; + + @BelongsToOne(() => Chef, { through: "comment://chef" }) + chef: string = ""; +} -// Update -recipe.name = "Dark Chocolate Cake"; -await recipe.update(); +@Model({ name: "Chef" }) +class Chef extends Ad4mModel { + @Property({ through: "chef://name" }) + name: string = ""; +} + +@Model({ name: "Image" }) +class Image extends Ad4mModel { + @Property({ through: "image://url" }) + url: string = ""; +} + +@Model({ name: "Category" }) +class Category extends Ad4mModel { + @Property({ through: "category://name" }) + name: string = ""; +} + +@Model({ name: "Recipe" }) +class Recipe extends Ad4mModel { + @Property({ through: "recipe://name" }) + name: string = ""; + + // One-to-many: this recipe owns many comments + @HasMany(() => Comment, { through: "recipe://comment" }) + comments: string[] = []; + + // One-to-one: this recipe has one featured image + @HasOne({ through: "recipe://featured_image", target: () => Image }) + featuredImage: string = ""; + + // Many-to-one: this recipe belongs to one chef (read-only reference) + @BelongsToOne(() => Chef, { through: "recipe://chef" }) + chef: string = ""; + + // Many-to-many: this recipe belongs to many categories (read-only) + @BelongsToMany(() => Category, { through: "recipe://category" }) + categories: string[] = []; +} ``` -### Basic Querying +Each relation decorator supports two calling conventions: ```typescript -// Get all recipes (uses SurrealDB by default - 10-100x faster) -const allRecipes = await Recipe.findAll(perspective); +// Target-first shorthand (recommended) +@HasMany(() => Comment, { through: "recipe://comment" }) -// Get with simple conditions -const recipes = await Recipe.findAll(perspective, { - where: { name: "Chocolate Cake" } -}); +// Options-object style +@HasMany({ through: "recipe://comment", target: () => Comment }) ``` -## Query Performance with SurrealDB +#### Relation types at a glance -**Important**: `Ad4mModel` now uses **SurrealDB by default** for all query operations, providing **10-100x faster performance** compared to the legacy Prolog engine. This means: +| Decorator | Cardinality | Generated methods | Ownership | +|-----------|------------|-------------------|-----------| +| `@HasMany` | One-to-many | `add*`, `remove*`, `set*` | Parent owns | +| `@HasOne` | One-to-one | Property setter | Parent owns | +| `@BelongsToOne` | Many-to-one | Read-only | Child references | +| `@BelongsToMany` | Many-to-many | Read-only | Child references | + + **Default `through`**: When you omit `through` on a relation decorator, it defaults to `'ad4m://has_child'`. + This is the standard AD4M parent-child predicate, so it works well for hierarchical data — but make sure it's intentional. + -- `findAll()` automatically uses SurrealDB -- `findAllAndCount()` automatically uses SurrealDB -- Query builder methods automatically use SurrealDB -- Live query subscriptions automatically use SurrealDB +Relation decorators also accept a `local` option (`local: true`) to store the relation links locally without syncing to the network. +#### Using relation methods + +`@HasMany` generates typed helper methods on the model instance: ```typescript -// Uses SurrealDB by default (fast!) -const highRated = await Recipe.findAll(perspective, { - where: { rating: { gt: 4 } }, - order: { rating: "DESC" }, - limit: 10 -}); +const recipe = await Recipe.findOne(perspective, { where: { name: "Chocolate Cake" } }); -// You can explicitly use Prolog if needed (for backward compatibility) -const recipesProlog = await Recipe.findAll(perspective, { - where: { rating: { gt: 4 } } -}, false); // useSurrealDB = false +// Add a comment — accepts a model instance or a string ID +const comment = await Comment.create(perspective, { body: "Delicious!" }); +await recipe.addComments(comment); // pass instance +await recipe.addComments(comment.id); // or pass ID + +// Remove +await recipe.removeComments(comment); + +// Replace all +await recipe.setComments([comment1.id, comment2.id]); + +// With batch support +const batchId = await perspective.createBatch(); +await recipe.addComments(comment, batchId); +await perspective.commitBatch(batchId); ``` -For advanced graph traversal queries and direct SurrealQL access, see the [SurrealDB Queries Guide](/developer-guides/surreal-queries). +### Flags + +Flags are immutable type markers. They are automatically `readOnly` and `required`, and cannot be changed after creation: + +```typescript +@Flag({ through: "ad4m://type", value: "recipe://main-course" }) +type: string = ""; +``` -## Understanding the Underlying System +Attempting to update a flag after creation throws an error. -Now that you've seen the basics, let's understand how it works under the hood. +## How It Works Under the Hood ### Graph-Based Storage @@ -205,15 +314,15 @@ recipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://sugar Every node in this graph is a URL pointing to an Expression in some language. -### Base Expressions +### Instance Identity -Each model instance has a unique identifier called a "base expression" that serves as the root node of its subgraph. You can specify it or let AD4M generate one: +Each model instance has a unique `id` that serves as the root node of its subgraph. You can specify it or let AD4M generate one: ```typescript -// Auto-generated base expression +// Auto-generated ID const recipe = new Recipe(perspective); -// Custom base expression +// Custom ID const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03"); ``` @@ -230,148 +339,529 @@ recipe.cookingTime = 45; // Stored as: literal://number:45 ``` -## Advanced Features +### Social DNA and SHACL -### Property Types +When you define a model class, AD4M generates a **SHACL** (Shapes Constraint Language) representation — a W3C standard for describing and validating RDF graph shapes: -AD4M provides several specialized property decorators: + + + ```typescript + @Model({ name: "Recipe" }) + class Recipe extends Ad4mModel { + @Property({ + through: "recipe://name", + required: true + }) + name: string = ""; -#### @ReadOnly -For computed or immutable properties: + @HasMany({ through: "recipe://ingredient" }) + ingredients: string[] = []; + } + ``` + + + ```turtle + @prefix sh: . + @prefix xsd: . + @prefix ad4m: . + + a sh:NodeShape ; + sh:targetClass ; + sh:property [ + sh:path ; + sh:datatype xsd:string ; + sh:maxCount 1 ; # Scalar property + sh:minCount 1 ; # Required + ad4m:resolveLanguage "literal" ; + ] ; + sh:property [ + sh:path ; + sh:datatype xsd:string ; + # No maxCount = relation (multiple values) + ] . + ``` + + + +The SHACL shape is stored as links in the perspective graph, making it discoverable and queryable by any agent or tool that joins the perspective. + +### How SHACL Maps to AD4M + +| SHACL Concept | AD4M Equivalent | +|--------------|-----------------| +| `sh:NodeShape` | Subject Class definition | +| `sh:PropertyShape` | Property or Relation definition | +| `sh:maxCount 1` | Scalar property (single value, generates `set_` tool) | +| No `sh:maxCount` or `> 1` | Relation (generates `add_`/`remove_` tools) | +| `sh:minCount 1` | Required property (must exist on creation — when `required: true` is used without an explicit `initial`, the `@Property` decorator auto-supplies a `"literal://string:uninitialized"` placeholder) | +| `sh:datatype` | Value type constraint | +| `sh:class` | Reference to another Subject Class (target model shape) | +| `sh:node` | Parent shape reference (model inheritance) | +| `ad4m://initial` | Default value on instance creation | +| `ad4m://resolveLanguage` | Expression language for value resolution | +| `ad4m://readOnly` | Read-only computed property | +| `ad4m://getter` | SurrealQL getter for conformance filtering | +| `ad4m://conformanceConditions` | Structured filter conditions for relation targets | + +AD4M extends standard SHACL with `ad4m://` predicates for features specific to the AD4M runtime (initial values, language resolution, write permissions). + +## Working with Models + +### Creating ```typescript -@ReadOnly({ - through: "recipe://rating", - getter: ` - findall(Rating, triple(Base, "recipe://user_rating", Rating), Ratings), - sum_list(Ratings, Sum), - length(Ratings, Count), - Value is Sum / Count - ` -}) -averageRating: number = 0; +// Option 1: Instantiate and save +const recipe = new Recipe(perspective); +recipe.name = "Chocolate Cake"; +await recipe.save(); + +// Option 2: Static create (one-step) +const recipe = await Recipe.create(perspective, { name: "Chocolate Cake" }); + +// Create with a specific ID +const recipe = new Recipe(perspective, "recipe://chocolate-cake"); +await recipe.save(); + +// Create with a parent relationship +const recipe = await Recipe.create(perspective, { name: "Cake" }, { + parent: { model: Cookbook, id: cookbook.id } +}); ``` -#### @Flag -For immutable type markers: +### Reading ```typescript -@Flag({ - through: "ad4m://type", - value: "recipe://main-course" -}) -type: string = ""; +// Get by ID +const recipe = new Recipe(perspective, existingId); +await recipe.get(); + +// Get with eager-loaded relations +await recipe.get({ include: { comments: true } }); + +// Get with sparse fieldset (only hydrate specific properties) +await recipe.get({ properties: ["name", "category"] }); ``` -### Advanced Collections +### Updating -Collections can be filtered and typed: +`save()` handles both creation and updates automatically. For existing instances (fetched via `get()` or a query), it only writes changed fields thanks to built-in dirty tracking: ```typescript -// Collection of other model instances -@Collection({ - through: "recipe://comment", - where: { isInstance: Comment } -}) -comments: Comment[] = []; +const recipe = await Recipe.findOne(perspective, { + where: { name: "Chocolate Cake" } +}); -// Collection with custom filter -@Collection({ - through: "recipe://review", - where: { condition: `triple(Target, "review://rating", Rating), Rating > 4` } -}) -topReviews: string[] = []; +recipe.name = "Dark Chocolate Cake"; +await recipe.save(); // Only the name field is updated + +// Static update shorthand +await Recipe.update(perspective, recipe.id, { name: "White Chocolate Cake" }); ``` -### Advanced Querying +### Deleting -The query builder provides a fluent interface for complex queries and uses **SurrealDB by default** for optimal performance: +```typescript +// Instance method +await recipe.delete(); + +// Static method +await Recipe.delete(perspective, recipeId); +``` + +The instance `delete()` also cleans up incoming links (e.g. a parent's `hasMany` reference to this instance). + +### Dirty Tracking + +After fetching an instance, AD4M takes a snapshot of all field values. You can inspect what changed: + +```typescript +const recipe = await Recipe.findOne(perspective); +recipe.name = "Updated Name"; + +recipe.isDirty(); // true +recipe.changedFields(); // ["name"] + +await recipe.save(); // Only "name" is written +``` + +### Instance Identity + +Every model instance has a unique `id` (a URI string): + +```typescript +const recipe = await Recipe.create(perspective, { name: "Cake" }); +console.log(recipe.id); // "literal://..." + +// Auto-generated when not specified +const recipe2 = new Recipe(perspective); +console.log(recipe2.id); // random literal URI + +// Custom ID +const recipe3 = new Recipe(perspective, "recipe://my-cake"); +console.log(recipe3.id); // "recipe://my-cake" +``` + + + The legacy `.baseExpression` getter still works but is deprecated. Use `.id` instead. + + +### Built-in Instance Properties + +Every model instance automatically gets these properties, populated from link metadata: + +| Property | Type | Description | +|----------|------|-------------| +| `.id` | `string` | Unique URI identifier | +| `.author` | `string` | DID of the agent who created the earliest link (e.g. `"did:key:z6Mk..."`) | +| `.createdAt` | `string \| number` | Timestamp of the earliest link (epoch ms or ISO string) | +| `.updatedAt` | `string \| number` | Timestamp of the most recent link | +| `.timestamp` | *(deprecated)* | Alias for `.createdAt` — use `.createdAt` instead | + +These are available after any fetch operation (`get()`, `findAll()`, `findOne()`, etc.) and can be used in queries: + +```typescript +// Order by creation date +const recent = await Recipe.query(perspective) + .order({ createdAt: "DESC" }) + .limit(10) + .get(); + +console.log(recent[0].author); // "did:key:z6Mk..." +console.log(recent[0].createdAt); // 1709049600000 +console.log(recent[0].updatedAt); // 1709136000000 +``` + +## Querying + +### Basic Queries + +```typescript +// Get all (uses SurrealDB by default — 10-100x faster than Prolog) +const allRecipes = await Recipe.findAll(perspective); + +// With conditions +const cakes = await Recipe.findAll(perspective, { where: { category: "Dessert" } }); + +// Find one +const recipe = await Recipe.findOne(perspective, { where: { name: "Chocolate Cake" } }); + +// Count +const { results, totalCount } = await Recipe.findAllAndCount(perspective, { + where: { category: "Dessert" } +}); + +// Pagination +const page = await Recipe.paginate(perspective, 10, 1, { where: { category: "Dessert" } }); +``` + +### Query Builder + +The fluent query builder provides a chainable interface: ```typescript -// Uses SurrealDB by default (10-100x faster) const recipes = await Recipe.query(perspective) - .where({ - category: "MainCourse", - rating: { gt: 4 } - }) + .where({ category: "MainCourse", rating: { gt: 4 } }) .order({ createdAt: "DESC" }) .limit(5) .get(); -// Explicitly control query engine -const recipesSurreal = await Recipe.query(perspective) +// Get first match +const topRecipe = await Recipe.query(perspective) .where({ rating: { gt: 4 } }) - .useSurrealDB(true) // Default is true + .order({ rating: "DESC" }) + .first(); // Returns Recipe | null +``` + +### Where Operators + +```typescript +const recipes = await Recipe.findAll(perspective, { + where: { + name: "Exact Match", // Equality + rating: { gt: 4 }, // Greater than + difficulty: { lte: 3 }, // Less than or equal + servings: { between: [2, 6] }, // Range + category: ["Dessert", "Snack"], // IN (array membership) + status: { not: "archived" }, // Not equal + tags: { contains: "vegan" }, // Contains + } +}); +``` + +### Eager Loading with `include` + +By default, relation fields contain raw URI strings. Use `include` to hydrate them into full model instances: + +```typescript +// Eager-load comments on query results +const recipes = await Recipe.query(perspective) + .where({ category: "Dessert" }) + .include({ comments: true }) .get(); -// Use Prolog for backward compatibility +// recipes[0].comments is now Comment[] instead of string[] +console.log(recipes[0].comments[0].body); // "Delicious!" + +// Nested includes +const recipes = await Recipe.query(perspective) + .include({ + comments: { + include: { chef: true } // Load comment chefs too + } + }) + .get(); + +// Also works on findAll / findOne +const recipe = await Recipe.findOne(perspective, { + where: { name: "Cake" }, + include: { comments: true } +}); + +// And on instance get() +const recipe = new Recipe(perspective, existingId); +await recipe.get({ include: { comments: true } }); +// Shorthand: +await recipe.get({ comments: true }); +``` + +#### Filtering and sorting eager-loaded relations + +Instead of `true`, pass a sub-query object to filter, sort, or paginate the eager-loaded relation: + +```typescript +// Only load the 5 most recent comments +const recipes = await Recipe.query(perspective) + .include({ + comments: { + where: { status: "approved" }, + order: { createdAt: "DESC" }, + limit: 5 + } + }) + .get(); + +// Combine with nested includes +const recipes = await Recipe.query(perspective) + .include({ + comments: { + order: { createdAt: "DESC" }, + limit: 10, + include: { chef: true } // Also hydrate each comment's chef + } + }) + .get(); +``` + +The sub-query accepts: `where`, `order`, `limit`, `offset`, `include`, and `properties`. + +### Sparse Fieldsets with `properties` + +Only hydrate specific properties to avoid unnecessary work (especially useful for properties with non-literal `resolveLanguage` that trigger network calls): + +```typescript +const recipes = await Recipe.query(perspective) + .properties(["name", "category"]) + .get(); +// Only name and category are hydrated; other fields stay at defaults +``` + +### Parent-Scoped Queries + +Query instances that are linked from a specific parent: + +```typescript +// From a model instance +const comments = await Comment.query(perspective) + .parent(recipe) + .get(); + +// From an ID + model class (predicate auto-resolved from metadata) +const comments = await Comment.query(perspective) + .parent(recipeId, Recipe) + .get(); + +// Raw predicate escape hatch +const comments = await Comment.query(perspective) + .parent(recipeId, "recipe://comment") + .get(); +``` + +### SurrealDB vs Prolog + +`Ad4mModel` uses **SurrealDB by default** for all query operations, providing **10-100x faster performance** compared to the legacy Prolog engine. + +```typescript +// Uses SurrealDB by default (fast!) +const recipes = await Recipe.findAll(perspective, { where: { rating: { gt: 4 } } }); + +// Explicitly use Prolog if needed (for backward compatibility) +const recipesProlog = await Recipe.findAll(perspective, { + where: { rating: { gt: 4 } } +}, false); // useSurrealDB = false + +// Or on the query builder const recipesProlog = await Recipe.query(perspective) .where({ rating: { gt: 4 } }) - .useSurrealDB(false) // Switch to Prolog + .useSurrealDB(false) .get(); ``` -### Real-time Updates +For advanced graph traversal queries and direct SurrealQL access, see the [SurrealDB Queries Guide](/developer-guides/surreal-queries). + +### Real-time Subscriptions -Subscribe to changes in your data. Subscriptions also use **SurrealDB by default** for better performance: +Subscribe to changes in your data: ```typescript -// Create a query builder (uses SurrealDB by default) const builder = Recipe.query(perspective) .where({ status: "cooking" }); -// Subscribe to updates +// Subscribe — callback fires immediately with initial results, +// then again whenever matching data changes const initialRecipes = await builder.subscribe(recipes => { console.log("Currently cooking:", recipes); }); -// Subscribe with Prolog (for backward compatibility) -const builderProlog = Recipe.query(perspective) - .where({ status: "cooking" }) - .useSurrealDB(false); // Use Prolog +// Count subscription +const initialCount = await builder.countSubscribe(count => { + console.log("Number cooking:", count); +}); -await builderProlog.subscribe(recipes => { - console.log("Currently cooking (Prolog):", recipes); +// Paginated subscription +const initialPage = await builder.paginateSubscribe(10, 1, page => { + console.log("Page 1:", page.results); }); // Important: Clean up when done builder.dispose(); ``` -The query builder's subscription system: -1. Returns initial results immediately -2. Calls your callback whenever the results change -3. Maintains an active connection to receive updates -4. Automatically cleans up resources when disposed +Always call `dispose()` when you're done with a subscription to prevent memory leaks. -Always call `dispose()` when you're done with the subscription to: -- Stop keepalive signals -- Unsubscribe from updates -- Notify the backend to clean up resources -- Prevent memory leaks +## Transactions -You can also subscribe to just the count of matching items: +Group multiple operations into an atomic batch: ```typescript -const builder = Recipe.query(perspective) - .where({ category: "Dessert" }); +await Ad4mModel.transaction(perspective, async (tx) => { + const recipe = await Recipe.create(perspective, { name: "Cake" }, { + batchId: tx.batchId + }); -const initialCount = await builder.countSubscribe(count => { - console.log("Number of desserts:", count); + const comment = new Comment(perspective); + comment.body = "Looks great!"; + await comment.save(tx.batchId); + + await recipe.addComments(comment, tx.batchId); }); +// All operations commit together, or none do if an error is thrown +``` -// Remember to clean up -builder.dispose(); +For lower-level batch control, see the [Batch Operations Guide](/developer-guides/batch-operations). + +## Static Convenience Methods + +| Method | Signature | Description | +|--------|-----------|-------------| +| `create` | `create(perspective, data?, options?)` | Create and save in one step. `options` supports `parent` and `batchId` | +| `update` | `update(perspective, id, data)` | Fetch by ID, merge data, save | +| `delete` | `delete(perspective, id)` | Delete by ID with incoming link cleanup | +| `remove` | `remove(perspective, id)` | *Deprecated* — alias for `delete` | +| `findAll` | `findAll(perspective, query?, useSurrealDB?)` | Query all matching instances | +| `findOne` | `findOne(perspective, query?, useSurrealDB?)` | First matching instance or `null` | +| `findAllAndCount` | `findAllAndCount(perspective, query?, useSurrealDB?)` | Results + total count | +| `paginate` | `paginate(perspective, pageSize, page, query?, useSurrealDB?)` | Paginated results | +| `register` | `register(perspective)` | Install the SHACL schema in the perspective | +| `transaction` | `transaction(perspective, fn)` | Atomic batch operation | +| `query` | `query(perspective)` | Returns a `ModelQueryBuilder` | +| `getModelMetadata` | `getModelMetadata()` | Introspect property & relation metadata | +| `generateSDNA` | `generateSDNA()` | Returns the generated Prolog SDNA rules (injected by `@Model`) | +| `generateSHACL` | `generateSHACL()` | Returns the generated SHACL shape graph (injected by `@Model`) | + +### Introspection + +Use `getModelMetadata()` to inspect a model's structure at runtime — useful for tooling, debugging, or dynamic UIs: + +```typescript +const meta = Recipe.getModelMetadata(); +console.log(meta.name); // "Recipe" +console.log(meta.properties); // [{ name: "name", predicate: "recipe://name", ... }, ...] +console.log(meta.relations); // [{ name: "comments", predicate: "recipe://comment", ... }, ...] ``` -## Dynamic Models from JSON Schema +`generateSDNA()` and `generateSHACL()` return the raw Prolog rules and SHACL shape respectively — primarily useful for debugging schema registration issues. + +## Relation Filtering + +When a relation has a `target` model, AD4M can auto-generate a conformance filter that only returns linked instances matching the target model's shape (checking flags and required properties): -The `fromJSONSchema()` method allows you to dynamically create AD4M model classes from JSON Schema definitions. This is perfect for: +```typescript +@Model({ name: "MainCourse" }) +class MainCourse extends Ad4mModel { + @Flag({ through: "ad4m://type", value: "recipe://main-course" }) + type: string = ""; + + @Property({ through: "recipe://name", required: true }) + name: string = ""; +} + +@Model({ name: "Cookbook" }) +class Cookbook extends Ad4mModel { + // Auto-filters: only returns linked items that match the MainCourse shape + @HasMany(() => MainCourse, { through: "cookbook://recipe" }) + mainCourses: string[] = []; +} +``` -- **Integrating with external systems** that use JSON Schema -- **Runtime model generation** based on user-defined schemas -- **Partner app integration** (like Holons) that define types using JSON Schema -- **Rapid prototyping** without writing decorator-based classes +### `where` on Relations + +Add value-based filtering using the same `where` syntax as queries: + +```typescript +@Model({ name: "TaskBoard" }) +class TaskBoard extends Ad4mModel { + // Only return tasks where status is "active" + @HasMany(() => Task, { through: "board://task", where: { status: "active" } }) + activeTasks: string[] = []; +} +``` + +### Filtering options + +| Option | Effect | +|--------|--------| +| `target: () => Model` | Auto-generates conformance filter from model shape | +| `where: { ... }` | Value-based filtering using query DSL | +| `filter: false` | Opt out of auto-filtering even when `target` is set | +| `getter: "..."` | Raw SurrealQL getter (escape hatch, mutually exclusive with `target`/`through`) | + +## Model Inheritance + +Models can extend other models. The child's SHACL shape references the parent via `sh:node`, ensuring inherited constraints are validated: + +```typescript +@Model({ name: "BaseRecipe" }) +class BaseRecipe extends Ad4mModel { + @Property({ through: "recipe://name" }) + name: string = ""; +} + +@Model({ name: "DetailedRecipe" }) +class DetailedRecipe extends BaseRecipe { + @Property({ through: "recipe://instructions" }) + instructions: string = ""; +} + +// DetailedRecipe inherits the "name" property from BaseRecipe +const recipe = await DetailedRecipe.create(perspective, { + name: "Cake", + instructions: "Mix and bake" +}); +``` + +## Dynamic Models from JSON Schema + +The `fromJSONSchema()` method dynamically creates AD4M model classes from JSON Schema definitions. This is perfect for integrating with external systems, runtime model generation, partner app integration (like Holons), and rapid prototyping. ### Basic Usage @@ -416,152 +906,60 @@ await post.save(); ### Configuration Options -The second parameter to `fromJSONSchema()` is optional and accepts these options: +The second parameter to `fromJSONSchema()` is optional: ```typescript interface JSONSchemaToModelOptions { // Model configuration - name?: string; // Class name override (optional: falls back to x-ad4m.className → schema.title → schema.$id) - namespace?: string; // Base namespace for predicates (optional: falls back to x-ad4m.namespace → schema.title → schema.$id) - - // Predicate generation helpers - // 1) Direct mapping: propertyName -> predicate URI - propertyMapping?: Record; + name?: string; // Class name override (falls back to x-ad4m.className → schema.title → schema.$id) + namespace?: string; // Base namespace for predicates (falls back to x-ad4m.namespace → schema.title → schema.$id) - // 2) Template: supports ${scheme}, ${namespace} (or ${ns}), ${title}, ${property} - predicateTemplate?: string; + // Predicate generation helpers (in order of precedence) + propertyMapping?: Record; // Direct propertyName → predicate URI mapping + predicateTemplate?: string; // Template: ${scheme}, ${namespace}/${ns}, ${title}, ${property} + predicateGenerator?: (title: string, property: string) => string; // Custom callback - // 3) Generator callback: receives schema title and property name - predicateGenerator?: (title: string, property: string) => string; - - // Global property settings (applied to all properties unless overridden) + // Global property settings resolveLanguage?: string; // Default language for all properties local?: boolean; // Whether properties are stored locally - // Property-specific overrides - // Accepts any PropertyOptions fields: through, initial, required, writable, - // resolveLanguage, getter, setter, local, transform + // Property-specific overrides (accepts any PropertyOptions fields) propertyOptions?: Record>; } ``` -### Class Name Resolution (Cascading Priority) - -The class name is determined using this priority order: - -1. **Explicit `options.name`** (highest priority) -2. **`x-ad4m.className` metadata in schema** -3. **Schema `title`** -4. **Schema `$id`** (extracted from URI) -5. **Error** if none found (lowest priority) - -```typescript -// Priority 1: Explicit name override -const Model1 = Ad4mModel.fromJSONSchema(schema, { - name: "CustomModelName" -}); - -// Priority 2: x-ad4m.className metadata -const schemaWithClassName = { - "title": "Person", - "x-ad4m": { - "className": "PersonModel" - }, - "properties": { /* ... */ } -}; -const PersonClass = Ad4mModel.fromJSONSchema(schemaWithClassName); - -// Priority 3: Inferred from title -const schemaWithTitle = { - "title": "BlogPost", // becomes "BlogPost" class name - "properties": { /* ... */ } -}; -const BlogPostClass = Ad4mModel.fromJSONSchema(schemaWithTitle); - -// Priority 4: Inferred from $id -const schemaWithId = { - "$id": "https://example.com/schemas/product.schema.json", // becomes "Product" - "properties": { /* ... */ } -}; -const ProductClass = Ad4mModel.fromJSONSchema(schemaWithId); -``` - -### Namespace Resolution (Cascading Priority) - -The namespace is determined using this priority order: +### Resolution Cascades -1. **Explicit `options.namespace`** (highest priority) -2. **`x-ad4m.namespace` metadata in schema** -3. **Schema `title`** (converted to namespace) -4. **Schema `$id`** (extracted from URI) -5. **Error** if none found (lowest priority) +The class name, namespace, and per-property predicate are each resolved with a cascading priority: -```typescript -// Priority 1: Explicit namespace -const Model1 = Ad4mModel.fromJSONSchema(schema, { - namespace: "custom://" -}); +| Setting | Priority 1 (highest) | Priority 2 | Priority 3 | Priority 4 | +|---------|----------------------|------------|------------|------------| +| **Class name** | `options.name` | `x-ad4m.className` | `schema.title` | `schema.$id` | +| **Namespace** | `options.namespace` | `x-ad4m.namespace` | `schema.title` | `schema.$id` | +| **Predicate** | `propertyMapping[name]` | `x-ad4m.through` | `predicateTemplate` | `predicateGenerator` → default `${namespace}/${property}` | -// Priority 2: x-ad4m.namespace metadata -const schemaWithMetadata = { - "title": "Person", - "x-ad4m": { - "namespace": "person://" - }, - "properties": { /* ... */ } -}; - -// Priority 3: Inferred from title -const schemaWithTitle = { - "title": "BlogPost", // becomes "blogpost://" - "properties": { /* ... */ } -}; -``` - -### Property Predicate Resolution - -Each property's predicate URI is determined by (highest to lowest precedence): - -1. **`options.propertyMapping[name]`** (explicit mapping) -2. **`x-ad4m.through` in property schema** -3. **`predicateTemplate`** (supports `${scheme}`, `${namespace}`/`${ns}`, `${title}`, `${property}`) -4. **`predicateGenerator(title, property)`** -5. **Default**: `${namespace}/${propertyName}` (normalized) +For example, to control predicate URIs directly: ```typescript -const schema = { - "title": "Product", - "properties": { - "name": { "type": "string" }, - "price": { - "type": "number", - "x-ad4m": { - "through": "product://cost" // Custom predicate - } - } - } -}; - const Product = Ad4mModel.fromJSONSchema(schema, { name: "Product", namespace: "product://", - // Option A: direct mapping + // Direct mapping: property name → predicate URI propertyMapping: { - name: "product://title" - } - // Option B: or per-property options - // propertyOptions: { name: { through: "product://title" } } + name: "product://title", + price: "product://cost" + }, + // Or use a template (lower priority than propertyMapping) + // predicateTemplate: "${namespace}/${property}" }); ``` -### Advanced Schema Features - -#### Using x-ad4m Extensions +### x-ad4m Schema Extensions Add AD4M-specific metadata directly to your JSON Schema: ```typescript -const advancedSchema = { +const schema = { "title": "User", "x-ad4m": { "namespace": "user://", @@ -570,106 +968,42 @@ const advancedSchema = { "properties": { "email": { "type": "string", - "x-ad4m": { - "through": "user://email_address", - "local": true - } - }, - "profile": { - "type": "object", - "x-ad4m": { - "resolveLanguage": "literal" // Store as JSON - } + "x-ad4m": { "through": "user://email_address", "local": true } }, "tags": { "type": "array", "items": { "type": "string" }, - "x-ad4m": { - "through": "user://interests" - } + "x-ad4m": { "through": "user://interests" } } }, "required": ["email"] }; - -const User = Ad4mModel.fromJSONSchema(advancedSchema, { name: "User" }); ``` -#### Complex Object Handling - -Object properties are automatically stored as JSON literals: - -```typescript -const schema = { - "title": "Article", - "properties": { - "metadata": { - "type": "object", - "properties": { - "author": { "type": "string" }, - "publishedAt": { "type": "string" }, - "views": { "type": "number" } - } - } - }, - "required": ["metadata"] -}; - -const Article = Ad4mModel.fromJSONSchema(schema, { - namespace: "article://" -}); +### Schema Type Mapping -const article = new Article(perspective); -article.metadata = { - author: "Alice", - publishedAt: "2025-09-23", - views: 42 -}; -await article.save(); +| JSON Schema type | AD4M treatment | +|------------------|----------------| +| `string`, `number`, `boolean` | Scalar `@Property` | +| `object` | Stored as JSON literal (limited semantic querying) | +| `array` | Relation (`@HasMany`-style), with `add*`/`remove*` methods | -// Complex objects are preserved -const saved = await Article.findAll(perspective); -console.log(saved[0].metadata.author); // "Alice" -``` - -#### Array/Collection Mapping - -Arrays in JSON Schema automatically become AD4M collections: +Arrays automatically get relation helper methods: ```typescript -const schema = { - "title": "BlogPost", - "properties": { - "tags": { - "type": "array", - "items": { "type": "string" } - }, - "categories": { - "type": "array", - "items": { "type": "string" } - } - } -}; - -const BlogPost = Ad4mModel.fromJSONSchema(schema, { - namespace: "blog://" -}); - const post = new BlogPost(perspective); post.tags = ["ad4m", "tutorial"]; -post.categories = ["technology"]; await post.save(); -// Collections work with all standard AD4M collection methods +// Relation methods generated from the property name post.addTags("blockchain"); -post.removeCategories("technology"); +post.removeTags("tutorial"); ``` -### Type Safety Considerations +### Type Safety -Since properties are added dynamically, TypeScript won't know about them at compile time. You can: +Since properties are added dynamically, TypeScript won't know about them at compile time. Use type assertions: -1. **Use type assertions** for better IDE support: ```typescript const BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & { new(perspective: PerspectiveProxy): Ad4mModel & { @@ -680,93 +1014,12 @@ const BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & { }; ``` -2. **Create TypeScript interfaces** for your schemas: -```typescript -interface BlogPostData { - title: string; - tags: string[]; - metadata: { author: string; publishedAt: string }; -} +### Limitations -const post = new BlogPost(perspective) as Ad4mModel & BlogPostData; -post.title = "Type-safe access"; -``` - -### Limitations and Best Practices - -- **No `author` property**: JSON schemas cannot define a top-level `author` property (conflicts with built-in AD4M property) +- **No `author` property**: Conflicts with the built-in AD4M `author` field - **Required properties**: At least one property must be required or have an initial value -- **Complex objects**: Nested objects are stored as JSON literals, limiting semantic querying capabilities -- **Performance**: For better semantic querying, consider flattening complex objects into separate properties - -## Under the Hood - -### Social DNA and SHACL - -When you define a model class, AD4M generates a **SHACL** (Shapes Constraint Language) representation — a W3C standard for describing and validating RDF graph shapes: - - - - ```typescript - @ModelOptions({ name: "Recipe" }) - class Recipe extends Ad4mModel { - @Property({ - through: "recipe://name", - resolveLanguage: "literal", - required: true - }) - name: string = ""; - - @Collection({ - through: "recipe://ingredient" - }) - ingredients: string[] = []; - } - ``` - - - ```turtle - @prefix sh: . - @prefix xsd: . - @prefix ad4m: . - - a sh:NodeShape ; - sh:targetClass ; - sh:property [ - sh:path ; - sh:datatype xsd:string ; - sh:maxCount 1 ; # Scalar property - sh:minCount 1 ; # Required - ad4m:resolveLanguage "literal" ; - ] ; - sh:property [ - sh:path ; - sh:datatype xsd:string ; - # No maxCount = collection (multiple values) - ] . - ``` - - - -The SHACL shape is stored as links in the perspective graph, making it discoverable and queryable by any agent or tool that joins the perspective. - -### How SHACL Maps to AD4M - -| SHACL Concept | AD4M Equivalent | -|--------------|-----------------| -| `sh:NodeShape` | Subject Class definition | -| `sh:PropertyShape` | Property or Collection definition | -| `sh:maxCount 1` | Scalar property (single value, generates `set_` tool) | -| No `sh:maxCount` or `> 1` | Collection (generates `add_`/`remove_` tools) | -| `sh:minCount 1` | Required property (must be set on creation) | -| `sh:datatype` | Value type constraint | -| `sh:class` | Reference to another Subject Class | -| `ad4m://initial` | Default value on instance creation | -| `ad4m://resolveLanguage` | Expression language for value resolution | -| `ad4m://writable` | Property supports updates | -| `ad4m://readonly` | Read-only computed property | - -AD4M extends standard SHACL with `ad4m://` predicates for features specific to the AD4M runtime (initial values, language resolution, write permissions). +- **Complex objects**: Nested objects are stored as JSON literals, limiting semantic querying +- **Performance**: For better querying, consider flattening complex objects into separate properties ## Best Practices @@ -785,13 +1038,10 @@ AD4M extends standard SHACL with `ad4m://` predicates for features specific to t servings: any; // Bad ``` -3. **Collection Filtering**: Use `where` conditions to filter collections: +3. **Relation Filtering**: Use typed `target` to auto-filter relations: ```typescript - @Collection({ - through: "recipe://review", - where: { isInstance: Review } // Only include Review instances - }) - reviews: Review[] = []; + @HasMany(() => Review, { through: "recipe://review" }) + reviews: string[] = []; ``` 4. **Query Optimization**: Use specific queries instead of filtering in memory, and leverage SurrealDB's performance: @@ -834,11 +1084,8 @@ AD4M extends standard SHACL with `ad4m://` predicates for features specific to t 7. **Use Literals Appropriately**: ```typescript - // Good - Using literals for simple values - @Property({ - through: "recipe://name", - resolveLanguage: "literal" - }) + // Good - Using literals for simple values (default resolveLanguage) + @Property({ through: "recipe://name" }) name: string = ""; // Good - Using specific language for rich content @@ -849,13 +1096,13 @@ AD4M extends standard SHACL with `ad4m://` predicates for features specific to t instructions: string = ""; ``` -8. **Meaningful Base Expressions**: +8. **Meaningful IDs**: ```typescript - // Good - Descriptive base expression + // Good - Descriptive ID const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03"); - // Bad - Random or meaningless base expression - const recipe = new Recipe(perspective, "x://123"); + // Fine - Auto-generated ID (most common) + const recipe = new Recipe(perspective); ``` ## Error Handling @@ -872,18 +1119,3 @@ try { // Handle error appropriately } ``` - -## Integration with AD4M Perspectives - -Before using a model class, register it with the perspective: - -```typescript -// Register the model class -await perspective.ensureSDNASubjectClass(Recipe); - -// Now you can use it -const recipe = new Recipe(perspective); -await recipe.save(); -``` - -This ensures the perspective knows how to handle instances of your model class. diff --git a/docs-src/pages/developer-guides/surreal-queries.mdx b/docs-src/pages/developer-guides/surreal-queries.mdx index ab4bacf50..740a43bd1 100644 --- a/docs-src/pages/developer-guides/surreal-queries.mdx +++ b/docs-src/pages/developer-guides/surreal-queries.mdx @@ -44,11 +44,11 @@ out->link[WHERE predicate = 'flux://entry_type'][0].out.uri **Key Functions**: - `fn::parse_literal(uri)` - Extract values from AD4M literal URIs (handles `literal://string:`, `literal://number:`, `literal://json:`, etc.) -**Indexed Fields** (fast): -- `in.uri` - Source node of link -- `out.uri` - Target node of link -- `predicate` - Link predicate -- `source`, `target` - String representations (also indexed) +**Fields & Indexes**: +- `predicate` — Indexed independently and in composites +- `source`, `target` — Indexed independently and in composites with `predicate` +- `(in, predicate)`, `(out, predicate)` — Composite indexes (pair `in.uri`/`out.uri` with `predicate` for best performance) +- `in.uri`, `out.uri` — Graph edge references, resolved via the node table's unique URI index (not independently indexed on the link table) ## Direct SurrealDB Queries @@ -104,13 +104,19 @@ const uniqueSources = await perspective.querySurrealDB( // uniqueSources.length gives you the count of unique sources ``` -## Graph Traversal Queries +## Graph Traversal -SurrealDB uses efficient graph traversal with indexed node lookups. The key is to use **direct field comparisons** rather than subqueries for optimal performance. +SurrealDB stores links as graph edges with indexed source and target node references, enabling efficient multi-hop traversal. See the [Quick Reference](#quick-reference-graph-traversal-syntax) above for the full syntax. -### ⚠️ Performance Warning: Avoid Subqueries +**Key fields**: +- `in.uri` — Source node (where the edge comes FROM). Composite-indexed with `predicate` +- `out.uri` — Target node (where the edge goes TO). Composite-indexed with `predicate` +- `predicate` — Link predicate (independently indexed) +- `source` / `target` — String representations (independently indexed, plus composite with `predicate`) -**Important**: Subqueries (using `IN (SELECT ...)`) can be very slow, especially with large datasets. Instead, use the graph traversal operator (`->`) which is optimized and uses indexed lookups. +### ⚠️ Avoid Subqueries + +Subqueries (`IN (SELECT ...)`) can be very slow. Use the `->` traversal operator instead: ```typescript // ❌ SLOW - Uses subquery @@ -124,68 +130,63 @@ const good = await perspective.querySurrealDB( ); ``` -### Graph Traversal Operators - -SurrealDB stores links as graph edges with indexed source (`in.uri`) and target (`out.uri`) node references: - -- `in.uri` - The source node of the link (where the edge comes FROM) -- `out.uri` - The target node of the link (where the edge goes TO) -- `source` / `target` - String fields (also available for simple filtering) - -### Forward Traversal (Outgoing Links) +### Basic Traversal ```typescript -// Find all users that Alice follows +// Forward: Find all users that Alice follows const aliceFollows = await perspective.querySurrealDB( "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'" ); -// Find all posts by Alice -const alicePosts = await perspective.querySurrealDB( - "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'author'" -); -``` - -### Reverse Traversal (Incoming Links) - -```typescript -// Find all users who follow Alice (followers) +// Reverse: Find all users who follow Alice const aliceFollowers = await perspective.querySurrealDB( "SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'" ); -// Find all posts that mention Alice -const mentionsAlice = await perspective.querySurrealDB( - "SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'mentions'" +// Bidirectional: All connections involving Alice +const aliceConnections = await perspective.querySurrealDB( + "SELECT source, target FROM link WHERE (in.uri = 'user://alice' OR out.uri = 'user://alice') AND predicate = 'follows'" ); ``` -### Bidirectional Queries +### Filtering ```typescript -// Find all users connected to Alice (either following or followed by) -const aliceConnections = await perspective.querySurrealDB( - "SELECT source, target FROM link WHERE (in.uri = 'user://alice' OR out.uri = 'user://alice') AND predicate = 'follows'" +// By timestamp range +const recentLinks = await perspective.querySurrealDB( + "SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'" +); + +// By author +const bobsLinks = await perspective.querySurrealDB( + "SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'" ); + +// Filter on multi-hop properties (find children of a specific type) +const subgroups = await perspective.querySurrealDB(` + SELECT out.uri AS subgroup + FROM link + WHERE in.uri = 'conversation://456' + AND predicate = 'ad4m://has_child' + AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' +`); ``` -### Multi-Hop Traversal with Graph Operators +### Multi-Hop Traversal Use the `->` operator to traverse multiple hops in a single efficient query: ```typescript -// Find friends of friends (2-hop traversal) -// Traverse: Alice -> Friends -> Their Friends -// Note: Use GROUP BY instead of DISTINCT for unique results +// 2-hop: Friends of friends const friendsOfFriends = await perspective.querySurrealDB(` SELECT out->link[WHERE predicate = 'follows'].out.uri AS friend_of_friend FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows' `); -// Deduplicate in JavaScript if needed: [...new Set(friendsOfFriends.map(f => f.friend_of_friend))] +// Deduplicate in JS (friend_of_friend is an array per row — flatten first): +// [...new Set(friendsOfFriends.flatMap(f => f.friend_of_friend))] -// Get user profiles 2 hops away -// Traverse: User -> Follows -> Profile +// 2-hop: User profiles via follows const profiles = await perspective.querySurrealDB(` SELECT out.uri AS user, @@ -193,11 +194,20 @@ const profiles = await perspective.querySurrealDB(` FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows' `); + +// 2-hop: Child items with their types +const childTypes = await perspective.querySurrealDB(` + SELECT + out.uri AS child, + out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type + FROM link + WHERE in.uri = 'parent://123' AND predicate = 'ad4m://has_child' +`); ``` -### Chaining Multiple Traversals +### Chaining Traversals -You can chain `->` operators for deeper traversals: +Chain `->` operators for deeper patterns: ```typescript // 3-hop: Conversation -> Subgroup -> Items -> Get item types @@ -210,15 +220,8 @@ const itemTypes = await perspective.querySurrealDB(` AND predicate = 'ad4m://has_child' AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' `); -``` -### Complex Graph Patterns - -Use graph traversal for complex multi-hop patterns: - -```typescript -// Find all comments on Alice's posts (2-hop) -// Traverse: Alice -> Posts (authored) -> Comments (has_comment) +// 2-hop: Comments on Alice's posts const commentsOnAlicePosts = await perspective.querySurrealDB(` SELECT out.uri AS post, @@ -227,8 +230,7 @@ const commentsOnAlicePosts = await perspective.querySurrealDB(` WHERE in.uri = 'user://alice' AND predicate = 'authored' `); -// Get all reactions to posts by people Alice follows (3-hop) -// Traverse: Alice -> Follows -> Posts -> Reactions +// 3-hop: Reactions to posts by people Alice follows const reactions = await perspective.querySurrealDB(` SELECT out.uri AS followed_user, @@ -239,103 +241,39 @@ const reactions = await perspective.querySurrealDB(` `); ``` -### Filtering by Properties - -```typescript -// Find all links from Alice with a specific timestamp range -const recentLinks = await perspective.querySurrealDB( - "SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'" -); - -// Find links by author -const bobsLinks = await perspective.querySurrealDB( - "SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'" -); -``` - -## Advanced Graph Traversal Patterns - -For complex graph queries, SurrealDB provides powerful traversal operators that let you navigate multi-hop relationships in a single query. - -### The Graph Traversal Operator (`->`) - -The `->` operator allows you to traverse edges in your graph. Combined with filtering and array indexing, you can express complex patterns efficiently: - -**Syntax**: `node->link[WHERE condition][index].field` - -- `node->link` - Follow link edges from the node -- `[WHERE condition]` - Filter the traversed links (optional) -- `[index]` - Select a specific result (e.g., `[0]` for first, `[-1]` for last) -- `.field` - Access a field from the result (e.g., `.out.uri` for target URI) - -### Multi-Hop Traversal Examples - -```typescript -// Get the type of child items (2-hop traversal) -// Traverse: Parent -> Child (via 'ad4m://has_child') -> Type (via 'flux://entry_type') -const query = ` - SELECT - out.uri AS child, - out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type - FROM link - WHERE in.uri = 'parent://123' - AND predicate = 'ad4m://has_child' -`; -const results = await perspective.querySurrealDB(query); -// Results include child URI and its type -``` - -### Filtering on Multi-Hop Properties - -You can filter based on properties several hops away: - -```typescript -// Find all children that are of type 'conversation_subgroup' -const subgroups = ` - SELECT out.uri AS subgroup - FROM link - WHERE in.uri = 'conversation://456' - AND predicate = 'ad4m://has_child' - AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' -`; -const results = await perspective.querySurrealDB(subgroups); -``` - -### The `fn::parse_literal()` Function +### Parsing Literal Values -AD4M provides a custom SurrealDB function to parse literal values. Literals in AD4M are stored as URIs like: -- `literal://string:Hello` → `"Hello"` -- `literal://number:42` → `42` -- `literal://boolean:true` → `true` -- `literal://json:{"data":"value"}` → `"value"` (extracts `.data` field) +AD4M stores values as literal URIs. Use `fn::parse_literal()` to extract them: -**Usage**: +| Literal URI | Parsed Value | +|-------------|-------------| +| `literal://string:Hello` | `"Hello"` | +| `literal://number:42` | `42` | +| `literal://boolean:true` | `true` | +| `literal://json:{"data":"value"}` | extracts `.data` field | ```typescript -// Extract parsed values from literals const query = ` SELECT - out.uri AS baseExpression, + out.uri AS id, fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS title, fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS body, fn::parse_literal(out->link[WHERE predicate = 'flux://count'][0].out.uri) AS count FROM link - WHERE in.uri = 'parent://789' - AND predicate = 'ad4m://has_child' + WHERE in.uri = 'parent://789' AND predicate = 'ad4m://has_child' `; const results = await perspective.querySurrealDB(query); -// Results have parsed values: { baseExpression, title: "Hello", body: "World", count: 42 } +// { id, title: "Hello", body: "World", count: 42 } ``` -### Real-World Example: Querying Messages with Metadata +### Real-World Examples -Here's a complete example showing how to query messages with their metadata: +#### Messages with Metadata ```typescript -// Get messages with type, body, and author information const messagesQuery = ` SELECT - out.uri AS baseExpression, + out.uri AS id, author, timestamp, out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type, @@ -350,61 +288,15 @@ const messagesQuery = ` ) ORDER BY timestamp ASC `; - const messages = await perspective.querySurrealDB(messagesQuery); -// Each message includes: baseExpression, author, timestamp, type, messageBody, postTitle -``` - -### Counting Nested Items - -Count items that match complex multi-hop conditions: - -```typescript -// Count conversation subgroups -const countQuery = ` - SELECT count() AS count - FROM link - WHERE in.uri = 'conversation://abc' - AND predicate = 'ad4m://has_child' - AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' -`; - -const result = await perspective.querySurrealDB(countQuery); -console.log(`Found ${result[0].count} subgroups`); ``` -### Finding Unique Values Across Hops - -Get unique authors from items nested within subgroups: +#### Mixed Item Types with Metadata ```typescript -// Get unique participants from nested items -// Traverse: Conversation -> Subgroups -> Items -> Extract unique authors -const participantsQuery = ` - SELECT VALUE author - FROM link - WHERE in.uri = 'conversation://xyz' - AND predicate = 'ad4m://has_child' - AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' - AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE - GROUP BY author -`; - -const participants = await perspective.querySurrealDB(participantsQuery); -// Returns array of unique author DIDs -``` - -### Complex Multi-Condition Queries - -Combine multiple traversals and conditions: - -```typescript -// Find all tasks, posts, and messages with their specific metadata const itemsQuery = ` SELECT - out.uri AS item, - author, - timestamp, + out.uri AS item, author, timestamp, out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type, fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody, fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle, @@ -420,37 +312,41 @@ const itemsQuery = ` ORDER BY timestamp DESC LIMIT 50 `; - -const items = await perspective.querySurrealDB(itemsQuery); -// Returns mixed items with appropriate metadata populated based on type ``` -### Performance Tips for Complex Queries - -1. **Index-Friendly Patterns**: Start with indexed fields (`in.uri`, `out.uri`, `predicate`) -2. **Filter Within Traversals**: Use `->link[WHERE predicate = 'x']` to filter as you traverse -3. **Array Indexing**: Use `[0]` to get first result efficiently, `[-1]` for last -4. **Traversal Depth**: 2-4 hops perform well in a single query -5. **Use IS NOT NONE**: Check for existence of traversed values to avoid errors -6. **Combine Conditions**: Use AND/OR in WHERE clauses on final filtered results - -### Pattern Breakdown - -Understanding the query structure: +#### Counting and Unique Values ```typescript -// Pattern: node->link[filter][index].field -out->link[WHERE predicate = 'flux://entry_type'][0].out.uri +// Count conversation subgroups +const countQuery = ` + SELECT count() AS count + FROM link + WHERE in.uri = 'conversation://abc' + AND predicate = 'ad4m://has_child' + AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' +`; +const result = await perspective.querySurrealDB(countQuery); -// Breakdown: -// 1. out - Start from the target node -// 2. ->link - Follow link edges -// 3. [WHERE predicate = ...]- Filter to specific predicate -// 4. [0] - Take first matching link -// 5. .out.uri - Get the target URI of that link +// Get unique participants from nested items +const participantsQuery = ` + SELECT VALUE out->link[WHERE predicate = 'ad4m://has_child'].author + FROM link + WHERE in.uri = 'conversation://xyz' + AND predicate = 'ad4m://has_child' + AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' + AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE +`; +// Returns nested author arrays (one per subgroup) — flatten and deduplicate client-side ``` -This pattern is equivalent to asking: "From this node, follow links with a specific predicate and tell me where they point." +### Performance Tips + +1. **Start with indexed fields**: `predicate`, `source`, `target` are independently indexed; `in`/`out` are composite-indexed with `predicate` +2. **Filter within traversals**: `->link[WHERE predicate = 'x']` filters as you traverse +3. **Array indexing**: `[0]` for first, `[-1]` for last result +4. **Traversal depth**: 2–4 hops perform well in a single query +5. **Use IS NOT NONE**: Check existence of traversed values to avoid errors +6. **Combine conditions**: AND/OR in WHERE clauses on final filtered results ## Using SurrealDB with Ad4mModel @@ -459,7 +355,7 @@ This pattern is equivalent to asking: "From this node, follow links with a speci ### findAll() - Default Uses SurrealDB ```typescript -@ModelOptions({ name: "Recipe" }) +@Model({ name: "Recipe" }) class Recipe extends Ad4mModel { @Property({ through: "recipe://name", resolveLanguage: "literal" }) name: string = ""; @@ -738,7 +634,7 @@ const recipes = await Recipe.findAll(perspective, { 8. **Profile Performance**: Use browser DevTools to measure query performance -9. **Index Awareness**: The system automatically indexes `in.uri`, `out.uri`, `predicate`, `source`, and `target` +9. **Index Awareness**: `predicate`, `source`, and `target` are independently indexed. `(in, predicate)` and `(out, predicate)` have composite indexes — always pair `in.uri`/`out.uri` with `predicate` for best performance 10. **Traversal Depth**: You can safely traverse 2-4 hops in a single query with good performance diff --git a/docs-src/pages/index.mdx b/docs-src/pages/index.mdx index d8b4de0b4..064bd7317 100644 --- a/docs-src/pages/index.mdx +++ b/docs-src/pages/index.mdx @@ -260,49 +260,24 @@ For app developers, writing queries directly is optional-AD4M's `Ad4mModel` clas This TypeScript base class lets you define model classes with properties and relationships, automatically using **SurrealDB** under the hood for fast query performance (10-100x faster than Prolog). Here's how you define a model: ```typescript -import { Ad4mModel, ModelOptions, Property, Collection, Flag, Optional, ReadOnly } from "@coasys/ad4m"; +import { Ad4mModel, Model, Property, HasMany, Flag, ReadOnly } from "@coasys/ad4m"; -@ModelOptions({ - name: "Todo" -}) +@Model({ name: "Todo" }) class Todo extends Ad4mModel { - @Property({ - through: "todo://state", - initial: "todo://ready" - }) + @Property({ through: "todo://state", initial: "todo://ready" }) state: string = ""; - @Optional({ - through: "todo://has_title", - writable: true, - resolveLanguage: "literal" - }) + @Property({ through: "todo://has_title" }) title: string = ""; @ReadOnly({ - getter: 'triple(Base, "flux://has_reaction", "flux://thumbsup"), Value = true' + through: "todo://is_liked", + getter: 'count(->link[WHERE predicate = "flux://has_reaction" AND out.uri = "flux://thumbsup"]) > 0' }) isLiked: boolean = false; - @Collection({ through: "todo://comment" }) + @HasMany({ through: "todo://comment" }) comments: string[] = []; - - @Collection({ - through: "flux://entry_type", - where: { prologCondition: 'triple(Target, "flux://has_reaction", "flux://thumbsup")' } - }) - likedMessages: string[] = []; - - // Static query methods - static async all(perspective: PerspectiveProxy): Promise { - return await Todo.findAll(perspective); - } - - static async allDone(perspective: PerspectiveProxy): Promise { - return await Todo.findAll(perspective, { - where: { state: "todo://done" } - }); - } } ``` @@ -325,12 +300,14 @@ todo.state = "todo://ready"; await todo.save(); // Query todos -const allTodos = await Todo.all(perspective); -const doneTodos = await Todo.allDone(perspective); +const allTodos = await Todo.findAll(perspective); +const doneTodos = await Todo.query(perspective) + .where({ state: "todo://done" }) + .get(); // Update a todo todo.state = "todo://done"; -await todo.update(); +await todo.save(); // Delete a todo await todo.delete(); diff --git a/docs-src/pages/social-dna.mdx b/docs-src/pages/social-dna.mdx index 2c87e721d..6da4d1462 100644 --- a/docs-src/pages/social-dna.mdx +++ b/docs-src/pages/social-dna.mdx @@ -168,24 +168,15 @@ Here's how a Todo class maps to SHACL: ```typescript - @ModelOptions({ name: "Todo" }) + @Model({ name: "Todo" }) class Todo extends Ad4mModel { - @Property({ - through: "todo://state", - initial: "todo://ready" - }) + @Property({ through: "todo://state", initial: "todo://ready" }) state: string = ""; - @Optional({ - through: "todo://has_title", - writable: true, - resolveLanguage: "literal" - }) + @Property({ through: "todo://has_title" }) title?: string; - @Collection({ - through: "todo://comment" - }) + @HasMany({ through: "todo://comment" }) comments: string[] = []; } ``` @@ -214,7 +205,6 @@ Here's how a Todo class maps to SHACL: sh:datatype xsd:string ; sh:maxCount 1 ; ad4m:resolveLanguage "literal" ; - ad4m:writable true ; ] ; # Collection: comments (unbounded) @@ -258,7 +248,7 @@ Here's how a Todo class maps to SHACL: | `sh:class ` | Reference to another Subject Class | Typed relationship | | `ad4m://initial` | Default value on creation | Initial state | | `ad4m://resolveLanguage` | Expression language for values | `"literal"` for inline values | -| `ad4m://writable` | Property can be updated | Enables setter generation | +| `ad4m://readOnly` | Property is read-only | Computed/immutable property | ### Using Subject Classes in Code @@ -274,47 +264,33 @@ This TypeScript-based approach provides: Here's how to define and use Subject Classes the recommended way: ```typescript -import { Ad4mModel, ModelOptions, Property, Optional, Collection } from '@coasys/ad4m'; +import { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m'; -@ModelOptions({ name: "Todo" }) +@Model({ name: "Todo" }) class Todo extends Ad4mModel { - @Property({ - through: "todo://state", - initial: "todo://ready" - }) + @Property({ through: "todo://state", initial: "todo://ready" }) state: string = ""; - @Optional({ - through: "todo://has_title", - writable: true, - resolveLanguage: "literal" - }) + @Property({ through: "todo://has_title" }) title?: string; - @Collection({ - through: "todo://comment" - }) + @HasMany({ through: "todo://comment" }) comments: string[] = []; - - // Static query methods - @InstanceQuery() - static async all(perspective: PerspectiveProxy): Promise { return [] } - - @InstanceQuery({ where: { state: "todo://done" }}) - static async allDone(perspective: PerspectiveProxy): Promise { return [] } } -// Register the class with a perspective -await perspective.ensureSDNASubjectClass(Todo); +// Register the class with a perspective (once at app startup) +await Todo.register(perspective); // Use it with full type safety and ActiveRecord patterns const todo = new Todo(perspective); todo.state = "todo://doing"; await todo.save(); -// Query with type safety -const todos = await Todo.all(perspective); -const doneTodos = await Todo.allDone(perspective); +// Query with the fluent API +const todos = await Todo.findAll(perspective); +const doneTodos = await Todo.query(perspective) + .where({ state: "todo://done" }) + .get(); ``` This approach automatically generates SHACL and provides a rich development experience. @@ -356,7 +332,7 @@ For a complete understanding, here are the basic PerspectiveProxy methods that p ```typescript // Add a subject class definition (SHACL) to a perspective -await perspective.ensureSDNASubjectClass(Todo); +await Todo.register(perspective); // Or add SHACL directly await perspective.addShacl("Todo", shape); @@ -536,7 +512,7 @@ To add Social DNA to a Perspective: ```typescript // Recommended: Use Model Classes (auto-generates SHACL) -await perspective.ensureSDNASubjectClass(Todo); +await Todo.register(perspective); // Or add SHACL shapes directly const shape = new SHACLShape('todo://Todo'); diff --git a/docs/404.html b/docs/404.html index 04cf65d29..bc09151ba 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html deleted file mode 100644 index 04cf65d29..000000000 --- a/docs/404/index.html +++ /dev/null @@ -1 +0,0 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/chunks/nextra-data-en-US.json b/docs/_next/static/chunks/nextra-data-en-US.json index 08a5d7c3e..52b29d94f 100644 --- a/docs/_next/static/chunks/nextra-data-en-US.json +++ b/docs/_next/static/chunks/nextra-data-en-US.json @@ -1 +1 @@ -{"/auth":{"title":"Authentication & Capabilities","data":{"overview#Overview":"AD4M uses a capability-based security model to protect user data and control access to agent functionality. Every application that wants to interact with an AD4M executor needs to request specific capabilities, which are then granted (or denied) by the user.","what-are-capabilities#What are Capabilities?":"Capabilities in AD4M are like permission tokens that:\nDefine what data an application can access (which perspectives)\nSpecify what operations an application can perform\nAre scoped to specific domains and functions\nCan be revoked by the user at any time\nA capability token might grant permissions like:\nRead access to specific perspectives\nWrite access to create or modify links\nAbility to create new perspectives\nPermission to manage agent relationships\nAccess to specific language functions","authentication-flow#Authentication Flow":"","standard-flow#Standard Flow":"When an application wants to connect to an AD4M executor, it goes through a secure authentication handshake:\nThe application requests access with specific capabilities\nThe AD4M executor generates a random verification code\nThe user must confirm the request and enter the code\nUpon successful verification, a capability token is issued\nThis flow ensures that:\nThe user explicitly approves application access\nThe application only gets the permissions it needs\nThe connection between UI and executor is secure","using-ad4m-connect#Using ad4m-connect":"The easiest way to implement this flow is using our ad4m-connect library:\nimport Ad4mConnect from \"@coasys/ad4m-connect\";\nconst ui = Ad4mConnect({\n appName: \"My First ADAM App\",\n appDesc: \"This is my first app here.\",\n appDomain: \"ad4m.dev\",\n appIconPath: \"https://i.ibb.co/GnqjPJP/icon.png\",\n capabilities: [{ \n with: { domain: \"*\", pointers: [\"*\"] }, \n can: [\"*\"] \n }],\n});\n// .connect() will show the authentication pop up\nui.connect().then((client) => {\n // Client is now authenticated with requested capabilities\n});\nIf ad4m-connect could not find a running AD4M-executor, it will show a screen prompting the user to either download and run\nthe AD4M Launcher to provide other connection settings:When ad4m-connect was able to find a running AD4M-executor, it will begin the authentication flow:\nClicking on \"Authorize\" will trigger the request against the AD4M-executor and Launcher will open a pop-up prompting the user\nwith the nature of this request:\nThe application requesting access\nThe capabilities being requested\nIf the user approves the request, the Launcher will show a six-digit random secret code that needs to be entered into the app UI.\nThat way we have safely established that the network agent initiating the capability request (as seen from\nthe AD4M-executor) really is the UI the users wants to use.\n(It could run on an external device, like the user's phone connecting through a proxy server).","capability-specification#Capability Specification":"When requesting capabilities, you need to specify:\n{\n with: {\n domain: string | \"*\", // Which perspective/domain\n pointers: string[] | \"*\" // Which parts of the domain\n },\n can: string[] | \"*\" // Which operations are allowed\n}\nExamples:\n// Request access to everything (development only)\n{ with: { domain: \"*\", pointers: [\"*\"] }, can: [\"*\"] }\n// Request read-only access to a specific perspective\n{ with: { domain: \"perspective-uuid\", pointers: [\"*\"] }, can: [\"read\"] }\n// Request specific operations on a domain\n{ with: { domain: \"friends\", pointers: [\"*\"] }, can: [\"read\", \"add\", \"remove\"] }","admin-credential-override#Admin Credential Override":"For automated scenarios or system integration, the authentication handshake can be bypassed using an admin credential:\n// In your application\nconst client = new Ad4mClient({\n adminCredential: \"your-secret-here\"\n});\nThis is particularly useful for:\nCI/CD pipelines\nTesting environments\nSystem services\nManagement interfaces (the AD4M Launcher uses this internally)\nTo enable this on the executor:\nad4m-executor run --admin-credential your-secret-here\n⚠️ Security Note: The admin credential grants full access to the executor. Use it carefully and never expose it in client-side code or public repositories.","best-practices#Best Practices":"Request Minimal Capabilities\nOnly request permissions your app actually needs\nUse specific domains and operations instead of wildcards\nConsider read-only access when possible\nHandle Authentication States\nCheck if capabilities are still valid\nImplement reconnection logic\nHandle capability revocation gracefully\nSecure Storage\nStore capability tokens securely\nNever expose admin credentials\nImplement token refresh mechanisms\nUser Experience\nClearly explain why your app needs certain capabilities\nProvide feedback during the authentication process\nHandle errors gracefully","more-information#More Information":"For more details about implementing authentication in your application:\nCheck the ad4m-connect documentation\nSee the Ad4mClient API reference"}},"/developer-guides/ai":{"title":"AI in AD4M","data":{"":"AD4M provides powerful AI capabilities through both local and remote model inference. This allows you to integrate various AI models into your applications, from language models to embedding models and speech recognition.","overview#Overview":"The AI system in AD4M supports:\nLarge Language Models (LLM) for text generation and chat\nEmbedding Models for vector representations of text\nSpeech-to-Text Models for audio transcription\nBoth local and remote (API-based) model execution\nModel management and configuration\nTask-based inference with system prompts and examples","model-configuration#Model Configuration":"Before using AI features, models need to be configured in the AD4M Launcher. Models can be either local (running on your device) or remote (using external APIs).","local-models#Local Models":"Local models run directly on your device using CPU or GPU acceleration (if available). There are three ways to configure local models:","1-pre-configured-models#1. Pre-configured Models":"AD4M comes with several pre-configured models that can be used by simply specifying their name:\nconst preConfiguredModel = {\n name: \"DeepHermes 3 (Q4)\",\n local: {\n fileName: \"deephermes-3-llama-3-8b-Q4\" // Just specify the model name\n },\n modelType: \"LLM\"\n};\nAvailable pre-configured models:Language Models (LLM):\nQwen2.5.1-Coder-7B-Instruct - Optimized for coding tasks\ndeephermes-3-llama-3-8b-Q4 - Fast, efficient 8B parameter model (Q4 quantization)\ndeephermes-3-llama-3-8b-Q6 - Better quality, slightly larger (Q6 quantization)\ndeephermes-3-llama-3-8b-Q8 - Best quality, largest size (Q8 quantization)\ndeepseek_r1_distill_qwen_1_5b - Small, fast 1.5B parameter model\ndeepseek_r1_distill_qwen_7b - Medium 7B parameter model\ndeepseek_r1_distill_qwen_14b - Large 14B parameter model\nEmbedding Models:\nbert - Built-in BERT model for text embeddings\nSpeech-to-Text Models:\nWhisper - OpenAI's Whisper model for audio transcription","2-models-from-hugging-face#2. Models from Hugging Face":"AD4M can automatically download and use models from Hugging Face. Just provide the repository details:\nconst huggingFaceModel = {\n name: \"Custom LLM\",\n local: {\n fileName: \"model.gguf\", // The model file to use from the repo\n huggingfaceRepo: \"username/model-repo\", // Hugging Face repository path\n revision: \"main\", // Branch or tag to use\n tokenizerSource: { // Optional custom tokenizer\n repo: \"username/tokenizer-repo\",\n revision: \"main\",\n fileName: \"tokenizer.json\"\n }\n },\n modelType: \"LLM\"\n};\n// Example with a specific model version\nconst versionedModel = {\n name: \"Specific Model Version\",\n local: {\n fileName: \"model-q4.gguf\",\n huggingfaceRepo: \"TheBloke/Mistral-7B-Instruct-v0.1-GGUF\",\n revision: \"main\"\n },\n modelType: \"LLM\"\n};\nWhen you add a model with a Hugging Face repository, AD4M will:\nDownload the model files from Hugging Face\nStore them locally\nLoad the model when needed","3-local-files#3. Local Files":"You can also use model files that are already on your device:\nconst localFileModel = {\n name: \"My Local Model\",\n local: {\n fileName: \"/absolute/path/to/model.gguf\", // Full path to model file\n tokenizerSource: {\n repo: \"\", // Empty repo means local file\n fileName: \"/path/to/tokenizer.json\"\n }\n },\n modelType: \"LLM\"\n};","remote-models-api#Remote Models (API)":"Remote models use external APIs for inference. AD4M currently supports OpenAI-compatible APIs:\n// OpenAI API\nconst openAiModel = {\n name: \"GPT-4\",\n api: {\n baseUrl: \"https://api.openai.com/v1\",\n apiKey: \"your-api-key\",\n model: \"gpt-4\",\n apiType: \"OPEN_AI\"\n },\n modelType: \"LLM\"\n};\n// Custom OpenAI-compatible API\nconst customApiModel = {\n name: \"Local API Server\",\n api: {\n baseUrl: \"http://localhost:8000\",\n apiKey: \"local-key\",\n model: \"local-model\",\n apiType: \"OPEN_AI\"\n },\n modelType: \"LLM\"\n};","hardware-acceleration#Hardware Acceleration":"AD4M automatically detects and uses available hardware acceleration:\nCUDA: For NVIDIA GPUs (requires cuda feature)\nMetal: For Apple Silicon and AMD GPUs on macOS (requires metal feature)\nCPU: Falls back to CPU if no GPU acceleration is available","using-ai-in-your-application#Using AI in Your Application":"","1-adding-models#1. Adding Models":"import { Ad4mClient } from '@coasys/ad4m';\nconst client = new Ad4mClient();\n// Add a model\nconst modelId = await client.ai.addModel(modelConfig);\n// Wait for model to load\nlet status;\ndo {\n status = await client.ai.modelLoadingStatus(modelId);\n await new Promise(resolve => setTimeout(resolve, 1000));\n} while (status.progress < 100);","2-creating-ai-tasks#2. Creating AI Tasks":"Tasks allow you to define specific use cases with system prompts and examples:\nconst task = await client.ai.addTask(\n \"code-helper\",\n modelId,\n \"You are a helpful coding assistant. Provide clear and concise code examples.\",\n [\n { \n input: \"How do I read a file in Node.js?\", \n output: \"Here's a simple example using fs.readFile:\\n\\n```javascript\\nconst fs = require('fs');\\n\\nfs.readFile('file.txt', 'utf8', (err, data) => {\\n if (err) throw err;\\n console.log(data);\\n});\\n```\" \n }\n ]\n);","3-using-models#3. Using Models":"","text-generation-llm#Text Generation (LLM)":"// Using a task\nconst response = await client.ai.prompt(\n task.taskId,\n \"How do I create a web server in Node.js?\"\n);\n// The response will follow the system prompt and examples pattern\nconsole.log(response);","text-embeddings#Text Embeddings":"// Get vector representation of text\nconst vector = await client.ai.embed(\n \"bert\", // Built-in BERT model\n \"Convert this text to a vector\"\n);","speech-to-text#Speech-to-Text":"// Open a transcription stream\nconst streamId = await client.ai.openTranscriptionStream(\n \"Whisper\",\n (text) => {\n console.log(\"Transcribed:\", text);\n },\n {\n // Optional voice activity detection parameters\n startThreshold: 0.3,\n startWindow: 150,\n endThreshold: 0.2,\n endWindow: 300,\n timeBeforeSpeech: 100\n }\n);\n// Feed audio data (Float32Array samples at 16kHz)\nawait client.ai.feedTranscriptionStream(streamId, audioSamples);\n// Close stream when done\nawait client.ai.closeTranscriptionStream(streamId);\n// Or use multiple streams simultaneously\nconst fastStreamId = await client.ai.openTranscriptionStream(\n \"whisper_tiny\",\n (text) => console.log(\"Fast preview:\", text),\n {\n startThreshold: 0.25,\n startWindow: 100,\n endThreshold: 0.15,\n endWindow: 100\n }\n);\nconst accurateStreamId = await client.ai.openTranscriptionStream(\n \"whisper_small\",\n (text) => console.log(\"Accurate:\", text),\n {\n startThreshold: 0.3,\n startWindow: 150,\n endThreshold: 0.2,\n endWindow: 500\n }\n);\n// Feed same audio to both streams with a single call\nawait client.ai.feedTranscriptionStream([fastStreamId, accurateStreamId], audioSamples);\nNote: Transcription streams are automatically cleaned up after 30 seconds of inactivity.","best-practices#Best Practices":"Model Selection\nUse quantized models (Q4/Q6) for faster inference on CPU\nUse larger models when quality is critical\nConsider API models for production use cases\nTask Design\nWrite clear system prompts\nProvide specific examples\nUse task-specific models when possible\nResource Management\nClose transcription streams when done\nMonitor model loading status\nHandle errors appropriately\nPerformance\nUse GPU acceleration when available\nBatch similar requests together\nConsider model size vs performance tradeoffs","error-handling#Error Handling":"try {\n const response = await client.ai.prompt(taskId, prompt);\n} catch (error) {\n if (error.message.includes(\"Model not found\")) {\n // Handle missing model\n } else if (error.message.includes(\"Task not found\")) {\n // Handle missing task\n } else {\n // Handle other errors\n }\n}","advanced-features#Advanced Features":"","default-models#Default Models":"You can set default models for each type:\nawait client.ai.setDefaultModel(\"LLM\", modelId);\n// Use default model in tasks\nconst task = await client.ai.addTask(\n \"default-task\",\n \"default\", // Uses the default LLM\n \"System prompt...\",\n []\n);","model-updates#Model Updates":"Models can be updated while maintaining tasks:\nconst updated = await client.ai.updateModel(modelId, newConfig);","real-time-transcription#Real-time Transcription":"Configure voice activity detection for word-by-word transcription:\nconst streamId = await client.ai.openTranscriptionStream(\n \"Whisper\",\n (text) => console.log(\"Word:\", text),\n {\n startThreshold: 0.25,\n startWindow: 100,\n endThreshold: 0.15,\n endWindow: 100,\n timeBeforeSpeech: 20\n }\n);","multiple-transcription-streams#Multiple Transcription Streams":"You can process the same audio through multiple models simultaneously:\n// Use a fast model for real-time preview\nconst fastStreamId = await client.ai.openTranscriptionStream(\n \"whisper_tiny\",\n (text) => console.log(\"Preview:\", text),\n { startThreshold: 0.25, endWindow: 100 }\n);\n// Use a more accurate model for final results\nconst accurateStreamId = await client.ai.openTranscriptionStream(\n \"whisper_small\",\n (text) => console.log(\"Final:\", text),\n { startThreshold: 0.3, endWindow: 500 }\n);\n// Feed audio to both streams efficiently\nawait client.ai.feedTranscriptionStream([fastStreamId, accurateStreamId], audioSamples);","automatic-stream-cleanup#Automatic Stream Cleanup":"Transcription streams are automatically cleaned up after 30 seconds of inactivity to prevent resource leaks. This means:\nNo need to manually close streams if the client disconnects\nResources are freed automatically when streams are abandoned\nStreams remain active as long as they receive audio data regularly"}},"/developer-guides/batch-operations":{"title":"Batch Operations","data":{"overview#Overview":"Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This feature is particularly useful when you need to perform multiple related changes that should either all succeed or all fail together, or when you want to optimize performance by reducing the number of Prolog engine updates and network operations.","key-benefits#Key Benefits":"","1-atomicity#1. Atomicity":"All operations in a batch are applied together or none are applied\nPrevents partial updates that could leave your data in an inconsistent state\nIdeal for complex operations that require multiple related changes","2-performance-optimization#2. Performance Optimization":"Reduces the number of Prolog engine updates (which can be computationally expensive)\nMinimizes the number of commits to the neighbourhood's link language\nBatches network operations for shared perspectives\nImproves overall system responsiveness when making multiple changes","using-batch-operations#Using Batch Operations":"","basic-usage-with-perspectiveproxy#Basic Usage with PerspectiveProxy":"// Create a new batch\nconst batchId = await perspective.createBatch();\ntry {\n // Add multiple links in the batch\n await perspective.add(link1, 'shared', batchId);\n await perspective.add(link2, 'shared', batchId);\n \n // Remove a link in the same batch\n await perspective.remove(oldLink, batchId);\n \n // Update a link in the batch\n await perspective.update(existingLink, newLink, batchId);\n \n // Commit all changes atomically\n const result = await perspective.commitBatch(batchId);\n console.log('Added:', result.additions.length);\n console.log('Removed:', result.removals.length);\n} catch (error) {\n // If any operation fails, none of the changes are applied\n console.error('Batch operation failed:', error);\n}","using-batches-with-ad4mmodel#Using Batches with Ad4mModel":"// Create a batch for model operations\nconst batchId = await perspective.createBatch();\ntry {\n // Create a new model instance\n const recipe = new Recipe(perspective);\n recipe.title = \"Chocolate Cake\";\n recipe.ingredients = [\"Sugar\", \"Flour\", \"Cocoa\"];\n await recipe.save(batchId);\n // Update another model in the same batch\n const existingRecipe = await Recipe.findAll(perspective)[0];\n existingRecipe.title = \"Updated Title\";\n await existingRecipe.update(batchId);\n // Delete a model in the batch\n await anotherRecipe.delete(batchId);\n // Commit all model changes together\n await perspective.commitBatch(batchId);\n} catch (error) {\n console.error('Model batch operations failed:', error);\n}","when-to-use-batch-operations#When to Use Batch Operations":"","1-complex-data-models#1. Complex Data Models":"When your application needs to maintain relationships between multiple entities:\nconst batchId = await perspective.createBatch();\n// Create a user profile with related entities\nawait userProfile.save(batchId);\nawait userSettings.save(batchId);\nfor (const preference of userPreferences) {\n await preference.save(batchId);\n}\nawait perspective.commitBatch(batchId);","2-bulk-operations#2. Bulk Operations":"When performing operations on multiple items:\nconst batchId = await perspective.createBatch();\n// Bulk status update\nfor (const task of tasks) {\n task.status = 'completed';\n await task.update(batchId);\n}\nawait perspective.commitBatch(batchId);","3-state-transitions#3. State Transitions":"When an operation requires multiple coordinated changes:\nconst batchId = await perspective.createBatch();\n// Moving a task between lists\nawait sourceList.removeTask(task, batchId);\nawait targetList.addTask(task, batchId);\nawait task.updateStatus('moved', batchId);\nawait perspective.commitBatch(batchId);","technical-details#Technical Details":"","batch-storage#Batch Storage":"Batches are stored in memory until committed\nEach batch has a unique UUID\nChanges are tracked separately for shared and local links","prolog-engine-synchronization#Prolog Engine Synchronization":"Prolog facts are updated only once per batch commit\nUpdates are performed using a oneshot channel to ensure completion\nThe engine state remains consistent with all changes","link-language-integration#Link Language Integration":"For shared perspectives, commits to the link language happen only once per batch\nReduces network operations in distributed scenarios","best-practices#Best Practices":"Batch Size\nKeep batches focused on related operations\nAvoid extremely large batches that could impact memory usage\nConsider splitting very large operations into multiple smaller batches\nError Handling\nconst batchId = await perspective.createBatch();\ntry {\n // Perform batch operations\n await perspective.commitBatch(batchId);\n} catch (error) {\n // Handle errors appropriately\n // No changes will be persisted\n}\nResource Management\nCommit or abandon batches in a timely manner\nDon't keep batches open longer than necessary\nConsider using async/await patterns for better control flow\nTesting\nTest both successful and failed batch scenarios\nVerify data consistency after batch operations\nInclude edge cases in your test suite","limitations-and-considerations#Limitations and Considerations":"Memory Usage\nBatches store changes in memory until committed\nVery large batches may impact system performance\nConcurrency\nBatch operations don't provide explicit locking\nConsider application-level synchronization for concurrent operations\nNetwork Connectivity\nFor shared perspectives, ensure stable network connectivity before committing large batches\nConsider implementing retry logic for network-related failures","examples#Examples":"","complex-subject-creation#Complex Subject Creation":"const batchId = await perspective.createBatch();\n// Create main subject\nconst post = new BlogPost(perspective);\npost.title = \"My First Post\";\nawait post.save(batchId);\n// Create related subjects\nconst comments = initialComments.map(comment => {\n const c = new Comment(perspective);\n c.content = comment;\n c.postId = post.baseExpression;\n return c;\n});\n// Save all related subjects in the same batch\nawait Promise.all(comments.map(c => c.save(batchId)));\n// Commit everything together\nawait perspective.commitBatch(batchId);","batch-processing-with-validation#Batch Processing with Validation":"async function updateRecipeWithIngredients(recipe, ingredients) {\n const batchId = await perspective.createBatch();\n \n try {\n // Validate all ingredients first\n for (const ingredient of ingredients) {\n if (!await validateIngredient(ingredient)) {\n throw new Error(`Invalid ingredient: ${ingredient}`);\n }\n }\n \n // If all valid, proceed with updates\n recipe.ingredients = ingredients;\n await recipe.update(batchId);\n \n // Create ingredient references\n for (const ingredient of ingredients) {\n const ref = new IngredientReference(perspective);\n ref.recipeId = recipe.baseExpression;\n ref.ingredientId = ingredient.id;\n await ref.save(batchId);\n }\n \n await perspective.commitBatch(batchId);\n } catch (error) {\n // No changes are persisted if any operation fails\n throw new Error(`Failed to update recipe: ${error.message}`);\n }\n}","migration-guide#Migration Guide":"Existing code will continue to work without modification. To adopt batch operations:\nIdentify groups of related operations in your code\nCreate a batch using perspective.createBatch()\nAdd the batchId parameter to your operations\nWrap operations in try/catch blocks\nCommit the batch when all operations are complete\nNo schema changes or data migration is required to use this feature."}},"/developer-guides/model-classes":{"title":"Model Classes in AD4M","data":{"":"Model classes in AD4M provide a way to define, store, and query structured data in your application. Let's start with a simple example that we'll build upon:","quick-start#Quick Start":"There are two ways to create model classes in AD4M:","option-1-using-decorators-traditional#Option 1: Using Decorators (Traditional)":"import { Ad4mModel, ModelOptions, Property } from '@coasys/ad4m';\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n}\n// Using the model\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nawait recipe.save();\n// Reading it back\nconst recipes = await Recipe.findAll(perspective);\nconsole.log(recipes[0].name); // \"Chocolate Cake\"","option-2-from-json-schema-dynamic#Option 2: From JSON Schema (Dynamic)":"Perfect for integrating with external systems or when you have existing JSON Schema definitions:\nimport { Ad4mModel } from '@coasys/ad4m';\n// Define your data structure using JSON Schema\nconst recipeSchema = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Recipe\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"ingredients\": { \n \"type\": \"array\", \n \"items\": { \"type\": \"string\" } \n },\n \"difficulty\": { \"type\": \"number\" }\n },\n \"required\": [\"name\"]\n};\n// Dynamically create the model class\nconst Recipe = Ad4mModel.fromJSONSchema(recipeSchema, {\n name: \"Recipe\",\n namespace: \"recipe://\",\n resolveLanguage: \"literal\"\n});\n// Use exactly like decorator-based models\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nrecipe.difficulty = 3;\nawait recipe.save();\nBefore using any model class, register it with your perspective:\nawait perspective.ensureSDNASubjectClass(Recipe);","basic-concepts#Basic Concepts":"","properties#Properties":"Properties are the basic building blocks of your models. They can be required or optional:\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n // Required property\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n // Optional property\n @Optional({\n through: \"recipe://description\",\n resolveLanguage: \"literal\"\n })\n description?: string;\n}","collections#Collections":"Collections represent one-to-many relationships:\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n @Collection({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n}\n// Using collections\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nawait recipe.save();","working-with-models#Working with Models":"","creating--saving#Creating & Saving":"// Create new instance\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nawait recipe.save();\n// Create with specific ID\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake\");\nawait recipe.save();","reading--updating#Reading & Updating":"// Get by ID\nconst recipe = new Recipe(perspective, existingId);\nawait recipe.get();\n// Update\nrecipe.name = \"Dark Chocolate Cake\";\nawait recipe.update();","basic-querying#Basic Querying":"// Get all recipes (uses SurrealDB by default - 10-100x faster)\nconst allRecipes = await Recipe.findAll(perspective);\n// Get with simple conditions\nconst recipes = await Recipe.findAll(perspective, {\n where: { name: \"Chocolate Cake\" }\n});","query-performance-with-surrealdb#Query Performance with SurrealDB":"Important: Ad4mModel now uses SurrealDB by default for all query operations, providing 10-100x faster performance compared to the legacy Prolog engine. This means:\nfindAll() automatically uses SurrealDB\nfindAllAndCount() automatically uses SurrealDB\nQuery builder methods automatically use SurrealDB\nLive query subscriptions automatically use SurrealDB\n// Uses SurrealDB by default (fast!)\nconst highRated = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } },\n order: { rating: \"DESC\" },\n limit: 10\n});\n// You can explicitly use Prolog if needed (for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false\nFor advanced graph traversal queries and direct SurrealQL access, see the SurrealDB Queries Guide.","understanding-the-underlying-system#Understanding the Underlying System":"Now that you've seen the basics, let's understand how it works under the hood.","graph-based-storage#Graph-Based Storage":"Each model instance is stored as a subgraph in an AD4M perspective. For example, our recipe is stored as:\nrecipe://chocolate-cake-123 -[recipe://name]-> literal://string:\"Chocolate Cake\"\nrecipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://flour\nrecipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://sugar\nEvery node in this graph is a URL pointing to an Expression in some language.","base-expressions#Base Expressions":"Each model instance has a unique identifier called a \"base expression\" that serves as the root node of its subgraph. You can specify it or let AD4M generate one:\n// Auto-generated base expression\nconst recipe = new Recipe(perspective);\n// Custom base expression\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake-2024-03\");","literals-for-simple-values#Literals for Simple Values":"AD4M provides Literals for storing simple values without needing a full language:\n// These are equivalent:\nrecipe.name = \"Chocolate Cake\";\n// Stored as: literal://string:Chocolate Cake\nrecipe.cookingTime = 45;\n// Stored as: literal://number:45","advanced-features#Advanced Features":"","property-types#Property Types":"AD4M provides several specialized property decorators:","readonly#@ReadOnly":"For computed or immutable properties:\n@ReadOnly({\n through: \"recipe://rating\",\n getter: `\n findall(Rating, triple(Base, \"recipe://user_rating\", Rating), Ratings),\n sum_list(Ratings, Sum),\n length(Ratings, Count),\n Value is Sum / Count\n `\n})\naverageRating: number = 0;","flag#@Flag":"For immutable type markers:\n@Flag({\n through: \"ad4m://type\",\n value: \"recipe://main-course\"\n})\ntype: string = \"\";","advanced-collections#Advanced Collections":"Collections can be filtered and typed:\n// Collection of other model instances\n@Collection({\n through: \"recipe://comment\",\n where: { isInstance: Comment }\n})\ncomments: Comment[] = [];\n// Collection with custom filter\n@Collection({\n through: \"recipe://review\",\n where: { condition: `triple(Target, \"review://rating\", Rating), Rating > 4` }\n})\ntopReviews: string[] = [];","advanced-querying#Advanced Querying":"The query builder provides a fluent interface for complex queries and uses SurrealDB by default for optimal performance:\n// Uses SurrealDB by default (10-100x faster)\nconst recipes = await Recipe.query(perspective)\n .where({ \n category: \"MainCourse\",\n rating: { gt: 4 }\n })\n .order({ createdAt: \"DESC\" })\n .limit(5)\n .get();\n// Explicitly control query engine\nconst recipesSurreal = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(true) // Default is true\n .get();\n// Use Prolog for backward compatibility\nconst recipesProlog = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false) // Switch to Prolog\n .get();","real-time-updates#Real-time Updates":"Subscribe to changes in your data. Subscriptions also use SurrealDB by default for better performance:\n// Create a query builder (uses SurrealDB by default)\nconst builder = Recipe.query(perspective)\n .where({ status: \"cooking\" });\n// Subscribe to updates\nconst initialRecipes = await builder.subscribe(recipes => {\n console.log(\"Currently cooking:\", recipes);\n});\n// Subscribe with Prolog (for backward compatibility)\nconst builderProlog = Recipe.query(perspective)\n .where({ status: \"cooking\" })\n .useSurrealDB(false); // Use Prolog\nawait builderProlog.subscribe(recipes => {\n console.log(\"Currently cooking (Prolog):\", recipes);\n});\n// Important: Clean up when done\nbuilder.dispose();\nThe query builder's subscription system:\nReturns initial results immediately\nCalls your callback whenever the results change\nMaintains an active connection to receive updates\nAutomatically cleans up resources when disposed\nAlways call dispose() when you're done with the subscription to:\nStop keepalive signals\nUnsubscribe from updates\nNotify the backend to clean up resources\nPrevent memory leaks\nYou can also subscribe to just the count of matching items:\nconst builder = Recipe.query(perspective)\n .where({ category: \"Dessert\" });\nconst initialCount = await builder.countSubscribe(count => {\n console.log(\"Number of desserts:\", count);\n});\n// Remember to clean up\nbuilder.dispose();","dynamic-models-from-json-schema#Dynamic Models from JSON Schema":"The fromJSONSchema() method allows you to dynamically create AD4M model classes from JSON Schema definitions. This is perfect for:\nIntegrating with external systems that use JSON Schema\nRuntime model generation based on user-defined schemas\nPartner app integration (like Holons) that define types using JSON Schema\nRapid prototyping without writing decorator-based classes","basic-usage#Basic Usage":"import { Ad4mModel } from '@coasys/ad4m';\nconst schema = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"BlogPost\",\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"tags\": { \n \"type\": \"array\", \n \"items\": { \"type\": \"string\" } \n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"author\": { \"type\": \"string\" },\n \"publishedAt\": { \"type\": \"string\" }\n }\n }\n },\n \"required\": [\"title\"]\n};\nconst BlogPost = Ad4mModel.fromJSONSchema(schema, {\n name: \"BlogPost\",\n namespace: \"blog://\",\n resolveLanguage: \"literal\"\n});\n// Use like any other Ad4mModel\nconst post = new BlogPost(perspective);\npost.title = \"My First Post\";\npost.tags = [\"ad4m\", \"tutorial\"];\npost.metadata = { author: \"Alice\", publishedAt: \"2025-09-23\" };\nawait post.save();","configuration-options#Configuration Options":"The second parameter to fromJSONSchema() is optional and accepts these options:\ninterface JSONSchemaToModelOptions {\n // Model configuration\n name?: string; // Class name override (optional: falls back to x-ad4m.className → schema.title → schema.$id)\n namespace?: string; // Base namespace for predicates (optional: falls back to x-ad4m.namespace → schema.title → schema.$id)\n // Predicate generation helpers\n // 1) Direct mapping: propertyName -> predicate URI\n propertyMapping?: Record;\n // 2) Template: supports ${scheme}, ${namespace} (or ${ns}), ${title}, ${property}\n predicateTemplate?: string;\n // 3) Generator callback: receives schema title and property name\n predicateGenerator?: (title: string, property: string) => string;\n // Global property settings (applied to all properties unless overridden)\n resolveLanguage?: string; // Default language for all properties\n local?: boolean; // Whether properties are stored locally\n // Property-specific overrides\n // Accepts any PropertyOptions fields: through, initial, required, writable,\n // resolveLanguage, getter, setter, local, transform\n propertyOptions?: Record>;\n}","class-name-resolution-cascading-priority#Class Name Resolution (Cascading Priority)":"The class name is determined using this priority order:\nExplicit options.name (highest priority)\nx-ad4m.className metadata in schema\nSchema title\nSchema $id (extracted from URI)\nError if none found (lowest priority)\n// Priority 1: Explicit name override\nconst Model1 = Ad4mModel.fromJSONSchema(schema, {\n name: \"CustomModelName\"\n});\n// Priority 2: x-ad4m.className metadata\nconst schemaWithClassName = {\n \"title\": \"Person\",\n \"x-ad4m\": {\n \"className\": \"PersonModel\"\n },\n \"properties\": { /* ... */ }\n};\nconst PersonClass = Ad4mModel.fromJSONSchema(schemaWithClassName);\n// Priority 3: Inferred from title\nconst schemaWithTitle = {\n \"title\": \"BlogPost\", // becomes \"BlogPost\" class name\n \"properties\": { /* ... */ }\n};\nconst BlogPostClass = Ad4mModel.fromJSONSchema(schemaWithTitle);\n// Priority 4: Inferred from $id\nconst schemaWithId = {\n \"$id\": \"https://example.com/schemas/product.schema.json\", // becomes \"Product\"\n \"properties\": { /* ... */ }\n};\nconst ProductClass = Ad4mModel.fromJSONSchema(schemaWithId);","namespace-resolution-cascading-priority#Namespace Resolution (Cascading Priority)":"The namespace is determined using this priority order:\nExplicit options.namespace (highest priority)\nx-ad4m.namespace metadata in schema\nSchema title (converted to namespace)\nSchema $id (extracted from URI)\nError if none found (lowest priority)\n// Priority 1: Explicit namespace\nconst Model1 = Ad4mModel.fromJSONSchema(schema, {\n namespace: \"custom://\"\n});\n// Priority 2: x-ad4m.namespace metadata\nconst schemaWithMetadata = {\n \"title\": \"Person\",\n \"x-ad4m\": {\n \"namespace\": \"person://\"\n },\n \"properties\": { /* ... */ }\n};\n// Priority 3: Inferred from title\nconst schemaWithTitle = {\n \"title\": \"BlogPost\", // becomes \"blogpost://\"\n \"properties\": { /* ... */ }\n};","property-predicate-resolution#Property Predicate Resolution":"Each property's predicate URI is determined by (highest to lowest precedence):\noptions.propertyMapping[name] (explicit mapping)\nx-ad4m.through in property schema\npredicateTemplate (supports ${scheme}, ${namespace}/${ns}, ${title}, ${property})\npredicateGenerator(title, property)\nDefault: ${namespace}/${propertyName} (normalized)\nconst schema = {\n \"title\": \"Product\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"price\": { \n \"type\": \"number\",\n \"x-ad4m\": {\n \"through\": \"product://cost\" // Custom predicate\n }\n }\n }\n};\nconst Product = Ad4mModel.fromJSONSchema(schema, {\n name: \"Product\",\n namespace: \"product://\",\n // Option A: direct mapping\n propertyMapping: {\n name: \"product://title\"\n }\n // Option B: or per-property options\n // propertyOptions: { name: { through: \"product://title\" } }\n});","advanced-schema-features#Advanced Schema Features":"","using-x-ad4m-extensions#Using x-ad4m Extensions":"Add AD4M-specific metadata directly to your JSON Schema:\nconst advancedSchema = {\n \"title\": \"User\",\n \"x-ad4m\": {\n \"namespace\": \"user://\",\n \"resolveLanguage\": \"literal\"\n },\n \"properties\": {\n \"email\": { \n \"type\": \"string\",\n \"x-ad4m\": {\n \"through\": \"user://email_address\",\n \"local\": true\n }\n },\n \"profile\": {\n \"type\": \"object\",\n \"x-ad4m\": {\n \"resolveLanguage\": \"literal\" // Store as JSON\n }\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"x-ad4m\": {\n \"through\": \"user://interests\"\n }\n }\n },\n \"required\": [\"email\"]\n};\nconst User = Ad4mModel.fromJSONSchema(advancedSchema, { name: \"User\" });","complex-object-handling#Complex Object Handling":"Object properties are automatically stored as JSON literals:\nconst schema = {\n \"title\": \"Article\",\n \"properties\": {\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"author\": { \"type\": \"string\" },\n \"publishedAt\": { \"type\": \"string\" },\n \"views\": { \"type\": \"number\" }\n }\n }\n },\n \"required\": [\"metadata\"]\n};\nconst Article = Ad4mModel.fromJSONSchema(schema, {\n namespace: \"article://\"\n});\nconst article = new Article(perspective);\narticle.metadata = {\n author: \"Alice\",\n publishedAt: \"2025-09-23\",\n views: 42\n};\nawait article.save();\n// Complex objects are preserved\nconst saved = await Article.findAll(perspective);\nconsole.log(saved[0].metadata.author); // \"Alice\"","arraycollection-mapping#Array/Collection Mapping":"Arrays in JSON Schema automatically become AD4M collections:\nconst schema = {\n \"title\": \"BlogPost\",\n \"properties\": {\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n },\n \"categories\": {\n \"type\": \"array\", \n \"items\": { \"type\": \"string\" }\n }\n }\n};\nconst BlogPost = Ad4mModel.fromJSONSchema(schema, {\n namespace: \"blog://\"\n});\nconst post = new BlogPost(perspective);\npost.tags = [\"ad4m\", \"tutorial\"];\npost.categories = [\"technology\"];\nawait post.save();\n// Collections work with all standard AD4M collection methods\npost.addTags(\"blockchain\");\npost.removeCategories(\"technology\");","type-safety-considerations#Type Safety Considerations":"Since properties are added dynamically, TypeScript won't know about them at compile time. You can:\nUse type assertions for better IDE support:\nconst BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & {\n new(perspective: PerspectiveProxy): Ad4mModel & {\n title: string;\n tags: string[];\n metadata: { author: string; publishedAt: string };\n }\n};\nCreate TypeScript interfaces for your schemas:\ninterface BlogPostData {\n title: string;\n tags: string[];\n metadata: { author: string; publishedAt: string };\n}\nconst post = new BlogPost(perspective) as Ad4mModel & BlogPostData;\npost.title = \"Type-safe access\";","limitations-and-best-practices#Limitations and Best Practices":"No author property: JSON schemas cannot define a top-level author property (conflicts with built-in AD4M property)\nRequired properties: At least one property must be required or have an initial value\nComplex objects: Nested objects are stored as JSON literals, limiting semantic querying capabilities\nPerformance: For better semantic querying, consider flattening complex objects into separate properties","under-the-hood#Under the Hood":"","social-dna-and-prolog#Social DNA and Prolog":"When you define a model class, AD4M generates a Social DNA (SDNA) representation in Prolog:\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\",\n required: true\n })\n name: string = \"\";\n}\nsubject_class(\"Recipe\", c).\nconstructor(c, '[\n {action: \"addLink\", source: \"this\", predicate: \"recipe://name\", target: \"literal://string:''\"}\n]').\ninstance(c, Base) :- triple(Base, \"recipe://name\", _).\nproperty(c, \"name\").\nproperty_resolve(c, \"name\").\nproperty_resolve_language(c, \"name\", \"literal\").\nproperty_getter(c, Base, \"name\", Value) :- triple(Base, \"recipe://name\", Value).\nproperty_setter(c, \"name\", '[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", \"target\": \"value\"}]').","relationship-with-shacl-and-linked-data#Relationship with SHACL and Linked Data":"AD4M's model classes share concepts with SHACL (Shapes Constraint Language):\nBoth define property constraints and validation rules\nBoth work with graph-based data\nAD4M adds TypeScript integration, CRUD operations, and real-time features","best-practices#Best Practices":"Use Meaningful Predicates: Structure your predicate URIs logically:\nthrough: \"recipe://name\" // Good\nthrough: \"myapp://x\" // Bad\nType Safety: Always define proper TypeScript types:\n@Property({ through: \"recipe://servings\" })\nservings: number = 0; // Good\n@Property({ through: \"recipe://servings\" })\nservings: any; // Bad\nCollection Filtering: Use where conditions to filter collections:\n@Collection({\n through: \"recipe://review\",\n where: { isInstance: Review } // Only include Review instances\n})\nreviews: Review[] = [];\nQuery Optimization: Use specific queries instead of filtering in memory, and leverage SurrealDB's performance:\n// Good - Let SurrealDB do the filtering (fast)\nconst topRated = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .get();\n// Bad - Fetching all and filtering in memory (slow)\nconst all = await Recipe.findAll(perspective);\nconst topRated = all.filter(r => r.rating > 4);\nUse SurrealDB by Default: SurrealDB is 10-100x faster than Prolog for most queries:\n// Good - Uses SurrealDB by default\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n});\n// Only use Prolog if you need backward compatibility\nconst recipesProlog = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false\nSubscriptions: Clean up subscriptions when they're no longer needed:\nconst builder = Recipe.query(perspective)\n .where({ status: \"active\" });\n \nawait builder.subscribe(recipes => {\n // Handle updates\n});\n// Later...\nbuilder.dispose();\nUse Literals Appropriately:\n// Good - Using literals for simple values\n@Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n})\nname: string = \"\";\n// Good - Using specific language for rich content\n@Property({\n through: \"recipe://instructions\",\n resolveLanguage: \"markdown\"\n})\ninstructions: string = \"\";\nMeaningful Base Expressions:\n// Good - Descriptive base expression\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake-2024-03\");\n// Bad - Random or meaningless base expression\nconst recipe = new Recipe(perspective, \"x://123\");","error-handling#Error Handling":"Always handle potential errors when working with models:\ntry {\n const recipe = new Recipe(perspective);\n recipe.name = \"Failed Recipe\";\n await recipe.save();\n} catch (error) {\n console.error(\"Failed to save recipe:\", error);\n // Handle error appropriately\n}","integration-with-ad4m-perspectives#Integration with AD4M Perspectives":"Before using a model class, register it with the perspective:\n// Register the model class\nawait perspective.ensureSDNASubjectClass(Recipe);\n// Now you can use it\nconst recipe = new Recipe(perspective);\nawait recipe.save();\nThis ensures the perspective knows how to handle instances of your model class."}},"/expressions":{"title":"Expressions: Agent-Authored Data Objects","data":{"understanding-expressions#Understanding Expressions":"In AD4M's agent-centric paradigm, all data is treated as a claim or statement made by an agent. These claims are called \"Expressions\" – following the metaphor of Languages, they are what agents \"express\" through different protocols (Languages). While they could be seen as simple data objects, Expressions are fundamentally different because they:\nAlways include cryptographic proof of who created them\nAre always created through a specific Language\nHave globally unique addresses in AD4M's universal addressing scheme","anatomy-of-an-expression#Anatomy of an Expression":"Every Expression consists of:\ninterface Expression {\n // The DID of the agent who created this Expression\n author: string;\n \n // When the Expression was created\n timestamp: string;\n \n // The actual data/content\n data: any;\n \n // Which Language this Expression belongs to\n language: LanguageRef;\n \n // Cryptographic proof of authorship\n proof: {\n // These flags are added by AD4M during retrieval\n valid?: boolean; // True if signature verification succeeded\n invalid?: boolean; // True if signature verification failed\n // The actual stored proof data\n signature: string; // The cryptographic signature\n key: string; // Key path in the author's DID Document used for signing\n };\n}\nFor example:\n{\n \"author\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"timestamp\": \"2023-06-21T14:47:48.935Z\",\n \"data\": \"Hello World!\",\n \"language\": {\n \"address\": \"literal\"\n },\n \"proof\": {\n \"valid\": true, // Added by AD4M during retrieval\n \"invalid\": false, // Added by AD4M during retrieval\n \"signature\": \"...\", // The stored signature\n \"key\": \"...\" // Key path in the author's DID Document used for signing\n }\n}","global-addressing#Global Addressing":"Every Expression in AD4M has a unique address in the format:\n://\nThis means:\nThe Language's hash identifies how to interpret/resolve the address\nThe expression_address is Language-specific (could be a CID, URL, hash, etc.)\nThe full address is globally unique and resolvable by any AD4M instance","working-with-expressions#Working with Expressions":"","creating-expressions#Creating Expressions":"When an agent wants to share data, they create an Expression through a Language:\n// Create an Expression using the literal Language\nconst url = await ad4m.expression.create(\n \"Hello World!\", \n \"literal\"\n);\n// Returns: literal://base64encoded-content\n// Create an Expression using a custom Language\nconst socialPost = await ad4m.expression.create(\n { text: \"My first post!\" },\n \"QmSocialApp123\" // Language hash\n);\n// Returns: QmSocialApp123://post789\nBehind the scenes, AD4M:\nPasses the data to the specified Language\nThe Language stores/processes the data and returns an address\nAD4M signs the Expression with the agent's keys\nReturns the full Expression URL","retrieving-expressions#Retrieving Expressions":"Any agent can retrieve an Expression using its address:\nconst expression = await ad4m.expression.get(\"QmSocialApp123://post789\");\nThe retrieved Expression includes:\nThe original data\nWho created it (author DID)\nWhen it was created\nCryptographic proof of authenticity","signature-verification#Signature Verification":"When you retrieve an Expression through ad4m.expression.get(), AD4M automatically:\nResolves the author's DID to get their public keys\nVerifies that the signature matches:\nThe author's DID\nThe Expression's data\nThe timestamp\nUsing the specified key from the author's DID Document\nEnriches the Expression object with verification flags:\nproof.valid: Set to true if verification succeeded\nproof.invalid: Set to true if verification failed\nThese verification flags are not stored with the Expression – they are computed on-the-fly during retrieval to ensure fresh verification against the current state of the author's DID Document.\n// When you retrieve an Expression\nconst expression = await ad4m.expression.get(\"QmSocialApp123://post789\");\n// AD4M has already verified the signature\nif (expression.proof.valid) {\n // The Expression is authentic and unmodified\n console.log(\"Verified expression from:\", expression.author);\n} else {\n // The signature verification failed\n console.warn(\"Could not verify expression authenticity\");\n}","expression-types#Expression Types":"While Expressions can contain any type of data, there are several common patterns:\nLiteral Expressions\nSimple data types (strings, numbers, objects)\nEncoded directly in the address\nExample: literal://base64encoded-content\nContent Expressions\nLarger data objects (posts, documents, media)\nStored in a distributed system (IPFS, Holochain, etc.)\nExample: QmSocialApp123://post789\nReference Expressions\nPoint to data in other systems\nAct as bridges to existing protocols\nExample: http://example.com/resource","expressions-and-trust#Expressions and Trust":"The agent-centric nature of Expressions enables a web of trust:\nAuthenticity: Every Expression is cryptographically signed, so you can verify who created it\nProvenance: The timestamp and author create an audit trail\nContext: Expressions can be referenced and linked in Perspectives, creating semantic meaning\nInteroperability: Any AD4M instance can verify and interpret Expressions","best-practices#Best Practices":"When working with Expressions:\nChoose the Right Language\nUse literal Language for simple, small data\nUse specialized Languages for specific data types\nConsider storage requirements and accessibility\nHandle Verification\nAlways check the proof.valid field\nConsider the Expression's author in your trust model\nUse timestamps for temporal context\nThink Agent-Centric\nRemember Expressions are claims made by agents\nConsider how Expressions fit into social contexts\nUse Perspectives to organize and give meaning to Expressions\nFor more details on implementing Languages that create and resolve Expressions, see the Language Development Guide."}},"/developer-guides/surreal-queries":{"title":"SurrealDB Queries in AD4M","data":{"":"AD4M now includes a powerful SurrealDB-based query engine that provides 10-100x faster performance compared to traditional Prolog queries. SurrealDB is used by default in Ad4mModel operations and can be accessed directly for advanced graph traversal queries.","why-surrealdb#Why SurrealDB?":"SurrealDB brings several key advantages:\nPerformance: 10-100x faster than Prolog for most queries\nFamiliar Syntax: SQL-like query language (SurrealQL)\nGraph Traversal: Native support for multi-hop graph patterns with -> operator\nPattern Matching: Query complex graph structures in a single query (e.g., node->link[WHERE ...][0].out.uri)\nLiteral Parsing: Built-in fn::parse_literal() function to extract values from AD4M literals\nAggregations: Built-in support for COUNT, SUM, AVG, GROUP BY, etc.\nScalability: Optimized for large datasets","default-behavior#Default Behavior":"Important: Ad4mModel now uses SurrealDB by default for all query operations. This means:\nfindAll() uses SurrealDB automatically\nfindAllAndCount() uses SurrealDB automatically\nQuery builder methods use SurrealDB automatically\nLive query subscriptions use SurrealDB automatically\nYou can still use Prolog queries by explicitly passing useSurrealDB: false if needed for backward compatibility.","quick-reference-graph-traversal-syntax#Quick Reference: Graph Traversal Syntax":"SurrealDB's graph traversal operator (->) enables powerful multi-hop queries:\n// Basic syntax: node->link[filter][index].field\nout->link[WHERE predicate = 'flux://entry_type'][0].out.uri\n// Components:\n// - out : Start from target node\n// - ->link : Follow link edges\n// - [WHERE predicate = ...] : Filter links (optional)\n// - [0] : Get first result (array index)\n// - .out.uri : Access target URI\nKey Functions:\nfn::parse_literal(uri) - Extract values from AD4M literal URIs (handles literal://string:, literal://number:, literal://json:, etc.)\nIndexed Fields (fast):\nin.uri - Source node of link\nout.uri - Target node of link\npredicate - Link predicate\nsource, target - String representations (also indexed)","direct-surrealdb-queries#Direct SurrealDB Queries":"For advanced use cases, you can execute SurrealQL queries directly using perspective.querySurrealDB():","basic-query#Basic Query":"// Get all links\nconst links = await perspective.querySurrealDB('SELECT * FROM link');\nconsole.log(links);\n// [\n// { source: \"user://alice\", predicate: \"follows\", target: \"user://bob\", ... },\n// { source: \"post://123\", predicate: \"likes\", target: \"user://alice\", ... }\n// ]","filtering#Filtering":"// Filter links by predicate\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Multiple conditions\nconst recentLikes = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'likes' AND timestamp > '2024-01-01T00:00:00Z'\"\n);","aggregations#Aggregations":"// Count links by predicate\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\n// [\n// { predicate: \"follows\", total: 42 },\n// { predicate: \"likes\", total: 156 }\n// ]\n// Count total links\nconst totalLinks = await perspective.querySurrealDB(\n \"SELECT count() as total FROM link\"\n);\n// Count unique sources using GROUP BY\nconst uniqueSources = await perspective.querySurrealDB(\n \"SELECT source FROM link GROUP BY source\"\n);\n// uniqueSources.length gives you the count of unique sources","graph-traversal-queries#Graph Traversal Queries":"SurrealDB uses efficient graph traversal with indexed node lookups. The key is to use direct field comparisons rather than subqueries for optimal performance.","️-performance-warning-avoid-subqueries#⚠️ Performance Warning: Avoid Subqueries":"Important: Subqueries (using IN (SELECT ...)) can be very slow, especially with large datasets. Instead, use the graph traversal operator (->) which is optimized and uses indexed lookups.\n// ❌ SLOW - Uses subquery\nconst bad = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE source IN (SELECT target FROM link WHERE source = 'user://alice')\"\n);\n// ✅ FAST - Use graph traversal operator for multi-hop\nconst good = await perspective.querySurrealDB(\n \"SELECT out->link[WHERE predicate = 'posted'].out.uri AS posts FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);","graph-traversal-operators#Graph Traversal Operators":"SurrealDB stores links as graph edges with indexed source (in.uri) and target (out.uri) node references:\nin.uri - The source node of the link (where the edge comes FROM)\nout.uri - The target node of the link (where the edge goes TO)\nsource / target - String fields (also available for simple filtering)","forward-traversal-outgoing-links#Forward Traversal (Outgoing Links)":"// Find all users that Alice follows\nconst aliceFollows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find all posts by Alice\nconst alicePosts = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'author'\"\n);","reverse-traversal-incoming-links#Reverse Traversal (Incoming Links)":"// Find all users who follow Alice (followers)\nconst aliceFollowers = await perspective.querySurrealDB(\n \"SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find all posts that mention Alice\nconst mentionsAlice = await perspective.querySurrealDB(\n \"SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'mentions'\"\n);","bidirectional-queries#Bidirectional Queries":"// Find all users connected to Alice (either following or followed by)\nconst aliceConnections = await perspective.querySurrealDB(\n \"SELECT source, target FROM link WHERE (in.uri = 'user://alice' OR out.uri = 'user://alice') AND predicate = 'follows'\"\n);","multi-hop-traversal-with-graph-operators#Multi-Hop Traversal with Graph Operators":"Use the -> operator to traverse multiple hops in a single efficient query:\n// Find friends of friends (2-hop traversal)\n// Traverse: Alice -> Friends -> Their Friends\n// Note: Use GROUP BY instead of DISTINCT for unique results\nconst friendsOfFriends = await perspective.querySurrealDB(`\n SELECT out->link[WHERE predicate = 'follows'].out.uri AS friend_of_friend\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);\n// Deduplicate in JavaScript if needed: [...new Set(friendsOfFriends.map(f => f.friend_of_friend))]\n// Get user profiles 2 hops away\n// Traverse: User -> Follows -> Profile\nconst profiles = await perspective.querySurrealDB(`\n SELECT \n out.uri AS user,\n out->link[WHERE predicate = 'has_profile'][0].out.uri AS profile\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);","chaining-multiple-traversals#Chaining Multiple Traversals":"You can chain -> operators for deeper traversals:\n// 3-hop: Conversation -> Subgroup -> Items -> Get item types\nconst itemTypes = await perspective.querySurrealDB(`\n SELECT \n out.uri AS subgroup,\n out->link[WHERE predicate = 'ad4m://has_child'].out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS item_type\n FROM link\n WHERE in.uri = 'conversation://main'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`);","complex-graph-patterns#Complex Graph Patterns":"Use graph traversal for complex multi-hop patterns:\n// Find all comments on Alice's posts (2-hop)\n// Traverse: Alice -> Posts (authored) -> Comments (has_comment)\nconst commentsOnAlicePosts = await perspective.querySurrealDB(`\n SELECT \n out.uri AS post,\n out->link[WHERE predicate = 'has_comment'].out.uri AS comments\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'authored'\n`);\n// Get all reactions to posts by people Alice follows (3-hop)\n// Traverse: Alice -> Follows -> Posts -> Reactions\nconst reactions = await perspective.querySurrealDB(`\n SELECT \n out.uri AS followed_user,\n out->link[WHERE predicate = 'authored'].out.uri AS post,\n out->link[WHERE predicate = 'authored'].out->link[WHERE predicate = 'has_reaction'].out.uri AS reaction\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);","filtering-by-properties#Filtering by Properties":"// Find all links from Alice with a specific timestamp range\nconst recentLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'\"\n);\n// Find links by author\nconst bobsLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'\"\n);","advanced-graph-traversal-patterns#Advanced Graph Traversal Patterns":"For complex graph queries, SurrealDB provides powerful traversal operators that let you navigate multi-hop relationships in a single query.","the-graph-traversal-operator--#The Graph Traversal Operator (->)":"The -> operator allows you to traverse edges in your graph. Combined with filtering and array indexing, you can express complex patterns efficiently:Syntax: node->link[WHERE condition][index].field\nnode->link - Follow link edges from the node\n[WHERE condition] - Filter the traversed links (optional)\n[index] - Select a specific result (e.g., [0] for first, [-1] for last)\n.field - Access a field from the result (e.g., .out.uri for target URI)","multi-hop-traversal-examples#Multi-Hop Traversal Examples":"// Get the type of child items (2-hop traversal)\n// Traverse: Parent -> Child (via 'ad4m://has_child') -> Type (via 'flux://entry_type')\nconst query = `\n SELECT \n out.uri AS child,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type\n FROM link\n WHERE in.uri = 'parent://123' \n AND predicate = 'ad4m://has_child'\n`;\nconst results = await perspective.querySurrealDB(query);\n// Results include child URI and its type","filtering-on-multi-hop-properties#Filtering on Multi-Hop Properties":"You can filter based on properties several hops away:\n// Find all children that are of type 'conversation_subgroup'\nconst subgroups = `\n SELECT out.uri AS subgroup\n FROM link\n WHERE in.uri = 'conversation://456'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`;\nconst results = await perspective.querySurrealDB(subgroups);","the-fnparse_literal-function#The fn::parse_literal() Function":"AD4M provides a custom SurrealDB function to parse literal values. Literals in AD4M are stored as URIs like:\nliteral://string:Hello → \"Hello\"\nliteral://number:42 → 42\nliteral://boolean:true → true\nliteral://json:{\"data\":\"value\"} → \"value\" (extracts .data field)\nUsage:\n// Extract parsed values from literals\nconst query = `\n SELECT \n out.uri AS baseExpression,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS title,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS body,\n fn::parse_literal(out->link[WHERE predicate = 'flux://count'][0].out.uri) AS count\n FROM link\n WHERE in.uri = 'parent://789'\n AND predicate = 'ad4m://has_child'\n`;\nconst results = await perspective.querySurrealDB(query);\n// Results have parsed values: { baseExpression, title: \"Hello\", body: \"World\", count: 42 }","real-world-example-querying-messages-with-metadata#Real-World Example: Querying Messages with Metadata":"Here's a complete example showing how to query messages with their metadata:\n// Get messages with type, body, and author information\nconst messagesQuery = `\n SELECT\n out.uri AS baseExpression,\n author,\n timestamp,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle\n FROM link\n WHERE in.uri = 'channel://main'\n AND predicate = 'ad4m://has_child'\n AND (\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_message'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_post'\n )\n ORDER BY timestamp ASC\n`;\nconst messages = await perspective.querySurrealDB(messagesQuery);\n// Each message includes: baseExpression, author, timestamp, type, messageBody, postTitle","counting-nested-items#Counting Nested Items":"Count items that match complex multi-hop conditions:\n// Count conversation subgroups\nconst countQuery = `\n SELECT count() AS count\n FROM link\n WHERE in.uri = 'conversation://abc'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`;\nconst result = await perspective.querySurrealDB(countQuery);\nconsole.log(`Found ${result[0].count} subgroups`);","finding-unique-values-across-hops#Finding Unique Values Across Hops":"Get unique authors from items nested within subgroups:\n// Get unique participants from nested items\n// Traverse: Conversation -> Subgroups -> Items -> Extract unique authors\nconst participantsQuery = `\n SELECT VALUE author\n FROM link\n WHERE in.uri = 'conversation://xyz'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE\n GROUP BY author\n`;\nconst participants = await perspective.querySurrealDB(participantsQuery);\n// Returns array of unique author DIDs","complex-multi-condition-queries#Complex Multi-Condition Queries":"Combine multiple traversals and conditions:\n// Find all tasks, posts, and messages with their specific metadata\nconst itemsQuery = `\n SELECT\n out.uri AS item,\n author,\n timestamp,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle,\n fn::parse_literal(out->link[WHERE predicate = 'flux://name'][0].out.uri) AS taskName\n FROM link\n WHERE in.uri = 'workspace://project1'\n AND predicate = 'ad4m://has_child'\n AND (\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_message'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_post'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_task'\n )\n ORDER BY timestamp DESC\n LIMIT 50\n`;\nconst items = await perspective.querySurrealDB(itemsQuery);\n// Returns mixed items with appropriate metadata populated based on type","performance-tips-for-complex-queries#Performance Tips for Complex Queries":"Index-Friendly Patterns: Start with indexed fields (in.uri, out.uri, predicate)\nFilter Within Traversals: Use ->link[WHERE predicate = 'x'] to filter as you traverse\nArray Indexing: Use [0] to get first result efficiently, [-1] for last\nTraversal Depth: 2-4 hops perform well in a single query\nUse IS NOT NONE: Check for existence of traversed values to avoid errors\nCombine Conditions: Use AND/OR in WHERE clauses on final filtered results","pattern-breakdown#Pattern Breakdown":"Understanding the query structure:\n// Pattern: node->link[filter][index].field\nout->link[WHERE predicate = 'flux://entry_type'][0].out.uri\n// Breakdown:\n// 1. out - Start from the target node\n// 2. ->link - Follow link edges\n// 3. [WHERE predicate = ...]- Filter to specific predicate\n// 4. [0] - Take first matching link\n// 5. .out.uri - Get the target URI of that link\nThis pattern is equivalent to asking: \"From this node, follow links with a specific predicate and tell me where they point.\"","using-surrealdb-with-ad4mmodel#Using SurrealDB with Ad4mModel":"Ad4mModel uses SurrealDB by default for all operations, providing significant performance improvements:","findall---default-uses-surrealdb#findAll() - Default Uses SurrealDB":"@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\", resolveLanguage: \"literal\" })\n name: string = \"\";\n @Property({ through: \"recipe://rating\", resolveLanguage: \"literal\" })\n rating: number = 0;\n}\n// Uses SurrealDB automatically (default)\nconst allRecipes = await Recipe.findAll(perspective);\n// With filters (still uses SurrealDB)\nconst highRated = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } },\n order: { rating: \"DESC\" },\n limit: 10\n});\n// Explicitly use Prolog (for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {}, false);","query-builder---default-uses-surrealdb#Query Builder - Default Uses SurrealDB":"// Query builder uses SurrealDB by default\nconst recipes = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .order({ rating: \"DESC\" })\n .limit(10)\n .get();\n// Explicitly enable SurrealDB (redundant since it's default)\nconst recipesSurreal = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(true) // Default is true\n .get();\n// Explicitly use Prolog\nconst recipesProlog = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false) // Switch to Prolog\n .get();","live-query-subscriptions#Live Query Subscriptions":"Subscriptions also benefit from SurrealDB's performance:\n// Subscribe using SurrealDB (default)\nawait Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .subscribe((recipes) => {\n console.log(\"Updated high-rated recipes:\", recipes);\n });\n// Subscribe using Prolog\nawait Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false)\n .subscribe((recipes) => {\n console.log(\"Updated recipes (Prolog):\", recipes);\n });","findallandcount#findAllAndCount()":"// Uses SurrealDB by default\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {\n where: { rating: { gt: 3 } },\n limit: 10,\n offset: 0\n});\nconsole.log(`Showing ${results.length} of ${totalCount} recipes`);\n// Use Prolog explicitly\nconst { results, totalCount } = await Recipe.findAllAndCount(\n perspective, \n { where: { rating: { gt: 3 } } },\n false // useSurrealDB = false\n);","performance-comparison#Performance Comparison":"Here's what you can expect from SurrealDB vs Prolog:\nOperation\tProlog\tSurrealDB\tSpeed-up\tFind all (1000 items)\t~500ms\t~5ms\t100x\tComplex where query\t~800ms\t~15ms\t53x\tAggregation (count)\t~600ms\t~8ms\t75x\tGraph traversal (3 hops)\t~1200ms\t~25ms\t48x\t\nBenchmarks on typical datasets. Actual performance varies by query complexity and data size.","advanced-surrealql-features#Advanced SurrealQL Features":"","grouping-and-aggregation#Grouping and Aggregation":"// Find posts with more than 10 likes\n// Note: SurrealDB doesn't support HAVING clause, so filter in JavaScript\nconst allPosts = await perspective.querySurrealDB(\n \"SELECT out.uri as post, count() as like_count FROM link WHERE predicate = 'likes' GROUP BY out.uri\"\n);\nconst popularPosts = allPosts.filter(p => p.like_count > 10);\n// Count followers per user\nconst followerCounts = await perspective.querySurrealDB(\n \"SELECT out.uri as user, count() as followers FROM link WHERE predicate = 'follows' GROUP BY out.uri ORDER BY followers DESC\"\n);","distinct-values#DISTINCT Values":"// Get all unique predicates used\n// Note: Use GROUP BY instead of SELECT DISTINCT\nconst predicates = await perspective.querySurrealDB(\n \"SELECT predicate FROM link GROUP BY predicate\"\n);\n// Get unique authors\nconst authors = await perspective.querySurrealDB(\n \"SELECT author FROM link GROUP BY author\"\n);","sorting-and-pagination#Sorting and Pagination":"// Recent links first, paginated\nconst recentLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link ORDER BY timestamp DESC LIMIT 20 START 0\"\n);\n// Next page\nconst nextPage = await perspective.querySurrealDB(\n \"SELECT * FROM link ORDER BY timestamp DESC LIMIT 20 START 20\"\n);","string-operations#String Operations":"// Find links with predicates containing \"follow\"\nconst followLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate CONTAINS 'follow'\"\n);\n// Case-insensitive search\nconst searchResults = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE string::lowercase(predicate) CONTAINS 'like'\"\n);","security-note#Security Note":"Important: querySurrealDB() only allows read-only operations for security reasons. The following operations are blocked:\n❌ DELETE - Use perspective.remove() instead\n❌ UPDATE - Use perspective.update() instead\n❌ INSERT / CREATE - Use perspective.add() instead\n❌ DROP / DEFINE - Not applicable to link data\nAllowed operations:\n✅ SELECT - Query data\n✅ RETURN - Return expressions\n✅ Aggregations (COUNT, SUM, AVG, etc.)\n✅ Graph traversal operators\nIf you need to modify links, use the standard AD4M methods:\n// Adding links\nawait perspective.add({ source: \"user://alice\", predicate: \"follows\", target: \"user://bob\" });\n// Removing links \nawait perspective.remove({ source: \"user://alice\", predicate: \"follows\", target: \"user://bob\" });","migration-from-prolog#Migration from Prolog":"If you have existing code using Prolog queries, here's how to migrate:","before-prolog#Before (Prolog)":"const results = await perspective.infer(\n 'triple(Post, \"likes\", User), triple(User, \"follows\", \"user://alice\")'\n);","after-surrealdb---graph-traversal#After (SurrealDB - Graph Traversal)":"// Use graph traversal to find posts liked by Alice's followers (2-hop)\nconst results = await perspective.querySurrealDB(`\n SELECT \n in.uri AS Post,\n out.uri AS User\n FROM link\n WHERE out.uri = 'user://alice'\n AND predicate = 'follows'\n AND in->link[WHERE predicate = 'likes'].out.uri IS NOT NONE\n`);\n// Alternative: Get all liked posts by traversing from followers\nconst likedPosts = await perspective.querySurrealDB(`\n SELECT \n out.uri AS follower,\n out->link[WHERE predicate = 'likes'].out.uri AS liked_posts\n FROM link\n WHERE out.uri = 'user://alice' AND predicate = 'follows'\n`);","ad4mmodel-migration#Ad4mModel Migration":"Good news! If you're using Ad4mModel, you don't need to change anything:\n// This automatically uses SurrealDB now (no code changes needed!)\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n});\nIf you need Prolog for backward compatibility:\n// Explicitly use Prolog\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false","when-to-use-which#When to Use Which?":"","use-surrealdb-default-when#Use SurrealDB (Default) When:":"✅ You need fast queries (most cases)\n✅ You're using Ad4mModel (automatic)\n✅ You need graph traversal (with -> operator)\n✅ You need multi-hop pattern matching\n✅ You need aggregations and analytics\n✅ You have large datasets\n✅ You need to parse literal values","use-prolog-when#Use Prolog When:":"⚠️ You have complex custom SDNA rules\n⚠️ You need backward compatibility with existing code\n⚠️ You're using advanced Prolog-specific features\n⚠️ You need logic programming capabilities beyond graph queries","best-practices#Best Practices":"Avoid Subqueries: Never use IN (SELECT ...) patterns - they're very slow. Use the -> traversal operator instead\nUse Graph Traversal Operators:\nin.uri / out.uri for direct node access (indexed)\nnode->link[WHERE predicate = 'x'][0].out.uri for multi-hop patterns\nChain multiple -> operators for deeper traversals\nMuch faster than subqueries\nUse fn::parse_literal(): Extract values from AD4M literal URIs automatically\nFilter on Traversals: Filter within traversals using [WHERE ...] for efficiency\nUse Ad4mModel: Let it handle query generation automatically with SurrealDB\nArray Indexing: Use [0] for first result, [-1] for last result on traversed links\nLimit Results: Always use LIMIT for large result sets\nProfile Performance: Use browser DevTools to measure query performance\nIndex Awareness: The system automatically indexes in.uri, out.uri, predicate, source, and target\nTraversal Depth: You can safely traverse 2-4 hops in a single query with good performance","examples-repository#Examples Repository":"For more examples, check out these real-world use cases:\nSocial Graph: Finding connections and recommendations\nContent Discovery: Filtering and ranking posts\nAnalytics Dashboard: Aggregating metrics and statistics\nHierarchical Data: Navigating tree structures\nSee the AD4M examples repository for complete implementations.","related-resources#Related Resources":"Model Classes Guide - Using Ad4mModel with SurrealDB\nPerspectives - Understanding perspectives and links\nSocial DNA - Advanced query patterns with SDNA\nSurrealDB Documentation - Complete SurrealQL reference"}},"/jsdoc/classes/AIClient":{"title":"Class: AIClient","data":{"":"@coasys/ad4m / Exports / AIClient","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#apolloClient\n#transcriptionSubscriptions","methods#Methods":"addModel\naddTask\ncloseTranscriptionStream\nembed\nfeedTranscriptionStream\ngetDefaultModel\ngetModels\nmodelLoadingStatus\nopenTranscriptionStream\nprompt\nremoveModel\nremoveTask\nsetDefaultModel\ntasks\nupdateModel\nupdateTask","constructors-1#Constructors":"","constructor#constructor":"• new AIClient(apolloClient, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tapolloClient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"ai/AIClient.ts:12","properties-1#Properties":"","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-1#Defined in":"ai/AIClient.ts:9","transcriptionsubscriptions##transcriptionSubscriptions":"• Private #transcriptionSubscriptions: Map","defined-in-2#Defined in":"ai/AIClient.ts:10","methods-1#Methods":"","addmodel#addModel":"▸ addModel(model): Promise","parameters-1#Parameters":"Name\tType\tmodel\tModelInput","returns#Returns":"Promise","defined-in-3#Defined in":"ai/AIClient.ts:47","addtask#addTask":"▸ addTask(name, modelId, systemPrompt, promptExamples, metaData?): Promise","parameters-2#Parameters":"Name\tType\tname\tstring\tmodelId\tstring\tsystemPrompt\tstring\tpromptExamples\t{ input: string ; output: string }[]\tmetaData?\tstring","returns-1#Returns":"Promise","defined-in-4#Defined in":"ai/AIClient.ts:151","closetranscriptionstream#closeTranscriptionStream":"▸ closeTranscriptionStream(streamId): Promise","parameters-3#Parameters":"Name\tType\tstreamId\tstring","returns-2#Returns":"Promise","defined-in-5#Defined in":"ai/AIClient.ts:339","embed#embed":"▸ embed(modelId, text): Promise","parameters-4#Parameters":"Name\tType\tmodelId\tstring\ttext\tstring","returns-3#Returns":"Promise","defined-in-6#Defined in":"ai/AIClient.ts:276","feedtranscriptionstream#feedTranscriptionStream":"▸ feedTranscriptionStream(streamIds, audio): Promise","parameters-5#Parameters":"Name\tType\tstreamIds\tstring | string[]\taudio\tFloat32Array","returns-4#Returns":"Promise","defined-in-7#Defined in":"ai/AIClient.ts:360","getdefaultmodel#getDefaultModel":"▸ getDefaultModel(modelType): Promise","parameters-6#Parameters":"Name\tType\tmodelType\tModelType","returns-5#Returns":"Promise","defined-in-8#Defined in":"ai/AIClient.ts:95","getmodels#getModels":"▸ getModels(): Promise","returns-6#Returns":"Promise","defined-in-9#Defined in":"ai/AIClient.ts:16","modelloadingstatus#modelLoadingStatus":"▸ modelLoadingStatus(model): Promise","parameters-7#Parameters":"Name\tType\tmodel\tstring","returns-7#Returns":"Promise","defined-in-10#Defined in":"ai/AIClient.ts:239","opentranscriptionstream#openTranscriptionStream":"▸ openTranscriptionStream(modelId, streamCallback, params?): Promise","parameters-8#Parameters":"Name\tType\tmodelId\tstring\tstreamCallback\t(text: string) => void\tparams?\tObject\tparams.endThreshold?\tnumber\tparams.endWindow?\tnumber\tparams.startThreshold?\tnumber\tparams.startWindow?\tnumber\tparams.timeBeforeSpeech?\tnumber","returns-8#Returns":"Promise","defined-in-11#Defined in":"ai/AIClient.ts:296","prompt#prompt":"▸ prompt(taskId, prompt): Promise","parameters-9#Parameters":"Name\tType\ttaskId\tstring\tprompt\tstring","returns-9#Returns":"Promise","defined-in-12#Defined in":"ai/AIClient.ts:260","removemodel#removeModel":"▸ removeModel(modelId): Promise","parameters-10#Parameters":"Name\tType\tmodelId\tstring","returns-10#Returns":"Promise","defined-in-13#Defined in":"ai/AIClient.ts:71","removetask#removeTask":"▸ removeTask(taskId): Promise","parameters-11#Parameters":"Name\tType\ttaskId\tstring","returns-11#Returns":"Promise","defined-in-14#Defined in":"ai/AIClient.ts:179","setdefaultmodel#setDefaultModel":"▸ setDefaultModel(modelType, modelId): Promise","parameters-12#Parameters":"Name\tType\tmodelType\tModelType\tmodelId\tstring","returns-12#Returns":"Promise","defined-in-15#Defined in":"ai/AIClient.ts:83","tasks#tasks":"▸ tasks(): Promise","returns-13#Returns":"Promise","defined-in-16#Defined in":"ai/AIClient.ts:127","updatemodel#updateModel":"▸ updateModel(modelId, model): Promise","parameters-13#Parameters":"Name\tType\tmodelId\tstring\tmodel\tModelInput","returns-14#Returns":"Promise","defined-in-17#Defined in":"ai/AIClient.ts:59","updatetask#updateTask":"▸ updateTask(taskId, task): Promise","parameters-14#Parameters":"Name\tType\ttaskId\tstring\ttask\tAITask","returns-15#Returns":"Promise","defined-in-18#Defined in":"ai/AIClient.ts:206"}},"/developer-guides/hooks":{"title":"AD4M React Hooks","data":{"":"AD4M provides a set of React hooks to easily work with core AD4M concepts like Agents, Perspectives, and Subjects. These hooks handle state management, caching, and real-time updates automatically.","useclient#useClient":"The most fundamental hook that provides access to the AD4M client instance.\nimport { useClient } from '@coasys/ad4m-react-hooks';\nfunction MyComponent() {\n const { client, error, reload } = useClient();\n if (error) {\n return
Error connecting to AD4M: {error}
;\n }\n if (!client) {\n return
Connecting to AD4M...
;\n }\n return
Connected to AD4M
;\n}\nThe hook returns:\nclient: The AD4M client instance\nerror: Any connection errors\nreload: Function to retry the connection\nmutate: Function to update the cached client instance","useagent#useAgent":"Fetches and caches agent data by DID, with support for profile formatting.\nimport { useAgent } from '@coasys/ad4m-react-hooks';\nfunction AgentProfile({ agentClient, did }) {\n const { agent, profile, error } = useAgent({\n client: agentClient,\n did,\n formatter: (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n })\n });\n if (error) return
Error: {error}
;\n if (!agent) return
Loading...
;\n return (\n
\n

{profile?.name}

\n

{profile?.bio}

\n

DID: {agent.did}

\n
\n );\n}","useme#useMe":"Provides access to the current agent's data and status.\nimport { useMe } from '@coasys/ad4m-react-hooks';\nfunction MyProfile({ agentClient }) {\n const { me, status, profile, error } = useMe(agentClient, (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n }));\n if (error) return
Error: {error}
;\n if (!me) return
Loading...
;\n return (\n
\n

{profile?.name}

\n

{profile?.bio}

\n

Status: {status.isUnlocked ? 'Unlocked' : 'Locked'}

\n
\n );\n}","useperspective#usePerspective":"Fetches and subscribes to a single perspective by UUID.\nimport { usePerspective } from '@coasys/ad4m-react-hooks';\nfunction Perspective({ client, uuid }) {\n const { data } = usePerspective(client, uuid);\n const { perspective, synced } = data;\n if (!perspective) return
Loading...
;\n return (\n
\n

{perspective.name}

\n

Synced: {synced ? 'Yes' : 'No'}

\n

UUID: {perspective.uuid}

\n
\n );\n}","useperspectives#usePerspectives":"Provides access to all perspectives and handles real-time updates.\nimport { usePerspectives } from '@coasys/ad4m-react-hooks';\nfunction PerspectivesList({ client }) {\n const { perspectives, neighbourhoods, onLinkAdded, onLinkRemoved } = usePerspectives(client);\n useEffect(() => {\n const handleNewLink = (perspective, link) => {\n console.log(`New link in ${perspective.name}:`, link);\n };\n onLinkAdded(handleNewLink);\n return () => onLinkRemoved(handleNewLink);\n }, []);\n return (\n
\n

All Perspectives

\n
    \n {Object.values(perspectives).map(p => (\n
  • {p.name}
  • \n ))}\n
\n \n

Neighbourhoods

\n
    \n {Object.values(neighbourhoods).map(p => (\n
  • {p.name}
  • \n ))}\n
\n
\n );\n}","usemodel#useModel":"Provides a convenient way to query and subscribe to AD4M models with pagination support.\nimport { useModel } from '@coasys/ad4m-react-hooks';\nimport { Todo } from './models/Todo';\nfunction TodoList({ perspective }) {\n const { entries, loading, error, totalCount, loadMore } = useModel({\n perspective,\n model: Todo,\n query: { /* optional query parameters */ },\n pageSize: 10, // Optional - enables pagination\n preserveReferences: true // Optional - improves rendering performance\n });\n if (error) return
Error: {error}
;\n if (loading && entries.length === 0) return
Loading...
;\n return (\n
\n

Todos ({totalCount})

\n {entries.map(todo => (\n
\n

{todo.title}

\n

{todo.description}

\n
\n ))}\n {entries.length < totalCount && (\n \n )}\n
\n );\n}","best-practices#Best Practices":"Always handle loading and error states\nif (error) return ;\nif (!data) return ;\nClean up subscriptions\nuseEffect(() => {\n const callback = (perspective, link) => { /* ... */ };\n onLinkAdded(callback);\n return () => onLinkRemoved(callback);\n}, []);\nUse formatters for consistent data structure\nconst formatter = (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n});\nLeverage caching\n// The hooks handle caching automatically\nconst { data: perspective1 } = usePerspective(client, uuid1);\nconst { data: perspective2 } = usePerspective(client, uuid2);\nUse TypeScript for better type safety\ninterface TodoSubject {\n id: string;\n title: string;\n description: string;\n}\nconst { entries } = useSubjects({\n perspective,\n subject: 'Todo'\n});"}},"/jsdoc/classes/AIModelLoadingStatus":{"title":"Class: AIModelLoadingStatus","data":{"":"@coasys/ad4m / Exports / AIModelLoadingStatus","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"downloaded\nloaded\nmodel\nprogress\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new AIModelLoadingStatus(model, status, progress, downloaded, loaded)","parameters#Parameters":"Name\tType\tmodel\tstring\tstatus\tstring\tprogress\tnumber\tdownloaded\tboolean\tloaded\tboolean","defined-in#Defined in":"ai/Tasks.ts:114","properties-1#Properties":"","downloaded#downloaded":"• downloaded: boolean","defined-in-1#Defined in":"ai/Tasks.ts:109","loaded#loaded":"• loaded: boolean","defined-in-2#Defined in":"ai/Tasks.ts:112","model#model":"• model: string","defined-in-3#Defined in":"ai/Tasks.ts:100","progress#progress":"• progress: number","defined-in-4#Defined in":"ai/Tasks.ts:106","status#status":"• status: string","defined-in-5#Defined in":"ai/Tasks.ts:103"}},"/jsdoc/classes/AITask":{"title":"Class: AITask","data":{"":"@coasys/ad4m / Exports / AITask","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"createdAt\nmetaData\nmodelId\nname\npromptExamples\nsystemPrompt\ntaskId\nupdatedAt","constructors-1#Constructors":"","constructor#constructor":"• new AITask(name, model_id, task_id, system_prompt, prompt_examples, metaData?, created_at?, updated_at?)","parameters#Parameters":"Name\tType\tname\tstring\tmodel_id\tstring\ttask_id\tstring\tsystem_prompt\tstring\tprompt_examples\tAIPromptExamples[]\tmetaData?\tstring\tcreated_at?\tstring\tupdated_at?\tstring","defined-in#Defined in":"ai/Tasks.ts:85","properties-1#Properties":"","createdat#createdAt":"• createdAt: string","defined-in-1#Defined in":"ai/Tasks.ts:80","metadata#metaData":"• Optional metaData: string","defined-in-2#Defined in":"ai/Tasks.ts:77","modelid#modelId":"• modelId: string","defined-in-3#Defined in":"ai/Tasks.ts:65","name#name":"• name: string","defined-in-4#Defined in":"ai/Tasks.ts:62","promptexamples#promptExamples":"• promptExamples: AIPromptExamples[]","defined-in-5#Defined in":"ai/Tasks.ts:74","systemprompt#systemPrompt":"• systemPrompt: string","defined-in-6#Defined in":"ai/Tasks.ts:71","taskid#taskId":"• taskId: string","defined-in-7#Defined in":"ai/Tasks.ts:68","updatedat#updatedAt":"• updatedAt: string","defined-in-8#Defined in":"ai/Tasks.ts:83"}},"/jsdoc/classes/AIPromptExamplesInput":{"title":"Class: AIPromptExamplesInput","data":{"":"@coasys/ad4m / Exports / AIPromptExamplesInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"input\noutput","constructors-1#Constructors":"","constructor#constructor":"• new AIPromptExamplesInput(input, output)","parameters#Parameters":"Name\tType\tinput\tstring\toutput\tstring","defined-in#Defined in":"ai/Tasks.ts:12","properties-1#Properties":"","input#input":"• input: string","defined-in-1#Defined in":"ai/Tasks.ts:7","output#output":"• output: string","defined-in-2#Defined in":"ai/Tasks.ts:10"}},"/jsdoc/classes/AIPromptExamples":{"title":"Class: AIPromptExamples","data":{"":"@coasys/ad4m / Exports / AIPromptExamples","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"input\noutput","constructors-1#Constructors":"","constructor#constructor":"• new AIPromptExamples(input, output)","parameters#Parameters":"Name\tType\tinput\tstring\toutput\tstring","defined-in#Defined in":"ai/Tasks.ts:27","properties-1#Properties":"","input#input":"• input: string","defined-in-1#Defined in":"ai/Tasks.ts:22","output#output":"• output: string","defined-in-2#Defined in":"ai/Tasks.ts:25"}},"/jsdoc/classes/Ad4mModel":{"title":"Class: Ad4mModel","data":{"":"@coasys/ad4m / Exports / Ad4mModelBase class for defining data models in AD4M.DescriptionAd4mModel provides the foundation for creating data models that are stored in AD4M perspectives.\nEach model instance is represented as a subgraph in the perspective, with properties and collections\nmapped to links in that graph. The class uses Prolog-based queries to efficiently search and filter\ninstances based on their properties and relationships.Key concepts:\nEach model instance has a unique base expression that serves as its identifier\nProperties are stored as links with predicates defined by the through option\nCollections represent one-to-many relationships as sets of links\nQueries are translated to Prolog for efficient graph pattern matching\nChanges are tracked through the perspective's subscription system\nExample\n// Define a recipe model\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n // Required property with literal value\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n // Optional property with custom initial value\n @Optional({\n through: \"recipe://status\",\n initial: \"recipe://draft\"\n })\n status: string = \"\";\n // Read-only computed property\n @ReadOnly({\n through: \"recipe://rating\",\n getter: `\n findall(Rating, triple(Base, \"recipe://user_rating\", Rating), Ratings),\n sum_list(Ratings, Sum),\n length(Ratings, Count),\n Value is Sum / Count\n `\n })\n averageRating: number = 0;\n // Collection of ingredients\n @Collection({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n // Collection of comments that are instances of another model\n @Collection({\n through: \"recipe://comment\",\n where: { isInstance: Comment }\n })\n comments: Comment[] = [];\n}\n// Create and save a new recipe\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nawait recipe.save();\n// Query recipes in different ways\n// Get all recipes\nconst allRecipes = await Recipe.findAll(perspective);\n// Find recipes with specific criteria\nconst desserts = await Recipe.findAll(perspective, {\n where: { \n status: \"recipe://published\",\n averageRating: { gt: 4 }\n },\n order: { name: \"ASC\" },\n limit: 10\n});\n// Use the fluent query builder\nconst popularRecipes = await Recipe.query(perspective)\n .where({ averageRating: { gt: 4.5 } })\n .order({ averageRating: \"DESC\" })\n .limit(5)\n .get();\n// Subscribe to real-time updates\nawait Recipe.query(perspective)\n .where({ status: \"recipe://cooking\" })\n .subscribe(recipes => {\n console.log(\"Currently being cooked:\", recipes);\n });\n// Paginate results\nconst { results, totalCount, pageNumber } = await Recipe.query(perspective)\n .where({ status: \"recipe://published\" })\n .paginate(10, 1);","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#baseExpression\n#perspective\n#source\n#subjectClassName\nauthor\ntimestamp\nclassNamesByClass","accessors#Accessors":"baseExpression\nperspective","methods#Methods":"cleanCopy\ndelete\nget\ngetData\ninnerUpdate\nsave\nsetCollectionAdder\nsetCollectionRemover\nsetCollectionSetter\nsetProperty\nupdate\nassignValuesToInstance\nbuildGraphTraversalWhereClause\nbuildSurrealSelectFields\nbuildSurrealSelectFieldsWithAggregation\nbuildSurrealWhereClause\ncount\ncountQueryToProlog\ncountQueryToSurrealQL\ndetermineNamespace\ndeterminePredicate\nfindAll\nfindAllAndCount\nformatSurrealValue\nfromJSONSchema\ngetClassName\ngetDefaultValueForType\ngetModelMetadata\ngetPropertyOption\ninstancesFromPrologResult\nmatchesCondition\npaginate\nquery\nqueryToProlog\nqueryToSurrealQL","constructors-1#Constructors":"","constructor#constructor":"• new Ad4mModel(perspective, baseExpression?, source?)Constructs a new model instance.","parameters#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective where this model will be stored\tbaseExpression?\tstring\tOptional unique identifier for this instance\tsource?\tstring\tOptional source expression this instance is linked to\t\nExample\n// Create a new recipe with auto-generated base expression\nconst recipe = new Recipe(perspective);\n// Create with specific base expression\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake\");\n// Create with source link\nconst recipe = new Recipe(perspective, undefined, \"cookbook://desserts\");","defined-in#Defined in":"model/Ad4mModel.ts:596","properties-1#Properties":"","baseexpression##baseExpression":"• Private #baseExpression: string","defined-in-1#Defined in":"model/Ad4mModel.ts:406","perspective##perspective":"• Private #perspective: PerspectiveProxy","defined-in-2#Defined in":"model/Ad4mModel.ts:409","source##source":"• Private #source: string","defined-in-3#Defined in":"model/Ad4mModel.ts:408","subjectclassname##subjectClassName":"• Private #subjectClassName: string","defined-in-4#Defined in":"model/Ad4mModel.ts:407","author#author":"• author: string","defined-in-5#Defined in":"model/Ad4mModel.ts:410","timestamp#timestamp":"• timestamp: string","defined-in-6#Defined in":"model/Ad4mModel.ts:411","classnamesbyclass#classNamesByClass":"▪ Static Private classNamesByClass: WeakMap","defined-in-7#Defined in":"model/Ad4mModel.ts:413","accessors-1#Accessors":"","baseexpression-1#baseExpression":"• get baseExpression(): stringGets the base expression of the subject.","returns#Returns":"string","defined-in-8#Defined in":"model/Ad4mModel.ts:605","perspective-1#perspective":"• Protected get perspective(): PerspectiveProxyProtected getter for the perspective.\nAllows subclasses to access the perspective while keeping it private from external code.","returns-1#Returns":"PerspectiveProxy","defined-in-9#Defined in":"model/Ad4mModel.ts:613","methods-1#Methods":"","cleancopy#cleanCopy":"▸ Private cleanCopy(): Object","returns-2#Returns":"Object","defined-in-10#Defined in":"model/Ad4mModel.ts:1974","delete#delete":"▸ delete(batchId?): PromiseDeletes the model instance from the perspective.","parameters-1#Parameters":"Name\tType\tDescription\tbatchId?\tstring\tOptional batch ID for batch operations","returns-3#Returns":"PromiseThrowsWill throw if removal failsExample\nconst recipe = await Recipe.findAll(perspective)[0];\nawait recipe.delete();\n// Or with batch operations:\nconst batchId = await perspective.createBatch();\nawait recipe.delete(batchId);\nawait perspective.commitBatch(batchId);","defined-in-11#Defined in":"model/Ad4mModel.ts:2077","get#get":"▸ get(): PromiseGets the model instance with all properties and collections populated.","returns-4#Returns":"PromiseThe populated model instanceThrowsWill throw if data retrieval failsExample\nconst recipe = new Recipe(perspective, existingId);\nawait recipe.get();\nconsole.log(recipe.name, recipe.ingredients);","defined-in-12#Defined in":"model/Ad4mModel.ts:2054","getdata#getData":"▸ Private getData(): Promise","returns-5#Returns":"Promise","defined-in-13#Defined in":"model/Ad4mModel.ts:669","innerupdate#innerUpdate":"▸ Private innerUpdate(setProperties?, batchId?): Promise","parameters-2#Parameters":"Name\tType\tDefault value\tsetProperties\tboolean\ttrue\tbatchId?\tstring\tundefined","returns-6#Returns":"Promise","defined-in-14#Defined in":"model/Ad4mModel.ts:1985","save#save":"▸ save(batchId?): PromiseSaves the model instance to the perspective.\nCreates a new instance with the base expression and links it to the source.","parameters-3#Parameters":"Name\tType\tDescription\tbatchId?\tstring\tOptional batch ID for batch operations","returns-7#Returns":"PromiseThrowsWill throw if instance creation, linking, or updating failsExample\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Spaghetti\";\nrecipe.ingredients = [\"pasta\", \"tomato sauce\"];\nawait recipe.save();\n// Or with batch operations:\nconst batchId = await perspective.createBatch();\nawait recipe.save(batchId);\nawait perspective.commitBatch(batchId);","defined-in-15#Defined in":"model/Ad4mModel.ts:1928","setcollectionadder#setCollectionAdder":"▸ Private setCollectionAdder(key, value, batchId?): Promise","parameters-4#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-8#Returns":"Promise","defined-in-16#Defined in":"model/Ad4mModel.ts:1864","setcollectionremover#setCollectionRemover":"▸ Private setCollectionRemover(key, value, batchId?): Promise","parameters-5#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-9#Returns":"Promise","defined-in-17#Defined in":"model/Ad4mModel.ts:1886","setcollectionsetter#setCollectionSetter":"▸ Private setCollectionSetter(key, value, batchId?): Promise","parameters-6#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-10#Returns":"Promise","defined-in-18#Defined in":"model/Ad4mModel.ts:1840","setproperty#setProperty":"▸ Private setProperty(key, value, batchId?): Promise","parameters-7#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-11#Returns":"Promise","defined-in-19#Defined in":"model/Ad4mModel.ts:1819","update#update":"▸ update(batchId?): PromiseUpdates the model instance's properties and collections.","parameters-8#Parameters":"Name\tType\tDescription\tbatchId?\tstring\tOptional batch ID for batch operations","returns-12#Returns":"PromiseThrowsWill throw if property setting or collection updates failExample\nconst recipe = await Recipe.findAll(perspective)[0];\nrecipe.rating = 5;\nrecipe.ingredients.push(\"garlic\");\nawait recipe.update();\n// Or with batch operations:\nconst batchId = await perspective.createBatch();\nawait recipe.update(batchId);\nawait perspective.commitBatch(batchId);","defined-in-20#Defined in":"model/Ad4mModel.ts:2036","assignvaluestoinstance#assignValuesToInstance":"▸ Static assignValuesToInstance(perspective, instance, values): Promise","parameters-9#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tinstance\tAd4mModel\tvalues\tValueTuple[]","returns-13#Returns":"Promise","defined-in-21#Defined in":"model/Ad4mModel.ts:617","buildgraphtraversalwhereclause#buildGraphTraversalWhereClause":"▸ Static Private buildGraphTraversalWhereClause(metadata, where?): stringBuilds the WHERE clause for SurrealQL queries using graph traversal syntax.","parameters-10#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property predicates\twhere?\tWhere\tWhere conditions from the query","returns-14#Returns":"stringGraph traversal WHERE clause filters, or empty string if no conditionsDescriptionTranslates where conditions into graph traversal filters: ->link[WHERE ...]\nThis is more efficient than nested SELECTs because SurrealDB can optimize graph traversals.Handles several condition types:\nSimple equality: { name: \"Pasta\" } → ->link[WHERE predicate = 'X' AND out.uri = 'Pasta']\nArrays (IN clause): { name: [\"Pasta\", \"Pizza\"] } → ->link[WHERE predicate = 'X' AND out.uri IN [...]]\nNOT operators: Use NOT prefix\nComparison operators (gt, gte, lt, lte, etc.): Handled in post-query JavaScript filtering\nSpecial fields: base uses uri directly, author/timestamp handled post-query","defined-in-22#Defined in":"model/Ad4mModel.ts:854","buildsurrealselectfields#buildSurrealSelectFields":"▸ Static Private buildSurrealSelectFields(metadata, properties?, collections?): stringBuilds the SELECT fields for SurrealQL queries.","parameters-11#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property and collection predicates\tproperties?\tstring[]\tOptional array of property names to include (default: all)\tcollections?\tstring[]\tOptional array of collection names to include (default: all)","returns-15#Returns":"stringComma-separated SELECT field listDescriptionGenerates the field list for the SELECT clause, resolving properties and collections\nvia subqueries. Each property is fetched with a subquery that finds the link with the\nappropriate predicate and returns its target. Collections are similar but don't use LIMIT 1.Field types:\nProperties: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X' LIMIT 1) AS propName\nCollections: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X') AS collName\nAuthor/Timestamp: Always included to provide metadata about each instance\nIf properties or collections arrays are provided, only those fields are included.\nOtherwise, all properties/collections from metadata are included.","defined-in-23#Defined in":"model/Ad4mModel.ts:1114","buildsurrealselectfieldswithaggregation#buildSurrealSelectFieldsWithAggregation":"▸ Static Private buildSurrealSelectFieldsWithAggregation(metadata, properties?, collections?): stringBuilds the SELECT fields for SurrealQL queries using aggregation functions.\nCompatible with GROUP BY source queries.","parameters-12#Parameters":"Name\tType\tmetadata\tModelMetadata\tproperties?\tstring[]\tcollections?\tstring[]","returns-16#Returns":"string","defined-in-24#Defined in":"model/Ad4mModel.ts:1150","buildsurrealwhereclause#buildSurrealWhereClause":"▸ Static Private buildSurrealWhereClause(metadata, where?): stringBuilds the WHERE clause for SurrealQL queries.","parameters-13#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property predicates\twhere?\tWhere\tWhere conditions from the query","returns-17#Returns":"stringWHERE clause string (without the \"WHERE\" keyword), or empty string if no conditionsDescriptionTranslates the where conditions from the Query object into SurrealQL WHERE clause fragments.\nFor each property filter, generates a subquery that checks for links with the appropriate\npredicate and target value.Handles several condition types:\nSimple equality: { name: \"Pasta\" } → subquery checking for predicate and target match\nArrays (IN clause): { name: [\"Pasta\", \"Pizza\"] } → target IN [...]\nOperators: { rating: { gt: 4 } } → target > '4'\ngt, gte, lt, lte: comparison operators\nnot: negation (single value or array)\nbetween: range check\ncontains: substring/element check (uses SurrealQL CONTAINS)\nSpecial fields: base, author, timestamp are accessed directly, not via subqueries\nAll conditions are joined with AND.","defined-in-25#Defined in":"model/Ad4mModel.ts:985","count#count":"▸ Static count(perspective, query?, useSurrealDB?): anyGets a count of all matching instances.","parameters-14#Parameters":"Name\tType\tDefault value\tDescription\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-18#Returns":"anyTotal count of matching entitiesExample\nconst totalRecipes = await Recipe.count(perspective);\nconst activeRecipes = await Recipe.count(perspective, {\n where: { status: \"active\" }\n});\n// Use Prolog explicitly (legacy)\nconst countProlog = await Recipe.count(perspective, {}, false);","defined-in-26#Defined in":"model/Ad4mModel.ts:1804","countquerytoprolog#countQueryToProlog":"▸ Static countQueryToProlog(perspective, query?, modelClassName?): Promise","parameters-15#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tquery\tQuery\tmodelClassName?\tstring","returns-19#Returns":"Promise","defined-in-27#Defined in":"model/Ad4mModel.ts:1749","countquerytosurrealql#countQueryToSurrealQL":"▸ Static Private countQueryToSurrealQL(perspective, query): PromiseGenerates a SurrealQL COUNT query for the model.","parameters-16#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective context\tquery\tQuery\tQuery parameters to filter the count","returns-20#Returns":"PromiseSurrealQL COUNT query string","defined-in-28#Defined in":"model/Ad4mModel.ts:1776","determinenamespace#determineNamespace":"▸ Static Private determineNamespace(schema, options): stringDetermines the namespace for predicates using cascading precedence","parameters-17#Parameters":"Name\tType\tschema\tJSONSchema\toptions\tJSONSchemaToModelOptions","returns-21#Returns":"string","defined-in-29#Defined in":"model/Ad4mModel.ts:2341","determinepredicate#determinePredicate":"▸ Static Private determinePredicate(schema, propertyName, propertySchema, namespace, options): stringDetermines the predicate for a specific property using cascading precedence","parameters-18#Parameters":"Name\tType\tschema\tJSONSchema\tpropertyName\tstring\tpropertySchema\tJSONSchemaProperty\tnamespace\tstring\toptions\tJSONSchemaToModelOptions","returns-22#Returns":"string","defined-in-30#Defined in":"model/Ad4mModel.ts:2385","findall#findAll":"▸ Static findAll(this, perspective, query?, useSurrealDB?): PromiseGets all instances of the model in the perspective that match the query params.","type-parameters#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-19#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-23#Returns":"PromiseArray of matching modelsExample\n// Get all recipes (uses SurrealDB by default)\nconst allRecipes = await Recipe.findAll(perspective);\n// Get recipes with specific criteria (uses SurrealDB)\nconst recipes = await Recipe.findAll(perspective, {\n where: { \n name: \"Pasta\",\n rating: { gt: 4 }\n },\n order: { createdAt: \"DESC\" },\n limit: 10\n});\n// Explicitly use Prolog (legacy, for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {}, false);","defined-in-31#Defined in":"model/Ad4mModel.ts:1650","findallandcount#findAllAndCount":"▸ Static findAllAndCount(this, perspective, query?, useSurrealDB?): Promise>Gets all instances with count of total matches without offset & limit applied.","type-parameters-1#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-20#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-24#Returns":"Promise>Object containing results array and total countExample\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {\n where: { category: \"Dessert\" },\n limit: 10\n});\nconsole.log(`Showing 10 of ${totalCount} dessert recipes`);\n// Use Prolog explicitly (legacy)\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {}, false);","defined-in-32#Defined in":"model/Ad4mModel.ts:1689","formatsurrealvalue#formatSurrealValue":"▸ Static Private formatSurrealValue(value): stringFormats a value for use in SurrealQL queries.","parameters-21#Parameters":"Name\tType\tDescription\tvalue\tany\tThe value to format","returns-25#Returns":"stringFormatted value string ready for SurrealQLDescriptionHandles different value types:\nStrings: Wrapped in single quotes with backslash-escaped special characters\nNumbers/booleans: Converted to string\nArrays: Recursively formatted and wrapped in brackets","defined-in-33#Defined in":"model/Ad4mModel.ts:1195","fromjsonschema#fromJSONSchema":"▸ Static fromJSONSchema(schema, options): typeof Ad4mModelCreates an Ad4mModel class from a JSON Schema definition.","parameters-22#Parameters":"Name\tType\tDescription\tschema\tJSONSchema\tJSON Schema definition\toptions\tJSONSchemaToModelOptions\tConfiguration options","returns-26#Returns":"typeof Ad4mModelGenerated Ad4mModel subclassDescriptionThis method dynamically generates an Ad4mModel subclass from a JSON Schema,\nenabling integration with systems that use JSON Schema for type definitions.The method follows a cascading approach for determining predicates:\nExplicit configuration in options parameter (highest precedence)\nx-ad4m metadata in the JSON Schema\nInference from schema title and property names\nError if no namespace can be determined\nExample\n// With explicit configuration\nconst PersonClass = Ad4mModel.fromJSONSchema(schema, {\n name: \"Person\",\n namespace: \"person://\",\n resolveLanguage: \"literal\"\n});\n// With property mapping\nconst ContactClass = Ad4mModel.fromJSONSchema(schema, {\n name: \"Contact\",\n namespace: \"contact://\",\n propertyMapping: {\n \"name\": \"foaf://name\",\n \"email\": \"foaf://mbox\"\n }\n});\n// With x-ad4m metadata in schema\nconst schema = {\n \"title\": \"Product\",\n \"x-ad4m\": { \"namespace\": \"product://\" },\n \"properties\": {\n \"name\": { \n \"type\": \"string\",\n \"x-ad4m\": { \"through\": \"product://title\" }\n }\n }\n};\nconst ProductClass = Ad4mModel.fromJSONSchema(schema, { name: \"Product\" });\nThrowsError when namespace cannot be inferred","defined-in-34#Defined in":"model/Ad4mModel.ts:2163","getclassname#getClassName":"▸ Static getClassName(perspective): Promise","parameters-23#Parameters":"Name\tType\tperspective\tPerspectiveProxy","returns-27#Returns":"Promise","defined-in-35#Defined in":"model/Ad4mModel.ts:415","getdefaultvaluefortype#getDefaultValueForType":"▸ Static Private getDefaultValueForType(type?): anyGets default value for a JSON Schema type","parameters-24#Parameters":"Name\tType\ttype?\tstring","returns-28#Returns":"any","defined-in-36#Defined in":"model/Ad4mModel.ts:2462","getmodelmetadata#getModelMetadata":"▸ Static getModelMetadata(): ModelMetadataExtracts metadata from decorators for query building.","returns-29#Returns":"ModelMetadataStructured metadata object containing className, properties, and collectionsDescriptionThis method reads the metadata stored by decorators (@Property, @Collection, etc.)\nand returns it in a structured format that's easier to work with for query builders\nand other systems that need to introspect model structure.The metadata includes:\nClass name from\nModel Options\nProperty metadata (predicates, types, constraints, etc.)\nCollection metadata (predicates, filters, etc.)\nFor models created via fromJSONSchema(), this method will derive metadata from\nthe stored __properties and __collections structures that were populated during\nthe dynamic class creation. If these structures are empty but a JSON schema was\nattached to the class, it can fall back to deriving metadata from that schema.ThrowsError if the class doesn't haveModel OptionsdecoratorExample\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\", resolveLanguage: \"literal\" })\n name: string = \"\";\n \n @Collection({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n}\nconst metadata = Recipe.getModelMetadata();\nconsole.log(metadata.className); // \"Recipe\"\nconsole.log(metadata.properties.name.predicate); // \"recipe://name\"\nconsole.log(metadata.collections.ingredients.predicate); // \"recipe://ingredient\"","defined-in-37#Defined in":"model/Ad4mModel.ts:478","getpropertyoption#getPropertyOption":"▸ Static Private getPropertyOption(propertyName, propertySchema, options, optionName, defaultValue?): anyGets property-specific options using cascading precedence","parameters-25#Parameters":"Name\tType\tpropertyName\tstring\tpropertySchema\tJSONSchemaProperty\toptions\tJSONSchemaToModelOptions\toptionName\tkeyof PropertyOptions\tdefaultValue?\tany","returns-30#Returns":"any","defined-in-38#Defined in":"model/Ad4mModel.ts:2433","instancesfromprologresult#instancesFromPrologResult":"▸ Static instancesFromPrologResult(this, perspective, query, result): Promise>","type-parameters-2#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-26#Parameters":"Name\tType\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tperspective\tPerspectiveProxy\tquery\tQuery\tresult\tAllInstancesResult","returns-31#Returns":"Promise>","defined-in-39#Defined in":"model/Ad4mModel.ts:1215","matchescondition#matchesCondition":"▸ Static Private matchesCondition(value, condition): booleanChecks if a value matches a condition (for post-query filtering).","parameters-27#Parameters":"Name\tType\tvalue\tany\tcondition\tWhereCondition","returns-32#Returns":"boolean","defined-in-40#Defined in":"model/Ad4mModel.ts:1562","paginate#paginate":"▸ Static paginate(this, perspective, pageSize, pageNumber, query?, useSurrealDB?): Promise>Helper function for pagination with explicit page size and number.","type-parameters-3#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-28#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tpageSize\tnumber\tundefined\tNumber of items per page\tpageNumber\tnumber\tundefined\tWhich page to retrieve (1-based)\tquery?\tQuery\tundefined\tOptional additional query parameters\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-33#Returns":"Promise>Paginated results with metadataExample\nconst page = await Recipe.paginate(perspective, 10, 1, {\n where: { category: \"Main Course\" }\n});\nconsole.log(`Page ${page.pageNumber} of recipes, ${page.results.length} items`);\n// Use Prolog explicitly (legacy)\nconst pageProlog = await Recipe.paginate(perspective, 10, 1, {}, false);","defined-in-41#Defined in":"model/Ad4mModel.ts:1727","query#query":"▸ Static query(this, perspective, query?): ModelQueryBuilderCreates a query builder for fluent query construction.","type-parameters-4#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-29#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\t-\tperspective\tPerspectiveProxy\tThe perspective to query\tquery?\tQuery\tOptional initial query parameters","returns-34#Returns":"ModelQueryBuilderA new query builder instanceExample\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .order({ rating: \"DESC\" })\n .limit(5)\n .run();\n// With real-time updates\nawait Recipe.query(perspective)\n .where({ status: \"cooking\" })\n .subscribe(recipes => {\n console.log(\"Currently cooking:\", recipes);\n });","defined-in-42#Defined in":"model/Ad4mModel.ts:2104","querytoprolog#queryToProlog":"▸ Static queryToProlog(perspective, query, modelClassName?): Promise","parameters-30#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tquery\tQuery\tmodelClassName?\tstring","returns-35#Returns":"Promise","defined-in-43#Defined in":"model/Ad4mModel.ts:689","querytosurrealql#queryToSurrealQL":"▸ Static queryToSurrealQL(perspective, query): PromiseGenerates a SurrealQL query from a Query object.","parameters-31#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective to query (used for metadata extraction)\tquery\tQuery\tQuery parameters (where, order, limit, offset, properties, collections)","returns-36#Returns":"PromiseComplete SurrealQL query string ready for executionDescriptionThis method translates high-level query parameters into a SurrealQL query string\nthat can be executed against the SurrealDB backend. Unlike Prolog queries which\noperate on SDNA-aware predicates, SurrealQL queries operate directly on raw links\nstored in SurrealDB.The generated query uses a CTE (Common Table Expression) pattern:\nFirst, identify candidate base expressions by filtering links based on where conditions\nThen, for each candidate base, resolve properties and collections via subqueries\nFinally, apply ordering, pagination (LIMIT/START) at the SQL level\nKey architectural notes:\nSurrealDB stores only raw links (source, predicate, target, author, timestamp)\nNo SDNA knowledge at the database level\nProperties are resolved via subqueries that look for links with specific predicates\nCollections are similar but return multiple values instead of one\nSpecial fields (base, author, timestamp) are accessed directly, not via subqueries\nExample\nconst query = Recipe.queryToSurrealQL(perspective, {\n where: { name: \"Pasta\", rating: { gt: 4 } },\n order: { timestamp: \"DESC\" },\n limit: 10\n});\n// Returns: SELECT source AS base, array::first(target[WHERE predicate = ...]) AS name, ...\n// FROM link WHERE ... GROUP BY source ORDER BY timestamp DESC LIMIT 10","defined-in-44#Defined in":"model/Ad4mModel.ts:751"}},"/jsdoc/classes/AITaskInput":{"title":"Class: AITaskInput","data":{"":"@coasys/ad4m / Exports / AITaskInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"metaData\nmodelId\nname\npromptExamples\nsystemPrompt","constructors-1#Constructors":"","constructor#constructor":"• new AITaskInput(name, model_id, system_prompt, prompt_examples, metaData?)","parameters#Parameters":"Name\tType\tname\tstring\tmodel_id\tstring\tsystem_prompt\tstring\tprompt_examples\tAIPromptExamplesInput[]\tmetaData?\tstring","defined-in#Defined in":"ai/Tasks.ts:50","properties-1#Properties":"","metadata#metaData":"• metaData: string","defined-in-1#Defined in":"ai/Tasks.ts:48","modelid#modelId":"• modelId: string","defined-in-2#Defined in":"ai/Tasks.ts:39","name#name":"• name: string","defined-in-3#Defined in":"ai/Tasks.ts:36","promptexamples#promptExamples":"• promptExamples: AIPromptExamplesInput[]","defined-in-4#Defined in":"ai/Tasks.ts:45","systemprompt#systemPrompt":"• systemPrompt: string","defined-in-5#Defined in":"ai/Tasks.ts:42"}},"/jsdoc/classes/AgentExpression":{"title":"Class: AgentExpression","data":{"":"@coasys/ad4m / Exports / AgentExpression","hierarchy#Hierarchy":"any↳ AgentExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new AgentExpression()","inherited-from#Inherited from":"ExpressionGeneric(Agent).constructor"}},"/jsdoc/classes/AgentClient":{"title":"Class: AgentClient","data":{"":"@coasys/ad4m / Exports / AgentClientProvides access to all functions regarding the local agent,\nsuch as generating, locking, unlocking, importing the DID keystore,\nas well as updating the publicly shared Agent expression.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#agentStatusChangedCallbacks\n#apolloClient\n#appsChangedCallback\n#updatedCallbacks","methods#Methods":"addAgentStatusChangedListener\naddAppChangedListener\naddEntanglementProofs\naddUpdatedListener\nbyDID\ndeleteEntanglementProofs\nentanglementProofPreFlight\ngenerate\ngenerateJwt\ngetApps\ngetEntanglementProofs\nimport\nisLocked\nlock\nme\nmutatePublicPerspective\npermitCapability\nremoveApp\nrequestCapability\nrevokeToken\nsignMessage\nstatus\nsubscribeAgentStatusChanged\nsubscribeAgentUpdated\nsubscribeAppsChanged\nunlock\nupdateDirectMessageLanguage\nupdatePublicPerspective","constructors-1#Constructors":"","constructor#constructor":"• new AgentClient(client, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tclient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"agent/AgentClient.ts:93","properties-1#Properties":"","agentstatuschangedcallbacks##agentStatusChangedCallbacks":"• Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]","defined-in-1#Defined in":"agent/AgentClient.ts:91","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-2#Defined in":"agent/AgentClient.ts:88","appschangedcallback##appsChangedCallback":"• Private #appsChangedCallback: AgentAppsUpdatedCallback[]","defined-in-3#Defined in":"agent/AgentClient.ts:89","updatedcallbacks##updatedCallbacks":"• Private #updatedCallbacks: AgentUpdatedCallback[]","defined-in-4#Defined in":"agent/AgentClient.ts:90","methods-1#Methods":"","addagentstatuschangedlistener#addAgentStatusChangedListener":"▸ addAgentStatusChangedListener(listener): void","parameters-1#Parameters":"Name\tType\tlistener\tany","returns#Returns":"void","defined-in-5#Defined in":"agent/AgentClient.ts:399","addappchangedlistener#addAppChangedListener":"▸ addAppChangedListener(listener): void","parameters-2#Parameters":"Name\tType\tlistener\tany","returns-1#Returns":"void","defined-in-6#Defined in":"agent/AgentClient.ts:356","addentanglementproofs#addEntanglementProofs":"▸ addEntanglementProofs(proofs): Promise","parameters-3#Parameters":"Name\tType\tproofs\tEntanglementProofInput[]","returns-2#Returns":"Promise","defined-in-7#Defined in":"agent/AgentClient.ts:290","addupdatedlistener#addUpdatedListener":"▸ addUpdatedListener(listener): void","parameters-4#Parameters":"Name\tType\tlistener\tany","returns-3#Returns":"void","defined-in-8#Defined in":"agent/AgentClient.ts:352","bydid#byDID":"▸ byDID(did): Promise","parameters-5#Parameters":"Name\tType\tdid\tstring","returns-4#Returns":"Promise","defined-in-9#Defined in":"agent/AgentClient.ts:200","deleteentanglementproofs#deleteEntanglementProofs":"▸ deleteEntanglementProofs(proofs): Promise","parameters-6#Parameters":"Name\tType\tproofs\tEntanglementProofInput[]","returns-5#Returns":"Promise","defined-in-10#Defined in":"agent/AgentClient.ts:306","entanglementproofpreflight#entanglementProofPreFlight":"▸ entanglementProofPreFlight(deviceKey, deviceKeyType): Promise","parameters-7#Parameters":"Name\tType\tdeviceKey\tstring\tdeviceKeyType\tstring","returns-6#Returns":"Promise","defined-in-11#Defined in":"agent/AgentClient.ts:335","generate#generate":"▸ generate(passphrase): Promise","parameters-8#Parameters":"Name\tType\tpassphrase\tstring","returns-7#Returns":"Promise","defined-in-12#Defined in":"agent/AgentClient.ts:136","generatejwt#generateJwt":"▸ generateJwt(requestId, rand): Promise","parameters-9#Parameters":"Name\tType\trequestId\tstring\trand\tstring","returns-8#Returns":"Promise","defined-in-13#Defined in":"agent/AgentClient.ts:450","getapps#getApps":"▸ getApps(): Promise","returns-9#Returns":"Promise","defined-in-14#Defined in":"agent/AgentClient.ts:464","getentanglementproofs#getEntanglementProofs":"▸ getEntanglementProofs(): Promise","returns-10#Returns":"Promise","defined-in-15#Defined in":"agent/AgentClient.ts:322","import#import":"▸ import(args): Promise","parameters-10#Parameters":"Name\tType\targs\tInitializeArgs","returns-11#Returns":"Promise","defined-in-16#Defined in":"agent/AgentClient.ts:152","islocked#isLocked":"▸ isLocked(): Promise","returns-12#Returns":"Promise","defined-in-17#Defined in":"agent/AgentClient.ts:505","lock#lock":"▸ lock(passphrase): Promise","parameters-11#Parameters":"Name\tType\tpassphrase\tstring","returns-13#Returns":"Promise","defined-in-18#Defined in":"agent/AgentClient.ts:172","me#me":"▸ me(): PromiseReturns the Agent expression of the local agent as it is shared\npublicly via the AgentLanguage.I.e. this is the users profile.","returns-14#Returns":"Promise","defined-in-19#Defined in":"agent/AgentClient.ts:112","mutatepublicperspective#mutatePublicPerspective":"▸ mutatePublicPerspective(mutations): Promise","parameters-12#Parameters":"Name\tType\tmutations\tLinkMutations","returns-15#Returns":"Promise","defined-in-20#Defined in":"agent/AgentClient.ts:240","permitcapability#permitCapability":"▸ permitCapability(auth): Promise","parameters-13#Parameters":"Name\tType\tauth\tstring","returns-16#Returns":"Promise","defined-in-21#Defined in":"agent/AgentClient.ts:436","removeapp#removeApp":"▸ removeApp(requestId): Promise","parameters-14#Parameters":"Name\tType\trequestId\tstring","returns-17#Returns":"Promise","defined-in-22#Defined in":"agent/AgentClient.ts:477","requestcapability#requestCapability":"▸ requestCapability(authInfo): Promise","parameters-15#Parameters":"Name\tType\tauthInfo\tAuthInfoInput","returns-18#Returns":"Promise","defined-in-23#Defined in":"agent/AgentClient.ts:422","revoketoken#revokeToken":"▸ revokeToken(requestId): Promise","parameters-16#Parameters":"Name\tType\trequestId\tstring","returns-19#Returns":"Promise","defined-in-24#Defined in":"agent/AgentClient.ts:491","signmessage#signMessage":"▸ signMessage(message): Promise","parameters-17#Parameters":"Name\tType\tmessage\tstring","returns-20#Returns":"Promise","defined-in-25#Defined in":"agent/AgentClient.ts:518","status#status":"▸ status(): Promise","returns-21#Returns":"Promise","defined-in-26#Defined in":"agent/AgentClient.ts:123","subscribeagentstatuschanged#subscribeAgentStatusChanged":"▸ subscribeAgentStatusChanged(): void","returns-22#Returns":"void","defined-in-27#Defined in":"agent/AgentClient.ts:403","subscribeagentupdated#subscribeAgentUpdated":"▸ subscribeAgentUpdated(): void","returns-23#Returns":"void","defined-in-28#Defined in":"agent/AgentClient.ts:360","subscribeappschanged#subscribeAppsChanged":"▸ subscribeAppsChanged(): void","returns-24#Returns":"void","defined-in-29#Defined in":"agent/AgentClient.ts:379","unlock#unlock":"▸ unlock(passphrase, holochain?): Promise","parameters-18#Parameters":"Name\tType\tDefault value\tpassphrase\tstring\tundefined\tholochain\tboolean\ttrue","returns-25#Returns":"Promise","defined-in-30#Defined in":"agent/AgentClient.ts:186","updatedirectmessagelanguage#updateDirectMessageLanguage":"▸ updateDirectMessageLanguage(directMessageLanguage): Promise","parameters-19#Parameters":"Name\tType\tdirectMessageLanguage\tstring","returns-26#Returns":"Promise","defined-in-31#Defined in":"agent/AgentClient.ts:271","updatepublicperspective#updatePublicPerspective":"▸ updatePublicPerspective(perspective): Promise","parameters-20#Parameters":"Name\tType\tperspective\tPerspectiveInput","returns-27#Returns":"Promise","defined-in-32#Defined in":"agent/AgentClient.ts:214"}},"/jsdoc/classes/Agent":{"title":"Class: Agent","data":{"":"@coasys/ad4m / Exports / AgentAD4M's representation of an AgentAD4M Agents are build around DIDs, which are used to identify and authenticate the Agent.\nConceptually, an Agent is regarded as something that can speak and that can listen.Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key,\nAnd they also speak (broadcast) by putting semantic statements into their public \"Agent Perspective\".\nThey listen (can receive messages) through their \"direct message Language\".These three aspects are represented by the three fields of this class.This class is used as format for the Expressions in the Agent language.\nSince AD4M treats DID URIs as addresses for the Agent Language,\nDIDs are resolved to Expressions that are objects of this class.\nThus, this is how agents see (other) agents.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\ndirectMessageLanguage\nperspective","constructors-1#Constructors":"","constructor#constructor":"• new Agent(did, perspective?)","parameters#Parameters":"Name\tType\tdid\tstring\tperspective?\tPerspective","defined-in#Defined in":"agent/Agent.ts:42","properties-1#Properties":"","did#did":"• did: stringThe DID of the Agent\nAll epxressions authored by them are signed with the keys mentioned\nin the DID document behind this DID URI.","defined-in-1#Defined in":"agent/Agent.ts:28","directmessagelanguage#directMessageLanguage":"• Optional directMessageLanguage: stringAddress of the Language by which the Agent will receive DMs","defined-in-2#Defined in":"agent/Agent.ts:40","perspective#perspective":"• Optional perspective: PerspectiveThe Perspective that holds the public-facing semantics/statements of the Agent\nHolds and shares a Perspective that links all information\nthis agent wants to offer as public-facing semantics.\nThis should be used for any kind of user profile information.","defined-in-3#Defined in":"agent/Agent.ts:36"}},"/jsdoc/classes/AgentStatus":{"title":"Class: AgentStatus","data":{"":"@coasys/ad4m / Exports / AgentStatus","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\ndidDocument\nerror\nisInitialized\nisUnlocked","constructors-1#Constructors":"","constructor#constructor":"• new AgentStatus(obj?)","parameters#Parameters":"Name\tType\tobj?\tobject","defined-in#Defined in":"agent/AgentStatus.ts:20","properties-1#Properties":"","did#did":"• Optional did: string","defined-in-1#Defined in":"agent/AgentStatus.ts:12","diddocument#didDocument":"• Optional didDocument: string","defined-in-2#Defined in":"agent/AgentStatus.ts:15","error#error":"• Optional error: string","defined-in-3#Defined in":"agent/AgentStatus.ts:18","isinitialized#isInitialized":"• isInitialized: Boolean","defined-in-4#Defined in":"agent/AgentStatus.ts:6","isunlocked#isUnlocked":"• isUnlocked: Boolean","defined-in-5#Defined in":"agent/AgentStatus.ts:9"}},"/jsdoc/classes/AgentSignature":{"title":"Class: AgentSignature","data":{"":"@coasys/ad4m / Exports / AgentSignature","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"publicKey\nsignature","constructors-1#Constructors":"","constructor#constructor":"• new AgentSignature(signature, publicKey)","parameters#Parameters":"Name\tType\tsignature\tstring\tpublicKey\tstring","defined-in#Defined in":"agent/Agent.ts:137","properties-1#Properties":"","publickey#publicKey":"• publicKey: string","defined-in-1#Defined in":"agent/Agent.ts:135","signature#signature":"• signature: string","defined-in-2#Defined in":"agent/Agent.ts:132"}},"/jsdoc/classes/Apps":{"title":"Class: Apps","data":{"":"@coasys/ad4m / Exports / Apps","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"auth\nrequestId\nrevoked\ntoken","constructors-1#Constructors":"","constructor#constructor":"• new Apps(requestId, auth, token, revoked?)","parameters#Parameters":"Name\tType\trequestId\tstring\tauth\tAuthInfo\ttoken\tstring\trevoked?\tboolean","defined-in#Defined in":"agent/Agent.ts:217","properties-1#Properties":"","auth#auth":"• auth: AuthInfo","defined-in-1#Defined in":"agent/Agent.ts:215","requestid#requestId":"• requestId: string","defined-in-2#Defined in":"agent/Agent.ts:206","revoked#revoked":"• Optional revoked: boolean","defined-in-3#Defined in":"agent/Agent.ts:212","token#token":"• token: string","defined-in-4#Defined in":"agent/Agent.ts:209"}},"/jsdoc/classes/AuthInfo":{"title":"Class: AuthInfo","data":{"":"@coasys/ad4m / Exports / AuthInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appDesc\nappIconPath\nappName\nappUrl\ncapabilities","constructors-1#Constructors":"","constructor#constructor":"• new AuthInfo(appName, appDesc, appUrl, capabilities, appIconPath?)","parameters#Parameters":"Name\tType\tappName\tstring\tappDesc\tstring\tappUrl\tstring\tcapabilities\tCapability[]\tappIconPath?\tstring","defined-in#Defined in":"agent/Agent.ts:188","properties-1#Properties":"","appdesc#appDesc":"• appDesc: string","defined-in-1#Defined in":"agent/Agent.ts:177","appiconpath#appIconPath":"• Optional appIconPath: string","defined-in-2#Defined in":"agent/Agent.ts:183","appname#appName":"• appName: string","defined-in-3#Defined in":"agent/Agent.ts:174","appurl#appUrl":"• appUrl: string","defined-in-4#Defined in":"agent/Agent.ts:180","capabilities#capabilities":"• capabilities: Capability[]","defined-in-5#Defined in":"agent/Agent.ts:186"}},"/jsdoc/classes/AuthInfoInput":{"title":"Class: AuthInfoInput","data":{"":"@coasys/ad4m / Exports / AuthInfoInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appDesc\nappDomain\nappIconPath\nappName\nappUrl\ncapabilities","constructors-1#Constructors":"","constructor#constructor":"• new AuthInfoInput(appName, appDesc, appDomain, appUrl?, appIconPath?, capabilities?)","parameters#Parameters":"Name\tType\tappName\tstring\tappDesc\tstring\tappDomain\tstring\tappUrl?\tstring\tappIconPath?\tstring\tcapabilities?\tCapabilityInput[]","defined-in#Defined in":"agent/Agent.ts:278","properties-1#Properties":"","appdesc#appDesc":"• appDesc: string","defined-in-1#Defined in":"agent/Agent.ts:264","appdomain#appDomain":"• appDomain: string","defined-in-2#Defined in":"agent/Agent.ts:267","appiconpath#appIconPath":"• Optional appIconPath: string","defined-in-3#Defined in":"agent/Agent.ts:273","appname#appName":"• appName: string","defined-in-4#Defined in":"agent/Agent.ts:261","appurl#appUrl":"• Optional appUrl: string","defined-in-5#Defined in":"agent/Agent.ts:270","capabilities#capabilities":"• Optional capabilities: CapabilityInput[]","defined-in-6#Defined in":"agent/Agent.ts:276"}},"/jsdoc/classes/Capability":{"title":"Class: Capability","data":{"":"@coasys/ad4m / Exports / Capability","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"can\nwith","constructors-1#Constructors":"","constructor#constructor":"• new Capability(withF, can)","parameters#Parameters":"Name\tType\twithF\tResource\tcan\tstring[]","defined-in#Defined in":"agent/Agent.ts:165","properties-1#Properties":"","can#can":"• can: string[]","defined-in-1#Defined in":"agent/Agent.ts:163","with#with":"• with: Resource","defined-in-2#Defined in":"agent/Agent.ts:160"}},"/jsdoc/classes/CapabilityInput":{"title":"Class: CapabilityInput","data":{"":"@coasys/ad4m / Exports / CapabilityInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"can\nwith","constructors-1#Constructors":"","constructor#constructor":"• new CapabilityInput(withF, can)","parameters#Parameters":"Name\tType\twithF\tResourceInput\tcan\tstring[]","defined-in#Defined in":"agent/Agent.ts:252","properties-1#Properties":"","can#can":"• can: string[]","defined-in-1#Defined in":"agent/Agent.ts:250","with#with":"• with: ResourceInput","defined-in-2#Defined in":"agent/Agent.ts:247"}},"/jsdoc/classes/Dna":{"title":"Class: Dna","data":{"":"@coasys/ad4m / Exports / Dna","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"file\nnick\nzomeCalls","constructors-1#Constructors":"","constructor#constructor":"• new Dna()","properties-1#Properties":"","file#file":"• file: Buffer","defined-in#Defined in":"language/LanguageContext.ts:23","nick#nick":"• nick: string","defined-in-1#Defined in":"language/LanguageContext.ts:24","zomecalls#zomeCalls":"• zomeCalls: [string, string][]","defined-in-2#Defined in":"language/LanguageContext.ts:25"}},"/jsdoc/classes/EntanglementProof":{"title":"Class: EntanglementProof","data":{"":"@coasys/ad4m / Exports / EntanglementProof","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"deviceKey\ndeviceKeySignedByDid\ndeviceKeyType\ndid\ndidSignedByDeviceKey\ndidSigningKeyId","constructors-1#Constructors":"","constructor#constructor":"• new EntanglementProof(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey?)","parameters#Parameters":"Name\tType\tdid\tstring\tdidSigningKeyId\tstring\tdeviceKeyType\tstring\tdeviceKey\tstring\tdeviceKeySignedByDid\tstring\tdidSignedByDeviceKey?\tstring","defined-in#Defined in":"agent/Agent.ts:75","properties-1#Properties":"","devicekey#deviceKey":"• deviceKey: string","defined-in-1#Defined in":"agent/Agent.ts:67","devicekeysignedbydid#deviceKeySignedByDid":"• deviceKeySignedByDid: string","defined-in-2#Defined in":"agent/Agent.ts:70","devicekeytype#deviceKeyType":"• deviceKeyType: string","defined-in-3#Defined in":"agent/Agent.ts:64","did#did":"• did: string","defined-in-4#Defined in":"agent/Agent.ts:58","didsignedbydevicekey#didSignedByDeviceKey":"• Optional didSignedByDeviceKey: string","defined-in-5#Defined in":"agent/Agent.ts:73","didsigningkeyid#didSigningKeyId":"• didSigningKeyId: string","defined-in-6#Defined in":"agent/Agent.ts:61"}},"/jsdoc/classes/EntanglementProofInput":{"title":"Class: EntanglementProofInput","data":{"":"@coasys/ad4m / Exports / EntanglementProofInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"deviceKey\ndeviceKeySignedByDid\ndeviceKeyType\ndid\ndidSignedByDeviceKey\ndidSigningKeyId","constructors-1#Constructors":"","constructor#constructor":"• new EntanglementProofInput(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey)","parameters#Parameters":"Name\tType\tdid\tstring\tdidSigningKeyId\tstring\tdeviceKeyType\tstring\tdeviceKey\tstring\tdeviceKeySignedByDid\tstring\tdidSignedByDeviceKey\tstring","defined-in#Defined in":"agent/Agent.ts:112","properties-1#Properties":"","devicekey#deviceKey":"• deviceKey: string","defined-in-1#Defined in":"agent/Agent.ts:104","devicekeysignedbydid#deviceKeySignedByDid":"• deviceKeySignedByDid: string","defined-in-2#Defined in":"agent/Agent.ts:107","devicekeytype#deviceKeyType":"• deviceKeyType: string","defined-in-3#Defined in":"agent/Agent.ts:101","did#did":"• did: string","defined-in-4#Defined in":"agent/Agent.ts:95","didsignedbydevicekey#didSignedByDeviceKey":"• didSignedByDeviceKey: string","defined-in-5#Defined in":"agent/Agent.ts:110","didsigningkeyid#didSigningKeyId":"• didSigningKeyId: string","defined-in-6#Defined in":"agent/Agent.ts:98"}},"/jsdoc/classes/Expression":{"title":"Class: Expression","data":{"":"@coasys/ad4m / Exports / Expression","hierarchy#Hierarchy":"any↳ Expression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new Expression()","inherited-from#Inherited from":"ExpressionGeneric(Object).constructor"}},"/jsdoc/classes/ExpressionProof":{"title":"Class: ExpressionProof","data":{"":"@coasys/ad4m / Exports / ExpressionProof","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"invalid\nkey\nsignature\nvalid","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionProof(sig, k)","parameters#Parameters":"Name\tType\tsig\tstring\tk\tstring","defined-in#Defined in":"expression/Expression.ts:20","properties-1#Properties":"","invalid#invalid":"• Optional invalid: boolean","defined-in-1#Defined in":"expression/Expression.ts:18","key#key":"• key: string","defined-in-2#Defined in":"expression/Expression.ts:12","signature#signature":"• signature: string","defined-in-3#Defined in":"expression/Expression.ts:9","valid#valid":"• Optional valid: boolean","defined-in-4#Defined in":"expression/Expression.ts:15"}},"/jsdoc/classes/ExpressionProofInput":{"title":"Class: ExpressionProofInput","data":{"":"@coasys/ad4m / Exports / ExpressionProofInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"invalid\nkey\nsignature\nvalid","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionProofInput()","properties-1#Properties":"","invalid#invalid":"• Optional invalid: boolean","defined-in#Defined in":"expression/Expression.ts:38","key#key":"• key: string","defined-in-1#Defined in":"expression/Expression.ts:32","signature#signature":"• signature: string","defined-in-2#Defined in":"expression/Expression.ts:29","valid#valid":"• Optional valid: boolean","defined-in-3#Defined in":"expression/Expression.ts:35"}},"/jsdoc/classes/ExpressionRef":{"title":"Class: ExpressionRef","data":{"":"@coasys/ad4m / Exports / ExpressionRef","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"expression\nlanguage","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionRef(lang, expr)","parameters#Parameters":"Name\tType\tlang\tLanguageRef\texpr\tstring","defined-in#Defined in":"expression/ExpressionRef.ts:14","properties-1#Properties":"","expression#expression":"• expression: string","defined-in-1#Defined in":"expression/ExpressionRef.ts:12","language#language":"• language: LanguageRef","defined-in-2#Defined in":"expression/ExpressionRef.ts:9"}},"/jsdoc/classes/ExpressionRendered":{"title":"Class: ExpressionRendered","data":{"":"@coasys/ad4m / Exports / ExpressionRendered","hierarchy#Hierarchy":"any↳ ExpressionRendered","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"icon\nlanguage","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionRendered()","inherited-from#Inherited from":"ExpressionGeneric(String).constructor","properties-1#Properties":"","icon#icon":"• icon: Icon","defined-in#Defined in":"expression/Expression.ts:94","language#language":"• language: LanguageRef","defined-in-1#Defined in":"expression/Expression.ts:91"}},"/jsdoc/classes/InteractionCall":{"title":"Class: InteractionCall","data":{"":"@coasys/ad4m / Exports / InteractionCall","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\nparametersStringified","accessors#Accessors":"parameters","constructors-1#Constructors":"","constructor#constructor":"• new InteractionCall(name, parameters)","parameters#Parameters":"Name\tType\tname\tstring\tparameters\tobject","defined-in#Defined in":"language/Language.ts:244","properties-1#Properties":"","name#name":"• name: string","defined-in-1#Defined in":"language/Language.ts:236","parametersstringified#parametersStringified":"• parametersStringified: string","defined-in-2#Defined in":"language/Language.ts:238","accessors-1#Accessors":"","parameters-1#parameters":"• get parameters(): object","returns#Returns":"object","defined-in-3#Defined in":"language/Language.ts:240"}},"/jsdoc/classes/InteractionMeta":{"title":"Class: InteractionMeta","data":{"":"@coasys/ad4m / Exports / InteractionMeta","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"label\nname\nparameters","constructors-1#Constructors":"","constructor#constructor":"• new InteractionMeta()","properties-1#Properties":"","label#label":"• label: string","defined-in#Defined in":"language/Language.ts:218","name#name":"• name: string","defined-in-1#Defined in":"language/Language.ts:221","parameters#parameters":"• parameters: InteractionParameter[]","defined-in-2#Defined in":"language/Language.ts:224"}},"/jsdoc/classes/LanguageExpression":{"title":"Class: LanguageExpression","data":{"":"@coasys/ad4m / Exports / LanguageExpression","hierarchy#Hierarchy":"any↳ LanguageExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new LanguageExpression()","inherited-from#Inherited from":"ExpressionGeneric(LanguageMetaInternal).constructor"}},"/jsdoc/classes/Icon":{"title":"Class: Icon","data":{"":"@coasys/ad4m / Exports / Icon","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"code","constructors-1#Constructors":"","constructor#constructor":"• new Icon(code)","parameters#Parameters":"Name\tType\tcode\tstring","defined-in#Defined in":"language/Icon.ts:8","properties-1#Properties":"","code#code":"• code: string","defined-in-1#Defined in":"language/Icon.ts:6"}},"/jsdoc/classes/LanguageLanguageInput":{"title":"Class: LanguageLanguageInput","data":{"":"@coasys/ad4m / Exports / LanguageLanguageInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"bundle\nmeta","constructors-1#Constructors":"","constructor#constructor":"• new LanguageLanguageInput()","properties-1#Properties":"","bundle#bundle":"• bundle: string","defined-in#Defined in":"language/LanguageMeta.ts:68","meta#meta":"• meta: LanguageMetaInternal","defined-in-1#Defined in":"language/LanguageMeta.ts:69"}},"/jsdoc/classes/LanguageMeta":{"title":"Class: LanguageMeta","data":{"":"@coasys/ad4m / Exports / LanguageMeta","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nauthor\ndescription\nname\npossibleTemplateParams\nsourceCodeLink\ntemplateAppliedParams\ntemplateSourceLanguageAddress\ntemplated","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMeta()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageMeta.ts:10","author#author":"• author: string","defined-in-1#Defined in":"language/LanguageMeta.ts:16","description#description":"• description: string","defined-in-2#Defined in":"language/LanguageMeta.ts:13","name#name":"• name: string","defined-in-3#Defined in":"language/LanguageMeta.ts:7","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-4#Defined in":"language/LanguageMeta.ts:28","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-5#Defined in":"language/LanguageMeta.ts:31","templateappliedparams#templateAppliedParams":"• Optional templateAppliedParams: string","defined-in-6#Defined in":"language/LanguageMeta.ts:25","templatesourcelanguageaddress#templateSourceLanguageAddress":"• Optional templateSourceLanguageAddress: string","defined-in-7#Defined in":"language/LanguageMeta.ts:22","templated#templated":"• templated: boolean","defined-in-8#Defined in":"language/LanguageMeta.ts:19"}},"/jsdoc/classes/LanguageMetaInternal":{"title":"Class: LanguageMetaInternal","data":{"":"@coasys/ad4m / Exports / LanguageMetaInternal","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\ndescription\nname\npossibleTemplateParams\nsourceCodeLink\ntemplateAppliedParams\ntemplateSourceLanguageAddress","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMetaInternal()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageMeta.ts:57","description#description":"• description: string","defined-in-1#Defined in":"language/LanguageMeta.ts:58","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageMeta.ts:56","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-3#Defined in":"language/LanguageMeta.ts:61","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-4#Defined in":"language/LanguageMeta.ts:62","templateappliedparams#templateAppliedParams":"• Optional templateAppliedParams: string","defined-in-5#Defined in":"language/LanguageMeta.ts:60","templatesourcelanguageaddress#templateSourceLanguageAddress":"• Optional templateSourceLanguageAddress: string","defined-in-6#Defined in":"language/LanguageMeta.ts:59"}},"/jsdoc/classes/LanguageRef":{"title":"Class: LanguageRef","data":{"":"@coasys/ad4m / Exports / LanguageRef","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nname","constructors-1#Constructors":"","constructor#constructor":"• new LanguageRef(address?, name?)","parameters#Parameters":"Name\tType\taddress?\tstring\tname?\tstring","defined-in#Defined in":"language/LanguageRef.ts:14","properties-1#Properties":"","address#address":"• address: string","defined-in-1#Defined in":"language/LanguageRef.ts:9","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageRef.ts:12"}},"/jsdoc/classes/LanguageHandle":{"title":"Class: LanguageHandle","data":{"":"@coasys/ad4m / Exports / LanguageHandle","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nconstructorIcon\nicon\nname\nsettings\nsettingsIcon","constructors-1#Constructors":"","constructor#constructor":"• new LanguageHandle()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageHandle.ts:10","constructoricon#constructorIcon":"• Optional constructorIcon: Icon","defined-in-1#Defined in":"language/LanguageHandle.ts:19","icon#icon":"• Optional icon: Icon","defined-in-2#Defined in":"language/LanguageHandle.ts:16","name#name":"• name: string","defined-in-3#Defined in":"language/LanguageHandle.ts:7","settings#settings":"• Optional settings: string","defined-in-4#Defined in":"language/LanguageHandle.ts:13","settingsicon#settingsIcon":"• Optional settingsIcon: Icon","defined-in-5#Defined in":"language/LanguageHandle.ts:22"}},"/jsdoc/classes/Link":{"title":"Class: Link","data":{"":"@coasys/ad4m / Exports / Link","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"predicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new Link(obj)","parameters#Parameters":"Name\tType\tobj\tany","defined-in#Defined in":"links/Links.ts:16","properties-1#Properties":"","predicate#predicate":"• Optional predicate: string","defined-in-1#Defined in":"links/Links.ts:14","source#source":"• source: string","defined-in-2#Defined in":"links/Links.ts:8","target#target":"• target: string","defined-in-3#Defined in":"links/Links.ts:11"}},"/jsdoc/classes/LanguageMetaInput":{"title":"Class: LanguageMetaInput","data":{"":"@coasys/ad4m / Exports / LanguageMetaInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"description\nname\npossibleTemplateParams\nsourceCodeLink","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMetaInput(name?, description?)","parameters#Parameters":"Name\tType\tname?\tstring\tdescription?\tstring","defined-in#Defined in":"language/LanguageMeta.ts:48","properties-1#Properties":"","description#description":"• description: string","defined-in-1#Defined in":"language/LanguageMeta.ts:40","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageMeta.ts:37","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-3#Defined in":"language/LanguageMeta.ts:43","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-4#Defined in":"language/LanguageMeta.ts:46"}},"/jsdoc/classes/LinkExpression":{"title":"Class: LinkExpression","data":{"":"@coasys/ad4m / Exports / LinkExpression","hierarchy#Hierarchy":"any↳ LinkExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"status","methods#Methods":"hash","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpression()","inherited-from#Inherited from":"ExpressionGeneric(Link).constructor","properties-1#Properties":"","status#status":"• Optional status: LinkStatus","defined-in#Defined in":"links/Links.ts:72","methods-1#Methods":"","hash#hash":"▸ hash(): number","returns#Returns":"number","defined-in-1#Defined in":"links/Links.ts:59"}},"/jsdoc/classes/LinkExpressionMutations":{"title":"Class: LinkExpressionMutations","data":{"":"@coasys/ad4m / Exports / LinkExpressionMutations","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionMutations(additions, removals)","parameters#Parameters":"Name\tType\tadditions\tLinkExpression[]\tremovals\tLinkExpression[]","defined-in#Defined in":"links/Links.ts:39","properties-1#Properties":"","additions#additions":"• additions: LinkExpression[]","defined-in-1#Defined in":"links/Links.ts:34","removals#removals":"• removals: LinkExpression[]","defined-in-2#Defined in":"links/Links.ts:37"}},"/jsdoc/classes/LinkExpressionInput":{"title":"Class: LinkExpressionInput","data":{"":"@coasys/ad4m / Exports / LinkExpressionInput","hierarchy#Hierarchy":"any↳ LinkExpressionInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"hash\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionInput()","inherited-from#Inherited from":"ExpressionGenericInput(LinkInput).constructor","properties-1#Properties":"","hash#hash":"• hash: () => number","type-declaration#Type declaration":"▸ (): number","returns#Returns":"number","defined-in#Defined in":"links/Links.ts:77","status#status":"• Optional status: LinkStatus","defined-in-1#Defined in":"links/Links.ts:80"}},"/jsdoc/classes/LinkExpressionUpdated":{"title":"Class: LinkExpressionUpdated","data":{"":"@coasys/ad4m / Exports / LinkExpressionUpdated","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"newLink\noldLink","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionUpdated(oldLink, newLink)","parameters#Parameters":"Name\tType\toldLink\tLinkExpression\tnewLink\tLinkExpression","defined-in#Defined in":"links/Links.ts:103","properties-1#Properties":"","newlink#newLink":"• newLink: LinkExpression","defined-in-1#Defined in":"links/Links.ts:101","oldlink#oldLink":"• oldLink: LinkExpression","defined-in-2#Defined in":"links/Links.ts:98"}},"/jsdoc/classes/InteractionParameter":{"title":"Class: InteractionParameter","data":{"":"@coasys/ad4m / Exports / InteractionParameter","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\ntype","constructors-1#Constructors":"","constructor#constructor":"• new InteractionParameter()","properties-1#Properties":"","name#name":"• name: string","defined-in#Defined in":"language/Language.ts:209","type#type":"• type: string","defined-in-1#Defined in":"language/Language.ts:212"}},"/jsdoc/classes/LinkQuery":{"title":"Class: LinkQuery","data":{"":"@coasys/ad4m / Exports / LinkQuery","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"fromDate\nlimit\npredicate\nsource\ntarget\nuntilDate","methods#Methods":"isMatch","constructors-1#Constructors":"","constructor#constructor":"• new LinkQuery(obj)","parameters#Parameters":"Name\tType\tobj\tobject","defined-in#Defined in":"perspectives/LinkQuery.ts:25","properties-1#Properties":"","fromdate#fromDate":"• Optional fromDate: Date","defined-in-1#Defined in":"perspectives/LinkQuery.ts:17","limit#limit":"• Optional limit: number","defined-in-2#Defined in":"perspectives/LinkQuery.ts:23","predicate#predicate":"• Optional predicate: string","defined-in-3#Defined in":"perspectives/LinkQuery.ts:14","source#source":"• Optional source: string","defined-in-4#Defined in":"perspectives/LinkQuery.ts:8","target#target":"• Optional target: string","defined-in-5#Defined in":"perspectives/LinkQuery.ts:11","untildate#untilDate":"• Optional untilDate: Date","defined-in-6#Defined in":"perspectives/LinkQuery.ts:20","methods-1#Methods":"","ismatch#isMatch":"▸ isMatch(l): boolean","parameters-1#Parameters":"Name\tType\tl\tLink","returns#Returns":"boolean","defined-in-7#Defined in":"perspectives/LinkQuery.ts:51"}},"/jsdoc/classes/LinkInput":{"title":"Class: LinkInput","data":{"":"@coasys/ad4m / Exports / LinkInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"predicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new LinkInput()","properties-1#Properties":"","predicate#predicate":"• Optional predicate: string","defined-in#Defined in":"links/Links.ts:54","source#source":"• source: string","defined-in-1#Defined in":"links/Links.ts:48","target#target":"• target: string","defined-in-2#Defined in":"links/Links.ts:51"}},"/jsdoc/classes/NeighbourhoodExpression":{"title":"Class: NeighbourhoodExpression","data":{"":"@coasys/ad4m / Exports / NeighbourhoodExpression","hierarchy#Hierarchy":"any↳ NeighbourhoodExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new NeighbourhoodExpression()","inherited-from#Inherited from":"ExpressionGeneric(Neighbourhood).constructor"}},"/jsdoc/classes/LinkMutations":{"title":"Class: LinkMutations","data":{"":"@coasys/ad4m / Exports / LinkMutations","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new LinkMutations()","properties-1#Properties":"","additions#additions":"• additions: LinkInput[]","defined-in#Defined in":"links/Links.ts:26","removals#removals":"• removals: LinkExpressionInput[]","defined-in-1#Defined in":"links/Links.ts:29"}},"/jsdoc/classes/ModelQueryBuilder":{"title":"Class: ModelQueryBuilder","data":{"":"@coasys/ad4m / Exports / ModelQueryBuilderQuery builder for Ad4mModel queries.\nAllows building queries with a fluent interface and either running them once\nor subscribing to updates.Example\nconst builder = Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .order({ rating: \"DESC\" })\n .limit(10);\n// Run once\nconst recipes = await builder.run();\n// Or subscribe to updates\nawait builder.subscribe(recipes => {\n console.log(\"Updated recipes:\", recipes);\n});","type-parameters#Type parameters":"Name\tType\tT\textends Ad4mModel","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"ctor\ncurrentSubscription\nmodelClassName\nperspective\nqueryParams\nuseSurrealDBFlag","methods#Methods":"collections\ncount\ncountSubscribe\ndispose\nget\nlimit\noffset\norder\noverrideModelClassName\npaginate\npaginateSubscribe\nproperties\nsource\nsubscribe\nuseSurrealDB\nwhere","constructors-1#Constructors":"","constructor#constructor":"• new ModelQueryBuilder(perspective, ctor, query?)","type-parameters-1#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tctor\ttypeof Ad4mModel\tquery?\tQuery","defined-in#Defined in":"model/Ad4mModel.ts:2503","properties-1#Properties":"","ctor#ctor":"• Private ctor: typeof Ad4mModel","defined-in-1#Defined in":"model/Ad4mModel.ts:2499","currentsubscription#currentSubscription":"• Private Optional currentSubscription: any","defined-in-2#Defined in":"model/Ad4mModel.ts:2500","modelclassname#modelClassName":"• Private modelClassName: string = null","defined-in-3#Defined in":"model/Ad4mModel.ts:2498","perspective#perspective":"• Private perspective: PerspectiveProxy","defined-in-4#Defined in":"model/Ad4mModel.ts:2496","queryparams#queryParams":"• Private queryParams: Query = {}","defined-in-5#Defined in":"model/Ad4mModel.ts:2497","usesurrealdbflag#useSurrealDBFlag":"• Private useSurrealDBFlag: boolean = true","defined-in-6#Defined in":"model/Ad4mModel.ts:2501","methods-1#Methods":"","collections#collections":"▸ collections(collections): ModelQueryBuilderSpecifies which collections to include in the results.","parameters-1#Parameters":"Name\tType\tDescription\tcollections\tstring[]\tArray of collection names to include","returns#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.collections([\"ingredients\", \"steps\"])","defined-in-7#Defined in":"model/Ad4mModel.ts:2640","count#count":"▸ count(): PromiseGets the total count of matching entities.","returns-1#Returns":"PromiseTotal countExample\nconst totalDesserts = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .count();","defined-in-8#Defined in":"model/Ad4mModel.ts:2794","countsubscribe#countSubscribe":"▸ countSubscribe(callback): PromiseSubscribes to count updates for matching entities.This method:\nCreates and initializes a SurrealDB live query subscription for the count (default)\nSets up the callback to process future count updates\nReturns the initial count immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-2#Parameters":"Name\tType\tDescription\tcallback\t(count: number) => void\tFunction to call with updated count","returns-2#Returns":"PromiseInitial countExample\nconst builder = Recipe.query(perspective)\n .where({ status: \"active\" });\nconst initialCount = await builder.countSubscribe(count => {\n console.log(\"Active items:\", count);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-9#Defined in":"model/Ad4mModel.ts:2841","dispose#dispose":"▸ dispose(): voidDisposes of the current subscription if one exists.This method:\nStops the keepalive signals to the subscription\nUnsubscribes from GraphQL subscription updates\nNotifies the backend to clean up subscription resources\nClears the subscription reference\nYou should call this method when you're done with a subscription\nto prevent memory leaks and ensure proper cleanup.","returns-3#Returns":"void","defined-in-10#Defined in":"model/Ad4mModel.ts:2521","get#get":"▸ get(): PromiseExecutes the query once and returns the results.","returns-4#Returns":"PromiseArray of matching entitiesExample\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .get();","defined-in-11#Defined in":"model/Ad4mModel.ts:2692","limit#limit":"▸ limit(limit): ModelQueryBuilderSets the maximum number of results to return.","parameters-3#Parameters":"Name\tType\tDescription\tlimit\tnumber\tMaximum number of results","returns-5#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.limit(10)","defined-in-12#Defined in":"model/Ad4mModel.ts:2576","offset#offset":"▸ offset(offset): ModelQueryBuilderSets the number of results to skip.","parameters-4#Parameters":"Name\tType\tDescription\toffset\tnumber\tNumber of results to skip","returns-6#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.offset(20) // Skip first 20 results","defined-in-13#Defined in":"model/Ad4mModel.ts:2592","order#order":"▸ order(orderBy): ModelQueryBuilderSets the order for the query results.","parameters-5#Parameters":"Name\tType\tDescription\torderBy\tOrder\tThe ordering criteria","returns-7#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.order({ createdAt: \"DESC\" })","defined-in-14#Defined in":"model/Ad4mModel.ts:2560","overridemodelclassname#overrideModelClassName":"▸ overrideModelClassName(className): ModelQueryBuilder","parameters-6#Parameters":"Name\tType\tclassName\tstring","returns-8#Returns":"ModelQueryBuilder","defined-in-15#Defined in":"model/Ad4mModel.ts:2645","paginate#paginate":"▸ paginate(pageSize, pageNumber): Promise>Gets a page of results with pagination metadata.","parameters-7#Parameters":"Name\tType\tDescription\tpageSize\tnumber\tNumber of items per page\tpageNumber\tnumber\tWhich page to retrieve (1-based)","returns-9#Returns":"Promise>Paginated results with metadataExample\nconst page = await Recipe.query(perspective)\n .where({ category: \"Main\" })\n .paginate(10, 1);\nconsole.log(`Page ${page.pageNumber}, ${page.results.length} of ${page.totalCount}`);","defined-in-16#Defined in":"model/Ad4mModel.ts:2890","paginatesubscribe#paginateSubscribe":"▸ paginateSubscribe(pageSize, pageNumber, callback): Promise>Subscribes to paginated results updates.This method:\nCreates and initializes a SurrealDB live query subscription for the paginated results (default)\nSets up the callback to process future page updates\nReturns the initial page immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-8#Parameters":"Name\tType\tDescription\tpageSize\tnumber\tNumber of items per page\tpageNumber\tnumber\tWhich page to retrieve (1-based)\tcallback\t(results: PaginationResult) => void\tFunction to call with updated pagination results","returns-10#Returns":"Promise>Initial pagination resultsExample\nconst builder = Recipe.query(perspective)\n .where({ category: \"Main\" });\nconst initialPage = await builder.paginateSubscribe(10, 1, page => {\n console.log(\"Updated page:\", page.results);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-17#Defined in":"model/Ad4mModel.ts:2938","properties-2#properties":"▸ properties(properties): ModelQueryBuilderSpecifies which properties to include in the results.","parameters-9#Parameters":"Name\tType\tDescription\tproperties\tstring[]\tArray of property names to include","returns-11#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.properties([\"name\", \"description\", \"rating\"])","defined-in-18#Defined in":"model/Ad4mModel.ts:2624","source#source":"▸ source(source): ModelQueryBuilderSets the source filter for the query.","parameters-10#Parameters":"Name\tType\tDescription\tsource\tstring\tThe source to filter by","returns-12#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.source(\"ad4m://self\")","defined-in-19#Defined in":"model/Ad4mModel.ts:2608","subscribe#subscribe":"▸ subscribe(callback): PromiseSubscribes to the query and receives updates when results change.This method:\nCreates and initializes a SurrealDB live query subscription (default)\nSets up the callback to process future updates\nReturns the initial results immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-11#Parameters":"Name\tType\tDescription\tcallback\t(results: T[]) => void\tFunction to call with updated results","returns-13#Returns":"PromiseInitial results arrayExample\nconst builder = Recipe.query(perspective)\n .where({ status: \"cooking\" });\nconst initialRecipes = await builder.subscribe(recipes => {\n console.log(\"Updated recipes:\", recipes);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-20#Defined in":"model/Ad4mModel.ts:2737","usesurrealdb#useSurrealDB":"▸ useSurrealDB(enabled?): ModelQueryBuilderEnables or disables SurrealDB query path.","parameters-12#Parameters":"Name\tType\tDefault value\tDescription\tenabled\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-14#Returns":"ModelQueryBuilderThe query builder for chainingExample\n// Use SurrealDB (default)\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .useSurrealDB(true)\n .get();\n// Use Prolog (legacy)\nconst recipesProlog = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .useSurrealDB(false)\n .get();\nRemarksNote: Subscriptions (subscribe(), countSubscribe(), paginateSubscribe()) default to SurrealDB live queries\nif useSurrealDB(true) is set (default).","defined-in-21#Defined in":"model/Ad4mModel.ts:2675","where#where":"▸ where(conditions): ModelQueryBuilderAdds where conditions to the query.","parameters-13#Parameters":"Name\tType\tDescription\tconditions\tWhere\tThe conditions to filter by","returns-15#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.where({\n category: \"Dessert\",\n rating: { gt: 4 },\n tags: [\"vegan\", \"quick\"],\n published: true\n})","defined-in-22#Defined in":"model/Ad4mModel.ts:2544"}},"/jsdoc/classes/Neighbourhood":{"title":"Class: Neighbourhood","data":{"":"@coasys/ad4m / Exports / Neighbourhood","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"linkLanguage\nmeta","constructors-1#Constructors":"","constructor#constructor":"• new Neighbourhood(linkLanguage, meta)","parameters#Parameters":"Name\tType\tlinkLanguage\tstring\tmeta\tPerspective","defined-in#Defined in":"neighbourhood/Neighbourhood.ts:15","properties-1#Properties":"","linklanguage#linkLanguage":"• linkLanguage: string","defined-in-1#Defined in":"neighbourhood/Neighbourhood.ts:10","meta#meta":"• meta: Perspective","defined-in-2#Defined in":"neighbourhood/Neighbourhood.ts:13"}},"/jsdoc/classes/NeighbourhoodProxy":{"title":"Class: NeighbourhoodProxy","data":{"":"@coasys/ad4m / Exports / NeighbourhoodProxy","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#client\n#pID","methods#Methods":"addSignalHandler\nhasTelepresenceAdapter\nonlineAgents\notherAgents\nremoveSignalHandler\nsendBroadcast\nsendBroadcastU\nsendSignal\nsendSignalU\nsetOnlineStatus\nsetOnlineStatusU","constructors-1#Constructors":"","constructor#constructor":"• new NeighbourhoodProxy(client, pID)","parameters#Parameters":"Name\tType\tclient\tNeighbourhoodClient\tpID\tstring","defined-in#Defined in":"neighbourhood/NeighbourhoodProxy.ts:10","properties-1#Properties":"","client##client":"• Private #client: NeighbourhoodClient","defined-in-1#Defined in":"neighbourhood/NeighbourhoodProxy.ts:7","pid##pID":"• Private #pID: string","defined-in-2#Defined in":"neighbourhood/NeighbourhoodProxy.ts:8","methods-1#Methods":"","addsignalhandler#addSignalHandler":"▸ addSignalHandler(handler): Promise","parameters-1#Parameters":"Name\tType\thandler\t(payload: PerspectiveExpression) => void","returns#Returns":"Promise","defined-in-3#Defined in":"neighbourhood/NeighbourhoodProxy.ts:51","hastelepresenceadapter#hasTelepresenceAdapter":"▸ hasTelepresenceAdapter(): Promise","returns-1#Returns":"Promise","defined-in-4#Defined in":"neighbourhood/NeighbourhoodProxy.ts:19","onlineagents#onlineAgents":"▸ onlineAgents(): Promise","returns-2#Returns":"Promise","defined-in-5#Defined in":"neighbourhood/NeighbourhoodProxy.ts:23","otheragents#otherAgents":"▸ otherAgents(): Promise","returns-3#Returns":"Promise","defined-in-6#Defined in":"neighbourhood/NeighbourhoodProxy.ts:15","removesignalhandler#removeSignalHandler":"▸ removeSignalHandler(handler): void","parameters-2#Parameters":"Name\tType\thandler\t(payload: PerspectiveExpression) => void","returns-4#Returns":"void","defined-in-7#Defined in":"neighbourhood/NeighbourhoodProxy.ts:55","sendbroadcast#sendBroadcast":"▸ sendBroadcast(payload, loopback?): Promise","parameters-3#Parameters":"Name\tType\tDefault value\tpayload\tPerspective\tundefined\tloopback\tboolean\tfalse","returns-5#Returns":"Promise","defined-in-8#Defined in":"neighbourhood/NeighbourhoodProxy.ts:43","sendbroadcastu#sendBroadcastU":"▸ sendBroadcastU(payload, loopback?): Promise","parameters-4#Parameters":"Name\tType\tDefault value\tpayload\tPerspectiveUnsignedInput\tundefined\tloopback\tboolean\tfalse","returns-6#Returns":"Promise","defined-in-9#Defined in":"neighbourhood/NeighbourhoodProxy.ts:47","sendsignal#sendSignal":"▸ sendSignal(remoteAgentDid, payload): Promise","parameters-5#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspective","returns-7#Returns":"Promise","defined-in-10#Defined in":"neighbourhood/NeighbourhoodProxy.ts:35","sendsignalu#sendSignalU":"▸ sendSignalU(remoteAgentDid, payload): Promise","parameters-6#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspectiveUnsignedInput","returns-8#Returns":"Promise","defined-in-11#Defined in":"neighbourhood/NeighbourhoodProxy.ts:39","setonlinestatus#setOnlineStatus":"▸ setOnlineStatus(status): Promise","parameters-7#Parameters":"Name\tType\tstatus\tPerspective","returns-9#Returns":"Promise","defined-in-12#Defined in":"neighbourhood/NeighbourhoodProxy.ts:27","setonlinestatusu#setOnlineStatusU":"▸ setOnlineStatusU(status): Promise","parameters-8#Parameters":"Name\tType\tstatus\tPerspectiveUnsignedInput","returns-10#Returns":"Promise","defined-in-13#Defined in":"neighbourhood/NeighbourhoodProxy.ts:31"}},"/jsdoc/classes/Perspective":{"title":"Class: Perspective","data":{"":"@coasys/ad4m / Exports / PerspectiveA Perspective represents subjective meaning, encoded through\nassociations between expressions, a.k.a. Links, that is a graph\nover the objective Expressions of any subset of Languages.This type represents the clean onotological concept of a Perspective.\nAn instance of this class can be regarded as an immutable snapshot of\na mutable perspective.The types PerspectiveProxy and PerspectiveHandle are used when dealing\nwith an instantiated mutable perspective as is done through most of\nthe GraphQL mutations.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","methods#Methods":"get\ngetSingleTarget","constructors-1#Constructors":"","constructor#constructor":"• new Perspective(links?)","parameters#Parameters":"Name\tType\tlinks?\tLinkExpression[]","defined-in#Defined in":"perspectives/Perspective.ts:24","properties-1#Properties":"","links#links":"• links: LinkExpression[]The content of the perspective, a list/graph of links","defined-in-1#Defined in":"perspectives/Perspective.ts:22","methods-1#Methods":"","get#get":"▸ get(query): LinkExpression[]Convenience function for filtering links just like with PerspectiveProxy","parameters-1#Parameters":"Name\tType\tquery\tLinkQuery","returns#Returns":"LinkExpression[]","defined-in-2#Defined in":"perspectives/Perspective.ts:33","getsingletarget#getSingleTarget":"▸ getSingleTarget(query): string | voidConvenience function to get the target of the first link that matches the given query\nThis makes sense when the query is expected to return only one link\nand the target of that link is what you are looking for.","parameters-2#Parameters":"Name\tType\tquery\tLinkQuery","returns-1#Returns":"string | void","defined-in-3#Defined in":"perspectives/Perspective.ts:81"}},"/jsdoc/classes/OnlineAgent":{"title":"Class: OnlineAgent","data":{"":"@coasys/ad4m / Exports / OnlineAgent","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new OnlineAgent()","properties-1#Properties":"","did#did":"• did: string","defined-in#Defined in":"language/Language.ts:253","status#status":"• status: PerspectiveExpression","defined-in-1#Defined in":"language/Language.ts:255"}},"/jsdoc/classes/PerspectiveAction":{"title":"Class: PerspectiveAction","data":{"":"@coasys/ad4m / Exports / PerspectiveAction","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"action\npredicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveAction()","properties-1#Properties":"","action#action":"• action: string","defined-in#Defined in":"model/decorators.ts:6","predicate#predicate":"• predicate: string","defined-in-1#Defined in":"model/decorators.ts:8","source#source":"• source: string","defined-in-2#Defined in":"model/decorators.ts:7","target#target":"• target: string","defined-in-3#Defined in":"model/decorators.ts:9"}},"/jsdoc/classes/PerspectiveExpression":{"title":"Class: PerspectiveExpression","data":{"":"@coasys/ad4m / Exports / PerspectiveExpression","hierarchy#Hierarchy":"any↳ PerspectiveExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveExpression()","inherited-from#Inherited from":"ExpressionGeneric(Perspective).constructor"}},"/jsdoc/classes/PerspectiveDiff":{"title":"Class: PerspectiveDiff","data":{"":"@coasys/ad4m / Exports / PerspectiveDiff","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveDiff()","properties-1#Properties":"","additions#additions":"• additions: LinkExpression[]","defined-in#Defined in":"perspectives/PerspectiveDiff.ts:8","removals#removals":"• removals: LinkExpression[]","defined-in-1#Defined in":"perspectives/PerspectiveDiff.ts:11"}},"/jsdoc/classes/PerspectiveDiffExpression":{"title":"Class: PerspectiveDiffExpression","data":{"":"@coasys/ad4m / Exports / PerspectiveDiffExpression","hierarchy#Hierarchy":"any↳ PerspectiveDiffExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveDiffExpression()","inherited-from#Inherited from":"ExpressionGeneric(PerspectiveDiff).constructor"}},"/jsdoc/classes/Literal":{"title":"Class: Literal","data":{"":"@coasys/ad4m / Exports / Literal","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#literal\n#url","methods#Methods":"get\ntoUrl\nfrom\nfromUrl","constructors-1#Constructors":"","constructor#constructor":"• new Literal()","properties-1#Properties":"","literal##literal":"• Private Optional #literal: any","defined-in#Defined in":"Literal.ts:10","url##url":"• Private Optional #url: string","defined-in-1#Defined in":"Literal.ts:11","methods-1#Methods":"","get#get":"▸ get(): any","returns#Returns":"any","defined-in-2#Defined in":"Literal.ts:52","tourl#toUrl":"▸ toUrl(): string","returns-1#Returns":"string","defined-in-3#Defined in":"Literal.ts:27","from#from":"▸ Static from(literal): Literal","parameters#Parameters":"Name\tType\tliteral\tany","returns-2#Returns":"Literal","defined-in-4#Defined in":"Literal.ts:21","fromurl#fromUrl":"▸ Static fromUrl(url): Literal","parameters-1#Parameters":"Name\tType\turl\tstring","returns-3#Returns":"Literal","defined-in-5#Defined in":"Literal.ts:13"}},"/jsdoc/classes/PerspectiveHandle":{"title":"Class: PerspectiveHandle","data":{"":"@coasys/ad4m / Exports / PerspectiveHandle","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\nneighbourhood\nsharedUrl\nstate\nuuid","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveHandle(uuid?, name?, state?)","parameters#Parameters":"Name\tType\tuuid?\tstring\tname?\tstring\tstate?\tPerspectiveState","defined-in#Defined in":"perspectives/PerspectiveHandle.ts:30","properties-1#Properties":"","name#name":"• name: string","defined-in-1#Defined in":"perspectives/PerspectiveHandle.ts:20","neighbourhood#neighbourhood":"• Optional neighbourhood: NeighbourhoodExpression","defined-in-2#Defined in":"perspectives/PerspectiveHandle.ts:28","sharedurl#sharedUrl":"• Optional sharedUrl: string","defined-in-3#Defined in":"perspectives/PerspectiveHandle.ts:25","state#state":"• state: PerspectiveState","defined-in-4#Defined in":"perspectives/PerspectiveHandle.ts:22","uuid#uuid":"• uuid: string","defined-in-5#Defined in":"perspectives/PerspectiveHandle.ts:18"}},"/jsdoc/classes/PerspectiveProxy":{"title":"Class: PerspectiveProxy","data":{"":"@coasys/ad4m / Exports / PerspectiveProxyPerspectiveProxy provides a high-level interface for working with AD4M Perspectives - agent-centric semantic graphs\nthat store and organize links between expressions.A Perspective is fundamentally a collection of links (subject-predicate-object triples) that represent an agent's view\nof their digital world. Through PerspectiveProxy, you can:\nAdd, remove, and query links\nWork with Social DNA (subject classes and flows)\nSubscribe to real-time updates\nShare perspectives as Neighbourhoods\nExecute Prolog queries for complex graph patterns\nExample\n// Create and work with links\nconst perspective = await ad4m.perspective.add(\"My Space\");\nawait perspective.add({\n source: \"did:key:alice\",\n predicate: \"knows\",\n target: \"did:key:bob\"\n});\n// Query links\nconst friends = await perspective.get({\n source: \"did:key:alice\",\n predicate: \"knows\"\n});\n// Use Social DNA\nawait perspective.addSdna(todoClass, \"subject_class\");\nconst todo = await perspective.createSubject(\"Todo\", \"expression://123\");\n// Subscribe to changes\nperspective.addListener(\"link-added\", (link) => {\n console.log(\"New link added:\", link);\n});","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#client\n#handle\n#perspectiveLinkAddedCallbacks\n#perspectiveLinkRemovedCallbacks\n#perspectiveLinkUpdatedCallbacks\n#perspectiveSyncStateChangeCallbacks\nname\nneighbourhood\nsharedUrl\nstate\nuuid","accessors#Accessors":"ai","methods#Methods":"add\naddLinkExpression\naddLinks\naddListener\naddSdna\naddSyncStateChangeListener\navailableFlows\nbuildQueryFromTemplate\ncommitBatch\ncreateBatch\ncreateExpression\ncreateSubject\nensureSDNASubjectClass\nexecuteAction\nexpressionsInFlowState\nflowActions\nflowState\nget\ngetAllSubjectInstances\ngetAllSubjectProxies\ngetExpression\ngetNeighbourhoodProxy\ngetSdna\ngetSdnaForClass\ngetSingleTarget\ngetSubjectData\ngetSubjectProxy\ninfer\nisSubjectInstance\nlinkMutations\nloadSnapshot\nquerySurrealDB\nremove\nremoveLinks\nremoveListener\nremoveSubject\nrunFlowAction\nsdnaFlows\nsetSingleTarget\nsnapshot\nstartFlow\nstringOrTemplateObjectToSubjectClassName\nsubjectClasses\nsubjectClassesByTemplate\nsubscribeInfer\nsubscribeSurrealDB\nupdate","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveProxy(handle, ad4m)Creates a new PerspectiveProxy instance.\nNote: Don't create this directly, use ad4m.perspective.add() instead.","parameters#Parameters":"Name\tType\thandle\tPerspectiveHandle\tad4m\tPerspectiveClient","defined-in#Defined in":"perspectives/PerspectiveProxy.ts:393","properties-1#Properties":"","client##client":"• Private #client: PerspectiveClient","defined-in-1#Defined in":"perspectives/PerspectiveProxy.ts:383","handle##handle":"• Private #handle: PerspectiveHandle","defined-in-2#Defined in":"perspectives/PerspectiveProxy.ts:382","perspectivelinkaddedcallbacks##perspectiveLinkAddedCallbacks":"• Private #perspectiveLinkAddedCallbacks: LinkCallback[]","defined-in-3#Defined in":"perspectives/PerspectiveProxy.ts:384","perspectivelinkremovedcallbacks##perspectiveLinkRemovedCallbacks":"• Private #perspectiveLinkRemovedCallbacks: LinkCallback[]","defined-in-4#Defined in":"perspectives/PerspectiveProxy.ts:385","perspectivelinkupdatedcallbacks##perspectiveLinkUpdatedCallbacks":"• Private #perspectiveLinkUpdatedCallbacks: LinkCallback[]","defined-in-5#Defined in":"perspectives/PerspectiveProxy.ts:386","perspectivesyncstatechangecallbacks##perspectiveSyncStateChangeCallbacks":"• Private #perspectiveSyncStateChangeCallbacks: SyncStateChangeCallback[]","defined-in-6#Defined in":"perspectives/PerspectiveProxy.ts:387","name#name":"• name: stringHuman-readable name of this perspective","defined-in-7#Defined in":"perspectives/PerspectiveProxy.ts:371","neighbourhood#neighbourhood":"• neighbourhood: NeighbourhoodExpressionIf this perspective is shared, this contains the Neighbourhood metadata","defined-in-8#Defined in":"perspectives/PerspectiveProxy.ts:377","sharedurl#sharedUrl":"• sharedUrl: stringIf this perspective is shared as a Neighbourhood, this is its URL","defined-in-9#Defined in":"perspectives/PerspectiveProxy.ts:374","state#state":"• state: PerspectiveStateCurrent sync state if this perspective is shared","defined-in-10#Defined in":"perspectives/PerspectiveProxy.ts:380","uuid#uuid":"• uuid: stringUnique identifier of this perspective","defined-in-11#Defined in":"perspectives/PerspectiveProxy.ts:368","accessors-1#Accessors":"","ai#ai":"• get ai(): AIClientReturns a proxy object for working with AI capabilities.","returns#Returns":"AIClientAIClient instanceExample\n// Use AI to analyze perspective content\nconst summary = await perspective.ai.summarize();\n// Generate new content\nconst suggestion = await perspective.ai.suggest(\"next action\");","defined-in-12#Defined in":"perspectives/PerspectiveProxy.ts:1303","methods-1#Methods":"","add#add":"▸ add(link, status?, batchId?): PromiseAdds a new link to the perspective.","parameters-1#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLink\tundefined\tThe link to add\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared in a Neighbourhood\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-1#Returns":"PromiseThe created LinkExpressionExample\n// Add a simple relationship\nawait perspective.add({\n source: \"did:key:alice\",\n predicate: \"follows\",\n target: \"did:key:bob\"\n});\n// Add a local-only link\nawait perspective.add({\n source: \"note://123\",\n predicate: \"tag\",\n target: \"private\"\n}, \"local\");","defined-in-13#Defined in":"perspectives/PerspectiveProxy.ts:583","addlinkexpression#addLinkExpression":"▸ addLinkExpression(link, status?, batchId?): PromiseAdds a pre-signed LinkExpression to the perspective.","parameters-2#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLinkExpression\tundefined\tThe signed LinkExpression to add\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-2#Returns":"PromiseThe added LinkExpression","defined-in-14#Defined in":"perspectives/PerspectiveProxy.ts:631","addlinks#addLinks":"▸ addLinks(links, status?, batchId?): PromiseAdds multiple links to the perspective in a single operation.\nMore efficient than adding links one by one.","parameters-3#Parameters":"Name\tType\tDefault value\tDescription\tlinks\tLink[]\tundefined\tArray of links to add\tstatus\tLinkStatus\t'shared'\tWhether the links should be shared\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-3#Returns":"PromiseArray of created LinkExpressions","defined-in-15#Defined in":"perspectives/PerspectiveProxy.ts:596","addlistener#addListener":"▸ addListener(type, cb): PromiseSubscribes to link changes in the perspective.","parameters-4#Parameters":"Name\tType\tDescription\ttype\tPerspectiveListenerTypes\tType of change to listen for\tcb\tLinkCallback\tCallback function","returns-4#Returns":"PromiseExample\n// Listen for new links\nperspective.addListener(\"link-added\", (link) => {\n console.log(\"New link:\", link);\n});\n// Listen for removed links\nperspective.addListener(\"link-removed\", (link) => {\n console.log(\"Link removed:\", link);\n});","defined-in-16#Defined in":"perspectives/PerspectiveProxy.ts:707","addsdna#addSdna":"▸ addSdna(name, sdnaCode, sdnaType): PromiseAdds the given Social DNA code to the perspective's SDNA code","parameters-5#Parameters":"Name\tType\tname\tstring\tsdnaCode\tstring\tsdnaType\t\"subject_class\" | \"flow\" | \"custom\"","returns-5#Returns":"Promise","defined-in-17#Defined in":"perspectives/PerspectiveProxy.ts:961","addsyncstatechangelistener#addSyncStateChangeListener":"▸ addSyncStateChangeListener(cb): PromiseSubscribes to sync state changes if this perspective is shared.","parameters-6#Parameters":"Name\tType\tDescription\tcb\tSyncStateChangeCallback\tCallback function","returns-6#Returns":"PromiseExample\nperspective.addSyncStateChangeListener((state) => {\n console.log(\"Sync state:\", state);\n});","defined-in-18#Defined in":"perspectives/PerspectiveProxy.ts:729","availableflows#availableFlows":"▸ availableFlows(exprAddr): PromiseReturns all Social DNA flows that can be started from the given expression","parameters-7#Parameters":"Name\tType\texprAddr\tstring","returns-7#Returns":"Promise","defined-in-19#Defined in":"perspectives/PerspectiveProxy.ts:846","buildqueryfromtemplate#buildQueryFromTemplate":"▸ Private buildQueryFromTemplate(obj): string","parameters-8#Parameters":"Name\tType\tobj\tobject","returns-8#Returns":"string","defined-in-20#Defined in":"perspectives/PerspectiveProxy.ts:1154","commitbatch#commitBatch":"▸ commitBatch(batchId): PromiseCommits a batch of operations","parameters-9#Parameters":"Name\tType\tbatchId\tstring","returns-9#Returns":"Promise","defined-in-21#Defined in":"perspectives/PerspectiveProxy.ts:662","createbatch#createBatch":"▸ createBatch(): PromiseCreates a new batch for grouping operations","returns-10#Returns":"Promise","defined-in-22#Defined in":"perspectives/PerspectiveProxy.ts:657","createexpression#createExpression":"▸ createExpression(content, languageAddress): PromiseCreates a new Expression in the specified Language.","parameters-10#Parameters":"Name\tType\tDescription\tcontent\tany\tContent for the new Expression\tlanguageAddress\tstring\tAddress of the Language to use","returns-11#Returns":"PromiseURI of the created Expression","defined-in-23#Defined in":"perspectives/PerspectiveProxy.ts:684","createsubject#createSubject":"▸ createSubject(subjectClass, exprAddr, initialValues?, batchId?): PromiseCreates a new subject instance of the given subject class","type-parameters#Type parameters":"Name\tType\tT\tT\tB\textends string = undefined","parameters-11#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class.\texprAddr\tstring\tThe address of the expression to be turned into a subject instance\tinitialValues?\tRecord\tOptional initial values for properties. If provided, these will be merged with constructor actions for better performance.\tbatchId?\tB\tOptional batch ID for grouping operations. If provided, returns the expression address instead of the subject proxy since the subject won't exist until the batch is committed.","returns-12#Returns":"PromiseA proxy object for the created subject, or just the expression address if in batch mode","defined-in-24#Defined in":"perspectives/PerspectiveProxy.ts:1000","ensuresdnasubjectclass#ensureSDNASubjectClass":"▸ ensureSDNASubjectClass(jsClass): PromiseTakes a JS class (its constructor) and assumes that it was decorated by\nthe","parameters-12#Parameters":"Name\tType\tjsClass\tany","returns-13#Returns":"PromiseSubject Classetc. decorators. It then tests if there is a subject class\nalready present in the perspective's SDNA that matches the given class.\nIf there is no such class, it gets the JS class's SDNA by calling its\nstatic generateSDNA() function and adds it to the perspective's SDNA.","defined-in-25#Defined in":"perspectives/PerspectiveProxy.ts:1274","executeaction#executeAction":"▸ executeAction(actions, expression, parameters, batchId?): PromiseExecutes a set of actions on an expression with optional parameters.\nUsed internally by Social DNA flows and subject class operations.Actions are specified as an array of commands that modify links in the perspective.\nEach action is an object with the following format:\n{\n action: \"addLink\" | \"removeLink\" | \"setSingleTarget\" | \"collectionSetter\",\n source: string, // Usually \"this\" to reference the current expression\n predicate: string, // The predicate URI\n target: string // The target value or \"value\" for parameters\n}\nAvailable commands:\naddLink: Creates a new link\nremoveLink: Removes an existing link\nsetSingleTarget: Removes all existing links with the same source/predicate and adds a new one\ncollectionSetter: Special command for setting collection properties\nWhen used with parameters, the special value \"value\" in the target field will be\nreplaced with the actual parameter value.","parameters-13#Parameters":"Name\tType\tDescription\tactions\tany\tArray of action objects to execute\texpression\tany\tTarget expression address (replaces \"this\" in actions)\tparameters\tParameter[]\tOptional parameters that replace \"value\" in actions\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-14#Returns":"PromiseExample\n// Add a state link and remove an old one\nawait perspective.executeAction([\n {\n action: \"addLink\",\n source: \"this\",\n predicate: \"todo://state\", \n target: \"todo://doing\"\n },\n {\n action: \"removeLink\",\n source: \"this\",\n predicate: \"todo://state\",\n target: \"todo://ready\"\n }\n], \"expression://123\");\n// Set a property using a parameter\nawait perspective.executeAction([\n {\n action: \"setSingleTarget\",\n source: \"this\",\n predicate: \"todo://title\",\n target: \"value\"\n }\n], \"expression://123\", [\n { name: \"title\", value: \"New Title\" }\n]);","defined-in-26#Defined in":"perspectives/PerspectiveProxy.ts:471","expressionsinflowstate#expressionsInFlowState":"▸ expressionsInFlowState(flowName, flowState): PromiseReturns all expressions in the given state of given Social DNA flow","parameters-14#Parameters":"Name\tType\tflowName\tstring\tflowState\tnumber","returns-15#Returns":"Promise","defined-in-27#Defined in":"perspectives/PerspectiveProxy.ts:860","flowactions#flowActions":"▸ flowActions(flowName, exprAddr): PromiseReturns available action names, with regard to Social DNA flow and expression's flow state","parameters-15#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring","returns-16#Returns":"Promise","defined-in-28#Defined in":"perspectives/PerspectiveProxy.ts:872","flowstate#flowState":"▸ flowState(flowName, exprAddr): PromiseReturns the given expression's flow state with regard to given Social DNA flow","parameters-16#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring","returns-17#Returns":"Promise","defined-in-29#Defined in":"perspectives/PerspectiveProxy.ts:866","get#get":"▸ get(query): PromiseRetrieves links from the perspective that match the given query.","parameters-17#Parameters":"Name\tType\tDescription\tquery\tLinkQuery\tQuery parameters to filter links","returns-18#Returns":"PromiseArray of matching LinkExpressionsExample\n// Get all links where Alice knows someone\nconst links = await perspective.get({\n source: \"did:key:alice\",\n predicate: \"knows\"\n});\n// Get all comments on a post\nconst comments = await perspective.get({\n source: \"post://123\",\n predicate: \"comment\"\n});","defined-in-30#Defined in":"perspectives/PerspectiveProxy.ts:496","getallsubjectinstances#getAllSubjectInstances":"▸ getAllSubjectInstances(subjectClass): PromiseReturns all subject instances of the given subject class as proxy objects.","type-parameters-1#Type parameters":"Name\tT","parameters-18#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.","returns-19#Returns":"Promise","defined-in-31#Defined in":"perspectives/PerspectiveProxy.ts:1116","getallsubjectproxies#getAllSubjectProxies":"▸ getAllSubjectProxies(subjectClass): PromiseReturns all subject proxies of the given subject class.","type-parameters-2#Type parameters":"Name\tT","parameters-19#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.","returns-20#Returns":"Promise","defined-in-32#Defined in":"perspectives/PerspectiveProxy.ts:1138","getexpression#getExpression":"▸ getExpression(expressionURI): PromiseRetrieves and renders an Expression referenced in this perspective.","parameters-20#Parameters":"Name\tType\tDescription\texpressionURI\tstring\tURI of the Expression to retrieve","returns-21#Returns":"PromiseThe rendered Expression","defined-in-33#Defined in":"perspectives/PerspectiveProxy.ts:673","getneighbourhoodproxy#getNeighbourhoodProxy":"▸ getNeighbourhoodProxy(): NeighbourhoodProxy","returns-22#Returns":"NeighbourhoodProxy","defined-in-34#Defined in":"perspectives/PerspectiveProxy.ts:1285","getsdna#getSdna":"▸ getSdna(): PromiseReturns the perspective's Social DNA code\nThis will return all SDNA code elements in an array.","returns-23#Returns":"Promise","defined-in-35#Defined in":"perspectives/PerspectiveProxy.ts:888","getsdnaforclass#getSdnaForClass":"▸ getSdnaForClass(className): PromiseReturns the Social DNA code for a specific class\nThis will return the SDNA code for the specified class, or null if not found.","parameters-21#Parameters":"Name\tType\tclassName\tstring","returns-24#Returns":"Promise","defined-in-36#Defined in":"perspectives/PerspectiveProxy.ts:931","getsingletarget#getSingleTarget":"▸ getSingleTarget(query): PromiseGets a single target value matching a query.\nUseful when you expect only one result.","parameters-22#Parameters":"Name\tType\tDescription\tquery\tLinkQuery\tQuery to find the target","returns-25#Returns":"PromiseTarget value or void if not foundExample\n// Get a user's name\nconst name = await perspective.getSingleTarget({\n source: \"did:key:alice\",\n predicate: \"name\"\n});","defined-in-37#Defined in":"perspectives/PerspectiveProxy.ts:799","getsubjectdata#getSubjectData":"▸ getSubjectData(subjectClass, exprAddr): Promise","type-parameters-3#Type parameters":"Name\tT","parameters-23#Parameters":"Name\tType\tsubjectClass\tT\texprAddr\tstring","returns-26#Returns":"Promise","defined-in-38#Defined in":"perspectives/PerspectiveProxy.ts:1042","getsubjectproxy#getSubjectProxy":"▸ getSubjectProxy(base, subjectClass): PromiseFor an existing subject instance (existing in the perspective's links)\nthis function returns a proxy object that can be used to access the subject's\nproperties and methods.","type-parameters-4#Type parameters":"Name\tT","parameters-24#Parameters":"Name\tType\tDescription\tbase\tstring\tURI of the subject's root expression\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.","returns-27#Returns":"Promise","defined-in-39#Defined in":"perspectives/PerspectiveProxy.ts:1101","infer#infer":"▸ infer(query): PromiseExecutes a Prolog query against the perspective's knowledge base.\nThis is a powerful way to find complex patterns in the graph.","parameters-25#Parameters":"Name\tType\tDescription\tquery\tstring\tProlog query string","returns-28#Returns":"PromiseQuery results or false if no resultsExample\n// Find friends of friends\nconst results = await perspective.infer(`\n triple(A, \"knows\", B),\n triple(B, \"knows\", C),\n A \\= C\n`);\n// Find all active todos\nconst todos = await perspective.infer(`\n instance(Todo, \"Todo\"),\n property_getter(\"Todo\", Todo, \"state\", \"active\")\n`);","defined-in-40#Defined in":"perspectives/PerspectiveProxy.ts:523","issubjectinstance#isSubjectInstance":"▸ isSubjectInstance(expression, subjectClass): PromiseChecks if the given expression is a subject instance of the given subject class","type-parameters-5#Type parameters":"Name\tT","parameters-26#Parameters":"Name\tType\tDescription\texpression\tstring\tThe expression to be checked\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.","returns-29#Returns":"Promise","defined-in-41#Defined in":"perspectives/PerspectiveProxy.ts:1077","linkmutations#linkMutations":"▸ linkMutations(mutations, status?): PromiseApplies a set of link mutations (adds and removes) in a single operation.\nUseful for atomic updates to the perspective.","parameters-27#Parameters":"Name\tType\tDefault value\tDescription\tmutations\tLinkMutations\tundefined\tObject containing links to add and remove\tstatus\tLinkStatus\t'shared'\tWhether new links should be shared","returns-30#Returns":"PromiseObject containing results of the mutations","defined-in-42#Defined in":"perspectives/PerspectiveProxy.ts:619","loadsnapshot#loadSnapshot":"▸ loadSnapshot(snapshot): PromiseLoads a perspective snapshot, replacing current content.","parameters-28#Parameters":"Name\tType\tDescription\tsnapshot\tPerspective\tPerspective snapshot to load","returns-31#Returns":"Promise","defined-in-43#Defined in":"perspectives/PerspectiveProxy.ts:770","querysurrealdb#querySurrealDB":"▸ querySurrealDB(query): PromiseExecutes a SurrealQL query against the perspective's link cache.\nThis allows powerful SQL-like queries on the link data stored in SurrealDB.Security Note: Only read-only queries (SELECT, RETURN, etc.) are permitted.\nMutating operations (DELETE, UPDATE, INSERT, CREATE, DROP, DEFINE, etc.) are\nblocked for security reasons. Use the perspective's add/remove methods to modify links.","parameters-29#Parameters":"Name\tType\tDescription\tquery\tstring\tSurrealQL query string (read-only operations only)","returns-32#Returns":"PromiseQuery results as parsed JSONExample\n// Get all links\nconst links = await perspective.querySurrealDB('SELECT * FROM link');\n// Filter links by predicate\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Complex aggregation query\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);","defined-in-44#Defined in":"perspectives/PerspectiveProxy.ts:554","remove#remove":"▸ remove(link, batchId?): PromiseRemoves a link from the perspective.","parameters-30#Parameters":"Name\tType\tDescription\tlink\tLinkExpressionInput\tThe link to remove\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-33#Returns":"Promise","defined-in-45#Defined in":"perspectives/PerspectiveProxy.ts:652","removelinks#removeLinks":"▸ removeLinks(links, batchId?): PromiseRemoves multiple links from the perspective.","parameters-31#Parameters":"Name\tType\tDescription\tlinks\tLinkExpressionInput[]\tArray of links to remove\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-34#Returns":"PromiseArray of removed LinkExpressions","defined-in-46#Defined in":"perspectives/PerspectiveProxy.ts:607","removelistener#removeListener":"▸ removeListener(type, cb): PromiseUnsubscribes from link changes.","parameters-32#Parameters":"Name\tType\tDescription\ttype\tPerspectiveListenerTypes\tType of change to stop listening for\tcb\tLinkCallback\tThe callback function to remove","returns-35#Returns":"Promise","defined-in-47#Defined in":"perspectives/PerspectiveProxy.ts:739","removesubject#removeSubject":"▸ removeSubject(subjectClass, exprAddr, batchId?): PromiseRemoves a subject instance by running its (SDNA defined) destructor,\nwhich means removing links around the given expression address","type-parameters-6#Type parameters":"Name\tT","parameters-33#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.\texprAddr\tstring\tThe address of the expression to be turned into a subject instance\tbatchId?\tstring\tOptional batch ID for grouping operations. If provided, the removal will be part of the batch and won't be executed until the batch is committed.","returns-36#Returns":"Promise","defined-in-48#Defined in":"perspectives/PerspectiveProxy.ts:1060","runflowaction#runFlowAction":"▸ runFlowAction(flowName, exprAddr, actionName): PromiseRuns given Social DNA flow action","parameters-34#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring\tactionName\tstring","returns-37#Returns":"Promise","defined-in-49#Defined in":"perspectives/PerspectiveProxy.ts:878","sdnaflows#sdnaFlows":"▸ sdnaFlows(): PromiseReturns all the Social DNA flows defined in this perspective","returns-38#Returns":"Promise","defined-in-50#Defined in":"perspectives/PerspectiveProxy.ts:840","setsingletarget#setSingleTarget":"▸ setSingleTarget(link, status?): PromiseSets a single target value, removing any existing targets.","parameters-35#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLink\tundefined\tLink defining the new target\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared","returns-39#Returns":"PromiseExample\n// Set a user's status\nawait perspective.setSingleTarget({\n source: \"did:key:alice\",\n predicate: \"status\",\n target: \"online\"\n});","defined-in-51#Defined in":"perspectives/PerspectiveProxy.ts:824","snapshot#snapshot":"▸ snapshot(): PromiseCreates a snapshot of the current perspective state.\nUseful for backup or sharing.","returns-40#Returns":"PromisePerspective object containing all links","defined-in-52#Defined in":"perspectives/PerspectiveProxy.ts:761","startflow#startFlow":"▸ startFlow(flowName, exprAddr): PromiseStarts the Social DNA flow","parameters-36#Parameters":"Name\tType\tDescription\tflowName\tstring\ton the expression\texprAddr\tstring","returns-41#Returns":"Promise","defined-in-53#Defined in":"perspectives/PerspectiveProxy.ts:852","stringortemplateobjecttosubjectclassname#stringOrTemplateObjectToSubjectClassName":"▸ stringOrTemplateObjectToSubjectClassName(subjectClass): Promise","type-parameters-7#Type parameters":"Name\tT","parameters-37#Parameters":"Name\tType\tsubjectClass\tT","returns-42#Returns":"Promise","defined-in-54#Defined in":"perspectives/PerspectiveProxy.ts:974","subjectclasses#subjectClasses":"▸ subjectClasses(): PromiseReturns all the Subject classes defined in this perspectives SDNA","returns-43#Returns":"Promise","defined-in-55#Defined in":"perspectives/PerspectiveProxy.ts:966","subjectclassesbytemplate#subjectClassesByTemplate":"▸ subjectClassesByTemplate(obj): PromiseReturns all subject classes that match the given template object.\nThis function looks at the properties of the template object and\nits setters and collections to create a Prolog query that finds\nall subject classes that would be converted to a proxy object\nwith exactly the same properties and collections.Since there could be multiple subject classes that match the given\ncriteria, this function returns a list of class names.","parameters-38#Parameters":"Name\tType\tDescription\tobj\tobject\tThe template object","returns-44#Returns":"Promise","defined-in-56#Defined in":"perspectives/PerspectiveProxy.ts:1258","subscribeinfer#subscribeInfer":"▸ subscribeInfer(query): PromiseCreates a subscription for a Prolog query that updates in real-time.This method:\nCreates the subscription on the Rust side\nSets up the subscription callback\nWaits for the initial result to come through the subscription channel\nReturns a fully initialized QuerySubscriptionProxy\nThe returned subscription is guaranteed to be ready to receive updates,\nas this method waits for the initialization process to complete.The subscription will be automatically cleaned up on both frontend and backend\nwhen dispose() is called. Make sure to call dispose() when you're done to\nprevent memory leaks and ensure proper cleanup of resources.","parameters-39#Parameters":"Name\tType\tDescription\tquery\tstring\tProlog query string","returns-45#Returns":"PromiseInitialized QuerySubscriptionProxy instanceExample\n// Subscribe to active todos\nconst subscription = await perspective.subscribeInfer(`\n instance(Todo, \"Todo\"),\n property_getter(\"Todo\", Todo, \"state\", \"active\")\n`);\n// Subscription is already initialized here\nconsole.log(\"Initial result:\", subscription.result);\n// Set up callback for future updates\nsubscription.onResult((todos) => {\n console.log(\"Active todos:\", todos);\n});\n// Clean up subscription when done\nsubscription.dispose();","defined-in-57#Defined in":"perspectives/PerspectiveProxy.ts:1346","subscribesurrealdb#subscribeSurrealDB":"▸ subscribeSurrealDB(query): PromiseCreates a subscription for a SurrealQL query that updates in real-time.This method:\nCreates the subscription on the Rust side\nSets up the subscription callback\nWaits for the initial result to come through the subscription channel\nReturns a fully initialized QuerySubscriptionProxy\nThe returned subscription is guaranteed to be ready to receive updates,\nas this method waits for the initialization process to complete.The subscription will be automatically cleaned up on both frontend and backend\nwhen dispose() is called. Make sure to call dispose() when you're done to\nprevent memory leaks and ensure proper cleanup of resources.","parameters-40#Parameters":"Name\tType\tDescription\tquery\tstring\tSurrealQL query string","returns-46#Returns":"PromiseInitialized QuerySubscriptionProxy instance","defined-in-58#Defined in":"perspectives/PerspectiveProxy.ts:1381","update#update":"▸ update(oldLink, newLink, batchId?): PromiseUpdates an existing link with new data.","parameters-41#Parameters":"Name\tType\tDescription\toldLink\tLinkExpressionInput\tThe existing link to update\tnewLink\tLink\tThe new link data\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-47#Returns":"Promise","defined-in-59#Defined in":"perspectives/PerspectiveProxy.ts:642"}},"/jsdoc/classes/QuerySubscriptionProxy":{"title":"Class: QuerySubscriptionProxy","data":{"":"@coasys/ad4m / Exports / QuerySubscriptionProxyProxy object for a subscribed Prolog query that provides real-time updatesThis class handles:\nKeeping the subscription alive by sending periodic keepalive signals\nManaging callbacks for result updates\nSubscribing to query updates via GraphQL subscriptions\nMaintaining the latest query result\nEnsuring subscription is fully initialized before allowing access\nCleaning up resources when disposed\nThe subscription will remain active as long as keepalive signals are sent.\nMake sure to call dispose() when you're done with the subscription to clean up\nresources, stop keepalive signals, and notify the backend to remove the subscription.The subscription goes through an initialization process where it waits for the first\nresult to come through the subscription channel. You can await the initialized\npromise to ensure the subscription is ready. The initialization will timeout after\n30 seconds if no result is received.Example usage:\nconst subscription = await perspective.subscribeInfer(\"my_query(X)\");\n// At this point the subscription is already initialized since subscribeInfer waits\n// Set up callback for future updates\nconst removeCallback = subscription.onResult(result => {\n console.log(\"New result:\", result);\n});\n// Later: clean up subscription and notify backend\nsubscription.dispose();","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#callbacks\n#client\n#disposed\n#initReject\n#initResolve\n#initTimeoutId\n#initialized\n#keepaliveTimer\n#latestResult\n#query\n#subscriptionId\n#unsubscribe\n#uuid\nisSurrealDB","accessors#Accessors":"id\ninitialized\nresult","methods#Methods":"#notifyCallbacks\ndispose\nonResult\nsubscribe","constructors-1#Constructors":"","constructor#constructor":"• new QuerySubscriptionProxy(uuid, query, client)Creates a new query subscription","parameters#Parameters":"Name\tType\tDescription\tuuid\tstring\tThe UUID of the perspective\tquery\tstring\tThe Prolog query to subscribe to\tclient\tPerspectiveClient\tThe PerspectiveClient instance to use for communication","defined-in#Defined in":"perspectives/PerspectiveProxy.ts:78","properties-1#Properties":"","callbacks##callbacks":"• Private #callbacks: Set","defined-in-1#Defined in":"perspectives/PerspectiveProxy.ts:61","client##client":"• Private #client: PerspectiveClient","defined-in-2#Defined in":"perspectives/PerspectiveProxy.ts:60","disposed##disposed":"• Private #disposed: boolean = false","defined-in-3#Defined in":"perspectives/PerspectiveProxy.ts:65","initreject##initReject":"• Private Optional #initReject: (reason?: any) => void","type-declaration#Type declaration":"▸ (reason?): void","parameters-1#Parameters":"Name\tType\treason?\tany","returns#Returns":"void","defined-in-4#Defined in":"perspectives/PerspectiveProxy.ts:68","initresolve##initResolve":"• Private Optional #initResolve: (value: boolean) => void","type-declaration-1#Type declaration":"▸ (value): void","parameters-2#Parameters":"Name\tType\tvalue\tboolean","returns-1#Returns":"void","defined-in-5#Defined in":"perspectives/PerspectiveProxy.ts:67","inittimeoutid##initTimeoutId":"• Private Optional #initTimeoutId: Timeout","defined-in-6#Defined in":"perspectives/PerspectiveProxy.ts:69","initialized##initialized":"• Private #initialized: Promise","defined-in-7#Defined in":"perspectives/PerspectiveProxy.ts:66","keepalivetimer##keepaliveTimer":"• Private #keepaliveTimer: number","defined-in-8#Defined in":"perspectives/PerspectiveProxy.ts:62","latestresult##latestResult":"• Private #latestResult: AllInstancesResult","defined-in-9#Defined in":"perspectives/PerspectiveProxy.ts:64","query##query":"• Private #query: string","defined-in-10#Defined in":"perspectives/PerspectiveProxy.ts:70","subscriptionid##subscriptionId":"• Private #subscriptionId: string","defined-in-11#Defined in":"perspectives/PerspectiveProxy.ts:59","unsubscribe##unsubscribe":"• Private Optional #unsubscribe: () => void","type-declaration-2#Type declaration":"▸ (): void","returns-2#Returns":"void","defined-in-12#Defined in":"perspectives/PerspectiveProxy.ts:63","uuid##uuid":"• Private #uuid: string","defined-in-13#Defined in":"perspectives/PerspectiveProxy.ts:58","issurrealdb#isSurrealDB":"• isSurrealDB: boolean = false","defined-in-14#Defined in":"perspectives/PerspectiveProxy.ts:71","accessors-1#Accessors":"","id#id":"• get id(): stringGet the subscription ID for this query subscriptionThis is a unique identifier assigned when the subscription was created.\nIt can be used to reference this specific subscription, for example when\nsending keepalive signals.","returns-3#Returns":"stringThe subscription ID string","defined-in-15#Defined in":"perspectives/PerspectiveProxy.ts:217","initialized-1#initialized":"• get initialized(): PromisePromise that resolves when the subscription has received its first result\nthrough the subscription channel. This ensures the subscription is fully\nset up before allowing access to results or updates.If no result is received within 30 seconds, the subscription will automatically\nretry. The promise will remain pending until a subscription message successfully\narrives, or until a fatal error occurs during subscription setup.Note: You typically don't need to await this directly since the subscription\ncreation methods (like subscribeInfer) already wait for initialization.","returns-4#Returns":"Promise","defined-in-16#Defined in":"perspectives/PerspectiveProxy.ts:232","result#result":"• get result(): AllInstancesResultGet the latest query resultThis returns the most recent result from the query, which could be either:\nThe initial result from when the subscription was created\nThe latest update received through the subscription","returns-5#Returns":"AllInstancesResultThe latest query result as a string (usually a JSON array of bindings)","defined-in-17#Defined in":"perspectives/PerspectiveProxy.ts:244","methods-1#Methods":"","notifycallbacks##notifyCallbacks":"▸ Private #notifyCallbacks(result): voidInternal method to notify all callbacks of a new result","parameters-3#Parameters":"Name\tType\tresult\tAllInstancesResult","returns-6#Returns":"void","defined-in-18#Defined in":"perspectives/PerspectiveProxy.ts:273","dispose#dispose":"▸ dispose(): voidClean up the subscription and stop keepalive signalsThis method:\nStops the keepalive timer\nUnsubscribes from GraphQL subscription updates\nClears all registered callbacks\nCleans up any pending initialization timeout\nAfter calling this method, the subscription is no longer active and\nwill not receive any more updates. The instance should be discarded.","returns-7#Returns":"void","defined-in-19#Defined in":"perspectives/PerspectiveProxy.ts:294","onresult#onResult":"▸ onResult(callback): () => voidAdd a callback that will be called whenever new results arriveThe callback will be called immediately with the current result,\nand then again each time the query results change.","parameters-4#Parameters":"Name\tType\tDescription\tcallback\tQueryCallback\tFunction that takes a result string and processes it","returns-8#Returns":"fnA function that can be called to remove this callbackExample:\nconst removeCallback = subscription.onResult(result => {\n const bindings = JSON.parse(result);\n console.log(\"New bindings:\", bindings);\n});\n// Later: stop receiving updates\nremoveCallback();\n▸ (): voidAdd a callback that will be called whenever new results arriveThe callback will be called immediately with the current result,\nand then again each time the query results change.","returns-9#Returns":"voidA function that can be called to remove this callbackExample:\nconst removeCallback = subscription.onResult(result => {\n const bindings = JSON.parse(result);\n console.log(\"New bindings:\", bindings);\n});\n// Later: stop receiving updates\nremoveCallback();","defined-in-20#Defined in":"perspectives/PerspectiveProxy.ts:267","subscribe#subscribe":"▸ subscribe(): Promise","returns-10#Returns":"Promise","defined-in-21#Defined in":"perspectives/PerspectiveProxy.ts:92"}},"/jsdoc/classes/PerspectiveInput":{"title":"Class: PerspectiveInput","data":{"":"@coasys/ad4m / Exports / PerspectiveInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveInput()","properties-1#Properties":"","links#links":"• links: LinkExpressionInput[]","defined-in#Defined in":"perspectives/Perspective.ts:95"}},"/jsdoc/classes/Resource":{"title":"Class: Resource","data":{"":"@coasys/ad4m / Exports / Resource","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"domain\npointers","constructors-1#Constructors":"","constructor#constructor":"• new Resource(domain, pointers)","parameters#Parameters":"Name\tType\tdomain\tstring\tpointers\tstring[]","defined-in#Defined in":"agent/Agent.ts:151","properties-1#Properties":"","domain#domain":"• domain: string","defined-in-1#Defined in":"agent/Agent.ts:146","pointers#pointers":"• pointers: string[]","defined-in-2#Defined in":"agent/Agent.ts:149"}},"/jsdoc/classes/PerspectiveUnsignedInput":{"title":"Class: PerspectiveUnsignedInput","data":{"":"@coasys/ad4m / Exports / PerspectiveUnsignedInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","methods#Methods":"fromLink","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveUnsignedInput(links?)","parameters#Parameters":"Name\tType\tlinks?\tLinkInput[]","defined-in#Defined in":"perspectives/Perspective.ts:103","properties-1#Properties":"","links#links":"• links: LinkInput[]","defined-in-1#Defined in":"perspectives/Perspective.ts:101","methods-1#Methods":"","fromlink#fromLink":"▸ Static fromLink(link): PerspectiveUnsignedInput","parameters-1#Parameters":"Name\tType\tlink\tLink","returns#Returns":"PerspectiveUnsignedInput","defined-in-2#Defined in":"perspectives/Perspective.ts:110"}},"/jsdoc/classes/SmartLiteral":{"title":"Class: SmartLiteral","data":{"":"@coasys/ad4m / Exports / SmartLiteral","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#base\n#perspective","accessors#Accessors":"base","methods#Methods":"get\nset\ncreate\ngetAllSmartLiterals\nisSmartLiteralBase","constructors-1#Constructors":"","constructor#constructor":"• new SmartLiteral(perspective, base)","parameters#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tbase\tstring","defined-in#Defined in":"SmartLiteral.ts:23","properties-1#Properties":"","base##base":"• Private #base: string","defined-in-1#Defined in":"SmartLiteral.ts:21","perspective##perspective":"• Private #perspective: PerspectiveProxy","defined-in-2#Defined in":"SmartLiteral.ts:20","accessors-1#Accessors":"","base-1#base":"• get base(): string","returns#Returns":"string","defined-in-3#Defined in":"SmartLiteral.ts:28","methods-1#Methods":"","get#get":"▸ get(): Promise","returns-1#Returns":"Promise","defined-in-4#Defined in":"SmartLiteral.ts:54","set#set":"▸ set(content): Promise","parameters-1#Parameters":"Name\tType\tcontent\tany","returns-2#Returns":"Promise","defined-in-5#Defined in":"SmartLiteral.ts:67","create#create":"▸ Static create(perspective, literal): Promise","parameters-2#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tliteral\tany","returns-3#Returns":"Promise","defined-in-6#Defined in":"SmartLiteral.ts:32","getallsmartliterals#getAllSmartLiterals":"▸ Static getAllSmartLiterals(perspective): Promise","parameters-3#Parameters":"Name\tType\tperspective\tPerspectiveProxy","returns-4#Returns":"Promise","defined-in-7#Defined in":"SmartLiteral.ts:47","issmartliteralbase#isSmartLiteralBase":"▸ Static isSmartLiteralBase(perspective, base): Promise","parameters-4#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tbase\tstring","returns-5#Returns":"Promise","defined-in-8#Defined in":"SmartLiteral.ts:39"}},"/jsdoc/classes/Subject":{"title":"Class: Subject","data":{"":"@coasys/ad4m / Exports / SubjectRepresents a subject in the perspective.\nA subject is an entity that has properties and collections.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#baseExpression\n#perspective\n#subjectClassName","accessors#Accessors":"baseExpression","methods#Methods":"init","constructors-1#Constructors":"","constructor#constructor":"• new Subject(perspective, baseExpression, subjectClassName)Constructs a new subject.","parameters#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective that the subject belongs to.\tbaseExpression\tstring\tThe base expression of the subject.\tsubjectClassName\tstring\tThe class name of the subject.","defined-in#Defined in":"model/Subject.ts:19","properties-1#Properties":"","baseexpression##baseExpression":"• Private #baseExpression: string","defined-in-1#Defined in":"model/Subject.ts:9","perspective##perspective":"• Private #perspective: PerspectiveProxy","defined-in-2#Defined in":"model/Subject.ts:11","subjectclassname##subjectClassName":"• Private #subjectClassName: string","defined-in-3#Defined in":"model/Subject.ts:10","accessors-1#Accessors":"","baseexpression-1#baseExpression":"• get baseExpression(): stringGets the base expression of the subject.","returns#Returns":"string","defined-in-4#Defined in":"model/Subject.ts:28","methods-1#Methods":"","init#init":"▸ init(): PromiseInitializes the subject by validating it and defining its properties and collections dynamically.NOTE: This method should be called before using the subject. All the properties and collections of the subject defined are not type-checked.","returns-1#Returns":"Promise","defined-in-5#Defined in":"model/Subject.ts:37"}},"/jsdoc/enums/ExceptionType":{"title":"Enumeration: ExceptionType","data":{"":"@coasys/ad4m / Exports / ExceptionType","table-of-contents#Table of contents":"","enumeration-members#Enumeration Members":"AgentIsUntrusted\nCapabilityRequested\nExpressionIsNotVerified\nInstallNotificationRequest\nLanguageIsNotLoaded","enumeration-members-1#Enumeration Members":"","agentisuntrusted#AgentIsUntrusted":"• AgentIsUntrusted = \"AGENT_IS_UNTRUSTED\"","defined-in#Defined in":"Exception.ts:4","capabilityrequested#CapabilityRequested":"• CapabilityRequested = \"CAPABILITY_REQUESTED\"","defined-in-1#Defined in":"Exception.ts:5","expressionisnotverified#ExpressionIsNotVerified":"• ExpressionIsNotVerified = \"EXPRESSION_IS_NOT_VERIFIED\"","defined-in-2#Defined in":"Exception.ts:3","installnotificationrequest#InstallNotificationRequest":"• InstallNotificationRequest = \"INSTALL_NOTIFICATION_REQUEST\"","defined-in-3#Defined in":"Exception.ts:6","languageisnotloaded#LanguageIsNotLoaded":"• LanguageIsNotLoaded = \"LANGUAGE_IS_NOT_LOADED\"","defined-in-4#Defined in":"Exception.ts:2"}},"/jsdoc/enums/PerspectiveState":{"title":"Enumeration: PerspectiveState","data":{"":"@coasys/ad4m / Exports / PerspectiveState","table-of-contents#Table of contents":"","enumeration-members#Enumeration Members":"LinkLanguageFailedToInstall\nLinkLanguageInstalledButNotSynced\nNeighboudhoodCreationInitiated\nNeighbourhoodJoinInitiated\nPrivate\nSynced","enumeration-members-1#Enumeration Members":"","linklanguagefailedtoinstall#LinkLanguageFailedToInstall":"• LinkLanguageFailedToInstall = \"LINK_LANGUAGE_FAILED_TO_INSTALL\"","defined-in#Defined in":"perspectives/PerspectiveHandle.ts:8","linklanguageinstalledbutnotsynced#LinkLanguageInstalledButNotSynced":"• LinkLanguageInstalledButNotSynced = \"LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED\"","defined-in-1#Defined in":"perspectives/PerspectiveHandle.ts:9","neighboudhoodcreationinitiated#NeighboudhoodCreationInitiated":"• NeighboudhoodCreationInitiated = \"NEIGHBOURHOOD_CREATION_INITIATED\"","defined-in-2#Defined in":"perspectives/PerspectiveHandle.ts:6","neighbourhoodjoininitiated#NeighbourhoodJoinInitiated":"• NeighbourhoodJoinInitiated = \"NEIGHBOURHOOD_JOIN_INITIATED\"","defined-in-3#Defined in":"perspectives/PerspectiveHandle.ts:7","private#Private":"• Private = \"PRIVATE\"","defined-in-4#Defined in":"perspectives/PerspectiveHandle.ts:5","synced#Synced":"• Synced = \"SYNCED\"","defined-in-5#Defined in":"perspectives/PerspectiveHandle.ts:10"}},"/jsdoc/interfaces/AgentService":{"title":"Interface: AgentService","data":{"":"@coasys/ad4m / Exports / AgentService","table-of-contents#Table of contents":"","properties#Properties":"did","methods#Methods":"createSignedExpression","properties-1#Properties":"","did#did":"• Readonly did: string","defined-in#Defined in":"language/LanguageContext.ts:5","methods-1#Methods":"","createsignedexpression#createSignedExpression":"▸ createSignedExpression(data): Expression","parameters#Parameters":"Name\tType\tdata\tany","returns#Returns":"Expression","defined-in-1#Defined in":"language/LanguageContext.ts:6"}},"/jsdoc/classes/ResourceInput":{"title":"Class: ResourceInput","data":{"":"@coasys/ad4m / Exports / ResourceInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"domain\npointers","constructors-1#Constructors":"","constructor#constructor":"• new ResourceInput(domain, pointers)","parameters#Parameters":"Name\tType\tdomain\tstring\tpointers\tstring[]","defined-in#Defined in":"agent/Agent.ts:238","properties-1#Properties":"","domain#domain":"• domain: string","defined-in-1#Defined in":"agent/Agent.ts:233","pointers#pointers":"• pointers: string[]","defined-in-2#Defined in":"agent/Agent.ts:236"}},"/jsdoc/interfaces/CollectionOptions":{"title":"Interface: CollectionOptions","data":{"":"@coasys/ad4m / Exports / CollectionOptions","table-of-contents#Table of contents":"","properties#Properties":"local\nthrough\nwhere","properties-1#Properties":"","local#local":"• Optional local: booleanIndicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.","defined-in#Defined in":"model/decorators.ts:391","through#through":"• through: stringThe predicate of the property. All properties must have this option.","defined-in-1#Defined in":"model/decorators.ts:381","where#where":"• Optional where: WhereOptionsAn object representing the WHERE clause of the query.","defined-in-2#Defined in":"model/decorators.ts:386"}},"/jsdoc/interfaces/DirectMessageAdapter":{"title":"Interface: DirectMessageAdapter","data":{"":"@coasys/ad4m / Exports / DirectMessageAdapter","table-of-contents#Table of contents":"","methods#Methods":"addMessageCallback\ninbox\nrecipient\nsendInbox\nsendP2P\nsetStatus\nstatus","methods-1#Methods":"","addmessagecallback#addMessageCallback":"▸ addMessageCallback(callback): any","parameters#Parameters":"Name\tType\tcallback\tMessageCallback","returns#Returns":"any","defined-in#Defined in":"language/Language.ts:203","inbox#inbox":"▸ inbox(filter?): Promise","parameters-1#Parameters":"Name\tType\tfilter?\tstring","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:202","recipient#recipient":"▸ recipient(): string","returns-2#Returns":"string","defined-in-2#Defined in":"language/Language.ts:195","sendinbox#sendInbox":"▸ sendInbox(message): Promise","parameters-2#Parameters":"Name\tType\tmessage\tPerspective","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:199","sendp2p#sendP2P":"▸ sendP2P(message): Promise","parameters-3#Parameters":"Name\tType\tmessage\tPerspective","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:198","setstatus#setStatus":"▸ setStatus(status): any","parameters-4#Parameters":"Name\tType\tstatus\tPerspectiveExpression","returns-5#Returns":"any","defined-in-5#Defined in":"language/Language.ts:201","status#status":"▸ status(): Promise","returns-6#Returns":"Promise","defined-in-6#Defined in":"language/Language.ts:197"}},"/jsdoc/interfaces/CollectionMetadata":{"title":"Interface: CollectionMetadata","data":{"":"@coasys/ad4m / Exports / CollectionMetadataMetadata for a single collection extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"local\nname\npredicate\nwhere","properties-1#Properties":"","local#local":"• Optional local: booleanWhether stored locally only","defined-in#Defined in":"model/Ad4mModel.ts:114","name#name":"• name: stringThe collection name","defined-in-1#Defined in":"model/Ad4mModel.ts:108","predicate#predicate":"• predicate: stringThe predicate URI (through value)","defined-in-2#Defined in":"model/Ad4mModel.ts:110","where#where":"• Optional where: ObjectFilter conditions","type-declaration#Type declaration":"Name\tType\tcondition?\tstring\tisInstance?\tany","defined-in-3#Defined in":"model/Ad4mModel.ts:112"}},"/jsdoc/interfaces/ExpressionUI":{"title":"Interface: ExpressionUI","data":{"":"@coasys/ad4m / Exports / ExpressionUIUI factories returning web components","table-of-contents#Table of contents":"","methods#Methods":"constructorIcon\nicon","methods-1#Methods":"","constructoricon#constructorIcon":"▸ constructorIcon(): stringReturns JS code of a web component used to create new expressions","returns#Returns":"string","defined-in#Defined in":"language/Language.ts:82","icon#icon":"▸ icon(): stringReturns JS code of a web component that renders the given expression","returns-1#Returns":"string","defined-in-1#Defined in":"language/Language.ts:80"}},"/jsdoc/interfaces/FlagOptions":{"title":"Interface: FlagOptions","data":{"":"@coasys/ad4m / Exports / FlagOptions","table-of-contents#Table of contents":"","properties#Properties":"through\nvalue","properties-1#Properties":"","through#through":"• through: stringThe predicate of the property. All properties must have this option.","defined-in#Defined in":"model/decorators.ts:280","value#value":"• value: stringThe value of the property.","defined-in-1#Defined in":"model/decorators.ts:285"}},"/jsdoc/interfaces/ExpressionAdapter":{"title":"Interface: ExpressionAdapter","data":{"":"@coasys/ad4m / Exports / ExpressionAdapterInterface for the most common Expression Languages","table-of-contents#Table of contents":"","properties#Properties":"putAdapter","methods#Methods":"get","properties-1#Properties":"","putadapter#putAdapter":"• putAdapter: PublicSharing | ReadOnlyLanguageStrategy for putting an expression with needs to be different\nfor those two cases:\nPublicSharing means that this language supports the creation\nand sharing of Expressions, which is the common use-case\nReadOnlyLanguage means that the Language implements a pre-defined\nset of expressions (which can be infinite or finite).\nFor example the url-iframe Language which directly maps URLs to\naddresses - meaning every well formed URL is an address in this\nLanguage. Or a potential Language implementing the verbs/predicates\nof a spec like FOAF.","defined-in#Defined in":"language/Language.ts:106","methods-1#Methods":"","get#get":"▸ get(address): PromiseReturns an Expression by address, or null if there is no Expression\nwith that given address","parameters#Parameters":"Name\tType\taddress\tstring","returns#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:93"}},"/jsdoc/interfaces/GetByAuthorAdapter":{"title":"Interface: GetByAuthorAdapter","data":{"":"@coasys/ad4m / Exports / GetByAuthorAdapter","table-of-contents#Table of contents":"","methods#Methods":"getByAuthor","methods-1#Methods":"","getbyauthor#getByAuthor":"▸ getByAuthor(author, count, page): Promise","parameters#Parameters":"Name\tType\tauthor\tstring\tcount\tnumber\tpage\tnumber","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:139"}},"/jsdoc/interfaces/HolochainLanguageDelegate":{"title":"Interface: HolochainLanguageDelegate","data":{"":"@coasys/ad4m / Exports / HolochainLanguageDelegate","table-of-contents#Table of contents":"","methods#Methods":"call\ncallAsync\nregisterDNAs","methods-1#Methods":"","call#call":"▸ call(dnaNick, zomeName, fnName, params): PromiseMakes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue","parameters#Parameters":"Name\tType\tdnaNick\tstring\tzomeName\tstring\tfnName\tstring\tparams\tstring | object","returns#Returns":"Promise","defined-in#Defined in":"language/LanguageContext.ts:32","callasync#callAsync":"▸ callAsync(calls, timeoutMs?): PromiseMakes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors","parameters-1#Parameters":"Name\tType\tcalls\t{ dnaNick: string ; fnName: string ; params: string | object ; zomeName: string }[]\ttimeoutMs?\tnumber","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/LanguageContext.ts:34","registerdnas#registerDNAs":"▸ registerDNAs(dnas, holochainSignalCallback?): PromiseInstalls/registers a given DNA in the ad4m-executor","parameters-2#Parameters":"Name\tType\tdnas\tDna[]\tholochainSignalCallback?\tAppSignalCb","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/LanguageContext.ts:30"}},"/jsdoc/interfaces/GetAllAdapter":{"title":"Interface: GetAllAdapter","data":{"":"@coasys/ad4m / Exports / GetAllAdapter","table-of-contents#Table of contents":"","methods#Methods":"getAll","methods-1#Methods":"","getall#getAll":"▸ getAll(filter, count, page): Promise","parameters#Parameters":"Name\tType\tfilter\tany\tcount\tnumber\tpage\tnumber","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:148"}},"/jsdoc/interfaces/InitializeArgs":{"title":"Interface: InitializeArgs","data":{"":"@coasys/ad4m / Exports / InitializeArgs","table-of-contents#Table of contents":"","properties#Properties":"did\ndidDocument\nkeystore\npassphrase","properties-1#Properties":"","did#did":"• did: string","defined-in#Defined in":"agent/AgentClient.ts:73","diddocument#didDocument":"• didDocument: string","defined-in-1#Defined in":"agent/AgentClient.ts:74","keystore#keystore":"• keystore: string","defined-in-2#Defined in":"agent/AgentClient.ts:75","passphrase#passphrase":"• passphrase: string","defined-in-3#Defined in":"agent/AgentClient.ts:76"}},"/jsdoc/interfaces/InstanceQueryParams":{"title":"Interface: InstanceQueryParams","data":{"":"@coasys/ad4m / Exports / InstanceQueryParams","table-of-contents#Table of contents":"","properties#Properties":"condition\nwhere","properties-1#Properties":"","condition#condition":"• Optional condition: stringA string representing the condition clause of the query.","defined-in#Defined in":"model/decorators.ts:34","where#where":"• Optional where: objectAn object representing the WHERE clause of the query.","defined-in-1#Defined in":"model/decorators.ts:29"}},"/jsdoc/interfaces/Interaction":{"title":"Interface: Interaction","data":{"":"@coasys/ad4m / Exports / Interaction","table-of-contents#Table of contents":"","properties#Properties":"label\nname\nparameters","methods#Methods":"execute","properties-1#Properties":"","label#label":"• Readonly label: string","defined-in#Defined in":"language/Language.ts:227","name#name":"• Readonly name: string","defined-in-1#Defined in":"language/Language.ts:228","parameters#parameters":"• Readonly parameters: InteractionParameter[]","defined-in-2#Defined in":"language/Language.ts:229","methods-1#Methods":"","execute#execute":"▸ execute(parameters): Promise","parameters-1#Parameters":"Name\tType\tparameters\tobject","returns#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:230"}},"/jsdoc/interfaces/LanguageAdapter":{"title":"Interface: LanguageAdapter","data":{"":"@coasys/ad4m / Exports / LanguageAdapter","table-of-contents#Table of contents":"","methods#Methods":"getLanguageSource","methods-1#Methods":"","getlanguagesource#getLanguageSource":"▸ getLanguageSource(address): Promise","parameters#Parameters":"Name\tType\taddress\tstring","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:132"}},"/jsdoc/interfaces/LanguageContext":{"title":"Interface: LanguageContext","data":{"":"@coasys/ad4m / Exports / LanguageContext","table-of-contents#Table of contents":"","properties#Properties":"Holochain\nad4mSignal\nagent\ncustomSettings\nsignatures\nstorageDirectory","properties-1#Properties":"","holochain#Holochain":"• Holochain: HolochainLanguageDelegate","defined-in#Defined in":"language/LanguageContext.ts:18","ad4msignal#ad4mSignal":"• ad4mSignal: Ad4mSignalCB","defined-in-1#Defined in":"language/LanguageContext.ts:19","agent#agent":"• agent: AgentService","defined-in-2#Defined in":"language/LanguageContext.ts:14","customsettings#customSettings":"• customSettings: object","defined-in-3#Defined in":"language/LanguageContext.ts:17","signatures#signatures":"• signatures: SignaturesService","defined-in-4#Defined in":"language/LanguageContext.ts:15","storagedirectory#storageDirectory":"• storageDirectory: string","defined-in-5#Defined in":"language/LanguageContext.ts:16"}},"/jsdoc/interfaces/PropertyMetadata":{"title":"Interface: PropertyMetadata","data":{"":"@coasys/ad4m / Exports / PropertyMetadataMetadata for a single property extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"flag\ngetter\ninitial\nlocal\nname\npredicate\nrequired\nresolveLanguage\nsetter\ntransform\nwritable","properties-1#Properties":"","flag#flag":"• Optional flag: booleanWhether this is a flag property","defined-in#Defined in":"model/Ad4mModel.ts:100","getter#getter":"• Optional getter: stringCustom Prolog getter code","defined-in-1#Defined in":"model/Ad4mModel.ts:92","initial#initial":"• Optional initial: stringInitial value if specified","defined-in-2#Defined in":"model/Ad4mModel.ts:88","local#local":"• Optional local: booleanWhether stored locally only","defined-in-3#Defined in":"model/Ad4mModel.ts:96","name#name":"• name: stringThe property name","defined-in-4#Defined in":"model/Ad4mModel.ts:80","predicate#predicate":"• predicate: stringThe predicate URI (through value)","defined-in-5#Defined in":"model/Ad4mModel.ts:82","required#required":"• required: booleanWhether the property is required","defined-in-6#Defined in":"model/Ad4mModel.ts:84","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringLanguage for resolution (e.g., \"literal\")","defined-in-7#Defined in":"model/Ad4mModel.ts:90","setter#setter":"• Optional setter: stringCustom Prolog setter code","defined-in-8#Defined in":"model/Ad4mModel.ts:94","transform#transform":"• Optional transform: (value: any) => any","type-declaration#Type declaration":"▸ (value): anyTransform function","parameters#Parameters":"Name\tType\tvalue\tany","returns#Returns":"any","defined-in-9#Defined in":"model/Ad4mModel.ts:98","writable#writable":"• writable: booleanWhether the property is writable","defined-in-10#Defined in":"model/Ad4mModel.ts:86"}},"/jsdoc/interfaces/Language":{"title":"Interface: Language","data":{"":"@coasys/ad4m / Exports / LanguageInterface of AD4M LanguagesAny JavaScript module that implements a create() function that returns an object that implements this interface\nis a valid AD4M language.\nSo the AD4M-internal representation of a language is an object that implements this interface.Since there are a few different kinds of languages, this interface is split into optional sub-interfaces.\nThe only required property is the name of the language.The most usual kind of language is the \"Expression Language\", which is a language that can be used to create\nand share Expressions.\nFor that, implement the expressionsAdapter and expressionUI interface.The second most common kind of language is the \"Link Language\", which is a language that builds the core\nof AD4M Neighbourhoods.\nFor that, implement the linksAdapter interface.","table-of-contents#Table of contents":"","properties#Properties":"directMessageAdapter\nexpressionAdapter\nexpressionUI\ngetAllAdapter\ngetByAuthorAdapter\nlanguageAdapter\nlinksAdapter\nname\nsettingsUI\nteardown\ntelepresenceAdapter","methods#Methods":"interactions\nisImmutableExpression","properties-1#Properties":"","directmessageadapter#directMessageAdapter":"• Optional Readonly directMessageAdapter: DirectMessageAdapterOptional adapter for direct messaging between agents","defined-in#Defined in":"language/Language.ts:65","expressionadapter#expressionAdapter":"• Optional Readonly expressionAdapter: ExpressionAdapterExpressionAdapter implements means of getting an Expression\nby address and putting an expression","defined-in-1#Defined in":"language/Language.ts:39","expressionui#expressionUI":"• Optional Readonly expressionUI: ExpressionUIInterface for getting UI/web components for rendering Expressions of this Language","defined-in-2#Defined in":"language/Language.ts:42","getalladapter#getAllAdapter":"• Optional Readonly getAllAdapter: GetAllAdapterOptional adapter for getting all Expressions","defined-in-3#Defined in":"language/Language.ts:62","getbyauthoradapter#getByAuthorAdapter":"• Optional Readonly getByAuthorAdapter: GetByAuthorAdapterOptional adapter for getting Expressions by author","defined-in-4#Defined in":"language/Language.ts:60","languageadapter#languageAdapter":"• Optional Readonly languageAdapter: LanguageAdapterImplementation of a Language that defines and stores Languages","defined-in-5#Defined in":"language/Language.ts:57","linksadapter#linksAdapter":"• Optional Readonly linksAdapter: LinkSyncAdapterInterface of LinkLanguages for the core implementation of Neighbourhoods","defined-in-6#Defined in":"language/Language.ts:45","name#name":"• Readonly name: string","defined-in-7#Defined in":"language/Language.ts:27","settingsui#settingsUI":"• Optional Readonly settingsUI: SettingsUIInterface for providing UI components for the settings of this Language","defined-in-8#Defined in":"language/Language.ts:68","teardown#teardown":"• Optional Readonly teardown: () => void","type-declaration#Type declaration":"▸ (): voidOptional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor","returns#Returns":"void","defined-in-9#Defined in":"language/Language.ts:71","telepresenceadapter#telepresenceAdapter":"• Optional Readonly telepresenceAdapter: TelepresenceAdapterAdditional Interface of LinkLanguages that support telepresence features,\nthat is:\nseeing who is online and getting a status\nsending/receiveing p2p signals to other online agents without affecting\nthe shared Perspective of the Neighbourhood\n(see TelepresenceAdapter for more details)","defined-in-10#Defined in":"language/Language.ts:54","methods-1#Methods":"","interactions#interactions":"▸ interactions(expression): Interaction[]All available interactions this agent could execute on given expression","parameters#Parameters":"Name\tType\texpression\tstring","returns-1#Returns":"Interaction[]","defined-in-11#Defined in":"language/Language.ts:74","isimmutableexpression#isImmutableExpression":"▸ Optional isImmutableExpression(expression): booleanFlagging expressions as immutable to enable\nexpression caching in the ad4m-executor","parameters-1#Parameters":"Name\tType\texpression\tstring","returns-2#Returns":"boolean","defined-in-12#Defined in":"language/Language.ts:32"}},"/jsdoc/interfaces/PublicSharing":{"title":"Interface: PublicSharing","data":{"":"@coasys/ad4m / Exports / PublicSharingImplement this interface if your Language supports creation of sharing\nof Expressions.\nSee ExpressionAdapter","table-of-contents#Table of contents":"","methods#Methods":"createPublic","methods-1#Methods":"","createpublic#createPublic":"▸ createPublic(content): PromiseCreate an Expression and shares it.\nReturn the Expression's address.","parameters#Parameters":"Name\tType\tDescription\tcontent\tobject\tis the object created by the constructorIcon component","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:118"}},"/jsdoc/interfaces/PropertyOptions":{"title":"Interface: PropertyOptions","data":{"":"@coasys/ad4m / Exports / PropertyOptions","table-of-contents#Table of contents":"","properties#Properties":"getter\ninitial\nlocal\nrequired\nresolveLanguage\nsetter\nthrough\ntransform\nwritable","properties-1#Properties":"","getter#getter":"• Optional getter: stringCustom getter to get the value of the property in the prolog engine. If not provided, the default getter will be used.","defined-in#Defined in":"model/decorators.ts:149","initial#initial":"• Optional initial: stringThe initial value of the property. Required if the property is marked as required.","defined-in-1#Defined in":"model/decorators.ts:129","local#local":"• Optional local: booleanIndicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.","defined-in-2#Defined in":"model/decorators.ts:159","required#required":"• Optional required: booleanIndicates whether the property is required. If true, an initial value must be provided.","defined-in-3#Defined in":"model/decorators.ts:134","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringThe language used to store the property. Can be the default Literal Language or a custom language address.","defined-in-4#Defined in":"model/decorators.ts:144","setter#setter":"• Optional setter: stringCustom setter to set the value of the property in the prolog engine. Only available if the property is writable.","defined-in-5#Defined in":"model/decorators.ts:154","through#through":"• Optional through: stringThe predicate of the property. All properties must have this option.","defined-in-6#Defined in":"model/decorators.ts:124","transform#transform":"• Optional transform: (value: any) => any","type-declaration#Type declaration":"▸ (value): anyOptional transform function to modify the property value after it is retrieved.\nThis is useful for transforming raw data into a more usable format.\nThe function takes the raw value as input and returns the transformed value.","parameters#Parameters":"Name\tType\tvalue\tany","returns#Returns":"any","defined-in-7#Defined in":"model/decorators.ts:166","writable#writable":"• Optional writable: booleanIndicates whether the property is writable. If true, a setter will be available in the prolog engine.","defined-in-8#Defined in":"model/decorators.ts:139"}},"/jsdoc/interfaces/ModelMetadata":{"title":"Interface: ModelMetadata","data":{"":"@coasys/ad4m / Exports / ModelMetadataComplete model metadata extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"className\ncollections\nproperties","properties-1#Properties":"","classname#className":"• className: stringThe model class name fromModel Options","defined-in#Defined in":"model/Ad4mModel.ts:122","collections#collections":"• collections: RecordMap of collection name to metadata","defined-in-1#Defined in":"model/Ad4mModel.ts:126","properties-2#properties":"• properties: RecordMap of property name to metadata","defined-in-2#Defined in":"model/Ad4mModel.ts:124"}},"/jsdoc/interfaces/ReadOnlyLanguage":{"title":"Interface: ReadOnlyLanguage","data":{"":"@coasys/ad4m / Exports / ReadOnlyLanguageImplement this interface if your Language is defined over a static\nset of pre-defined Expressions.","table-of-contents#Table of contents":"","methods#Methods":"addressOf","methods-1#Methods":"","addressof#addressOf":"▸ addressOf(content): PromiseThis just calculates the address of an object","parameters#Parameters":"Name\tType\tDescription\tcontent\tobject\tis the object created by the constructorIcon component","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:128"}},"/jsdoc/interfaces/SignaturesService":{"title":"Interface: SignaturesService","data":{"":"@coasys/ad4m / Exports / SignaturesService","table-of-contents#Table of contents":"","methods#Methods":"verify","methods-1#Methods":"","verify#verify":"▸ verify(expr): boolean","parameters#Parameters":"Name\tType\texpr\tExpression","returns#Returns":"boolean","defined-in#Defined in":"language/LanguageContext.ts:10"}},"/jsdoc/interfaces/SettingsUI":{"title":"Interface: SettingsUI","data":{"":"@coasys/ad4m / Exports / SettingsUI","table-of-contents#Table of contents":"","methods#Methods":"settingsIcon","methods-1#Methods":"","settingsicon#settingsIcon":"▸ settingsIcon(): string","returns#Returns":"string","defined-in#Defined in":"language/Language.ts:86"}},"/jsdoc/interfaces/TelepresenceAdapter":{"title":"Interface: TelepresenceAdapter","data":{"":"@coasys/ad4m / Exports / TelepresenceAdapter","table-of-contents#Table of contents":"","methods#Methods":"getOnlineAgents\nregisterSignalCallback\nsendBroadcast\nsendSignal\nsetOnlineStatus","methods-1#Methods":"","getonlineagents#getOnlineAgents":"▸ getOnlineAgents(): Promise","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:261","registersignalcallback#registerSignalCallback":"▸ registerSignalCallback(callback): Promise","parameters#Parameters":"Name\tType\tcallback\tTelepresenceSignalCallback","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:265","sendbroadcast#sendBroadcast":"▸ sendBroadcast(payload): Promise","parameters-1#Parameters":"Name\tType\tpayload\tPerspectiveExpression","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/Language.ts:264","sendsignal#sendSignal":"▸ sendSignal(remoteAgentDid, payload): Promise","parameters-2#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspectiveExpression","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:263","setonlinestatus#setOnlineStatus":"▸ setOnlineStatus(status): Promise","parameters-3#Parameters":"Name\tType\tstatus\tPerspectiveExpression","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:260"}},"/jsdoc/modules":{"title":"@coasys/ad4m","data":{"":"@coasys/ad4m / Exports","table-of-contents#Table of contents":"","enumerations#Enumerations":"ExceptionType\nPerspectiveState","classes#Classes":"AIClient\nAIModelLoadingStatus\nAIPromptExamples\nAIPromptExamplesInput\nAITask\nAITaskInput\nAd4mClient\nAd4mModel\nAgent\nAgentClient\nAgentExpression\nAgentSignature\nAgentStatus\nApps\nAuthInfo\nAuthInfoInput\nCapability\nCapabilityInput\nDna\nEntanglementProof\nEntanglementProofInput\nExceptionInfo\nExpression\nExpressionProof\nExpressionProofInput\nExpressionRef\nExpressionRendered\nIcon\nImportResult\nImportStats\nInteractionCall\nInteractionMeta\nInteractionParameter\nLanguageExpression\nLanguageHandle\nLanguageLanguageInput\nLanguageMeta\nLanguageMetaInput\nLanguageMetaInternal\nLanguageRef\nLink\nLinkExpression\nLinkExpressionInput\nLinkExpressionMutations\nLinkExpressionUpdated\nLinkInput\nLinkMutations\nLinkQuery\nLiteral\nModelQueryBuilder\nNeighbourhood\nNeighbourhoodExpression\nNeighbourhoodProxy\nNotification\nNotificationInput\nOnlineAgent\nPerspective\nPerspectiveAction\nPerspectiveDiff\nPerspectiveDiffExpression\nPerspectiveExpression\nPerspectiveHandle\nPerspectiveInput\nPerspectiveProxy\nPerspectiveUnsignedInput\nQuerySubscriptionProxy\nResource\nResourceInput\nRuntimeInfo\nSentMessage\nSmartLiteral\nSubject\nTriggeredNotification","interfaces#Interfaces":"AgentService\nCollectionMetadata\nCollectionOptions\nDirectMessageAdapter\nExpressionAdapter\nExpressionUI\nFlagOptions\nGetAllAdapter\nGetByAuthorAdapter\nHolochainLanguageDelegate\nInitializeArgs\nInstanceQueryParams\nInteraction\nLanguage\nLanguageAdapter\nLanguageContext\nLinkSyncAdapter\nModelMetadata\nModelOptionsOptions\nPropertyMetadata\nPropertyOptions\nPublicSharing\nReadOnlyLanguage\nSettingsUI\nSignaturesService\nTelepresenceAdapter","type-aliases#Type Aliases":"Ad4mSignalCB\nAddress\nAgentAppsUpdatedCallback\nAgentStatusChangedCallback\nAgentUpdatedCallback\nAllInstancesResult\nDID\nLinkStatus\nMessageCallback\nPaginationResult\nPerspectiveDiffObserver\nQuery\nResultsWithTotalCount\nStatusCallback\nSyncStateChangeObserver\nTelepresenceSignalCallback","variables#Variables":"SMART_LITERAL_CONTENT_PREDICATE\ntypeDefsString","decorators-functions#Decorators Functions":"Collection\nFlag\nInstanceQuery\nModelOptions\nOptional\nProperty\nReadOnly","other-functions#Other Functions":"ExpressionGeneric\nExpressionGenericInput\naddLink\ncapSentence\nexprRef2String\nformatList\nhasLink\nisExpression\nisLink\nlinkEqual\nmakeRandomPrologAtom\nparseExprUrl","type-aliases-1#Type Aliases":"","ad4msignalcb#Ad4mSignalCB":"Ƭ Ad4mSignalCB: (signal: any) => void","type-declaration#Type declaration":"▸ (signal): void","parameters#Parameters":"Name\tType\tsignal\tany","returns#Returns":"void","defined-in#Defined in":"language/LanguageContext.ts:37","address#Address":"Ƭ Address: string","defined-in-1#Defined in":"Address.ts:1","agentappsupdatedcallback#AgentAppsUpdatedCallback":"Ƭ AgentAppsUpdatedCallback: () => null","type-declaration-1#Type declaration":"▸ (): null","returns-1#Returns":"null","defined-in-2#Defined in":"agent/AgentClient.ts:81","agentstatuschangedcallback#AgentStatusChangedCallback":"Ƭ AgentStatusChangedCallback: (agent: Agent) => null","type-declaration-2#Type declaration":"▸ (agent): null","parameters-1#Parameters":"Name\tType\tagent\tAgent","returns-2#Returns":"null","defined-in-3#Defined in":"agent/AgentClient.ts:80","agentupdatedcallback#AgentUpdatedCallback":"Ƭ AgentUpdatedCallback: (agent: Agent) => null","type-declaration-3#Type declaration":"▸ (agent): null","parameters-2#Parameters":"Name\tType\tagent\tAgent","returns-3#Returns":"null","defined-in-4#Defined in":"agent/AgentClient.ts:79","allinstancesresult#AllInstancesResult":"Ƭ AllInstancesResult: Object","type-declaration-4#Type declaration":"Name\tType\tAllInstances\tAd4mModel[]\tTotalCount?\tnumber\tisInit?\tboolean","defined-in-5#Defined in":"model/Ad4mModel.ts:71","did#DID":"Ƭ DID: string","defined-in-6#Defined in":"DID.ts:1","linkstatus#LinkStatus":"Ƭ LinkStatus: \"shared\" | \"local\"","defined-in-7#Defined in":"perspectives/PerspectiveProxy.ts:321","messagecallback#MessageCallback":"Ƭ MessageCallback: (message: PerspectiveExpression) => void","type-declaration-5#Type declaration":"▸ (message): void","parameters-3#Parameters":"Name\tType\tmessage\tPerspectiveExpression","returns-4#Returns":"void","defined-in-8#Defined in":"language/Language.ts:192","paginationresult#PaginationResult":"Ƭ PaginationResult: Object","type-parameters#Type parameters":"Name\tT","type-declaration-6#Type declaration":"Name\tType\tpageNumber\tnumber\tpageSize\tnumber\tresults\tT[]\ttotalCount?\tnumber","defined-in-9#Defined in":"model/Ad4mModel.ts:73","perspectivediffobserver#PerspectiveDiffObserver":"Ƭ PerspectiveDiffObserver: (diff: PerspectiveDiff) => void","type-declaration-7#Type declaration":"▸ (diff): void","parameters-4#Parameters":"Name\tType\tdiff\tPerspectiveDiff","returns-5#Returns":"void","defined-in-10#Defined in":"language/Language.ts:151","query#Query":"Ƭ Query: Object","type-declaration-8#Type declaration":"Name\tType\tcollections?\tstring[]\tcount?\tboolean\tlimit?\tnumber\toffset?\tnumber\torder?\tOrder\tproperties?\tstring[]\tsource?\tstring\twhere?\tWhere","defined-in-11#Defined in":"model/Ad4mModel.ts:60","resultswithtotalcount#ResultsWithTotalCount":"Ƭ ResultsWithTotalCount: Object","type-parameters-1#Type parameters":"Name\tT","type-declaration-9#Type declaration":"Name\tType\tresults\tT[]\ttotalCount?\tnumber","defined-in-12#Defined in":"model/Ad4mModel.ts:72","statuscallback#StatusCallback":"Ƭ StatusCallback: (caller: DID) => Perspective","type-declaration-10#Type declaration":"▸ (caller): Perspective","parameters-5#Parameters":"Name\tType\tcaller\tDID","returns-6#Returns":"Perspective","defined-in-13#Defined in":"language/Language.ts:193","syncstatechangeobserver#SyncStateChangeObserver":"Ƭ SyncStateChangeObserver: (state: PerspectiveState) => void","type-declaration-11#Type declaration":"▸ (state): void","parameters-6#Parameters":"Name\tType\tstate\tPerspectiveState","returns-7#Returns":"void","defined-in-14#Defined in":"language/Language.ts:152","telepresencesignalcallback#TelepresenceSignalCallback":"Ƭ TelepresenceSignalCallback: (payload: PerspectiveExpression) => void","type-declaration-12#Type declaration":"▸ (payload): void","parameters-7#Parameters":"Name\tType\tpayload\tPerspectiveExpression","returns-8#Returns":"void","defined-in-15#Defined in":"language/Language.ts:258","variables-1#Variables":"","smart_literal_content_predicate#SMART_LITERAL_CONTENT_PREDICATE":"• Const SMART_LITERAL_CONTENT_PREDICATE: \"smart_literal://content\"","defined-in-16#Defined in":"SmartLiteral.ts:6","typedefsstring#typeDefsString":"• Const typeDefsString: \"\"","defined-in-17#Defined in":"typeDefs.ts:6","decorators-functions-1#Decorators Functions":"","collection#Collection":"▸ Collection(opts): (target: T, key: keyof T) => voidDecorator for defining collections on model classes.","parameters-8#Parameters":"Name\tType\tDescription\topts\tCollectionOptions\tCollection configuration","returns-9#Returns":"fn▸ (target, key): void","type-parameters-2#Type parameters":"Name\tT","parameters-9#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-10#Returns":"voidDescriptionDefines a property that represents a collection of values linked to the model instance.\nCollections are always arrays and support operations for adding, removing, and setting values.For each collection property, the following methods are automatically generated:\naddX(value) - Add a value to the collection\nremoveX(value) - Remove a value from the collection\nsetCollectionX(values) - Replace all values in the collection\nWhere X is the capitalized property name.Collections can be filtered using the where option to only include values that:\nAre instances of a specific model class\nMatch a custom Prolog condition\nExample\nclass Recipe extends Ad4mModel {\n // Basic collection of ingredients\n @Collection({ \n through: \"recipe://ingredient\" \n })\n ingredients: string[] = [];\n // Collection that only includes instances of another model\n @Collection({\n through: \"recipe://comment\",\n where: { isInstance: Comment }\n })\n comments: string[] = [];\n // Collection with custom filter condition\n @Collection({\n through: \"recipe://step\",\n where: { condition: `triple(Target, \"step://order\", Order), Order < 3` }\n })\n firstSteps: string[] = [];\n // Local-only collection not shared with network\n @Collection({\n through: \"recipe://note\",\n local: true\n })\n privateNotes: string[] = [];\n}\n// Using the generated methods:\nconst recipe = new Recipe(perspective);\nawait recipe.addIngredients(\"ingredient://flour\");\nawait recipe.removeIngredients(\"ingredient://sugar\");\nawait recipe.setCollectionIngredients([\"ingredient://butter\", \"ingredient://eggs\"]);","defined-in-18#Defined in":"model/decorators.ts:459","flag#Flag":"▸ Flag(opts): (target: T, key: keyof T) => voidDecorator for defining flags on model classes.","parameters-10#Parameters":"Name\tType\tDescription\topts\tFlagOptions\tFlag configuration","returns-11#Returns":"fn▸ (target, key): void","type-parameters-3#Type parameters":"Name\tT","parameters-11#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-12#Returns":"voidDescriptionA specialized property decorator for defining immutable type flags or markers on model instances.\nFlags are always required properties with a fixed value that cannot be changed after creation.Common uses for flags:\nType discrimination between different kinds of models\nMarking models with specific capabilities or features\nVersioning or compatibility markers\nNote: Use of Flag is discouraged unless you specifically need type-based filtering or\ndiscrimination between different kinds of models. For most cases, regular properties\nwithPropertyorOptionalare more appropriate.Example\nclass Message extends Ad4mModel {\n // Type flag to identify message models\n @Flag({\n through: \"ad4m://type\",\n value: \"ad4m://message\"\n })\n type: string = \"\";\n // Version flag for compatibility\n @Flag({\n through: \"ad4m://version\",\n value: \"1.0.0\"\n })\n version: string = \"\";\n // Feature flag\n @Flag({\n through: \"message://feature\",\n value: \"message://encrypted\"\n })\n feature: string = \"\";\n}\n// Later you can query for specific types:\nconst messages = await Message.query(perspective)\n .where({ type: \"ad4m://message\" })\n .run();","defined-in-19#Defined in":"model/decorators.ts:341","instancequery#InstanceQuery":"▸ InstanceQuery(options?): (target: T, key: keyof T, descriptor: PropertyDescriptor) => voidDecorator for querying instances of a model class.","parameters-12#Parameters":"Name\tType\tDescription\toptions?\tInstanceQueryParams\tQuery options","returns-13#Returns":"fn▸ (target, key, descriptor): void","type-parameters-4#Type parameters":"Name\tT","parameters-13#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T\tdescriptor\tPropertyDescriptor","returns-14#Returns":"voidDescriptionAllows you to define static query methods on your model class to retrieve instances based on custom conditions.\nThis decorator can only be applied to static async methods that return a Promise of an array of model instances.The query can be constrained using either:\nA where clause that matches property values\nA custom Prolog condition for more complex queries\nExample\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\" })\n name: string = \"\";\n @Property({ through: \"recipe://rating\" })\n rating: number = 0;\n // Get all recipes\n @InstanceQuery()\n static async all(perspective: PerspectiveProxy): Promise { return [] }\n // Get recipes by name\n @InstanceQuery({ where: { name: \"Chocolate Cake\" }})\n static async findByName(perspective: PerspectiveProxy): Promise { return [] }\n // Get highly rated recipes using a custom condition\n @InstanceQuery({ condition: \"triple(Instance, 'recipe://rating', Rating), Rating > 4\" })\n static async topRated(perspective: PerspectiveProxy): Promise { return [] }\n}","defined-in-20#Defined in":"model/decorators.ts:77","modeloptions#ModelOptions":"▸ ModelOptions(opts): (target: any) => voidDecorator for defining model classes in AD4M.","parameters-14#Parameters":"Name\tType\tDescription\topts\tModelOptionsOptions\tModel configuration","returns-15#Returns":"fn▸ (target): void","parameters-15#Parameters":"Name\tType\ttarget\tany","returns-16#Returns":"voidDescriptionThe root decorator that must be applied to any class that represents a model in AD4M.\nIt registers the class as a Social DNA (SDNA) subject class and provides the infrastructure\nfor storing and retrieving instances.This decorator:\nRegisters the class with a unique name in the AD4M system\nGenerates the necessary SDNA code for the model's properties and collections\nEnables the use of other model decorators (@Property, @Collection, etc.)\nProvides static query methods through the Ad4mModel base class\nExample\n@ModelOptions({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n @Collection({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n // Static query methods from Ad4mModel:\n static async findByName(perspective: PerspectiveProxy, name: string) {\n return Recipe.query(perspective)\n .where({ name })\n .run();\n }\n}\n// Using the model:\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nawait recipe.save();\n// Querying instances:\nconst recipes = await Recipe.query(perspective)\n .where({ name: \"Chocolate Cake\" })\n .run();\n// Using with PerspectiveProxy:\nawait perspective.ensureSDNASubjectClass(Recipe);","defined-in-21#Defined in":"model/decorators.ts:544","optional#Optional":"▸ Optional(opts): (target: T, key: keyof T) => voidDecorator for defining optional properties on model classes.","parameters-16#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration options","returns-17#Returns":"fn▸ (target, key): void","type-parameters-5#Type parameters":"Name\tT","parameters-17#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-18#Returns":"voidDescriptionThe most flexible property decorator that allows you to define properties with full control over:\nWhether the property is required\nWhether the property is writable\nHow values are stored and retrieved\nCustom getter/setter logic\nLocal vs network storage\nBothPropertyandRead Onlyare specialized versions ofOptionalwith preset configurations.Example\nclass Recipe extends Ad4mModel {\n // Basic optional property\n @Optional({\n through: \"recipe://description\"\n })\n description?: string;\n // Optional property with custom initial value\n @Optional({\n through: \"recipe://status\",\n initial: \"recipe://draft\",\n required: true\n })\n status: string = \"\";\n // Read-only property with custom getter\n @Optional({\n through: \"recipe://rating\",\n writable: false,\n getter: `\n findall(Rating, triple(Base, \"recipe://user_rating\", Rating), Ratings),\n sum_list(Ratings, Sum),\n length(Ratings, Count),\n Value is Sum / Count\n `\n })\n averageRating: number = 0;\n // Property that resolves to a Literal and is stored locally\n @Optional({\n through: \"recipe://notes\",\n resolveLanguage: \"literal\",\n local: true\n })\n notes?: string;\n // Property with custom getter and setter logic\n @Optional({\n through: \"recipe://ingredients\",\n getter: `\n triple(Base, \"recipe://ingredients\", RawValue),\n atom_json_term(RawValue, Value)\n `,\n setter: `\n atom_json_term(Value, JsonValue),\n Actions = [{\"action\": \"setSingleTarget\", \"source\": \"this\", \"predicate\": \"recipe://ingredients\", \"target\": JsonValue}]\n `\n })\n ingredients: string[] = [];\n}","defined-in-22#Defined in":"model/decorators.ts:249","property#Property":"▸ Property(opts): (target: T, key: keyof T) => voidDecorator for defining required and writable properties on model classes.","parameters-18#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration","returns-19#Returns":"fn▸ (target, key): void","type-parameters-6#Type parameters":"Name\tT","parameters-19#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-20#Returns":"voidDescriptionA convenience decorator that defines a required property that must have an initial value and is writable by default.\nThis is equivalent to usingOptionalwith required: true and writable: true.Properties defined with this decorator:\nMust have a value (required)\nCan be modified after creation (writable)\nDefault to \"literal://string:uninitialized\" if no initial value is provided\nExample\nclass User extends Ad4mModel {\n // Basic required property with default initial value\n @Property({\n through: \"user://name\"\n })\n name: string = \"\";\n // Required property with custom initial value\n @Property({\n through: \"user://status\",\n initial: \"user://active\"\n })\n status: string = \"\";\n // Required property with literal resolution\n @Property({\n through: \"user://bio\",\n resolveLanguage: \"literal\"\n })\n bio: string = \"\";\n // Required property with custom getter/setter\n @Property({\n through: \"user://age\",\n getter: `triple(Base, \"user://birthYear\", Year), Value is 2024 - Year`,\n setter: `Year is 2024 - Value, Actions = [{\"action\": \"setSingleTarget\", \"source\": \"this\", \"predicate\": \"user://birthYear\", \"target\": Year}]`\n })\n age: number = 0;\n}","defined-in-23#Defined in":"model/decorators.ts:776","readonly#ReadOnly":"▸ ReadOnly(opts): (target: T, key: keyof T) => voidDecorator for defining read-only properties on model classes.","parameters-20#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration","returns-21#Returns":"fn▸ (target, key): void","type-parameters-7#Type parameters":"Name\tT","parameters-21#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-22#Returns":"voidDescriptionA convenience decorator that defines a property that can only be read and cannot be modified after initialization.\nThis is equivalent to usingOptionalwith writable: false.Read-only properties are ideal for:\nComputed or derived values\nProperties that should never change after creation\nProperties that are set by the system\nProperties that represent immutable data\nExample\nclass Post extends Ad4mModel {\n // Read-only property with custom getter for computed value\n @ReadOnly({\n through: \"post://likes\",\n getter: `findall(User, triple(Base, \"post://liked_by\", User), Users), length(Users, Value)`\n })\n likeCount: number = 0;\n // Read-only property for creation timestamp\n @ReadOnly({\n through: \"post://created_at\",\n initial: new Date().toISOString()\n })\n createdAt: string = \"\";\n // Read-only property that resolves to a Literal\n @ReadOnly({\n through: \"post://author\",\n resolveLanguage: \"literal\"\n })\n author: string = \"\";\n // Read-only property for system-managed data\n @ReadOnly({\n through: \"post://version\",\n initial: \"1.0.0\"\n })\n version: string = \"\";\n}","defined-in-24#Defined in":"model/decorators.ts:840","other-functions-1#Other Functions":"","expressiongeneric#ExpressionGeneric":"▸ ExpressionGeneric(DataTypeClass): any","type-parameters-8#Type parameters":"Name\tDataType","parameters-22#Parameters":"Name\tType\tDataTypeClass\tClassType","returns-23#Returns":"any","defined-in-25#Defined in":"expression/Expression.ts:42","expressiongenericinput#ExpressionGenericInput":"▸ ExpressionGenericInput(DataTypeClass): any","type-parameters-9#Type parameters":"Name\tDataType","parameters-23#Parameters":"Name\tType\tDataTypeClass\tClassType","returns-24#Returns":"any","defined-in-26#Defined in":"expression/Expression.ts:67","addlink#addLink":"▸ addLink(source, predicate, target): PerspectiveAction","parameters-24#Parameters":"Name\tType\tsource\tstring\tpredicate\tstring\ttarget\tstring","returns-25#Returns":"PerspectiveAction","defined-in-27#Defined in":"model/decorators.ts:12","capsentence#capSentence":"▸ capSentence(cap): string","parameters-25#Parameters":"Name\tType\tcap\tany","returns-26#Returns":"string","defined-in-28#Defined in":"utils.ts:15","exprref2string#exprRef2String":"▸ exprRef2String(ref): string","parameters-26#Parameters":"Name\tType\tref\tExpressionRef","returns-27#Returns":"string","defined-in-29#Defined in":"expression/ExpressionRef.ts:22","formatlist#formatList":"▸ formatList(list): any","parameters-27#Parameters":"Name\tType\tlist\tany","returns-28#Returns":"any","defined-in-30#Defined in":"utils.ts:1","haslink#hasLink":"▸ hasLink(predicate): string","parameters-28#Parameters":"Name\tType\tpredicate\tstring","returns-29#Returns":"string","defined-in-31#Defined in":"model/decorators.ts:21","isexpression#isExpression":"▸ isExpression(e): boolean","parameters-29#Parameters":"Name\tType\te\tany","returns-30#Returns":"boolean","defined-in-32#Defined in":"expression/Expression.ts:97","islink#isLink":"▸ isLink(l): boolean","parameters-30#Parameters":"Name\tType\tl\tany","returns-31#Returns":"boolean","defined-in-33#Defined in":"links/Links.ts:91","linkequal#linkEqual":"▸ linkEqual(l1, l2): boolean","parameters-31#Parameters":"Name\tType\tl1\tLinkExpression\tl2\tLinkExpression","returns-32#Returns":"boolean","defined-in-34#Defined in":"links/Links.ts:83","makerandomprologatom#makeRandomPrologAtom":"▸ makeRandomPrologAtom(length): string","parameters-32#Parameters":"Name\tType\tlength\tnumber","returns-33#Returns":"string","defined-in-35#Defined in":"model/decorators.ts:473","parseexprurl#parseExprUrl":"▸ parseExprUrl(url): ExpressionRef","parameters-33#Parameters":"Name\tType\turl\tstring","returns-34#Returns":"ExpressionRef","defined-in-36#Defined in":"expression/ExpressionRef.ts:29"}},"/perspectives":{"title":"Perspectives: Agent-Centric Knowledge Graphs","data":{"understanding-perspectives#Understanding Perspectives":"Perspectives are semantic knowledge graphs inspired by the Semantic Web and Linked Data principles, but reimagined through an agent-centric lens. While traditional RDF graphs and Solid PODs are designed around data ownership, Perspectives emphasize that all knowledge is inherently subjective and tied to the agent who claims it.","objective-vs-subjective-data#Objective vs. Subjective Data":"In AD4M, we distinguish between two types of data:\nObjective Data (Expressions):\nStored in Languages\nSame content for any agent requesting a given URL\nCryptographically signed by their author\nExample: A post stored at QmSocial123://post789\nSubjective Data (Perspectives):\nPersonal associations between Expressions\nOwned by a specific agent\nRepresent that agent's view of relationships\nExample: Agent Alice linking a post as \"important\" or \"related-to\" another post","links-agent-centric-triples#Links: Agent-Centric Triples":"Perspectives consist of Links – our agent-centric version of RDF triples. Each Link connects three URIs:\ninterface Link {\n source: string; // Subject Expression URL\n predicate: string; // Predicate Expression URL\n target: string; // Object Expression URL\n}\nThese Links are stored as LinkExpressions – special Expressions where the data field contains a Link:\n{\n author: \"did:key:z6Mk...\", // Who made this association\n timestamp: \"2023-06-21...\",\n data: {\n source: \"QmSocial123://post789\",\n predicate: \"sioc://likes\",\n target: \"did:key:z6Mk...\"\n },\n proof: { ... } // Cryptographic proof of the claim\n}","subjective-overlays#Subjective Overlays":"Perspectives act as subjective overlays on the objective Expression layer:\nEvery node in the graph must be a URI pointing to an Expression\nThe same Expressions can appear in many Perspectives with different relationships\nEach agent can maintain multiple Perspectives for different contexts\nLinks in a Perspective represent an agent's claims about relationships\nFor example:\nAgent Alice's Perspective:\nPost1 --likes--> Post2\nPost2 --related-to--> Post3\nAgent Bob's Perspective:\nPost1 --disagrees-with--> Post2\nPost2 --authored-by--> Carol","storage-and-sharing#Storage and Sharing":"Perspectives are stored locally in your AD4M instance's database, but can be shared in several ways:\nSnapshots:\nExport a Perspective as an Expression\nContains a JSON rendering of all Links\nUseful for point-in-time sharing\nNeighbourhoods:\nCollaborative spaces where multiple agents share and sync Perspectives\nReal-time updates and p2p synchronization\nSee Neighbourhoods for more details","future-standards-integration#Future Standards Integration":"While AD4M currently uses its own formats to accommodate agent-centric features, we plan to implement W3C, RDF, and Solid compatibility:\nEvery Perspective will be accessible as a Solid POD\nLinks will be expressible as RDF triples\nStandard SPARQL queries will be supported","working-with-perspectives#Working with Perspectives":"The PerspectiveProxy class provides a rich interface for working with Perspectives:\n// Create a new Perspective\nconst perspective = await ad4m.perspective.add(\"My Knowledge Graph\");\n// Add a Link\nawait perspective.add({\n source: \"QmSocial123://post789\",\n predicate: \"sioc://likes\",\n target: \"did:key:z6Mk...\"\n});\n// Query Links\nconst links = await perspective.get({\n source: \"QmSocial123://post789\"\n});","surrealdb-integration-recommended#SurrealDB Integration (Recommended)":"Every Perspective includes a high-performance SurrealDB query engine that provides 10-100x faster performance than traditional Prolog queries. SurrealDB is the recommended query method for most use cases:\n// Direct SurrealQL query - fast and powerful\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Graph traversal using indexed fields (in.uri = source, out.uri = target)\nconst aliceFollows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find who follows Alice (reverse traversal)\nconst aliceFollowers = await perspective.querySurrealDB(\n \"SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Aggregations and analytics\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\nPerformance Note: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they can be very slow.Security Note: querySurrealDB() only allows read-only operations (SELECT, RETURN, etc.). Use perspective.add() and perspective.remove() to modify links.For comprehensive examples and graph traversal patterns, see the SurrealDB Queries Guide.","prolog-integration-legacy#Prolog Integration (Legacy)":"Perspectives also include a Prolog engine for backward compatibility and advanced logic programming:\n// Basic Prolog query\nconst results = await perspective.queryProlog(\n 'triple(Post, \"sioc://likes\", Agent), triple(Agent, \"foaf://knows\", \"did:key:z6Mk...\")'\n);\n// Finds posts liked by agents who know a specific person\n// Real-time query subscription\nconst subscription = await perspective.subscribeInfer(\n 'triple(Post, \"sioc://status\", \"active\"), triple(Post, \"sioc://author\", Author)'\n);\n// Set up callback for updates\nsubscription.onResult(results => {\n console.log(\"Active posts and their authors:\", results);\n});\n// Important: Clean up subscription when done\nsubscription.dispose();\nQuery subscriptions provide real-time updates but require proper cleanup:\nInitialization: When you create a subscription, it waits for the first result before becoming active\nKeepalive: The subscription stays active through periodic keepalive signals\nUpdates: Receive real-time updates through your callback as the data changes\nCleanup: Call dispose() when done to:\nStop keepalive signals\nUnsubscribe from updates\nNotify the backend to clean up resources\nPrevent memory leaks\nAlways remember to call dispose() when you're done with a subscription.Recommendation: Use SurrealDB for most queries (faster), and reserve Prolog for complex logic programming or custom SDNA rules.","advanced-data-modeling#Advanced Data Modeling":"AD4M provides a sophisticated data modeling system built on top of the Prolog integration. This allows you to:\nDefine TypeScript classes that map to semantic structures\nUse decorators to specify relationships\nQuery with type safety and IDE support\nFor details on this powerful feature, see our guide on Model Classes.","basic-usage-examples#Basic Usage Examples":"Creating a Perspective:\nconst myNotes = ad4m.perspective.add(\"My private notes\");\nThe returning object will be an instance of PerspectiveProxy\n– which essentially will work as your database instance.Adding a Link:\nconst link = {\n subject: \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n predicate: \"sioc://likes\",\n target: \"literal://ad4m\",\n};\nmyNotes.add(link);\nQuery Links:\nconst allLinks = await myNotes.get(\n new LinkQuery({ predicate: \"sioc://likes\" })\n);\nWhat you get back will be an array of LinkExpressions:\n[\n {\n \"author\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"timestamp\": \"2023-06-21T14:47:48.935Z\",\n \"data\": {\n \"subject\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"predicate\": \"sioc://likes\",\n \"target\": \"literal://ad4m\"\n },\n \"proof\": {\n \"key\": \"#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n \"signature\": \"xxxx\"\n }\n }\n]\nEven though this Perspective is not shared (yet) but just our private, local\ngraph database, we might want to share it as Neighbourhood."}},"/tutorial/2-neighbourhood-publish":{"title":"Publish Perspective as Neighbourhood","data":{"":"The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing\nand thus synchronizing of links (see LinksAdapter).\nWhile there can and will be many different implementations\nwith different trade-offs and features (like membranes etc.),\nthere currently is one fully implemented and Holochain based LinkLanguage with the name Perspective Diff Sync.It is deployed on the current test network (Language Language v0.0.15, included in current network seed) under the address:\nQmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8.","creating-our-unique-linklanguage-clone-through-templating#Creating our unique LinkLanguage clone through templating":"But we should not just use this publicly known Language as the back-bone for our new Neighbourhood,\nif we don't want to have everybody following this guide end up in the same network.So what we want is to use this existing Language as a template and create a new copy with the same code\nbut different UUID and/name in order to create a fresh space for our new Neighbourhood.What parameters can we adjust when using it as template?\nLet's have a look at the Language's meta information:\nconst socialContextMeta = await ad4m.languages.meta(\n \"QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8\"\n);\nconsole.log(socialContextMeta);\nWhich should yield something like this:\n {\n name: 'Perspective Diff Sync',\n address: 'QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8',\n description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',\n author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',\n templated: false,\n templateSourceLanguageAddress: null,\n templateAppliedParams: null,\n possibleTemplateParams: [ 'uuid', 'name', 'description' ],\n sourceCodeLink: 'https://github.com/perspect3vism/perspective-diff-sync'\n}\nThe field possibleTemplateParams tells us that we can set a UUID and override name and description.\nLet's leave description but change the name.\nThe function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:\nconst uniqueLinkLanguage = await ad4m.languages.applyTemplateAndPublish(\n \"QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8\",\n JSON.stringify({\n uuid: \"84a329-77384c-1510fb\",\n name: \"Perspective Diff Sync clone for demo Neighbourhood\",\n })\n);\nThis function call has done a lot for us:\nIt took the source language (first parameter) and made sure we got the code,\ni.e. potentially downloading it from the Language of Languages.\nThe provided template parameters have been applied. In the case of a Language using Holochain, it has unpacked the Holochain DNA, changed the DNA variables according to the values given as template parameters and packed the DNA again (not touching the WASM code)\nThe resulting Language was published with meta information showing that it was templated, providing the source hash and template parameters.\nSo the new templated Language is ready to be used.","creating-the-neighbourhood#Creating the Neighbourhood":"With that new LinkLanguage, actually creating the Neighbourhood is simple.\nWe just have to provide the id of the perspective we want to upgrade to a\nNeighbourhood and the address of the LinkLanguage used for that:\nconst meta = new Perspective();\nconst neighbourhoodUrl = await ad4m.neighbourhood.publishFromPerspective(\n myPerspective.uuid,\n uniqueLinkLanguage.address,\n meta\n);\nconsole.log(neighbourhoodUrl); // => neighbourhood://Qm123456789abcdef\nThe meta field a (static/snapshotted) Perspective that is immutably stored with\nthe Neighbourhood. It can hold arbitrary/semantic meta information about the\nNeighbourhood but can technically stay empty, just like we did here."}},"/social-dna":{"title":"Social DNA: Making Social Interaction Patterns Explicit","data":{"what-is-social-dna#What is Social DNA?":"Social DNA represents the core interaction patterns and social contracts within a digital space. Just as biological DNA encodes the rules for how cells interact and function, Social DNA encodes the rules for how agents (users) interact and collaborate in a digital space.Think of it as the \"business logic\" of social applications, but with a crucial difference: instead of being buried in application code, these patterns are made explicit and separated from both:\nThe storage layer (Languages) - how data is actually stored and shared\nThe UI layer - how these interactions are presented to users","why-social-dna#Why \"Social DNA\"?":"In traditional applications, social interaction patterns are often:\nImplicit in the application code\nTied to specific storage implementations\nMixed with UI concerns\nHard to modify or extend\nNot portable between applications\nSocial DNA makes these patterns:\nExplicit and declarative\nIndependent of storage details\nSeparated from UI concerns\nEasy to modify and extend\nPortable between applications","example-a-simple-social-space#Example: A Simple Social Space":"Let's look at a common social interaction pattern: posting and liking content. In a traditional app, this might be scattered across:\nDatabase schemas\nAPI endpoints\nUI components\nBusiness logic\nWith Social DNA, we can express this as a clear social contract:\n// Define what a \"post\" means in this space\nconst postClass = {\n properties: {\n content: \"string\",\n author: \"did\",\n timestamp: \"datetime\"\n },\n actions: {\n like: \"any agent can like a post once\",\n comment: \"any agent can comment on a post\",\n edit: \"only the author can edit their post\"\n }\n}\n// Define what \"trending\" means in this space\nconst trendingRule = {\n condition: \"post has more than 5 likes in last 24 hours\",\n action: \"mark post as trending\"\n}\nThis is just pseudo-code, but it illustrates how Social DNA makes interaction patterns explicit and declarative.","how-social-dna-works#How Social DNA Works":"AD4M implements Social DNA through two main mechanisms:\nSubject Classes: Define what things mean in a space\nGraph patterns that represent specific types of data\nProperties and relationships between data\nValidation rules for data integrity\nFlows: Define what agents can do in a space\nPreconditions for actions\nState transitions\nEffects of actions\nBoth are implemented using Prolog, a logical programming language perfect for:\nPattern matching in graphs\nDeclarative rules\nComplex reasoning\nDon't worry if you are unfamiliar with Prolog. You will normally either\nuse AI to write it for you, or you will use some of our abstraction layers to\navoid writing Prolog code yourself. (Think of ORMs vs raw SQL, AD4m comes with its own implementation Model Classes).","subject-classes-defining-things#Subject Classes: Defining Things":"","understanding-subject-classes#Understanding Subject Classes":"The term \"Subject Class\" was deliberately chosen to emphasize the subjective nature of pattern recognition in semantic graphs. Unlike traditional object-oriented programming where classes define objective structures, Subject Classes represent subjective interpretations of graph patterns – different ways of \"seeing\" meaning in the connections between expressions.","subjective-pattern-recognition#Subjective Pattern Recognition":"Think of a Subject Class as a lens through which an application views and interprets graph patterns:\nDifferent apps can have different \"opinions\" about what constitutes a meaningful pattern\nThe same base expression can be interpreted through multiple Subject Classes\nEach Subject Class defines what properties and relationships are important to its perspective\nFor example, consider a base expression representing some content:\nexpression://xyz123\nDifferent applications might interpret this through different Subject Classes:\nA chat app might see it as a \"Message\" with replies and reactions\nA task app might see it as a \"Todo\" with state and assignments\nA social app might see it as a \"Post\" with likes and shares\nA wiki might see it as a \"Document\" with citations and revisions\nEach of these interpretations is equally valid – they're just different subjective lenses on the same underlying graph structure.","subject-oriented-programming#Subject-Oriented Programming":"This approach is inspired by subject-oriented programming, where:\nBehavior and structure are separated from the base objects\nDifferent subjects can have different views of the same object\nMultiple interpretations can coexist without conflict\nNew interpretations can be added without modifying existing ones\nIn AD4M, this means:\nSubject Classes define patterns around base expressions\nMultiple Subject Classes can match the same expression\nNew Subject Classes can be added without changing existing ones\nApplications can choose which patterns matter to them","base-expressions-and-graph-patterns#Base Expressions and Graph Patterns":"Every Subject Class instance is anchored to a base expression, but its properties and relationships are defined by patterns in the surrounding graph:\nBase Expression: expression://xyz123\n │\n ┌───────────────┬──┴──┬───────────────┐\n │ │ │ │\n state author title comments\n │ │ │ │\n \"done\" did:123 \"Hi\" [expr1, expr2]\nDifferent Subject Classes might look for different patterns around this same base:\n// A Todo class looks for state and assignments\nclass Todo {\n state: string; // Looks for todo://state links\n assignee: string; // Looks for todo://assigned-to links\n}\n// A Post class looks for social interactions\nclass Post {\n likes: string[]; // Looks for social://like links\n comments: string[]; // Looks for social://comment links\n}\n// Both can exist simultaneously on the same base expression\nconst todo = await perspective.getSubjectProxy(baseExpr, \"Todo\");\nconst post = await perspective.getSubjectProxy(baseExpr, \"Post\");\nHere's a complete example of a Todo class:\n// Define a Todo class\nsubject_class(\"Todo\", c).\n// Constructor - called when creating new instances\nconstructor(c, '[{\n action: \"addLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://ready\"\n}]').\n// Instance check - what makes something a Todo?\ninstance(c, Base) :- triple(Base, \"todo://state\", _).\n// Properties\nproperty(c, \"state\").\nproperty_getter(c, Base, \"state\", Value) :- \n triple(Base, \"todo://state\", Value).\nproperty_setter(c, \"state\", '[{\n action: \"setSingleTarget\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"value\"\n}]').\n// Resolvable properties (e.g., literal values)\nproperty(c, \"title\").\nproperty_resolve(c, \"title\").\nproperty_resolve_language(c, \"title\", \"literal\").\nproperty_getter(c, Base, \"title\", Value) :- \n triple(Base, \"todo://has_title\", Value).\n// Computed properties\nproperty(c, \"isLiked\").\nproperty_getter(c, Base, \"isLiked\", Value) :- \n triple(Base, \"flux://has_reaction\", \"flux://thumbsup\"), \n Value = true.\n// Collections\ncollection(c, \"comments\").\ncollection_getter(c, Base, \"comments\", List) :- \n findall(C, triple(Base, \"todo://comment\", C), List).\ncollection_adder(c, \"comments\", '[{\n action: \"addLink\", \n source: \"this\", \n predicate: \"todo://comment\", \n target: \"value\"\n}]').\nThis defines:\nWhat makes something a Todo\nWhat properties it has\nHow to get and set those properties\nWhat collections it contains","using-subject-classes-in-code#Using Subject Classes in Code":"While the PerspectiveProxy provides low-level methods for working with Subject Classes,\nwe strongly recommend using our high-level Ad4mModel system\n(described in detail in the Model Classes guide).\nThis TypeScript-based approach provides:\nAutomatic Prolog code generation from decorated classes\nType safety and IDE support\nRich ActiveRecord-style semantics\nClean, declarative syntax\nHere's how to define and use Subject Classes the recommended way:\nimport { Ad4mModel, ModelOptions, Property, Optional, Collection } from '@coasys/ad4m';\n@ModelOptions({ name: \"Todo\" })\nclass Todo extends Ad4mModel {\n @Property({\n through: \"todo://state\",\n initial: \"todo://ready\"\n })\n state: string = \"\";\n @Optional({\n through: \"todo://has_title\",\n writable: true,\n resolveLanguage: \"literal\"\n })\n title?: string;\n @ReadOnly({\n through: \"flux://has_reaction\",\n getter: `triple(Base, \"flux://has_reaction\", \"flux://thumbsup\"), Value = true`\n })\n isLiked: boolean = false;\n @Collection({ \n through: \"todo://comment\"\n })\n comments: string[] = [];\n // Static query methods\n @InstanceQuery()\n static async all(perspective: PerspectiveProxy): Promise { return [] }\n @InstanceQuery({ where: { state: \"todo://done\" }})\n static async allDone(perspective: PerspectiveProxy): Promise { return [] }\n}\n// Use it with full type safety and ActiveRecord patterns\nconst todo = new Todo(perspective);\ntodo.state = \"todo://doing\";\nawait todo.save();\n// Query with type safety\nconst todos = await Todo.all(perspective);\nconst doneTodos = await Todo.allDone(perspective);\nThis approach automatically generates the Prolog code we saw earlier and provides a much richer development experience.","understanding-the-lower-level#Understanding the Lower Level":"For a complete understanding, here are the basic PerspectiveProxy methods that power the above abstractions:\n// Add the subject class definition to a perspective\nawait perspective.addSdna(\"Todo\", classDefinition, \"subject_class\");\n// List all available subject classes\nconst classes = await perspective.subjectClasses();\n// Returns: [\"Todo\"]\n// Create a new subject instance\nawait perspective.createSubject(\"Todo\", \"expression://123\");\n// Check if an expression is an instance of a class\nconst isTodo = await perspective.isSubjectInstance(\"expression://123\", \"Todo\");\n// Get subject data\nconst todoData = await perspective.getSubjectData(\"Todo\", \"expression://123\");\n// Remove a subject (runs destructor if defined)\nawait perspective.removeSubject(\"Todo\", \"expression://123\");\n// Get all instances of a class\nconst allTodos = await perspective.getAllSubjectInstances(\"Todo\");\n// Get a proxy object\nconst todo = await perspective.getSubjectProxy(\"expression://123\", \"Todo\");\nWhile these methods are available, we recommend using the Ad4mModel system for most use cases. It provides a more maintainable and type-safe way to work with Subject Classes while handling all the low-level details automatically.","flows-defining-actions#Flows: Defining Actions":"Flows define what agents can do in a space and under what conditions. Here's a complete example of a Todo flow that manages state transitions:\n// Register this flow with a name and reference (t)\nregister_sdna_flow(\"TODO\", t).\n// Define what expressions can enter this flow (all in this case)\nflowable(_, t).\n// Define the possible states (using numbers)\nflow_state(ExprAddr, 0, t) :- triple(ExprAddr, \"todo://state\", \"todo://ready\").\nflow_state(ExprAddr, 0.5, t) :- triple(ExprAddr, \"todo://state\", \"todo://doing\").\nflow_state(ExprAddr, 1, t) :- triple(ExprAddr, \"todo://state\", \"todo://done\").\n// Initial action when starting the flow\nstart_action('[{\n action: \"addLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://ready\"\n}]', t).\n// Define state transitions with actions\naction(0, \"Start\", 0.5, '[{\n action: \"addLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://doing\"\n}, {\n action: \"removeLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://ready\"\n}]').\naction(0.5, \"Finish\", 1, '[{\n action: \"addLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://done\"\n}, {\n action: \"removeLink\", \n source: \"this\", \n predicate: \"todo://state\", \n target: \"todo://doing\"\n}]').\nThis flow defines:\nA named flow (\"TODO\") with states (0 = ready, 0.5 = doing, 1 = done)\nWhat expressions can enter the flow (any expression)\nHow states are determined (by checking todo://state links)\nInitial action when starting the flow\nAvailable actions for each state with their transitions","using-flows-in-code#Using Flows in Code":"You can work with flows using these methods:\n// Get all flows defined in a perspective\nconst flows = await perspective.sdnaFlows();\n// Returns: [\"TODO\"]\n// Check what flows are available for an expression\nconst availableFlows = await perspective.availableFlows(\"expression://123\");\n// Returns flows that can be started on this expression\n// Start a flow on an expression\nawait perspective.startFlow(\"TODO\", \"expression://123\");\n// This runs the start_action, putting the expression in initial state\n// Get expressions in a specific flow state\nconst readyTodos = await perspective.expressionsInFlowState(\"TODO\", 0);\n// Returns expressions in the \"ready\" state\n// Get current state of an expression in a flow\nconst state = await perspective.flowState(\"TODO\", \"expression://123\");\n// Returns: 0, 0.5, or 1\n// Get available actions for current state\nconst actions = await perspective.flowActions(\"TODO\", \"expression://123\");\n// Returns: [\"Start\"] if in ready state\n// Execute an action\nawait perspective.runFlowAction(\"TODO\", \"expression://123\", \"Start\");\n// Transitions from ready (0) to doing (0.5)","adding-flows-to-a-perspective#Adding Flows to a Perspective":"To add a flow to your perspective:\n// Add the flow definition\nawait perspective.addSdna(\"Todo\", flowDefinition, \"flow\");\n// Check if it was added\nconst flows = await perspective.sdnaFlows();\nconsole.log(flows); // Should include \"TODO\"","query-engines-surrealdb--prolog#Query Engines: SurrealDB & Prolog":"AD4M provides two query engines for working with Social DNA and perspective data:","surrealdb-high-performance-queries-recommended#SurrealDB: High-Performance Queries (Recommended)":"For most query needs, SurrealDB provides 10-100x faster performance than Prolog. It's especially powerful for:\nFast filtering and searching\nGraph traversal queries using indexed in.uri and out.uri fields\nAggregations and analytics\nLarge dataset handling\n// Fast query - find all todos in \"done\" state\nconst doneTodos = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'todo://done'\"\n);\n// Graph traversal - find all posts by Alice\nconst alicePosts = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'\"\n);\n// Graph traversal - find comments on a specific post\nconst comments = await perspective.querySurrealDB(\n \"SELECT source, target FROM link WHERE in.uri = 'post://123' AND predicate = 'has_comment'\"\n);\n// Aggregation - count by type\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\nPerformance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed. Avoid subqueries as they're slow.Note: Ad4mModel uses SurrealDB by default for findAll() and query builder operations. See the SurrealDB Queries Guide for comprehensive examples.","the-prolog-engine-for-advanced-logic--sdna#The Prolog Engine (For Advanced Logic & SDNA)":"For custom Social DNA rules, complex logic programming, and backward compatibility, AD4M includes a Prolog engine:","core-predicates#Core Predicates":"// Basic graph predicates\ntriple(Subject, Predicate, Object). // Access raw triples\nlink(Subject, Predicate, Object, Timestamp, Author). // Access links with metadata\n// Graph traversal\nreachable(A, B). // True if B can be reached from A through any predicates\n// Expression metadata\nlanguageAddress(Expression, Address). // Get language address for expression\nlanguageName(Expression, Name). // Get language name for expression\nexpressionAddress(Expression, Address). // Get expression address","built-in-utilities#Built-in Utilities":"// Pagination and sorting\npaginate(Data, PageNumber, PageSize, PageData).\nsort_instances(Instances, SortKey, Direction, Sorted).\n// String and data handling\nremove_html_tags(Input, Output).\nstring_includes(String, Substring).\nliteral_from_url(Url, Decoded, Scheme).\njson_property(JsonString, Property, Value).\nWhen to use which?\nUse SurrealDB for: Fast queries, graph traversal, analytics (most use cases)\nUse Prolog for: Custom SDNA rules, complex logic, backward compatibility","using-social-dna-in-your-space#Using Social DNA in Your Space":"To add Social DNA to a Perspective:\n// Add a subject class definition\nperspective.addSDNA(classDefinition, \"subject_class\");\n// Add a flow definition\nperspective.addSDNA(flowDefinition, \"flow\");\n// Add custom rules\nperspective.addSDNA(customRules, \"custom\");\nThen query it using SurrealDB (fast) or Prolog (advanced logic):\n// Option 1: Use Ad4mModel with SurrealDB (recommended, 10-100x faster)\nconst activeTodos = await Todo.findAll(perspective, {\n where: { state: \"active\" }\n});\n// Option 2: Direct SurrealQL query\nconst todos = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'active'\"\n);\n// Option 3: Prolog (for custom SDNA rules)\nconst todos = await perspective.infer(\n 'instance(Todo, \"Todo\"), property_getter(\"Todo\", Todo, \"state\", \"active\")'\n);\n// Check if an action is allowed (Prolog for complex logic)\nconst canVote = await perspective.infer(\n `can_vote(\"${agentDid}\", \"${proposalId}\")`\n);","best-practices#Best Practices":"Start with Patterns\nIdentify common interaction patterns\nMake implicit rules explicit\nThink about preconditions and effects\nUse Subject Classes for:\nData validation\nComputed properties\nRelationship definitions\nUse Flows for:\nAction permissions\nState transitions\nComplex processes\nKeep it Simple\nStart with basic patterns\nAdd complexity gradually\nUse the high-level Model Classes when possible"}},"/tutorial/1-perspective":{"title":"Tutorial","data":{"":"This will get you to a shared Neighbourhood on Holochain in less than 20\nminutes! The code assumes an ad4m variable was setup as described in\nGetting Started.","create-a-perspective-and-add-content#Create a Perspective and add content":"Adding a new perspective is as easy as\nconst myPerspective = await ad4m.perspective.add(\"My new perspective\");\nThe returned object is of type PerspectiveProxy,\nwhich hides all the remote calls to the AD4M executor and can be treated like a\nlocal database object.Perspectives are basically local graph databases.\nWe can query all links on that proxy object with get:\nconst allLinks = await myPerspective.get(new LinkQuery({})); // => []\nIn this case it should return an empty array since we just created that perspective.So let's add something!\nWith the following code I'm creating an adhoc semantic statement\nrepresenting what I think about AD4M...\nimport { Literal } from \"@coasys/ad4m\";\nconst me = await ad4m.agent.me();\nconst source = me.did;\nconst predicate = Literal.from(\"thinks\").toUrl();\nconst target = Literal.from(\"AD4M will be the last social network\").toUrl();\nconst linkExpresion = await myPerspective.add({ source, predicate, target });\nLinks consist of 3 URIs pointing to Expressions of Languages.\nFor this example, we made life easy by using the agent's DID and AD4M's Literal Language.","agent-did#Agent DID":"For the source of our link, we got the user's DID URI by first getting\nthe users Agent object with ad4m.agent.me().\nThat has a DID property and DID URIs are considered valid URIs in AD4M\n(they can be looked-up using the Agent bootstrap language which resolves\nto the same Agent object we got through ad4m.agent.me() - just even if\nthat agent behind the resolved DID isn't me).","literal#Literal":"The Literal Language is an AD4M Language without back-end.\nIt stores JavaScript literals (i.e. strings, numbers and objects)\nby encoding them into the Expression URL.\nSo,\nLiteral.from(\"thinks\").toUrl();\nreturns literal://string:thinks - which is a valid URI -\nand\nLiteral.from(\"AD4M will be the last social network\").toUrl();\nreturns literal://string:AD4M%20will%20be%20the%20last%20social%20network.\nThis is basically like URL parameters and let's us get around introducing Languages\nbefore using Perspectives and Links.We can decode the URL into a JavaScript literal like so:\nconst string = Literal.fromUrl(\"literal://string:thinks\").get();\n// string == 'thinks'","linkexpression#LinkExpression":"We have put in a Link object into myPerspective.add()\n({source, predicate, target}),\nbut what this function returns is a LinkExpression.Even though this Perspective is not shared (yet) but just our private, local\ngraph database, we might want to share it later\nas Neighbourhood.\nThen, all links added by some agent to their local Perspective will be shared\nwith the other agents using a LinkLanguage - a Language which defines Expressions\nrepresenting Links. That is LinkExpressions.Using the generic Expression template,\nLinkExpressions wrap Links with author, timestamp and signature:\n{\n author: \"did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n timestamp: \"Sun Oct 23 2022 15:31:52 GMT+0200 (Central European Summer Time)\",\n data: {\n source: \"did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n predicate: \"literal://string:thinks\",\n target: \"literal://string:AD4M%20will%20be%20the%20last%20social%20network\",\n },\n proof: {\n key: \"#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n signature: \"xxxx\",\n }\n}"}},"/jsdoc/interfaces/ModelOptionsOptions":{"title":"Interface: ModelOptionsOptions","data":{"":"@coasys/ad4m / Exports / ModelOptionsOptions","table-of-contents#Table of contents":"","properties#Properties":"name","properties-1#Properties":"","name#name":"• name: stringThe name of the entity.","defined-in#Defined in":"model/decorators.ts:487"}},"/tutorial/3-neighbourhood-join":{"title":"Joining a Neighbourhood (on another node/agent)","data":{"":"Assume everything above happened on Alice's agent.\nAlice now shares the Neighbourhood's URL with Bob.\nThis is what Bob does to join the Neigbourhood, access it as a (local) Perspective\nand retrieve the Expression Alice created and linked there:\nconst joinedNeighbourhood = await ad4m.neighbourhood.joinFromUrl(\n neighbourhoodUrl\n);\nconst myPerspective = await ad4m.perspective.byUUID(joinedNeighbourhood.uuid);\nconst links = await myPerspective.get(\n new LinkQuery({\n predicate: Literal.from(\"thinks\").toUrl(),\n })\n);\nlinks.forEach(async (link) => {\n const who = link.data.source;\n const what = Literal.fromUrl(link.data.target).get();\n console.log(who, \" thinks that \", what);\n});"}},"/tutorial/4-change-listener":{"title":"Listening to Perspective changes","data":{"":"Perspectives that have been turned into Neighbourhoods are like entangled particles.\nEvery agent still has their local copy of the Perspective, but a change from any agent\nwill be shared with all other agents immediately,\nresulting in AD4M automatically updating the local Perspective with the changes by\nthe others.Even with Perspectives that are not shared as Neighbourhood,\na different UI could have access to the same Perspective and cause mutations\non it.Apps/UIs can simply register a listener function on that\nPerspectiveProxy object:\nmyPerspective.addListener(\"link-added\", (addedLink: LinkExpression) => {\n console.log(\"Got a new link:\", addedLink);\n});\nmyPerspective.addListener(\"link-removed\", (removedLink: LinkExpression) => {\n console.log(\"A link was removed:\", removedLink);\n});"}},"/jsdoc/interfaces/LinkSyncAdapter":{"title":"Interface: LinkSyncAdapter","data":{"":"@coasys/ad4m / Exports / LinkSyncAdapterInterface for \"Link Languages\" that facilitate the synchronization\nbetween agents' local Perspectives inside a Neighbourhood.\nThe assumption is that every version of the shared Perspective\nis labeled with a unique revision string.\nChanges are committed and retrieved through diffs.\nThink of a LinkSyncAdapter as a git branch to which agents commit\ntheir changes to and pull diffs from their current revision\nto the latest one.","table-of-contents#Table of contents":"","methods#Methods":"addCallback\naddSyncStateChangeCallback\ncommit\ncurrentRevision\nothers\npublic\nrender\nsync\nwritable","methods-1#Methods":"","addcallback#addCallback":"▸ addCallback(callback): anyGet push notification when a diff got published","parameters#Parameters":"Name\tType\tcallback\tPerspectiveDiffObserver","returns#Returns":"any","defined-in#Defined in":"language/Language.ts:186","addsyncstatechangecallback#addSyncStateChangeCallback":"▸ addSyncStateChangeCallback(callback): anyAdd a sync state callback method","parameters-1#Parameters":"Name\tType\tcallback\tSyncStateChangeObserver","returns-1#Returns":"any","defined-in-1#Defined in":"language/Language.ts:189","commit#commit":"▸ commit(diff): PromisePublish changes","parameters-2#Parameters":"Name\tType\tdiff\tPerspectiveDiff","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/Language.ts:183","currentrevision#currentRevision":"▸ currentRevision(): PromiseWhat revision are we on now -> what changes are included in output of render()","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:169","others#others":"▸ others(): Promise","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:166","public#public":"▸ public(): boolean","returns-5#Returns":"boolean","defined-in-5#Defined in":"language/Language.ts:165","render#render":"▸ render(): PromiseReturns the full, rendered Perspective at currentRevision","returns-6#Returns":"Promise","defined-in-6#Defined in":"language/Language.ts:180","sync#sync":"▸ sync(): PromiseCheck for and get new changes,\nnotify others of local changes.\nThis function will be called every\nfew seconds by the ad4m-executor.","returns-7#Returns":"Promise","defined-in-7#Defined in":"language/Language.ts:177","writable#writable":"▸ writable(): boolean","returns-8#Returns":"boolean","defined-in-8#Defined in":"language/Language.ts:164"}},"/agents":{"title":"Agents: The Foundation of AD4M","data":{"agent-centric-architecture#Agent-Centric Architecture":"In AD4M, we take a fundamentally different approach to building distributed systems. Instead of treating data as the primary building block, we place agents – humans and their computers – at the center of our architecture. This philosophical shift from \"data-centric\" to \"agent-centric\" has profound implications for how we build and interact with digital systems.","why-agent-centric#Why Agent-Centric?":"In traditional web architectures, data is treated as an objective, standalone entity that exists independently of its creators and consumers. This leads to centralized data silos, privacy concerns, and a disconnect between users and their digital footprint.AD4M's agent-centric approach recognizes that:\nAll data is fundamentally a claim or statement made by an agent\nTrust and context come from understanding who made a claim\nAgents should have sovereignty over their data and digital identity\nInteractions should be peer-to-peer between agents","technical-implementation#Technical Implementation":"","decentralized-identifiers-dids#Decentralized Identifiers (DIDs)":"Every agent in AD4M is identified by a Decentralized Identifier (DID). DIDs are globally unique identifiers that:\nAre fully controlled by the agent\nCan be resolved to cryptographic keys\nEnable verifiable, decentralized digital identity\n// Generate a new agent with associated DID\nawait ad4m.agent.generate(\"YourSecurePassword\");\n// Get your agent's DID and information\nconst { did, perspective } = await ad4m.agent.me();","agent-expressions#Agent Expressions":"AD4M comes with a built-in \"agent bootstrap language\" that resolves DIDs to AgentExpression objects. An AgentExpression contains:\nclass Agent {\n // The agent's DID - their unique identifier\n did: string;\n // The agent's public semantic profile\n perspective?: Perspective;\n // Address of the language used for direct messaging\n directMessageLanguage?: string;\n}\nThe perspective field is particularly important as it serves as the agent's \"homepage\" in the semantic web – a public space where they can share information about themselves using semantic links.","cryptographic-keys-and-signatures#Cryptographic Keys and Signatures":"AD4M manages cryptographic keys associated with an agent's DID. These keys are used to:\nSign expressions created by the agent\nVerify the authenticity of expressions from other agents\nEstablish secure communication channels\nWhen an agent creates an expression, AD4M automatically signs it with their private key:\n// The expression will be signed with the agent's key\nconst expression = await ad4m.expression.create(languageAddress, content);","communication-between-agents#Communication Between Agents":"Agents can communicate directly with each other through AD4M's messaging system. The runtime client provides convenient functions that handle the underlying direct message language mechanics:\n// Send a message to another agent\nawait ad4m.runtime.sendMessage(recipientDID, \"Hello!\");\n// Listen for incoming messages\nad4m.runtime.addMessageCallback((message) => {\n console.log(\"Message from:\", message.from);\n console.log(\"Content:\", message.content);\n});\nUnder the hood, AD4M uses the recipient's preferred direct message language (specified in their AgentExpression) to deliver the message. This abstraction ensures that:\nMessages are delivered using the recipient's chosen communication method\nThe underlying transport mechanism can be changed without affecting applications\nMessages are properly encrypted and signed\nYou can also check if an agent is available for messaging:\n// Get another agent's information\nconst otherAgent = await ad4m.agent.byDID(someDID);\n// Check if they have messaging capability\nif (otherAgent.directMessageLanguage) {\n // They can receive messages\n}","agent-perspectives#Agent Perspectives":"Every agent has a public perspective that acts as their semantic profile. This perspective can contain:\nPersonal information\nSocial connections\nPublished content\nPublic keys\nContact methods\nThe perspective uses semantic links to create a rich web of information:\n// Add information to your public perspective\nconst { did } = await ad4m.agent.me();\nawait ad4m.agent.updatePublicPerspective({\n links: [\n { source: did, predicate: \"foaf://name\", target: \"literal://string:Alice\" },\n { source: did, predicate: \"foaf://knows\", target: \"did:key:other-agent\" }\n ]\n});","security-and-privacy#Security and Privacy":"The agent-centric model provides several security benefits:\nAll expressions are cryptographically signed\nAgents have full control over their keys and identity\nCommunication can be encrypted end-to-end\nTrust is built on verifiable claims and signatures\nFor more details about working with agents programmatically, see the Agent class definition."}},"/developer-guides/cli":{"title":"AD4M Command Line Tools","data":{"":"AD4M provides two command-line tools that enable developers to work with AD4M in headless and scripting scenarios:\nad4m-executor: A full AD4M node implementation (similar to the Launcher but without UI)\nad4m: A client tool for interacting with any AD4M executor","installation#Installation":"For build and installation instructions, please refer to the CLI README.","the-ad4m-executor#The AD4M Executor":"The ad4m-executor binary runs a complete AD4M node, making it ideal for:\nServer deployments\nAutomated testing\nCI/CD pipelines\nHeadless applications\nSystem integration\nUnlike the Launcher which provides a GUI, the executor is designed for command-line and programmatic interaction.","authentication--security#Authentication & Security":"The executor uses a secure authentication handshake system. When a client attempts to connect, the executor generates a random number that must be used to complete the authentication. This number is printed in the executor's logs.For automated scenarios where manual authentication is impractical, you can provide an admin credential that bypasses the handshake:\nad4m-executor run --admin-credential your-secret-here\nThis is particularly useful for:\nScripts managing the executor\nCI/CD pipelines\nIntegration testing\nManagement UIs (the Launcher uses this internally)","configuration-parameters#Configuration Parameters":"The executor supports various configuration parameters to customize its behavior. Here are the key parameters:\n# Basic configuration\nad4m-executor run \\\n --gql-port 12000 \\ # Main GraphQL API port (default: 4000)\n --admin-credential secret \\ # Bypass authentication handshake\n --app-data-path ./data \\ # Custom data directory (default: ~/.ad4m)\n --run-dapp-server true # Run the DApp server (default: false)\n# Holochain-related configuration\n --hc-admin-port 1234 \\ # Holochain admin interface port (default: 1234)\n --hc-app-port 8888 \\ # Holochain app interface port (default: 8888)\n --hc-use-bootstrap true \\ # Use bootstrap service (default: true)\n --hc-use-proxy true \\ # Use proxy for Holochain (default: true)\n --hc-proxy-url url \\ # Custom proxy URL\n --hc-bootstrap-url url # Custom bootstrap URL","running-multiple-executors#Running Multiple Executors":"For development and testing, you might want to run multiple AD4M executors on the same machine. Here's how to configure two executors to run simultaneously:\n# First executor (default ports)\nad4m-executor run\n# Second executor (custom ports)\nad4m-executor run \\\n --gql-port 14000 \\ # Different GraphQL port\n --hc-admin-port 2234 \\ # Different Holochain admin port\n --hc-app-port 9888 \\ # Different Holochain app port\n --app-data-path ~/.ad4m2 # Separate data directory\nWhen connecting to the second executor with the client, specify the custom GraphQL port:\nad4m --executor-url http://localhost:14000 agent me","basic-usage#Basic Usage":"Initialize a new AD4M instance:\nad4m-executor init\nThis creates the necessary directory structure and configuration in ~/.ad4m.\nStart the executor:\nad4m-executor run\n(Optional) Run local Holochain services:\nad4m-executor run-local-hc-services\nThis starts the bootstrap and signaling services required by Holochain-based languages.","the-ad4m-client-a-tutorial#The AD4M Client: A Tutorial":"The ad4m client tool provides a complete interface to interact with a running executor. Let's explore its features through practical examples.","getting-started#Getting Started":"First, ensure you have an executor running (see above).\nFor a fresh installation, generate a new agent:\nad4m agent generate\nThis will prompt you for a password to encrypt your agent's keys.\nOn subsequent starts, unlock your agent:\nad4m agent unlock\nView your agent's information:\nad4m agent me\nThis shows your DID, public perspective, and messaging capabilities.","working-with-perspectives#Working with Perspectives":"Perspectives are semantic spaces where you can store and query linked data.\nCreate a new perspective:\nad4m perspectives create\nList all perspectives:\nad4m perspectives\nAdd links to a perspective:\nad4m perspectives add-link \"Alice\" \"knows\" \"Bob\"\nQuery links:\nad4m perspectives query-links --source \"Alice\"\nWatch for real-time changes:\nad4m perspectives watch ","interactive-data-manipulation#Interactive Data Manipulation":"The REPL provides an interactive environment for working with perspective data:\nad4m perspectives repl \nIn the REPL, you can:\n# Add links\nadd Alice knows Bob\n# Query with variables\n?Person knows Bob\n# Create subjects\nnew Person(alice)\nsubject(alice)[name] = \"Alice Smith\"\nsubject(alice)[interests] <= \"coding\"\n# View subject data\nsubject(alice)\n# Run Prolog queries\nfriend(X, Y), hobby(Y, 'coding')","managing-languages#Managing Languages":"Languages in AD4M are pluggable protocols that define how data is stored and shared.\nList installed languages:\nad4m languages all\nGet language details:\nad4m languages by-address \nPublish a new language:\nad4m languages publish ./my-language --name \"My Language\" --description \"A custom language\"","building-communities-with-neighborhoods#Building Communities with Neighborhoods":"Neighborhoods are shared spaces built on perspectives and languages.\nCreate a neighborhood:\nad4m neighbourhoods create \nThis publishes your perspective as a shared space others can join.\nJoin an existing neighborhood:\nad4m neighbourhoods join ","runtime-management#Runtime Management":"Monitor and manage your AD4M node:\nView runtime information:\nad4m runtime info\nManage trusted agents:\n# Add trusted agents\nad4m runtime add-trusted-agents did:key:123...\n# List trusted agents\nad4m runtime trusted-agents\nManage friends:\n# Add friends\nad4m runtime add-friends did:key:123...\n# List friends\nad4m runtime friends\nView logs:\nad4m log","expression-management#Expression Management":"Work with language-specific expressions:\nCreate an expression:\nad4m expression create '{\"key\": \"value\"}'\nRetrieve expressions:\n# Get parsed expression\nad4m expression get \n# Get raw data\nad4m expression get-raw ","advanced-features#Advanced Features":"For development and testing:\n# Generate bootstrap seed\nad4m dev generate-bootstrap \n# Test expression language\nad4m dev publish-and-test-expression-language \nFor a complete list of commands and their options:\nad4m --help\nad4m --help"}},"/installation":{"title":"Installation","data":{"":"To kick off with AD4M and tap into its agent-centric network, you’ll need to install the core runtime and, for JavaScript UI projects,\nthe client libraries to connect your apps. AD4M provides the AD4M Launcher for ease of use, the AD4M CLI for developer flexibility,\nand two npm packages—@coasys/ad4m and @coasys/ad4m-connect—for front-end integration.\nThis guide aligns with the v0.10.1 release candidate (as of March 24, 2025), featuring AI integration and enhanced Social DNA querying.","ad4m-launcher#AD4M Launcher":"The AD4M Launcher is a Tauri-based, system-tray app that bundles the AD4M executor, a background UI and a setup wizard—ideal for users and developers seeking a quick start.\nIt runs your agent’s instance locally, managing keys and data as the back-end for AD4M apps. Install it like this:\nDownload: Visit the GitHub release page and download the binary for your OS—e.g.,\nADAM_Launcher_-release-candidate-1_aarch64.dmg, or ADAM.Launcher_-release-candidate-1_amd64-CUDA.AppImage\n(We are working on a Windows build!.)\nRun/Install: Execute the file. Windows may prompt a security warning (allow it; signed builds are coming); macOS/Linux follow standard app install steps.\nInitialize: Launch it to generate or unlock an agent (DID and keys). It runs on localhost:12000, offering WebSocket and GraphQL endpoints.\nThe Launcher delivers a plug-and-play AD4M experience, ready for UI connections.","ad4m-cli-for-developers#AD4M CLI (For Developers)":"The AD4M CLI, written in Rust, gives developers command-line control over the AD4M ecosystem.\nAvailable on Crates.io (currently not updated due to unpublished dependencies ) and sourced at https://github.com/coasys/ad4m/tree/dev/cli,\nit includes two binaries: ad4m (CLI client) and ad4m-executor (full runtime without UI). It’s perfect for debugging, scripting, or Language development.","set-it-up#Set it up:":"Follow the CLI README to install all necessary dependencies.\nClone or Install: Clone the repo and build:\ngit clone --branch dev https://github.com/coasys/ad4m.git\ncd ad4m/cli\ncargo install --path .\n(Or install from Crates.io once we have published all dependencies: cargo install ad4m.)Run the Executor: Start the full runtime with:\nad4m-executor run\nUse ad4m init first to generate an agent if needed. It runs on localhost:12000.CLI Usage Example: With the executor running, use the ad4m CLI to interact:\nad4m languages meta QmXyz123\nThis fetches metadata for a Language (e.g., social-context) at QmXyz123, outputting details like name and description. See the CLI README for commands like ad4m expression create.The ad4m-executor provides the runtime (like the Launcher sans UI), while ad4m offers client commands—together, they’re a developer’s toolkit for AD4M.","ad4m-client-libraries-for-js-ui-projects#AD4M Client Libraries for JS UI Projects":"For JavaScript UI projects (React, Vue, etc.), the client libraries @coasys/ad4m and @coasys/ad4m-connect connect your front-end to an AD4M instance (Launcher or CLI executor).\n@coasys/ad4m: The core client, offering direct API access. Install it:\nnpm install @coasys/ad4m\nUse it for raw interactions:\nimport { Ad4mClient } from \"@coasys/ad4m\";\nconst client = new Ad4mClient(\"ws://localhost:12000\");\nconst agent = await client.agent.me();\nconsole.log(agent.did); // e.g., \"did:key:z6Mk...\"\nIt’s suited for custom logic needing full API control.@coasys/ad4m-connect: A higher-level library with WebSocket connectivity and authentication handling, ideal for streamlined UI integration. Install it:\nnpm install @coasys/ad4m-connect\nUse it to connect and authenticate:\nimport Ad4mConnect from \"@coasys/ad4m-connect\";\n \nconst ui = Ad4mConnect({\n appName: \"My First ADAM App\",\n appDesc: \"This is my first app here.\",\n appDomain: \"ad4m.dev\",\n appIconPath: \"https://i.ibb.co/GnqjPJP/icon.png\",\n capabilities: [{ with: { domain: \"*\", pointers: [\"*\"] }, can: [\"*\"] }],\n});\n \n// .connect() will show the authentication pop up\nui.connect().then((client) => {\n // Save the client after authentication is done\n const perspectives = await client.perspective.all();\n console.log(perspectives[0].name); // e.g., \"MyCommunity\"\n});\nAuthentication Handling: Per auth docs, @coasys/ad4m-connect manages capability-based auth. On first connect, it requests a capability token from the executor, prompting the user (via Launcher UI or CLI) to approve. Specify required capabilities (e.g., perspective:write) in the config. Once approved, it stores a JWT locally, auto-authenticating future connections. If the executor isn’t running or capabilities mismatch, it retries or prompts again—simplifying secure app setup.Start with @coasys/ad4m-connect for quick UI integration with auth, then use @coasys/ad4m for deeper API calls. Ensure the executor (Launcher or ad4m-executor) is active first.","system-requirements#System Requirements":"OS: macOS 10.15+, or modern Linux (e.g., Ubuntu 22.04+, glibc 2.35+).\nWe are working on a Windows build!.\nMemory: 4GB RAM minimum (8GB recommended).\nNode.js: 18+\nDependencies: Launcher bundles all (Holochain, Deno, Rust); CLI needs Rust; client libs need Node.js (18+) and an executor instance.\nOptional: CUDA for GPU acceleration AI inference.\nWith these tools installed, you’re ready to harness AD4M’s distributed power."}},"/jsdoc/README":{"title":"AD4M","data":{"":"@coasys/ad4m / ExportsThe Agent-Centric Distributed Application Meta-ontology\nor just:\nAgent-Centric DApp Meta-ontology\nA new meta-ontology for interoperable, decentralized application design\nA spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends\nThe basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network","ok-lets-go#Ok, let's go...":"To build an app/UI against Ad4m, you need to make sure that an\nad4m-executor is running\non the user's machine.The easiest way to get that is to use ad4m-cli:\ncargo install ad4m\nad4m-executor run\nThen use Ad4mClient to connect to and work with the running ad4m-executor like this:\nnpm install --save @coasys/ad4m\nnpm install --save-exact @apollo/client@3.7.10\nnpm install --save graphql-ws\nnpm install --save ws\nIn your code:\nimport { Ad4mClient } from '@coasys/ad4m'\nimport { ApolloClient, InMemoryCache } from \"@apollo/client/core\";\nimport { GraphQLWsLink } from \"@apollo/client/link/subscriptions\";\nimport { createClient } from 'graphql-ws';\nimport Websocket from \"ws\";\nconst wsLink = new GraphQLWsLink(createClient({\n url: `ws://localhost:4000/graphql`,\n webSocketImpl: Websocket\n}));\nconst apolloClient = new ApolloClient({\n link: wsLink,\n cache: new InMemoryCache(),\n defaultOptions: {\n watchQuery: {\n fetchPolicy: 'network-only',\n nextFetchPolicy: 'network-only'\n },\n }\n});\nad4mClient = new Ad4mClient(apolloClient)","unlocking--initializing-the-agent#Unlocking / initializing the agent":"You can't do much with the Ad4m runtime as long as the agent is not initialized.\nSo first get the agent status to see if we either need to create new DID or unlock\nan existing keystore.\nconst { isInitialized, isUnlocked, did } = await ad4mClient.agent.status()\nIf isInitialized is false (and then did is empty) we need to create or import\na DID and keys. generate() will create a new DID with method key and lock the\nkeystore with the given passphrase.\nconst { did } = await ad4mClient.agent.generate(\"passphrase\")\nIn following runs of the exectuor, ad4mClient.agent.status() will return a did\nand isInitialized true, but if isUnlocked is false, we need to unlock the keystore\nproviding the passphrase:\nconst { isUnlocked, did } = await ad4mClient.agent.unlock(\"passphrase\")","languages#Languages":"For creating an expression we need to select a language that we create an expression in:\nconst languages = await ad4mClient.languages.all()\nconst noteIpfsAddress = languages.find(l => l.name === 'note-ipfs').address","creating-an-expression#Creating an Expression":"const exprAddress = await ad4mClient.expression.create(\"A new text note\", noteIpfsAddress)","creating-a-perspective-and-linking-that-new-expression#Creating a Perspective and linking that new Expression":"const perspectiveHandle = await ad4mClient.perspective.add(\"A new perspective on apps...\")\nawait ad4mClient.perspective.addLink(\n perspectiveHandle.uuid,\n new Link({\n source: 'root',\n target: exprAddress\n })\n)","publishing-that-local-perspective-by-turning-it-into-a-neighbourhood#Publishing that local Perspective by turning it into a Neighbourhood":"The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing\nand thus synchronizing of links (see LinksAdapter in Language.ts).\nWhile there can and should be many different implementations\nwith different trade-offs and features (like membranes etc.),\nthere currently is one fully implemented and Holochain based LinkLanguage with the name Social Context.It is deployed on the current test network (Language Language v0.0.5) under the address:\nQmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ.","creating-our-unique-linklanguage-clone-through-templating#Creating our unique LinkLanguage clone through templating":"But we should not just use this publicly known Language as the back-bone for our new Neighbourhood,\nsince we need a unique clone.\nSo what we want is to use this existing Language as a template and create a new copy with the same code\nbut different UUID and/name in order to create a fresh space for our new Neighbourhood.What parameters can we adjust when using it as template?\nLet's have a look at the Language's meta information:\nconst socialContextMeta = await ad4mClient.languages.meta(\"QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ\") \nconsole.log(socialContextMeta)\nWhich should yield something like this:\n {\n name: 'social-context',\n address: 'QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ',\n description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',\n author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',\n templated: false,\n templateSourceLanguageAddress: null,\n templateAppliedParams: null,\n possibleTemplateParams: [ 'uuid', 'name', 'description' ],\n sourceCodeLink: 'https://github.com/juntofoundation/Social-Context'\n}\nThe field possibleTemplateParams tells us that we can set a UUID and override name and description.\nLet's leave description but change the name.\nThe function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:\nconst uniqueLinkLanguage = await ad4mClient.languages.applyTemplateAndPublish(\"QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ\", JSON.stringify({\"uuid\": \"84a329-77384c-1510fb\", \"name\": \"Social Context clone for demo Neighbourhood\"}));\nAnd then use this new LinkLanguage in our Neighbourhood:\nconst meta = new Perspective()\nconst neighbourhoodUrl = await ad4mClient.neighbourhood.publishFromPerspective(\n perspectiveHandle.uuid,\n uniqueLinkLanguage.address,\n meta\n)\nconsole.log(neighbourhoodUrl) // => neighbourhood://Qm123456789abcdef","joining-a-neighbourhood-on-another-nodeagent#Joining a Neighbourhood (on another node/agent)":"Assume everything above happened on Alice's agent.\nAlice now shares the Neighbourhood's URL with Bob.\nThis is what Bob does to join the Neigbourhood, access it as a (local) Perspective\nand retrieve the Expression Alice created and linked there:\nconst joinedNeighbourhood = await ad4mClient.neighbourhood.joinFromUrl(neighbourhoodUrl)\nconst links = await ad4mClient.perspective.queryLinks(joinedNeighbourhood.uuid, new LinkQuery({source: 'a'}))\nlinks.forEach(async link => {\n const address = link.data.target\n const expression = await ad4mClient.expression.get(address)\n const data = JSON.parse(expression.data)\n console.log(data) //=> \"A new text note\"\n})","building-from-source#Building from source":"Run:\nnpm i && npm run build","wait-what#Wait, what?!":"The central claim of AD4M is that any single- but also specifically multi-user application can be bootstrapped out of a meta-ontology consisting of 3 quintessential ontological units:\nAgents\nLanguages\nand Perspectives\nThis is a meta-ontology since it doesn't make any assumptions about the specific ontologies implemented in those bootstrapped apps. But since apps bootstrapped from it share the same meta-ontology, they are mutualy interoperable.","agents#Agents...":"...represent humans with their devices, which is what the internet actually is. Technically represented as Decentralized Identifiers - DIDs.","languages-1#Languages...":"...encapsulate the actual technology used to communicate, like Holochain or IPFS, but what they provide to the high-level layers is this: Languages define Expressions, which are the atoms of what Agents communicate. Expressions are always created, and thus signed, by an agent. Expressions are referenced via a URL of the kind ://. That URL and the Expression itself is the only objective part in AD4M.","perspectives#Perspectives...":"...belong to a specific agent. They represent context and association between expressions. They consist of a list of RDF/semantic web like triplets (subject-predicate-object) called links because all three items are just URLs pointing to expressions. Perspectives are like Solid's pods, but they are agent-centric. There is no such thing as a Perspective that does not belong to an agent. It is like the canvas on which an agent perceives and onto which they create anything. To the next layer above (either the very general UI built in Perspectivism - or any other special purpose UI), they are like a database scope.","bootstrapping#Bootstrapping":"Any AD4M implementation will have to include at least 3 reflexive system Languages to enable the dynamic bootstrapping of apps and interconnected sense-making networks:\nA Language of Agents, i.e. where the expressions represent agents, and which uses DIDs as the expression URLs.\nA Language of Languages, i.e. a way to talk about Languages so Languages can be created by users and shared.\nA Language of Perspectives which implies the concept of Shared Perspectives a.k.a. Neighbourhoods, i.e. a way to share an otherwise local and private Perspective with others which constitutes the basic building block of any collaboration context.\nHaving these Languages means Agents can author expressions that represent Agents, Languages and Perspectives. These expressions get linked from inside Perspectives. That way we can model primitives like friends-lists (Perspective including agent expressions), app-stores (Perspective including Languages) and more.","how-do-i-build-an-app-onwith-ad4m#How do I build an app on/with AD4M?":"Building an AD4M app actually means extending the AD4M ecosystem with the\nLanguages\nand link-ontologies\nneeded for the app's domain - and then creating expressions from those Languages and linking them inside Perspectives.The latter means creating RDF/semantic web style triplets that associate expressions in order to represent app specific semantics - not too different to how Solid style linked-data would work."}},"/":{"title":"Introduction","data":{"":"The internet has evolved from a platform for creating and sharing simple documents to highly social digital experiences,\nand now to an era dominated by centralized artificial intelligence systems. Yet, no social infrastructure is woven into its core.\nWithout a universal social protocol, companies have erected siloed networks, harvesting and profiting from user content—a problem\nintensified by centralized AI, which concentrates power and insight extraction, deepening data monopolies and eroding agency.AD4M (Agent-centric Distributed Application Meta-ontology) counters this by centering agents—primarily human users with\nDecentralized Identifiers (DIDs), though extensible to synthetic entities—and their social contexts in digital communication.Built on Holochain, AD4M forms an agent-centric spanning layer on top of the internet, harmonizing fragmented ecosystems into a distributed\nCollective Intelligence network. This deep implementation empowers agents to choose which Language they speak—bridging currently\ncompeting P2P, federated, and centralized approaches in synergy, whether it’s a P2P protocol, a federated API, or HTTP itself.If you’re versed in Holochain’s distributed design and the semantic web’s linked data paradigm (e.g., RDF, Solid), AD4M blends\nthe best of both, crafting an agent-centric semantic web where social relationships fuel a decentralized alternative to centralized\nAI dominance, aligned with the real human networks of its users through graph-based data and a global addressing scheme.","what-is-ad4m-practically#What is AD4M practically?":"AD4M, as an agent-centric spanning layer married with an app development framework,\nredefines how decentralized applications connect users, data, and ecosystems. Unlike traditional back-ends tied to centralized servers,\nAD4M runs as a distinct instance for every user—think of it as a personal, local runtime environment. Each instance, built on Holochain,\nholds the user’s cryptographic keys (via their DID), stores their data in Perspectives (subjective RDF-based knowledge graphs),\nand executes code that interfaces with Languages—protocol-like abstractions that attach to existing systems, from HTTP to IPFS to custom P2P\nprotocols. This instance serves as the back-end that UIs and apps connect to, providing a unified, interoperable gateway to the user’s digital world.At its core, AD4M inverts the typical app-centric model. Instead of apps owning your data and social graph, your AD4M instance owns them,\nrunning on your device (or a trusted host) and exposing a GraphQL API, wrapped by our JavaScript client library, for apps to query and interact with.\nFor example, a chat app might connect to localhost:4000/graphql to fetch messages stored in a Perspective, addressed via a Language like\nQmXyz123://message789. This local runtime attaches to existing Languages—say, http for web content or solid for semantic triples—executing\ntheir logic to read or write Expressions (data objects). Developers don’t rewrite the web; they extend it, with AD4M harmonizing these connections\ninto a single, agent-owned layer.\nAgent Autonomy: Each instance is sovereign, controlled by the user’s DID (e.g., did:key:z6Mk...). It signs every action—links in Perspectives, joins to Neighbourhoods—ensuring data integrity and ownership without intermediaries.\nInteroperability Through Expressions and Perspectives:\nAD4M achieves seamless integration across ecosystems via two pillars: Expressions and Perspectives. Languages produce objective Expressions—data objects with global addresses like ://
(e.g., ), readable by any AD4M-connected app. Meanwhile, Perspectives are subjective knowledge graphs, built from RDF triples (e.g., ), representing an agent’s unique view. Together, they enable portability and connection: an Expression can be linked across Perspectives, and a Perspective can pull in data from multiple Languages, bridging web, semantic web, and P2P systems effortlessly.\nRule-Based Distributed Consistency:\nUsing Holochain for it's core backbone, each instance doesn’t just store data—it enforces consistency through Language-defined rules and Social DNA (Prolog-based logic). For example, a Neighbourhood might restrict posting to members via a rule like member(Agent) :- link(Agent, \"memberOf\", Neighbourhood). This distributed validation ensures data aligns across the network without a central authority, giving developers a reliable, self-regulating foundation.\nPractically, this means every developer’s user runs their own AD4M node. Install it, configure it (e.g., via a RuntimeConfig JSON), and it spins up a process holding their private keys, syncing their Perspectives, and running Language code—like a lightweight, personal cloud. A UI might then query:\n// Initialize the client\nconst ad4mClient = new Ad4mClient(\"ws://localhost:4000\", false);\n// Get the current agent\nconst agent = await ad4mClient.agent.me();\nconsole.log(agent.did); // did:key:z6Mk...\n// Create and work with a perspective\nconst perspective = await ad4mClient.perspective.add(\"MyPerspective\");\nconst link = await perspective.add(new Link({\n source: \"test://source\",\n predicate: \"test://predicate\", \n target: \"test://target\"\n}));\n// Query links\nconst links = await perspective.get({} as LinkQuery);\nconsole.log(links); // [{source: \"test://source\", predicate: \"test://predicate\", target: \"test://target\"}]\nThis spanning layer doesn’t replace the internet—it augments it, giving agents control over their data and connections while enabling apps to tap into a distributed, interoperable network. AD4M is the engine behind a user’s digital agency, the glue for ecosystem synergy, and the foundation for Collective Intelligence—all in one local instance.","ad4m-languages#AD4M Languages":"","protocols-with-a-global-addressing-scheme#Protocols with a Global Addressing Scheme":"At the heart of AD4M are Languages, which are more than just data formats—they’re protocol-like abstractions that define how agents express,\nstore, and share data across ecosystems. Conceptually akin to protocols like HTTP or IPFS, each Language encapsulates the capacity of (AD4M-) agents\n(read: nodes/users) to spawn Expressions-that is: data-objects with cryptographic provenance- messages, posts, you name it.\nHow the Language implementation actually stores and shares these Expressions is up to the Language implementor.The key point here is to introduce a global addressing scheme, extending the familiar URI model.\nEvery Language is identified by a unique code hash (a cryptographic hash of its implementation), which becomes the scheme in a URL-like address:\n://. This mirrors the method resolution in Decentralized Identifiers (DIDs) but applies it to data\nobjects (Expressions) across the network.For example:\nA social context Language might have a hash like QmXyz123..., so an Expression could be addressed as QmXyz123://agent123/post456.HTTP, as a particular Language (read protocol), maps to http://example.com/resource, making AD4M backwards compatible with the web.Languages are implemented as JavaScript modules, that will be run in AD4M's integrated JavaScript runtime (an integrated build of Deno).\nThis scheme ensures that any Expression—whether a tweet, a post, a semantic triple, or a custom data object—is globally referenceable across Languages (protocols).\nDevelopers can thus integrate existing systems into the AD4M spanning layer by writing a Language that wraps and interfaces with given system (e.g. a database, blockchain, Holochain app...).","foundational-bootstrap-languages#Foundational Bootstrap Languages":"Out of the gate, AD4M relies on bootstrap Languages—pre-installed essentials like the agent, perspective, & language languages.\nThese provide the core grammar for identity (did:key:z6Mk...), knowledge graphs / perspectives (perspective://2f168edc-...)\nand their collaboratively shared pendandts, Neighbourhoods, (neighbourhood://2345d23...), and then languages themselves (lang://Qm3dgfw23...)\nThey standardize interactions across every AD4M instance, around the core ontology of AD4M itself.For instance:\nconst ad4mClient = await getAd4mClient(\"ws://localhost:4000\");\nconst agentExpression = await ad4mClient.expression.get(\"did:key:z6Mk...\");\nconsole.log(agentExpression.data); // { did: \"did:key:z6Mk...\" }\nresolves a DID to the Agent Expression, which contains some information about the referenced AD4M agent (read: user).Bootstrap Languages make AD4M a functional spanning layer from the start, an evolvable bare-bones social network that enables\nits users to spawn their own ontologies and spaces into this meta-space.","evolvability-through-the-language-language#Evolvability through the Language-Language":"The true genius of AD4M’s Language system lies in its evolvability, driven by the language-language—a meta-Language through which new Languages are defined, published, and shared across the network.\nThis bootstrap Language acts as a registry and distribution mechanism: developers create a custom Language (e.g., my-social-app), its code is hashed (e.g., QmCustom321),\nand it’s published as an Expression at language://QmCustom321. Other agents can then fetch and install it:\n// Publish a new language\nconst languageMeta = {\n name: \"my-social-app\",\n description: \"A custom social app language\"\n};\nconst published = await ad4mClient.languages.publish(\"./build/bundle.js\", languageMeta);\nconsole.log(published.address); // QmCustom321\n// Get all installed languages\nconst languages = await ad4mClient.languages.all();\nconsole.log(languages); // Includes the newly published language\nThis Language installation process happens automatically when AD4M tries to resolve an Expression of a new Language.\nWith the hash of the Language code being part of the Expression URL, AD4M will try to retrieve the Language throug the Language of Languages.\nSince every Expression contains its crytographic provenance, AD4M has a natural built-in way to apply code-signing and verification-only Languages of trusted agents\nwill be installed automatically.This makes the AD4M spanning layer a living, adaptive system. The language-language ensures that as new protocols or needs emerge—say, a federated messaging standard or a novel AI integration—agents can adopt them without centralized gatekeepers or hard forks.\nIt’s the most critical aspect of Languages: not just connecting existing ecosystems, but enabling the entire framework to evolve with its users.\nA developer might extend AD4M with:\ninterface CustomLanguage {\n hash: \"QmCustom321\";\n name: \"my-social-app\";\n expressionTypes: {\n create: (content: { text: string }) => {\n /* handle any transformation required here, save the data, and return its address */\n return \"QmCustom321://post789\";\n },\n get: (address: string) => {\n /* fetch the data here, handle any transformation required, and return it to the UI */\n return { text: string };\n };\n };\n}\nBy rooting adaptability in the language-language, AD4M ensures its spanning layer isn’t static—it grows, driven by the collective innovation of its agents, making it a future-proof foundation for Collective Intelligence.","perspectives-and-neighbourhoods#Perspectives and Neighbourhoods":"The local AD4M node stores, manages and gives access to an arbitrary number of Perspectives—subjective knowledge graphs of RDF triples.\nEach Perspective is similar to a Solid Pod, in that it's a (private) collection of semantic associations.\nThe main difference to semantic web style graphs is that each triple (called a Link in AD4M) is an Expression and thus has a cryptographic provenance.\nThese triples, like , store data such as .Agents share these local graph databases in a collaberative way with other AD4M agents via Neighbourhoods, app-independent social contexts that act as shared,\ncollaboratively edited graphs. Built on the same linked data principles as the semantic web or Solid, Neighbourhoods enable portability:\na community’s social structure—its links and relationships—can move seamlessly across apps. For instance:\nconst perspective = await ad4mClient.perspective.add(\"MyCommunity\");\n// Add a link to the perspective\nawait perspective.add(new Link({\n source: \"agent123\",\n predicate: \"memberOf\",\n target: \"neighbourhood://QmAbc789\"\n}));\n// Query links\nconst links = await perspective.get({} as LinkQuery);\nconsole.log(links);\n// [{source: \"agent123\", predicate: \"memberOf\", target: \"neighbourhood://QmAbc789\"}]\nThis focus on agent-to-agent relationships, not app boundaries, drives AD4M’s interoperability, making social networks the foundation of its architecture.","social-dna#Social DNA":"In a decentralized network awash with data, the leap from raw information to collective wisdom hinges on more than just connectivity—it requires a way to encode how agents\nand their communities process, filter, and reason over that data. Social DNA is AD4M’s answer: a conceptual parallel to biological DNA, it defines the rules,\nbehaviors, and logic that transform static Perspectives and Neighbourhoods into dynamic, intelligent Social Organisms. For developers, Social DNA is the key to\ncrafting app-specific intelligence—whether it’s validating data, enforcing roles, or aggregating insights—all while keeping control distributed among agents.\nIt’s the engine driving AD4M’s vision of a Collective Intelligence network, turning linked data into actionable, shared understanding.","query-engines-surrealdb--prolog#Query Engines: SurrealDB & Prolog":"AD4M provides two powerful query engines for working with graph data in Perspectives:","surrealdb-high-performance-queries-recommended#SurrealDB: High-Performance Queries (Recommended)":"AD4M now includes SurrealDB, a modern database that provides 10-100x faster performance than Prolog for most queries. SurrealDB uses SQL-like syntax (SurrealQL) and excels at:\nFast graph traversal using indexed in.uri and out.uri fields\nAggregations and analytics\nComplex filtering and sorting\nLarge dataset handling\n// Fast graph query - find who Alice follows\nconst follows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find posts by Alice\nconst posts = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'\"\n);\nPerformance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they're very slow.Important: Ad4mModel (described below) now uses SurrealDB by default for all operations, providing dramatic performance improvements with no code changes required.For detailed examples and graph traversal patterns, see the SurrealDB Queries Guide.","prolog-logic-programming-legacy#Prolog: Logic Programming (Legacy)":"For backward compatibility and advanced logic programming, AD4M also includes Prolog, optimized for reasoning over relational data like the RDF triples in Perspectives.\nProlog's declarative nature lets developers write rules as predicates:\n% Check if an agent is a member\nmember(Agent, Neighbourhood) :-\n link(Agent, \"memberOf\", Neighbourhood).\n% Validate a post by a member\nmemberPost(Post, Agent, Neighbourhood) :-\n link(Agent, \"posted\", Post),\n member(Agent, Neighbourhood).\n% Query all member posts\n?- memberPost(Post, Agent, \"neighbourhood://QmGroup789\").\nThis could be queried via the AD4M client:\nconst posts = await perspective.infer(\n \"memberPost(Post, Agent, 'neighbourhood://QmGroup789')\"\n);\nconsole.log(posts); // [{Post: \"QmXyz123://post456\", Agent: \"did:key:z6Mk...\"}, ...]\nWhile these raw query engines are powerful, AD4M simplifies development with a higher-level abstraction.","ad4mmodel#Ad4mModel":"For app developers, writing queries directly is optional—AD4M's Ad4mModel class and its decorators handle the heavy lifting.\nThis TypeScript base class lets you define model classes with properties and relationships, automatically using SurrealDB under the hood for\nfast query performance (10-100x faster than Prolog). Here's how you define a model:\nimport { Ad4mModel, ModelOptions, Property, Collection, Flag, Optional, ReadOnly } from \"@coasys/ad4m\";\n@ModelOptions({\n name: \"Todo\"\n})\nclass Todo extends Ad4mModel {\n @Property({\n through: \"todo://state\",\n initial: \"todo://ready\"\n })\n state: string = \"\";\n @Optional({\n through: \"todo://has_title\",\n writable: true,\n resolveLanguage: \"literal\"\n })\n title: string = \"\";\n @ReadOnly({\n getter: 'triple(Base, \"flux://has_reaction\", \"flux://thumbsup\"), Value = true'\n })\n isLiked: boolean = false;\n @Collection({ through: \"todo://comment\" })\n comments: string[] = [];\n @Collection({ \n through: \"flux://entry_type\",\n where: { condition: 'triple(Target, \"flux://has_reaction\", \"flux://thumbsup\")' }\n })\n likedMessages: string[] = [];\n // Static query methods\n static async all(perspective: PerspectiveProxy): Promise {\n return await Todo.findAll(perspective);\n }\n static async allDone(perspective: PerspectiveProxy): Promise {\n return await Todo.findAll(perspective, { \n where: { state: \"todo://done\" }\n });\n }\n}\nBehind this, Ad4mModel:\nUses SurrealDB by default for fast queries (10-100x faster)\nGenerates efficient SurrealQL queries automatically\nStores data as graph links in the perspective\nProvides type-safe TypeScript interfaces\nFor example, Todo.findAll(perspective, { where: { state: \"todo://done\" } }) automatically generates and executes an optimized SurrealQL query.For backward compatibility, Prolog is still supported (pass useSurrealDB: false to query methods). See the Model Classes Guide and SurrealDB Queries Guide for details.You can use this model to work with Todo items in a type-safe way:\n// Create a new Todo\nconst todo = new Todo(perspective);\ntodo.title = \"Complete documentation\";\ntodo.state = \"todo://ready\";\nawait todo.save();\n// Query todos\nconst allTodos = await Todo.all(perspective);\nconst doneTodos = await Todo.allDone(perspective);\n// Update a todo\ntodo.state = \"todo://done\";\nawait todo.update();\n// Delete a todo\nawait todo.delete();\nDevelopers define their app's data model in familiar TypeScript, and AD4M handles the Social DNA—stored in a Perspective or Neighbourhood—making it both accessible and powerful. This abstraction lets you focus on app logic while SurrealDB provides fast queries and Prolog enables decentralized reasoning that scales across the network.","why#Why?":"The goal is to arrive at scalable and interoparable communication infrastructure\nthat enables group agency without imposing a bias on how a group manages itself.This is the real problem we're facing when trying to provide a\ntechnological solution to the web's fractured sense-making.AD4M is a sense-making network disguised as an app development framework.\nAD4M apps don't have to leak any of the AD4M concepts at all,\nand they would still be interoperable with each other to the degree\nof just being different views over the same agent-centric semantic web.","why-should-i-build-on-adam#Why should I build on ADAM?":"ADAM solves a lot of common challenges when developing social applications:\nCold Start: When a new social platform has limited content and a small user base, it is challenging to attract users and engagement. By interacting with already existing agents and their social groups, you don't need to onboard users.\nAuthentication: Authentication is already taken care of, reducing the overload of having to implement authentication flows and user management.\nPrivacy by default: Each social group in ADAM is its own private network, making communication private by default.\nDatabase management: ADAM is completely decentralized, hence there is no database to manage, and no infrastructure you need to scale.\nInteroperability: You are not locked into using one kind of storage technology\nand can switch out your tech stack incrementally. With ADAMs Language implementation, you are able to interact with any existing centralized or decentralized system.\nSmart Contracts without fees: With ADAMs Social DNA, social spaces can easily add their own small programs (smart contracts) using prolog."}},"/jsdoc/classes/Ad4mClient":{"title":"Class: Ad4mClient","data":{"":"@coasys/ad4m / Exports / Ad4mClientClient for the Ad4m interface wrapping GraphQL queryies\nfor convenient use in user facing code.Aggregates the six sub-clients:\nAgentClient, ExpressionClient, LanguageClient,\nNeighbourhoodClient, PerspectiveClient and RuntimeClient\nfor the respective functionality.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#agentClient\n#aiClient\n#apolloClient\n#expressionClient\n#languageClient\n#neighbourhoodClient\n#perspectiveClient\n#runtimeClient","accessors#Accessors":"agent\nai\nexpression\nlanguages\nneighbourhood\nperspective\nruntime","constructors-1#Constructors":"","constructor#constructor":"• new Ad4mClient(client, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tclient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"Ad4mClient.ts:30","properties-1#Properties":"","agentclient##agentClient":"• Private #agentClient: AgentClient","defined-in-1#Defined in":"Ad4mClient.ts:21","aiclient##aiClient":"• Private #aiClient: AIClient","defined-in-2#Defined in":"Ad4mClient.ts:27","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-3#Defined in":"Ad4mClient.ts:20","expressionclient##expressionClient":"• Private #expressionClient: ExpressionClient","defined-in-4#Defined in":"Ad4mClient.ts:22","languageclient##languageClient":"• Private #languageClient: LanguageClient","defined-in-5#Defined in":"Ad4mClient.ts:23","neighbourhoodclient##neighbourhoodClient":"• Private #neighbourhoodClient: NeighbourhoodClient","defined-in-6#Defined in":"Ad4mClient.ts:24","perspectiveclient##perspectiveClient":"• Private #perspectiveClient: PerspectiveClient","defined-in-7#Defined in":"Ad4mClient.ts:25","runtimeclient##runtimeClient":"• Private #runtimeClient: RuntimeClient","defined-in-8#Defined in":"Ad4mClient.ts:26","accessors-1#Accessors":"","agent#agent":"• get agent(): AgentClient","returns#Returns":"AgentClient","defined-in-9#Defined in":"Ad4mClient.ts:45","ai#ai":"• get ai(): AIClient","returns-1#Returns":"AIClient","defined-in-10#Defined in":"Ad4mClient.ts:69","expression#expression":"• get expression(): ExpressionClient","returns-2#Returns":"ExpressionClient","defined-in-11#Defined in":"Ad4mClient.ts:49","languages#languages":"• get languages(): LanguageClient","returns-3#Returns":"LanguageClient","defined-in-12#Defined in":"Ad4mClient.ts:53","neighbourhood#neighbourhood":"• get neighbourhood(): NeighbourhoodClient","returns-4#Returns":"NeighbourhoodClient","defined-in-13#Defined in":"Ad4mClient.ts:57","perspective#perspective":"• get perspective(): PerspectiveClient","returns-5#Returns":"PerspectiveClient","defined-in-14#Defined in":"Ad4mClient.ts:61","runtime#runtime":"• get runtime(): RuntimeClient","returns-6#Returns":"RuntimeClient","defined-in-15#Defined in":"Ad4mClient.ts:65"}},"/jsdoc/classes/ExceptionInfo":{"title":"Class: ExceptionInfo","data":{"":"@coasys/ad4m / Exports / ExceptionInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"addon\nmessage\ntitle\ntype","constructors-1#Constructors":"","constructor#constructor":"• new ExceptionInfo()","properties-1#Properties":"","addon#addon":"• Optional addon: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:54","message#message":"• message: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:50","title#title":"• title: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:48","type#type":"• type: ExceptionType","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:52"}},"/jsdoc/classes/ImportStats":{"title":"Class: ImportStats","data":{"":"@coasys/ad4m / Exports / ImportStats","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"errors\nfailed\nimported\nomitted\ntotal","constructors-1#Constructors":"","constructor#constructor":"• new ImportStats()","properties-1#Properties":"","errors#errors":"• errors: string[]","defined-in#Defined in":"runtime/RuntimeResolver.ts:156","failed#failed":"• failed: number","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:150","imported#imported":"• imported: number","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:147","omitted#omitted":"• omitted: number","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:153","total#total":"• total: number","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:144"}},"/jsdoc/classes/ImportResult":{"title":"Class: ImportResult","data":{"":"@coasys/ad4m / Exports / ImportResult","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"defaultModels\nexpressions\nfriends\nknownLinkLanguages\nlinks\nmodels\nnotifications\nperspectiveDiffs\nperspectives\ntasks\ntrustedAgents","constructors-1#Constructors":"","constructor#constructor":"• new ImportResult()","properties-1#Properties":"","defaultmodels#defaultModels":"• defaultModels: ImportStats","defined-in#Defined in":"runtime/RuntimeResolver.ts:180","expressions#expressions":"• expressions: ImportStats","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:168","friends#friends":"• friends: ImportStats","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:186","knownlinklanguages#knownLinkLanguages":"• knownLinkLanguages: ImportStats","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:192","links#links":"• links: ImportStats","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:165","models#models":"• models: ImportStats","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:177","notifications#notifications":"• notifications: ImportStats","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:174","perspectivediffs#perspectiveDiffs":"• perspectiveDiffs: ImportStats","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:171","perspectives#perspectives":"• perspectives: ImportStats","defined-in-8#Defined in":"runtime/RuntimeResolver.ts:162","tasks#tasks":"• tasks: ImportStats","defined-in-9#Defined in":"runtime/RuntimeResolver.ts:183","trustedagents#trustedAgents":"• trustedAgents: ImportStats","defined-in-10#Defined in":"runtime/RuntimeResolver.ts:189"}},"/jsdoc/classes/NotificationInput":{"title":"Class: NotificationInput","data":{"":"@coasys/ad4m / Exports / NotificationInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appIconPath\nappName\nappUrl\ndescription\nperspectiveIds\ntrigger\nwebhookAuth\nwebhookUrl","constructors-1#Constructors":"","constructor#constructor":"• new NotificationInput()","properties-1#Properties":"","appiconpath#appIconPath":"• appIconPath: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:68","appname#appName":"• appName: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:64","appurl#appUrl":"• appUrl: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:66","description#description":"• description: string","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:62","perspectiveids#perspectiveIds":"• perspectiveIds: string[]","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:79","trigger#trigger":"• trigger: string","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:75","webhookauth#webhookAuth":"• webhookAuth: string","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:87","webhookurl#webhookUrl":"• webhookUrl: string","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:83"}},"/jsdoc/classes/Notification":{"title":"Class: Notification","data":{"":"@coasys/ad4m / Exports / Notification","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appIconPath\nappName\nappUrl\ndescription\ngranted\nid\nperspectiveIds\ntrigger\nwebhookAuth\nwebhookUrl","constructors-1#Constructors":"","constructor#constructor":"• new Notification()","properties-1#Properties":"","appiconpath#appIconPath":"• appIconPath: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:105","appname#appName":"• appName: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:101","appurl#appUrl":"• appUrl: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:103","description#description":"• description: string","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:99","granted#granted":"• granted: boolean","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:97","id#id":"• id: string","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:95","perspectiveids#perspectiveIds":"• perspectiveIds: string[]","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:116","trigger#trigger":"• trigger: string","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:112","webhookauth#webhookAuth":"• webhookAuth: string","defined-in-8#Defined in":"runtime/RuntimeResolver.ts:124","webhookurl#webhookUrl":"• webhookUrl: string","defined-in-9#Defined in":"runtime/RuntimeResolver.ts:120"}},"/jsdoc/classes/RuntimeInfo":{"title":"Class: RuntimeInfo","data":{"":"@coasys/ad4m / Exports / RuntimeInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"ad4mExecutorVersion\nisInitialized\nisUnlocked","constructors-1#Constructors":"","constructor#constructor":"• new RuntimeInfo()","properties-1#Properties":"","ad4mexecutorversion#ad4mExecutorVersion":"• ad4mExecutorVersion: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:38","isinitialized#isInitialized":"• isInitialized: Boolean","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:40","isunlocked#isUnlocked":"• isUnlocked: Boolean","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:42"}},"/jsdoc/classes/SentMessage":{"title":"Class: SentMessage","data":{"":"@coasys/ad4m / Exports / SentMessage","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"message\nrecipient","constructors-1#Constructors":"","constructor#constructor":"• new SentMessage()","properties-1#Properties":"","message#message":"• message: PerspectiveExpression","defined-in#Defined in":"runtime/RuntimeResolver.ts:32","recipient#recipient":"• recipient: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:30"}},"/jsdoc/classes/TriggeredNotification":{"title":"Class: TriggeredNotification","data":{"":"@coasys/ad4m / Exports / TriggeredNotification","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"notification\nperspectiveId\ntriggerMatch","constructors-1#Constructors":"","constructor#constructor":"• new TriggeredNotification()","properties-1#Properties":"","notification#notification":"• notification: Notification","defined-in#Defined in":"runtime/RuntimeResolver.ts:131","perspectiveid#perspectiveId":"• perspectiveId: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:133","triggermatch#triggerMatch":"• triggerMatch: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:138"}},"/neighbourhoods":{"title":"Neighbourhoods: Collaborative Knowledge Spaces","data":{"understanding-neighbourhoods#Understanding Neighbourhoods":"Neighbourhoods transform private Perspectives into shared semantic spaces where multiple agents can collaborate. They represent AD4M's vision of group collaboration: decentralized, storage-agnostic, and centered around shared meaning rather than applications.","from-personal-to-shared-knowledge#From Personal to Shared Knowledge":"While Perspectives are personal knowledge graphs, Neighbourhoods enable:\nReal-time synchronization of semantic links between agents\nApp-independent group collaboration\nShared context through a common knowledge graph\nIntegration with existing group spaces and infrastructure\nFor example, the same Neighbourhood could be viewed through:\nA chat application showing messages and threads\nA task management tool showing assignments and deadlines\nA document editor showing collaborative documents\nA social network showing relationships and posts\nAll these views operate on the same underlying semantic graph, just interpreting the links differently.","linklanguages-the-sync-layer#LinkLanguages: The Sync Layer":"Neighbourhoods achieve their magic through LinkLanguages – specialized Languages that define how links are stored and synchronized between agents. A LinkLanguage implements the LinkSyncAdapter interface:\ninterface LinkSyncAdapter {\n // Is this link space writable?\n writable(): boolean;\n \n // Is this link space public?\n public(): boolean;\n \n // Get list of other agents in the space\n others(): Promise;\n // Get current revision (like git commit hash)\n currentRevision(): Promise;\n // Sync with other agents, returns changes\n sync(): Promise;\n // Get full state at current revision\n render(): Promise;\n // Publish local changes\n commit(diff: PerspectiveDiff): Promise;\n // Subscribe to remote changes\n addCallback(callback: (diff: PerspectiveDiff) => void);\n // Subscribe to sync state changes\n addSyncStateChangeCallback(callback: (state: PerspectiveState) => void);\n}\nThis git-like interface enables Neighbourhoods to:\nTrack revisions of the shared space\nSync changes between agents efficiently\nMaintain consistency through CRDT-like mechanisms\nSupport different backend implementations","the-neighbourhood-bootstrap-language#The Neighbourhood Bootstrap Language":"AD4M includes a built-in \"Neighbourhood Language\" that serves as a public registry for Neighbourhoods. When you create a Neighbourhood, an Expression in this language is published containing:\nThe address of the LinkLanguage used for sync\nMeta information about the Neighbourhood (name, description, etc.)\nAccess control information\n// Example Neighbourhood Expression\n{\n data: {\n linkLanguage: \"QmLinkLang123...\", // Address of the sync language\n meta: { // Optional metadata\n name: \"My Team Space\",\n description: \"Collaboration space for our team\"\n }\n }\n}","joining-process#Joining Process":"When an agent joins a Neighbourhood using its URL:\nThe Neighbourhood Expression is retrieved\nThe specified LinkLanguage is downloaded and installed\nThe agent connects to the shared space using that language\n// Join flow under the hood [PSEUDO-CODE]\nconst join = async (url) => {\n // 1. Get Neighbourhood Expression\n const hood = await ad4m.expression.get(url);\n \n // 2. Install LinkLanguage if needed\n const linkLang = hood.data.linkLanguage;\n if (!await ad4m.languages.isInstalled(linkLang)) {\n await ad4m.languages.install(linkLang);\n }\n \n // 3. Connect using the LinkLanguage\n return await ad4m.perspective.join(linkLang);\n}","language-templates-and-trust#Language Templates and Trust":"AD4M provides a powerful templating mechanism for Languages, particularly useful for LinkLanguages. This enables:\nCreating unique P2P networks for each Neighbourhood\nVerifiable code provenance\nTrust-based language installation","the-default-template#The Default Template":"AD4M comes with a default LinkLanguage template called \"Perspective Diff Sync\" (P-Diff-Sync), authored by Coasys. This implementation:\nUses Holochain as the P2P backend\nImplements a CRDT algorithm for consistency\nCreates isolated DHT networks per instance","trust-and-templates#Trust and Templates":"The templating system works with AD4M's trust mechanism:\nInitial Trust:\nNew AD4M installations trust Coasys by default\nThis means they trust the P-Diff-Sync template\nThe template's code hash is verified against Coasys's signature\nTemplate Usage:\n// Create a unique LinkLanguage instance\nconst linkLanguage = await ad4m.languages.applyTemplateAndPublish(\n templateAddress,\n {\n uuid: \"unique-network-id\", // Creates isolated DHT\n name: \"Team Space Sync\"\n }\n);\nTrust Verification:\nWhen installing a templated Language, AD4M verifies:\nThe template source is trusted\nThe templating only modified allowed parameters\nThe resulting code matches the expected hash\nThis means agents can safely install Languages created from trusted templates, even if they don't trust the Neighbourhood creator directly.","holochain-integration#Holochain Integration":"For the P-Diff-Sync template:\nEach templated instance creates its own Holochain DNA\nThe uuid parameter ensures a unique network ID\nAgents joining the Neighbourhood join this specific DHT\nThe network is isolated from other Neighbourhoods\n// Example of full Neighbourhood creation with templating\nconst createNeighbourhood = async () => {\n // 1. Create unique LinkLanguage from template\n const template = (await ad4m.runtime.knownLinkLanguageTemplates())[0];\n const linkLang = await ad4m.languages.applyTemplateAndPublish(\n template,\n {\n uuid: crypto.randomUUID(),\n name: \"My Space Sync\"\n }\n );\n \n // 2. Create and publish Neighbourhood\n const meta = new Perspective();\n meta.add({\n source: \"self\",\n predicate: \"name\",\n target: \"My Collaborative Space\"\n });\n \n return await ad4m.neighbourhood.publishFromPerspective(\n perspective.uuid,\n linkLang.address,\n meta\n );\n};","creating-collaborative-spaces#Creating Collaborative Spaces":"","setting-up-a-neighbourhood#Setting Up a Neighbourhood":"First, choose or create a LinkLanguage for your sync needs:\n// List available LinkLanguage templates\nconst templates = await ad4m.runtime.knownLinkLanguageTemplates();\n// Create a unique instance of a LinkLanguage\nconst linkLanguage = await ad4m.languages.applyTemplateAndPublish(\n templates[0], // e.g., Perspective Diff Sync\n JSON.stringify({\n uuid: \"unique-id-123\", // Unique network identifier\n name: \"My Team Sync\"\n })\n);\nThen create the Neighbourhood:\n// Optional: Create metadata about the Neighbourhood\nconst meta = new Perspective();\nawait meta.add({\n source: \"neighbourhood://self\",\n predicate: \"name\",\n target: \"literal://My Team Space\"\n});\n// Create the Neighbourhood from a Perspective\nconst url = await ad4m.neighbourhood.publishFromPerspective(\n perspective.uuid,\n linkLanguage.address,\n meta\n);\n// Returns: neighbourhood://Qm123456789abcdef","joining-a-neighbourhood#Joining a Neighbourhood":"Other agents can join using the Neighbourhood URL:\n// Join the Neighbourhood\nconst { uuid } = await ad4m.neighbourhood.joinFromUrl(url);\n// Get the shared Perspective\nconst shared = await ad4m.perspective.byUUID(uuid);\n// Listen for changes\nshared.addListener((links) => {\n console.log(\"New links:\", links);\n});","building-on-neighbourhoods#Building on Neighbourhoods":"","app-independent-collaboration#App-Independent Collaboration":"Neighbourhoods enable collaboration without locking data into specific apps:\n// Chat app might add message links\nawait shared.add({\n source: \"did:key:alice\",\n predicate: \"chat://posted\",\n target: \"QmMsg123://Hello!\"\n});\n// Task app might add assignment links\nawait shared.add({\n source: \"did:key:bob\",\n predicate: \"task://assigned-to\",\n target: \"did:key:carol\"\n});","integration-examples#Integration Examples":"The power of LinkLanguages lies in their ability to bridge AD4M with existing infrastructure. Here are some practical integration scenarios:\nCompany Intranet Integration:\nWrap your existing database or document management system in a LinkLanguage\nLeverage existing user permissions and access control\nMake company data available to AD4M apps while maintaining security\nEnable semantic overlays on traditional hierarchical storage\nFor example, your company's SharePoint or document management system could become a LinkLanguage, allowing AD4M apps to collaborate on documents while respecting existing access controls and security policies.\nLegacy System Integration:\nConnect to existing groupware or collaboration tools\nMap traditional data structures to semantic links\nMaintain existing workflows while enabling new capabilities\nGradually transition to more semantic approaches\nThis allows teams to keep using their familiar tools while gaining the benefits of AD4M's semantic capabilities. For instance, a team's JIRA instance could be wrapped as a LinkLanguage, making tickets and workflows available in the semantic web.\nFederated Systems:\nBridge ActivityPub, Matrix, or other federated protocols\nEnable cross-platform semantic connections\nMaintain federation while adding semantic capabilities\nIntegrate with existing social networks\nThe beauty of this approach is that AD4M apps don't need to know about the underlying infrastructure. Whether links are stored in a corporate database, a blockchain, or a p2p network, the apps just work with the semantic layer provided by the LinkLanguage.","best-practices#Best Practices":"Choose the Right LinkLanguage:\nConsider privacy requirements\nEvaluate scalability needs\nThink about integration points\nDesign Semantic Structure:\nPlan your predicate vocabulary\nConsider multiple app use cases\nDocument link patterns\nHandle Updates:\nListen for changes\nUpdate UI in real-time\nHandle conflicts gracefully"}},"/languages":{"title":"Languages: Communication Protocols for Agents","data":{"understanding-languages-in-ad4m#Understanding Languages in AD4M":"In AD4M, Languages are the fundamental building blocks that define how agents communicate and share data. While we call them \"Languages\", they could just as well be called \"Protocols\" or \"Data Storage Adapters\" – they define the rules and mechanisms by which nodes in the network exchange information.The term \"Language\" was chosen deliberately: just as human languages enable people to communicate and share ideas, AD4M Languages enable digital agents to exchange data and interact. Alternative metaphors could have been \"Games\" or \"Dances\" – patterns of interaction between agents.","core-mechanism#Core Mechanism":"At their heart, Languages implement a simple but powerful mechanism:\nStorage: Take some data, store it in a shared space (could be a server, Holochain DHT, blockchain, etc.), and return a URI that points to that data\nRetrieval: Take a URI and return the previously stored data (called an \"Expression\" in AD4M)\nThis mechanism creates a universal way for agents to share and reference information, regardless of where or how it's actually stored. For example:\nAn IPFS Language might store data in the IPFS network and return a CID\nA Holochain Language might store data in a DHT and return an entry hash\nA Web2 Language might store data on a server and return a URL","universal-addressing-mechanism#Universal Addressing Mechanism":"AD4M's Language system extends the familiar URI/URL model into a truly universal addressing scheme. Every Expression (the signed data objects in AD4M) is addressable through a URI that combines:\nThe Language's unique identifier (a hash of its implementation code)\nThe Language-specific address for that data\nFor example:\n://\nThis means AD4M can seamlessly integrate with and extend existing addressing systems:\nWeb URLs become: http://example.com/resource\nIPFS content becomes: QmIPFS123://\nAgent DIDs become: did:key:z6Mk...\nCustom protocols become: QmCustom789://user123/post456\nThe Language-Language (one of AD4M's bootstrap Languages) makes this system dynamic and extensible:\nNew Languages can be published and their code verified\nAny AD4M instance can discover and install Languages as needed\nThe system can evolve without central coordination\nThis creates a spanning layer across the internet where:\nEvery piece of data has a globally unique address\nAddresses are self-describing (include their protocol)\nNew protocols can be added dynamically\nExisting systems can be integrated seamlessly","why-languages-matter#Why Languages Matter":"Languages in AD4M serve several crucial purposes:\nDefine how data is stored and retrieved\nSpecify how agents communicate\nEnable different storage backends (IPFS, Holochain, centralized servers, etc.)\nAllow for extensible and pluggable protocols\nCreate semantic meaning through shared understanding","technical-implementation#Technical Implementation":"At its core, AD4M is a Language runtime. Languages are implemented as JavaScript modules that run in a sandboxed Deno environment within the AD4M executor. This provides:\nSecure execution environment\nTypeScript support out of the box\nModern ES module system\nBuilt-in permissions model","language-module-contract#Language Module Contract":"Every Language module must export a default create function with this signature:\nexport default function create(context: LanguageContext): Language | Promise\nThis function is the entry point for your Language. The AD4M executor will:\nLoad your Language module in the Deno sandbox\nCall the create function with a LanguageContext\nUse the returned Language object to interact with your implementation","the-languagecontext#The LanguageContext":"The LanguageContext provides essential services and capabilities to your Language:\ninterface LanguageContext {\n // Access to the agent's signing capabilities\n agent: AgentService;\n \n // For verifying signatures\n signatures: SignaturesService;\n \n // Path for persistent storage\n storageDirectory: string;\n \n // Language-specific settings\n customSettings: object;\n \n // Access to Holochain functionality\n Holochain?: HolochainLanguageDelegate;\n \n // For handling AD4M signals\n ad4mSignal: Ad4mSignalCB;\n}\nKey features provided by the context:\nAgent Service\n// Sign expressions with the agent's keys\nconst expression = context.agent.createSignedExpression(data);\n// Get the agent's DID\nconst did = context.agent.did;\nHolochain Integration\n// Register a Holochain DNA\nawait context.Holochain.registerDNAs([{\n file: dnaPath,\n nick: 'my-dna'\n}]);\n// Call Holochain zome functions\nconst result = await context.Holochain.call(\n 'my-dna',\n 'zome-name',\n 'function-name',\n payload\n);\nStorage and Settings\n// Access persistent storage\nconst storagePath = context.storageDirectory;\n// Use custom settings\nconst settings = context.customSettings;","the-language-interface#The Language Interface":"Here's the core interface that all Languages must implement:\ninterface Language {\n // Required: Name of the language\n readonly name: string;\n // Optional adapters for different functionalities:\n // For languages that store and retrieve expressions\n readonly expressionAdapter?: ExpressionAdapter;\n // For languages that handle UI rendering\n readonly expressionUI?: ExpressionUI;\n // For languages that manage links (used in Neighbourhoods)\n readonly linksAdapter?: LinkSyncAdapter;\n // For real-time presence and p2p signals\n readonly telepresenceAdapter?: TelepresenceAdapter;\n // For direct messaging between agents\n readonly directMessageAdapter?: DirectMessageAdapter;\n // For language-specific settings UI\n readonly settingsUI?: SettingsUI;\n // Optional: Mark expressions as immutable for caching\n isImmutableExpression?(expression: Address): boolean;\n // Define available interactions with expressions\n interactions(expression: Address): Interaction[];\n}\nLanguage interface in the API reference |\nLanguage.ts in the codebase","types-of-languages#Types of Languages":"AD4M supports several types of Languages for different purposes:\nExpression Languages\nStore and retrieve data\nMost common type\nExample: IPFS-based file storage\nLink Languages\nCore building block of Neighbourhoods\nEnable shared semantic spaces\nExample: Holochain-based p2p links\nDirect Message Languages\nEnable agent-to-agent communication\nSupport private messaging\nExample: Encrypted p2p messaging","working-with-languages#Working with Languages":"","the-core-expression-mechanism#The Core Expression Mechanism":"Before diving into examples, it's important to understand that most Languages (all basic \"Expression Languages\") operate around the same core pattern:\ninterface ExpressionAdapter {\n // Store data and get a reference\n putAdapter: {\n createPublic(content: object): Promise
;\n // or for read-only languages:\n addressOf(content: object): Promise
;\n };\n \n // Retrieve data using its reference\n get(address: Address): Promise;\n}\nThis simple pattern enables AD4M to create a web of semantic references, where any piece of data can be stored and referenced by its address, regardless of the underlying storage mechanism.","installing-languages#Installing Languages":"// Install a language from its address\nawait ad4m.languages.install(\"Qm...\");\n// List all installed languages\nconst languages = await ad4m.languages.all();","publishing-languages#Publishing Languages":"// Publish a new language\nconst address = await ad4m.languages.publish({\n name: \"my-language\",\n description: \"A custom language implementation\",\n sourceCodeLink: \"https://github.com/...\",\n bundle: languageBundle\n});","using-languages#Using Languages":"// Create an expression in a language\nconst expression = await ad4m.expression.create(\n languageAddress,\n { content: \"Hello, World!\" }\n);\n// Retrieve an expression\nconst retrieved = await ad4m.expression.get(expression.address);","built-in-languages#Built-in Languages":"AD4M comes with several bootstrap languages:\nAgent Language: Resolves DIDs to agent information\nLanguage Language: Manages language publication and installation\nPerspective Language: Handles perspective storage and sharing\nNeighbourhood Language: Enables creation of shared spaces","security-considerations#Security Considerations":"Languages run in a sandboxed environment with:\nControlled access to system resources\nExplicit permission model\nIsolated execution context\nSecure communication channels\nFor a detailed guide on creating your own Language, see the Language Development Guide.To help you get started with creating your own languages, we have provided some templates that you can use as a starting point. These templates are Deno compatible and provide a basic structure for your language.\nExpression Language without DNA template\nExpression Language with DNA template\nLink Language without DNA template\nLink Language with DNA template\nYou can clone these repositories and modify them to create your own language. Remember to follow the guidelines for making your language Deno compatible."}}} \ No newline at end of file +{"/developer-guides/ai":{"title":"AI in AD4M","data":{"":"Looking for AI agent integration? This page covers running AI models inside AD4M. If you want AI agents to use AD4M — creating perspectives, managing data, joining neighbourhoods — see the MCP Server guide.\nAD4M provides powerful AI capabilities through both local and remote model inference. This allows you to integrate various AI models into your applications, from language models to embedding models and speech recognition.","overview#Overview":"The AI system in AD4M supports:\nLarge Language Models (LLM) for text generation and chat\nEmbedding Models for vector representations of text\nSpeech-to-Text Models for audio transcription\nBoth local and remote (API-based) model execution\nModel management and configuration\nTask-based inference with system prompts and examples","model-configuration#Model Configuration":"Before using AI features, models need to be configured in the AD4M Launcher. Models can be either local (running on your device) or remote (using external APIs).","local-models#Local Models":"Local models run directly on your device using CPU or GPU acceleration (if available). There are three ways to configure local models:","1-pre-configured-models#1. Pre-configured Models":"AD4M comes with several pre-configured models that can be used by simply specifying their name:\nconst preConfiguredModel = {\n name: \"DeepHermes 3 (Q4)\",\n local: {\n fileName: \"deephermes-3-llama-3-8b-Q4\" // Just specify the model name\n },\n modelType: \"LLM\"\n};\nAvailable pre-configured models:Language Models (LLM):\nQwen2.5.1-Coder-7B-Instruct - Optimized for coding tasks\ndeephermes-3-llama-3-8b-Q4 - Fast, efficient 8B parameter model (Q4 quantization)\ndeephermes-3-llama-3-8b-Q6 - Better quality, slightly larger (Q6 quantization)\ndeephermes-3-llama-3-8b-Q8 - Best quality, largest size (Q8 quantization)\ndeepseek_r1_distill_qwen_1_5b - Small, fast 1.5B parameter model\ndeepseek_r1_distill_qwen_7b - Medium 7B parameter model\ndeepseek_r1_distill_qwen_14b - Large 14B parameter model\nEmbedding Models:\nbert - Built-in BERT model for text embeddings\nSpeech-to-Text Models:\nWhisper - OpenAI's Whisper model for audio transcription","2-models-from-hugging-face#2. Models from Hugging Face":"AD4M can automatically download and use models from Hugging Face. Just provide the repository details:\nconst huggingFaceModel = {\n name: \"Custom LLM\",\n local: {\n fileName: \"model.gguf\", // The model file to use from the repo\n huggingfaceRepo: \"username/model-repo\", // Hugging Face repository path\n revision: \"main\", // Branch or tag to use\n tokenizerSource: { // Optional custom tokenizer\n repo: \"username/tokenizer-repo\",\n revision: \"main\",\n fileName: \"tokenizer.json\"\n }\n },\n modelType: \"LLM\"\n};\n// Example with a specific model version\nconst versionedModel = {\n name: \"Specific Model Version\",\n local: {\n fileName: \"model-q4.gguf\",\n huggingfaceRepo: \"TheBloke/Mistral-7B-Instruct-v0.1-GGUF\",\n revision: \"main\"\n },\n modelType: \"LLM\"\n};\nWhen you add a model with a Hugging Face repository, AD4M will:\nDownload the model files from Hugging Face\nStore them locally\nLoad the model when needed","3-local-files#3. Local Files":"You can also use model files that are already on your device:\nconst localFileModel = {\n name: \"My Local Model\",\n local: {\n fileName: \"/absolute/path/to/model.gguf\", // Full path to model file\n tokenizerSource: {\n repo: \"\", // Empty repo means local file\n fileName: \"/path/to/tokenizer.json\"\n }\n },\n modelType: \"LLM\"\n};","remote-models-api#Remote Models (API)":"Remote models use external APIs for inference. AD4M currently supports OpenAI-compatible APIs:\n// OpenAI API\nconst openAiModel = {\n name: \"GPT-4\",\n api: {\n baseUrl: \"https://api.openai.com/v1\",\n apiKey: \"your-api-key\",\n model: \"gpt-4\",\n apiType: \"OPEN_AI\"\n },\n modelType: \"LLM\"\n};\n// Custom OpenAI-compatible API\nconst customApiModel = {\n name: \"Local API Server\",\n api: {\n baseUrl: \"http://localhost:8000\",\n apiKey: \"local-key\",\n model: \"local-model\",\n apiType: \"OPEN_AI\"\n },\n modelType: \"LLM\"\n};","hardware-acceleration#Hardware Acceleration":"AD4M automatically detects and uses available hardware acceleration:\nCUDA: For NVIDIA GPUs (requires cuda feature)\nMetal: For Apple Silicon and AMD GPUs on macOS (requires metal feature)\nCPU: Falls back to CPU if no GPU acceleration is available","using-ai-in-your-application#Using AI in Your Application":"","1-adding-models#1. Adding Models":"import { Ad4mClient } from '@coasys/ad4m';\nconst client = new Ad4mClient();\n// Add a model\nconst modelId = await client.ai.addModel(modelConfig);\n// Wait for model to load\nlet status;\ndo {\n status = await client.ai.modelLoadingStatus(modelId);\n await new Promise(resolve => setTimeout(resolve, 1000));\n} while (status.progress < 100);","2-creating-ai-tasks#2. Creating AI Tasks":"Tasks allow you to define specific use cases with system prompts and examples:\nconst task = await client.ai.addTask(\n \"code-helper\",\n modelId,\n \"You are a helpful coding assistant. Provide clear and concise code examples.\",\n [\n { \n input: \"How do I read a file in Node.js?\", \n output: \"Here's a simple example using fs.readFile:\\n\\n```javascript\\nconst fs = require('fs');\\n\\nfs.readFile('file.txt', 'utf8', (err, data) => {\\n if (err) throw err;\\n console.log(data);\\n});\\n```\" \n }\n ]\n);","3-using-models#3. Using Models":"","text-generation-llm#Text Generation (LLM)":"// Using a task\nconst response = await client.ai.prompt(\n task.taskId,\n \"How do I create a web server in Node.js?\"\n);\n// The response will follow the system prompt and examples pattern\nconsole.log(response);","text-embeddings#Text Embeddings":"// Get vector representation of text\nconst vector = await client.ai.embed(\n \"bert\", // Built-in BERT model\n \"Convert this text to a vector\"\n);","speech-to-text#Speech-to-Text":"// Open a transcription stream\nconst streamId = await client.ai.openTranscriptionStream(\n \"Whisper\",\n (text) => {\n console.log(\"Transcribed:\", text);\n },\n {\n // Optional voice activity detection parameters\n startThreshold: 0.3,\n startWindow: 150,\n endThreshold: 0.2,\n endWindow: 300,\n timeBeforeSpeech: 100\n }\n);\n// Feed audio data (Float32Array samples at 16kHz)\nawait client.ai.feedTranscriptionStream(streamId, audioSamples);\n// Close stream when done\nawait client.ai.closeTranscriptionStream(streamId);\n// Or use multiple streams simultaneously\nconst fastStreamId = await client.ai.openTranscriptionStream(\n \"whisper_tiny\",\n (text) => console.log(\"Fast preview:\", text),\n {\n startThreshold: 0.25,\n startWindow: 100,\n endThreshold: 0.15,\n endWindow: 100\n }\n);\nconst accurateStreamId = await client.ai.openTranscriptionStream(\n \"whisper_small\",\n (text) => console.log(\"Accurate:\", text),\n {\n startThreshold: 0.3,\n startWindow: 150,\n endThreshold: 0.2,\n endWindow: 500\n }\n);\n// Feed same audio to both streams with a single call\nawait client.ai.feedTranscriptionStream([fastStreamId, accurateStreamId], audioSamples);\nNote: Transcription streams are automatically cleaned up after 30 seconds of inactivity.","best-practices#Best Practices":"Model Selection\nUse quantized models (Q4/Q6) for faster inference on CPU\nUse larger models when quality is critical\nConsider API models for production use cases\nTask Design\nWrite clear system prompts\nProvide specific examples\nUse task-specific models when possible\nResource Management\nClose transcription streams when done\nMonitor model loading status\nHandle errors appropriately\nPerformance\nUse GPU acceleration when available\nBatch similar requests together\nConsider model size vs performance tradeoffs","error-handling#Error Handling":"try {\n const response = await client.ai.prompt(taskId, prompt);\n} catch (error) {\n if (error.message.includes(\"Model not found\")) {\n // Handle missing model\n } else if (error.message.includes(\"Task not found\")) {\n // Handle missing task\n } else {\n // Handle other errors\n }\n}","advanced-features#Advanced Features":"","default-models#Default Models":"You can set default models for each type:\nawait client.ai.setDefaultModel(\"LLM\", modelId);\n// Use default model in tasks\nconst task = await client.ai.addTask(\n \"default-task\",\n \"default\", // Uses the default LLM\n \"System prompt...\",\n []\n);","model-updates#Model Updates":"Models can be updated while maintaining tasks:\nconst updated = await client.ai.updateModel(modelId, newConfig);","real-time-transcription#Real-time Transcription":"Configure voice activity detection for word-by-word transcription:\nconst streamId = await client.ai.openTranscriptionStream(\n \"Whisper\",\n (text) => console.log(\"Word:\", text),\n {\n startThreshold: 0.25,\n startWindow: 100,\n endThreshold: 0.15,\n endWindow: 100,\n timeBeforeSpeech: 20\n }\n);","multiple-transcription-streams#Multiple Transcription Streams":"You can process the same audio through multiple models simultaneously:\n// Use a fast model for real-time preview\nconst fastStreamId = await client.ai.openTranscriptionStream(\n \"whisper_tiny\",\n (text) => console.log(\"Preview:\", text),\n { startThreshold: 0.25, endWindow: 100 }\n);\n// Use a more accurate model for final results\nconst accurateStreamId = await client.ai.openTranscriptionStream(\n \"whisper_small\",\n (text) => console.log(\"Final:\", text),\n { startThreshold: 0.3, endWindow: 500 }\n);\n// Feed audio to both streams efficiently\nawait client.ai.feedTranscriptionStream([fastStreamId, accurateStreamId], audioSamples);","automatic-stream-cleanup#Automatic Stream Cleanup":"Transcription streams are automatically cleaned up after 30 seconds of inactivity to prevent resource leaks. This means:\nNo need to manually close streams if the client disconnects\nResources are freed automatically when streams are abandoned\nStreams remain active as long as they receive audio data regularly"}},"/auth":{"title":"Authentication & Capabilities","data":{"overview#Overview":"AD4M uses a capability-based security model to protect user data and control access to agent functionality. Every application that wants to interact with an AD4M executor needs to request specific capabilities, which are then granted (or denied) by the user.","what-are-capabilities#What are Capabilities?":"Capabilities in AD4M are like permission tokens that:\nDefine what data an application can access (which perspectives)\nSpecify what operations an application can perform\nAre scoped to specific domains and functions\nCan be revoked by the user at any time\nA capability token might grant permissions like:\nRead access to specific perspectives\nWrite access to create or modify links\nAbility to create new perspectives\nPermission to manage agent relationships\nAccess to specific language functions","authentication-flow#Authentication Flow":"","standard-flow#Standard Flow":"When an application wants to connect to an AD4M executor, it goes through a secure authentication handshake:\nThe application requests access with specific capabilities\nThe AD4M executor generates a random verification code\nThe user must confirm the request and enter the code\nUpon successful verification, a capability token is issued\nThis flow ensures that:\nThe user explicitly approves application access\nThe application only gets the permissions it needs\nThe connection between UI and executor is secure","using-ad4m-connect#Using ad4m-connect":"The easiest way to implement this flow is using our ad4m-connect library:\nimport Ad4mConnect from \"@coasys/ad4m-connect\";\nconst ui = Ad4mConnect({\n appName: \"My First ADAM App\",\n appDesc: \"This is my first app here.\",\n appDomain: \"ad4m.dev\",\n appIconPath: \"https://i.ibb.co/GnqjPJP/icon.png\",\n capabilities: [{ \n with: { domain: \"*\", pointers: [\"*\"] }, \n can: [\"*\"] \n }],\n});\n// .connect() will show the authentication pop up\nui.connect().then((client) => {\n // Client is now authenticated with requested capabilities\n});\nIf ad4m-connect could not find a running AD4M-executor, it will show a screen prompting the user to either download and run\nthe AD4M Launcher to provide other connection settings:When ad4m-connect was able to find a running AD4M-executor, it will begin the authentication flow:\nClicking on \"Authorize\" will trigger the request against the AD4M-executor and Launcher will open a pop-up prompting the user\nwith the nature of this request:\nThe application requesting access\nThe capabilities being requested\nIf the user approves the request, the Launcher will show a six-digit random secret code that needs to be entered into the app UI.\nThat way we have safely established that the network agent initiating the capability request (as seen from\nthe AD4M-executor) really is the UI the users wants to use.\n(It could run on an external device, like the user's phone connecting through a proxy server).","capability-specification#Capability Specification":"When requesting capabilities, you need to specify:\n{\n with: {\n domain: string | \"*\", // Which perspective/domain\n pointers: string[] | \"*\" // Which parts of the domain\n },\n can: string[] | \"*\" // Which operations are allowed\n}\nExamples:\n// Request access to everything (development only)\n{ with: { domain: \"*\", pointers: [\"*\"] }, can: [\"*\"] }\n// Request read-only access to a specific perspective\n{ with: { domain: \"perspective-uuid\", pointers: [\"*\"] }, can: [\"read\"] }\n// Request specific operations on a domain\n{ with: { domain: \"friends\", pointers: [\"*\"] }, can: [\"read\", \"add\", \"remove\"] }","admin-credential-override#Admin Credential Override":"For automated scenarios or system integration, the authentication handshake can be bypassed using an admin credential:\n// In your application\nconst client = new Ad4mClient({\n adminCredential: \"your-secret-here\"\n});\nThis is particularly useful for:\nCI/CD pipelines\nTesting environments\nSystem services\nManagement interfaces (the AD4M Launcher uses this internally)\nTo enable this on the executor:\nad4m-executor run --admin-credential your-secret-here\n⚠️ Security Note: The admin credential grants full access to the executor. Use it carefully and never expose it in client-side code or public repositories.","best-practices#Best Practices":"Request Minimal Capabilities\nOnly request permissions your app actually needs\nUse specific domains and operations instead of wildcards\nConsider read-only access when possible\nHandle Authentication States\nCheck if capabilities are still valid\nImplement reconnection logic\nHandle capability revocation gracefully\nSecure Storage\nStore capability tokens securely\nNever expose admin credentials\nImplement token refresh mechanisms\nUser Experience\nClearly explain why your app needs certain capabilities\nProvide feedback during the authentication process\nHandle errors gracefully","more-information#More Information":"For more details about implementing authentication in your application:\nCheck the ad4m-connect documentation\nSee the Ad4mClient API reference"}},"/developer-guides/hooks":{"title":"AD4M React Hooks","data":{"":"AD4M provides a set of React hooks to easily work with core AD4M concepts like Agents, Perspectives, and Subjects. These hooks handle state management, caching, and real-time updates automatically.","useclient#useClient":"The most fundamental hook that provides access to the AD4M client instance.\nimport { useClient } from '@coasys/ad4m-react-hooks';\nfunction MyComponent() {\n const { client, error, reload } = useClient();\n if (error) {\n return
Error connecting to AD4M: {error}
;\n }\n if (!client) {\n return
Connecting to AD4M...
;\n }\n return
Connected to AD4M
;\n}\nThe hook returns:\nclient: The AD4M client instance\nerror: Any connection errors\nreload: Function to retry the connection\nmutate: Function to update the cached client instance","useagent#useAgent":"Fetches and caches agent data by DID, with support for profile formatting.\nimport { useAgent } from '@coasys/ad4m-react-hooks';\nfunction AgentProfile({ agentClient, did }) {\n const { agent, profile, error } = useAgent({\n client: agentClient,\n did,\n formatter: (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n })\n });\n if (error) return
Error: {error}
;\n if (!agent) return
Loading...
;\n return (\n
\n

{profile?.name}

\n

{profile?.bio}

\n

DID: {agent.did}

\n
\n );\n}","useme#useMe":"Provides access to the current agent's data and status.\nimport { useMe } from '@coasys/ad4m-react-hooks';\nfunction MyProfile({ agentClient }) {\n const { me, status, profile, error } = useMe(agentClient, (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n }));\n if (error) return
Error: {error}
;\n if (!me) return
Loading...
;\n return (\n
\n

{profile?.name}

\n

{profile?.bio}

\n

Status: {status.isUnlocked ? 'Unlocked' : 'Locked'}

\n
\n );\n}","useperspective#usePerspective":"Fetches and subscribes to a single perspective by UUID.\nimport { usePerspective } from '@coasys/ad4m-react-hooks';\nfunction Perspective({ client, uuid }) {\n const { data } = usePerspective(client, uuid);\n const { perspective, synced } = data;\n if (!perspective) return
Loading...
;\n return (\n
\n

{perspective.name}

\n

Synced: {synced ? 'Yes' : 'No'}

\n

UUID: {perspective.uuid}

\n
\n );\n}","useperspectives#usePerspectives":"Provides access to all perspectives and handles real-time updates.\nimport { usePerspectives } from '@coasys/ad4m-react-hooks';\nfunction PerspectivesList({ client }) {\n const { perspectives, neighbourhoods, onLinkAdded, onLinkRemoved } = usePerspectives(client);\n useEffect(() => {\n const handleNewLink = (perspective, link) => {\n console.log(`New link in ${perspective.name}:`, link);\n };\n onLinkAdded(handleNewLink);\n return () => onLinkRemoved(handleNewLink);\n }, []);\n return (\n
\n

All Perspectives

\n
    \n {Object.values(perspectives).map(p => (\n
  • {p.name}
  • \n ))}\n
\n \n

Neighbourhoods

\n
    \n {Object.values(neighbourhoods).map(p => (\n
  • {p.name}
  • \n ))}\n
\n
\n );\n}","uselivequery#useLiveQuery":"Provides reactive, live-updating access to AD4M model data with support for collections, single instances, pagination, and parent-scoped queries. Replaces the previous useModel hook.","collection-mode-default#Collection Mode (default)":"import { useLiveQuery } from '@coasys/ad4m-react-hooks';\nimport { Todo } from './models/Todo';\nfunction TodoList({ perspective }) {\n const { data, loading, error, totalCount, loadMore } = useLiveQuery(\n Todo,\n perspective,\n {\n query: { where: { status: \"active\" } },\n pageSize: 10,\n }\n );\n if (error) return
Error: {error}
;\n if (loading && data.length === 0) return
Loading...
;\n return (\n
\n

Todos ({totalCount})

\n {data.map(todo => (\n
\n

{todo.title}

\n

{todo.description}

\n
\n ))}\n {data.length < totalCount && (\n \n )}\n
\n );\n}","single-instance-mode#Single-Instance Mode":"When you provide id in options, the hook returns a single item instead of an array:\nfunction TodoDetail({ perspective, todoId }) {\n const { data: todo, loading, error } = useLiveQuery(\n Todo,\n perspective,\n { id: todoId }\n );\n if (loading) return
Loading...
;\n if (error) return
Error: {error}
;\n if (!todo) return
Not found
;\n return

{todo.title}

;\n}","parent-scoped-queries#Parent-Scoped Queries":"Filter results to children of a specific parent:\nfunction RecipeComments({ perspective, recipe }) {\n const { data: comments } = useLiveQuery(\n Comment,\n perspective,\n {\n parent: { model: Recipe, id: recipe.id }\n }\n );\n return (\n
    \n {comments.map(c =>
  • {c.body}
  • )}\n
\n );\n}","return-types#Return Types":"Collection mode (LiveCollectionResult):\ndata: T[] — Array of model instances\nloading: boolean — Whether a query is in progress\nerror: string — Error message if any\ntotalCount: number — Total matching items (for pagination)\nloadMore: () => void — Load next page\nSingle-instance mode (LiveInstanceResult):\ndata: T | null — The model instance or null\nloading: boolean\nerror: string","vue-usage#Vue Usage":"The Vue hook has the same API but returns Vue Ref-wrapped values and accepts ComputedRef for the perspective parameter:\nimport { useLiveQuery } from '@coasys/ad4m-vue-hooks';\nconst { data, loading, error, totalCount, loadMore } = useLiveQuery(\n Todo,\n perspective, // Can be a ComputedRef\n { pageSize: 10 }\n);\n// data.value is T[] (collection) or T | null (single-instance)\nThe Vue hook automatically re-subscribes when the perspective ref changes, and cleans up subscriptions on unmount.","important-notes#Important Notes":"Registration: Call .register(perspective) once at app startup (e.g., await Recipe.register(perspective)) — the hook does not register models automatically. Use the concrete generated class, not the @Model decorator.\nCleanup: Subscriptions are automatically disposed on component unmount.\nString model support: You can pass a model class name string instead of a class for dynamic/generic use cases.","best-practices#Best Practices":"Always handle loading and error states\nif (error) return ;\nif (!data) return ;\nClean up subscriptions\nuseEffect(() => {\n const callback = (perspective, link) => { /* ... */ };\n onLinkAdded(callback);\n return () => onLinkRemoved(callback);\n}, []);\nUse formatters for consistent data structure\nconst formatter = (links) => ({\n name: links.find(l => l.data.predicate === 'name')?.data.target,\n bio: links.find(l => l.data.predicate === 'bio')?.data.target\n});\nLeverage caching\n// The hooks handle caching automatically\nconst { data: perspective1 } = usePerspective(client, uuid1);\nconst { data: perspective2 } = usePerspective(client, uuid2);\nUse TypeScript for better type safety\n// useLiveQuery is fully typed — generics are inferred from the model class\nconst { data } = useLiveQuery(Todo, perspective);\n// data is Todo[] with full autocomplete"}},"/developer-guides/batch-operations":{"title":"Batch Operations","data":{"overview#Overview":"Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This is useful when you need to perform multiple related changes that should either all succeed or all fail together, and when you want to optimize performance by reducing internal engine updates (SurrealDB indexing, and Prolog inference if activated) and network operations.","key-benefits#Key Benefits":"","1-atomicity#1. Atomicity":"All operations in a batch are applied together or none are applied\nPrevents partial updates that could leave your data in an inconsistent state\nIdeal for complex operations that require multiple related changes","2-performance-optimization#2. Performance Optimization":"Reduces the number of internal engine updates (SurrealDB indexing, query subscriptions, and Prolog inference if activated)\nMinimizes the number of commits to the neighbourhood's link language\nBatches network operations for shared perspectives\nImproves overall system responsiveness when making multiple changes","using-transactions#Using Transactions":"The recommended way to use batch operations is Ad4mModel.transaction(), which creates a batch, runs your callback, and commits only on success:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n const recipe = await Recipe.create(perspective, { name: \"Cake\" }, { batchId: tx.batchId });\n const comment = new Comment(perspective);\n comment.body = \"Looks great!\";\n await comment.save(tx.batchId);\n // Relation methods also accept batchId\n await recipe.addComments(comment, tx.batchId);\n});\n// All operations commit together, or none do if an error is thrown\nIf any operation inside the callback throws, the batch is never committed and no changes are persisted.","complex-data-models#Complex Data Models":"When your application needs to maintain relationships between multiple entities:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n const userProfile = await UserProfile.create(perspective, { name: \"Alice\" }, { batchId: tx.batchId });\n const userSettings = await UserSettings.create(perspective, { theme: \"dark\" }, { batchId: tx.batchId });\n for (const preference of userPreferences) {\n await preference.save(tx.batchId);\n }\n});","bulk-operations#Bulk Operations":"When performing operations on multiple items:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n for (const task of tasks) {\n task.status = 'completed';\n await task.save(tx.batchId);\n }\n});","state-transitions#State Transitions":"When an operation requires multiple coordinated changes:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n await sourceList.removeTask(task, tx.batchId);\n await targetList.addTask(task, tx.batchId);\n task.status = 'moved';\n await task.save(tx.batchId);\n});","creating-related-subjects#Creating Related Subjects":"await Ad4mModel.transaction(perspective, async (tx) => {\n // Create main subject\n const post = await BlogPost.create(perspective, { title: \"My First Post\" }, { batchId: tx.batchId });\n // Create related subjects\n const comments = initialComments.map(text => {\n const c = new Comment(perspective);\n c.content = text;\n c.postId = post.id;\n return c;\n });\n // Save all related subjects in the same transaction\n await Promise.all(comments.map(c => c.save(tx.batchId)));\n});","validation-before-commit#Validation Before Commit":"Validate data before any writes — if validation fails, the thrown error prevents commit:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n // Validate all ingredients first\n for (const ingredient of ingredients) {\n if (!await validateIngredient(ingredient)) {\n throw new Error(`Invalid ingredient: ${ingredient}`);\n }\n }\n // If all valid, proceed with updates\n recipe.ingredients = ingredients;\n await recipe.save(tx.batchId);\n // Create ingredient references\n for (const ingredient of ingredients) {\n const ref = new IngredientReference(perspective);\n ref.recipeId = recipe.id;\n ref.ingredientId = ingredient.id;\n await ref.save(tx.batchId);\n }\n});\n// Nothing is persisted if validation threw","advanced-manual-batch-control#Advanced: Manual Batch Control":"For lower-level control (e.g. mixing model operations with raw link operations), you can manage batches directly via PerspectiveProxy:\nconst batchId = await perspective.createBatch();\ntry {\n // Add multiple links in the batch\n await perspective.add(link1, 'shared', batchId);\n await perspective.add(link2, 'shared', batchId);\n \n // Remove a link in the same batch\n await perspective.remove(oldLink, batchId);\n \n // Update a link in the batch\n await perspective.update(existingLink, newLink, batchId);\n // Model operations also accept batchId\n const recipe = new Recipe(perspective);\n recipe.title = \"Chocolate Cake\";\n await recipe.save(batchId);\n // Commit all changes atomically\n const result = await perspective.commitBatch(batchId);\n console.log('Added:', result.additions.length);\n console.log('Removed:', result.removals.length);\n} catch (error) {\n // If any operation fails, none of the changes are applied\n console.error('Batch operation failed:', error);\n}\nUnder the hood, Ad4mModel.transaction() calls createBatch() and commitBatch() for you.","technical-details#Technical Details":"","batch-storage#Batch Storage":"Batches are stored in memory until committed\nEach batch has a unique UUID\nChanges are tracked separately for shared and local links","engine-synchronization#Engine Synchronization":"Internal indexes (SurrealDB, query subscriptions, and Prolog facts if activated) are updated only once per batch commit\nUpdates are performed using a oneshot channel to ensure completion\nThe engine state remains consistent with all changes","link-language-integration#Link Language Integration":"For shared perspectives, commits to the link language happen only once per batch\nReduces network operations in distributed scenarios","best-practices#Best Practices":"Prefer transaction(): Use Ad4mModel.transaction() over manual createBatch()/commitBatch() — if the callback throws, the batch is not committed and no changes are persisted.\nBatch Size: Keep batches focused on related operations. Avoid extremely large batches that could impact memory usage — split very large operations into multiple smaller batches.\nError Handling: With transaction(), errors thrown inside the callback automatically prevent commit. With manual batches, wrap operations in try/catch.\nResource Management: Don't keep batches open longer than necessary. With transaction() this is handled for you.\nTesting: Test both successful and failed batch scenarios. Verify data consistency after batch operations.","limitations-and-considerations#Limitations and Considerations":"Memory Usage\nBatches store changes in memory until committed\nVery large batches may impact system performance\nConcurrency\nBatch operations don't provide explicit locking\nConsider application-level synchronization for concurrent operations\nNetwork Connectivity\nFor shared perspectives, ensure stable network connectivity before committing large batches\nConsider implementing retry logic for network-related failures","migration-guide#Migration Guide":"Existing code using manual createBatch()/commitBatch() will continue to work. To modernize:\n// Before: manual batch management\nconst batchId = await perspective.createBatch();\ntry {\n await recipe.save(batchId);\n await comment.save(batchId);\n await perspective.commitBatch(batchId);\n} catch (error) {\n console.error(error);\n}\n// After: transaction() handles it\nawait Ad4mModel.transaction(perspective, async (tx) => {\n await recipe.save(tx.batchId);\n await comment.save(tx.batchId);\n});\nNo schema changes or data migration is required."}},"/expressions":{"title":"Expressions: Agent-Authored Data Objects","data":{"understanding-expressions#Understanding Expressions":"In AD4M's agent-centric paradigm, all data is treated as a claim or statement made by an agent. These claims are called \"Expressions\" – following the metaphor of Languages, they are what agents \"express\" through different protocols (Languages). While they could be seen as simple data objects, Expressions are fundamentally different because they:\nAlways include cryptographic proof of who created them\nAre always created through a specific Language\nHave globally unique addresses in AD4M's universal addressing scheme","anatomy-of-an-expression#Anatomy of an Expression":"Every Expression consists of:\ninterface Expression {\n // The DID of the agent who created this Expression\n author: string;\n \n // When the Expression was created\n timestamp: string;\n \n // The actual data/content\n data: any;\n \n // Which Language this Expression belongs to\n language: LanguageRef;\n \n // Cryptographic proof of authorship\n proof: {\n // These flags are added by AD4M during retrieval\n valid?: boolean; // True if signature verification succeeded\n invalid?: boolean; // True if signature verification failed\n // The actual stored proof data\n signature: string; // The cryptographic signature\n key: string; // Key path in the author's DID Document used for signing\n };\n}\nFor example:\n{\n \"author\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"timestamp\": \"2023-06-21T14:47:48.935Z\",\n \"data\": \"Hello World!\",\n \"language\": {\n \"address\": \"literal\"\n },\n \"proof\": {\n \"valid\": true, // Added by AD4M during retrieval\n \"invalid\": false, // Added by AD4M during retrieval\n \"signature\": \"...\", // The stored signature\n \"key\": \"...\" // Key path in the author's DID Document used for signing\n }\n}","global-addressing#Global Addressing":"Every Expression in AD4M has a unique address in the format:\n://\nThis means:\nThe Language's hash identifies how to interpret/resolve the address\nThe expression_address is Language-specific (could be a CID, URL, hash, etc.)\nThe full address is globally unique and resolvable by any AD4M instance","working-with-expressions#Working with Expressions":"","creating-expressions#Creating Expressions":"When an agent wants to share data, they create an Expression through a Language:\n// Create an Expression using the literal Language\nconst url = await ad4m.expression.create(\n \"Hello World!\", \n \"literal\"\n);\n// Returns: literal://base64encoded-content\n// Create an Expression using a custom Language\nconst socialPost = await ad4m.expression.create(\n { text: \"My first post!\" },\n \"QmSocialApp123\" // Language hash\n);\n// Returns: QmSocialApp123://post789\nBehind the scenes, AD4M:\nPasses the data to the specified Language\nThe Language stores/processes the data and returns an address\nAD4M signs the Expression with the agent's keys\nReturns the full Expression URL","retrieving-expressions#Retrieving Expressions":"Any agent can retrieve an Expression using its address:\nconst expression = await ad4m.expression.get(\"QmSocialApp123://post789\");\nThe retrieved Expression includes:\nThe original data\nWho created it (author DID)\nWhen it was created\nCryptographic proof of authenticity","signature-verification#Signature Verification":"When you retrieve an Expression through ad4m.expression.get(), AD4M automatically:\nResolves the author's DID to get their public keys\nVerifies that the signature matches:\nThe author's DID\nThe Expression's data\nThe timestamp\nUsing the specified key from the author's DID Document\nEnriches the Expression object with verification flags:\nproof.valid: Set to true if verification succeeded\nproof.invalid: Set to true if verification failed\nThese verification flags are not stored with the Expression – they are computed on-the-fly during retrieval to ensure fresh verification against the current state of the author's DID Document.\n// When you retrieve an Expression\nconst expression = await ad4m.expression.get(\"QmSocialApp123://post789\");\n// AD4M has already verified the signature\nif (expression.proof.valid) {\n // The Expression is authentic and unmodified\n console.log(\"Verified expression from:\", expression.author);\n} else {\n // The signature verification failed\n console.warn(\"Could not verify expression authenticity\");\n}","expression-types#Expression Types":"While Expressions can contain any type of data, there are several common patterns:\nLiteral Expressions\nSimple data types (strings, numbers, objects)\nEncoded directly in the address\nExample: literal://base64encoded-content\nContent Expressions\nLarger data objects (posts, documents, media)\nStored in a distributed system (IPFS, Holochain, etc.)\nExample: QmSocialApp123://post789\nReference Expressions\nPoint to data in other systems\nAct as bridges to existing protocols\nExample: http://example.com/resource","expressions-and-trust#Expressions and Trust":"The agent-centric nature of Expressions enables a web of trust:\nAuthenticity: Every Expression is cryptographically signed, so you can verify who created it\nProvenance: The timestamp and author create an audit trail\nContext: Expressions can be referenced and linked in Perspectives, creating semantic meaning\nInteroperability: Any AD4M instance can verify and interpret Expressions","best-practices#Best Practices":"When working with Expressions:\nChoose the Right Language\nUse literal Language for simple, small data\nUse specialized Languages for specific data types\nConsider storage requirements and accessibility\nHandle Verification\nAlways check the proof.valid field\nConsider the Expression's author in your trust model\nUse timestamps for temporal context\nThink Agent-Centric\nRemember Expressions are claims made by agents\nConsider how Expressions fit into social contexts\nUse Perspectives to organize and give meaning to Expressions\nFor more details on implementing Languages that create and resolve Expressions, see the Language Development Guide."}},"/developer-guides/surreal-queries":{"title":"SurrealDB Queries in AD4M","data":{"":"AD4M now includes a powerful SurrealDB-based query engine that provides 10-100x faster performance compared to traditional Prolog queries. SurrealDB is used by default in Ad4mModel operations and can be accessed directly for advanced graph traversal queries.","why-surrealdb#Why SurrealDB?":"SurrealDB brings several key advantages:\nPerformance: 10-100x faster than Prolog for most queries\nFamiliar Syntax: SQL-like query language (SurrealQL)\nGraph Traversal: Native support for multi-hop graph patterns with -> operator\nPattern Matching: Query complex graph structures in a single query (e.g., node->link[WHERE ...][0].out.uri)\nLiteral Parsing: Built-in fn::parse_literal() function to extract values from AD4M literals\nAggregations: Built-in support for COUNT, SUM, AVG, GROUP BY, etc.\nScalability: Optimized for large datasets","default-behavior#Default Behavior":"Important: Ad4mModel now uses SurrealDB by default for all query operations. This means:\nfindAll() uses SurrealDB automatically\nfindAllAndCount() uses SurrealDB automatically\nQuery builder methods use SurrealDB automatically\nLive query subscriptions use SurrealDB automatically\nYou can still use Prolog queries by explicitly passing useSurrealDB: false if needed for backward compatibility.","quick-reference-graph-traversal-syntax#Quick Reference: Graph Traversal Syntax":"SurrealDB's graph traversal operator (->) enables powerful multi-hop queries:\n// Basic syntax: node->link[filter][index].field\nout->link[WHERE predicate = 'flux://entry_type'][0].out.uri\n// Components:\n// - out : Start from target node\n// - ->link : Follow link edges\n// - [WHERE predicate = ...] : Filter links (optional)\n// - [0] : Get first result (array index)\n// - .out.uri : Access target URI\nKey Functions:\nfn::parse_literal(uri) - Extract values from AD4M literal URIs (handles literal://string:, literal://number:, literal://json:, etc.)\nFields & Indexes:\npredicate — Indexed independently and in composites\nsource, target — Indexed independently and in composites with predicate\n(in, predicate), (out, predicate) — Composite indexes (pair in.uri/out.uri with predicate for best performance)\nin.uri, out.uri — Graph edge references, resolved via the node table's unique URI index (not independently indexed on the link table)","direct-surrealdb-queries#Direct SurrealDB Queries":"For advanced use cases, you can execute SurrealQL queries directly using perspective.querySurrealDB():","basic-query#Basic Query":"// Get all links\nconst links = await perspective.querySurrealDB('SELECT * FROM link');\nconsole.log(links);\n// [\n// { source: \"user://alice\", predicate: \"follows\", target: \"user://bob\", ... },\n// { source: \"post://123\", predicate: \"likes\", target: \"user://alice\", ... }\n// ]","filtering#Filtering":"// Filter links by predicate\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Multiple conditions\nconst recentLikes = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'likes' AND timestamp > '2024-01-01T00:00:00Z'\"\n);","aggregations#Aggregations":"// Count links by predicate\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\n// [\n// { predicate: \"follows\", total: 42 },\n// { predicate: \"likes\", total: 156 }\n// ]\n// Count total links\nconst totalLinks = await perspective.querySurrealDB(\n \"SELECT count() as total FROM link\"\n);\n// Count unique sources using GROUP BY\nconst uniqueSources = await perspective.querySurrealDB(\n \"SELECT source FROM link GROUP BY source\"\n);\n// uniqueSources.length gives you the count of unique sources","graph-traversal#Graph Traversal":"SurrealDB stores links as graph edges with indexed source and target node references, enabling efficient multi-hop traversal. See the Quick Reference above for the full syntax.Key fields:\nin.uri — Source node (where the edge comes FROM). Composite-indexed with predicate\nout.uri — Target node (where the edge goes TO). Composite-indexed with predicate\npredicate — Link predicate (independently indexed)\nsource / target — String representations (independently indexed, plus composite with predicate)","️-avoid-subqueries#⚠️ Avoid Subqueries":"Subqueries (IN (SELECT ...)) can be very slow. Use the -> traversal operator instead:\n// ❌ SLOW - Uses subquery\nconst bad = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE source IN (SELECT target FROM link WHERE source = 'user://alice')\"\n);\n// ✅ FAST - Use graph traversal operator for multi-hop\nconst good = await perspective.querySurrealDB(\n \"SELECT out->link[WHERE predicate = 'posted'].out.uri AS posts FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);","basic-traversal#Basic Traversal":"// Forward: Find all users that Alice follows\nconst aliceFollows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Reverse: Find all users who follow Alice\nconst aliceFollowers = await perspective.querySurrealDB(\n \"SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Bidirectional: All connections involving Alice\nconst aliceConnections = await perspective.querySurrealDB(\n \"SELECT source, target FROM link WHERE (in.uri = 'user://alice' OR out.uri = 'user://alice') AND predicate = 'follows'\"\n);","filtering-1#Filtering":"// By timestamp range\nconst recentLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'\"\n);\n// By author\nconst bobsLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'\"\n);\n// Filter on multi-hop properties (find children of a specific type)\nconst subgroups = await perspective.querySurrealDB(`\n SELECT out.uri AS subgroup\n FROM link\n WHERE in.uri = 'conversation://456'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`);","multi-hop-traversal#Multi-Hop Traversal":"Use the -> operator to traverse multiple hops in a single efficient query:\n// 2-hop: Friends of friends\nconst friendsOfFriends = await perspective.querySurrealDB(`\n SELECT out->link[WHERE predicate = 'follows'].out.uri AS friend_of_friend\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);\n// Deduplicate in JS (friend_of_friend is an array per row — flatten first):\n// [...new Set(friendsOfFriends.flatMap(f => f.friend_of_friend))]\n// 2-hop: User profiles via follows\nconst profiles = await perspective.querySurrealDB(`\n SELECT \n out.uri AS user,\n out->link[WHERE predicate = 'has_profile'][0].out.uri AS profile\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);\n// 2-hop: Child items with their types\nconst childTypes = await perspective.querySurrealDB(`\n SELECT \n out.uri AS child,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type\n FROM link\n WHERE in.uri = 'parent://123' AND predicate = 'ad4m://has_child'\n`);","chaining-traversals#Chaining Traversals":"Chain -> operators for deeper patterns:\n// 3-hop: Conversation -> Subgroup -> Items -> Get item types\nconst itemTypes = await perspective.querySurrealDB(`\n SELECT \n out.uri AS subgroup,\n out->link[WHERE predicate = 'ad4m://has_child'].out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS item_type\n FROM link\n WHERE in.uri = 'conversation://main'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`);\n// 2-hop: Comments on Alice's posts\nconst commentsOnAlicePosts = await perspective.querySurrealDB(`\n SELECT \n out.uri AS post,\n out->link[WHERE predicate = 'has_comment'].out.uri AS comments\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'authored'\n`);\n// 3-hop: Reactions to posts by people Alice follows\nconst reactions = await perspective.querySurrealDB(`\n SELECT \n out.uri AS followed_user,\n out->link[WHERE predicate = 'authored'].out.uri AS post,\n out->link[WHERE predicate = 'authored'].out->link[WHERE predicate = 'has_reaction'].out.uri AS reaction\n FROM link\n WHERE in.uri = 'user://alice' AND predicate = 'follows'\n`);","parsing-literal-values#Parsing Literal Values":"AD4M stores values as literal URIs. Use fn::parse_literal() to extract them:\nLiteral URI\tParsed Value\tliteral://string:Hello\t\"Hello\"\tliteral://number:42\t42\tliteral://boolean:true\ttrue\tliteral://json:{\"data\":\"value\"}\textracts .data field\t\nconst query = `\n SELECT \n out.uri AS id,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS title,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS body,\n fn::parse_literal(out->link[WHERE predicate = 'flux://count'][0].out.uri) AS count\n FROM link\n WHERE in.uri = 'parent://789' AND predicate = 'ad4m://has_child'\n`;\nconst results = await perspective.querySurrealDB(query);\n// { id, title: \"Hello\", body: \"World\", count: 42 }","real-world-examples#Real-World Examples":"","messages-with-metadata#Messages with Metadata":"const messagesQuery = `\n SELECT\n out.uri AS id,\n author,\n timestamp,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle\n FROM link\n WHERE in.uri = 'channel://main'\n AND predicate = 'ad4m://has_child'\n AND (\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_message'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_post'\n )\n ORDER BY timestamp ASC\n`;\nconst messages = await perspective.querySurrealDB(messagesQuery);","mixed-item-types-with-metadata#Mixed Item Types with Metadata":"const itemsQuery = `\n SELECT\n out.uri AS item, author, timestamp,\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,\n fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody,\n fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle,\n fn::parse_literal(out->link[WHERE predicate = 'flux://name'][0].out.uri) AS taskName\n FROM link\n WHERE in.uri = 'workspace://project1'\n AND predicate = 'ad4m://has_child'\n AND (\n out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_message'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_post'\n OR out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://has_task'\n )\n ORDER BY timestamp DESC\n LIMIT 50\n`;","counting-and-unique-values#Counting and Unique Values":"// Count conversation subgroups\nconst countQuery = `\n SELECT count() AS count\n FROM link\n WHERE in.uri = 'conversation://abc'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n`;\nconst result = await perspective.querySurrealDB(countQuery);\n// Get unique participants from nested items\nconst participantsQuery = `\n SELECT VALUE out->link[WHERE predicate = 'ad4m://has_child'].author\n FROM link\n WHERE in.uri = 'conversation://xyz'\n AND predicate = 'ad4m://has_child'\n AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'\n AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE\n`;\n// Returns nested author arrays (one per subgroup) — flatten and deduplicate client-side","performance-tips#Performance Tips":"Start with indexed fields: predicate, source, target are independently indexed; in/out are composite-indexed with predicate\nFilter within traversals: ->link[WHERE predicate = 'x'] filters as you traverse\nArray indexing: [0] for first, [-1] for last result\nTraversal depth: 2–4 hops perform well in a single query\nUse IS NOT NONE: Check existence of traversed values to avoid errors\nCombine conditions: AND/OR in WHERE clauses on final filtered results","using-surrealdb-with-ad4mmodel#Using SurrealDB with Ad4mModel":"Ad4mModel uses SurrealDB by default for all operations, providing significant performance improvements:","findall---default-uses-surrealdb#findAll() - Default Uses SurrealDB":"@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\", resolveLanguage: \"literal\" })\n name: string = \"\";\n @Property({ through: \"recipe://rating\", resolveLanguage: \"literal\" })\n rating: number = 0;\n}\n// Uses SurrealDB automatically (default)\nconst allRecipes = await Recipe.findAll(perspective);\n// With filters (still uses SurrealDB)\nconst highRated = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } },\n order: { rating: \"DESC\" },\n limit: 10\n});\n// Explicitly use Prolog (for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {}, false);","query-builder---default-uses-surrealdb#Query Builder - Default Uses SurrealDB":"// Query builder uses SurrealDB by default\nconst recipes = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .order({ rating: \"DESC\" })\n .limit(10)\n .get();\n// Explicitly enable SurrealDB (redundant since it's default)\nconst recipesSurreal = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(true) // Default is true\n .get();\n// Explicitly use Prolog\nconst recipesProlog = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false) // Switch to Prolog\n .get();","live-query-subscriptions#Live Query Subscriptions":"Subscriptions also benefit from SurrealDB's performance:\n// Subscribe using SurrealDB (default)\nawait Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .subscribe((recipes) => {\n console.log(\"Updated high-rated recipes:\", recipes);\n });\n// Subscribe using Prolog\nawait Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false)\n .subscribe((recipes) => {\n console.log(\"Updated recipes (Prolog):\", recipes);\n });","findallandcount#findAllAndCount()":"// Uses SurrealDB by default\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {\n where: { rating: { gt: 3 } },\n limit: 10,\n offset: 0\n});\nconsole.log(`Showing ${results.length} of ${totalCount} recipes`);\n// Use Prolog explicitly\nconst { results, totalCount } = await Recipe.findAllAndCount(\n perspective, \n { where: { rating: { gt: 3 } } },\n false // useSurrealDB = false\n);","performance-comparison#Performance Comparison":"Here's what you can expect from SurrealDB vs Prolog:\nOperation\tProlog\tSurrealDB\tSpeed-up\tFind all (1000 items)\t~500ms\t~5ms\t100x\tComplex where query\t~800ms\t~15ms\t53x\tAggregation (count)\t~600ms\t~8ms\t75x\tGraph traversal (3 hops)\t~1200ms\t~25ms\t48x\t\nBenchmarks on typical datasets. Actual performance varies by query complexity and data size.","advanced-surrealql-features#Advanced SurrealQL Features":"","grouping-and-aggregation#Grouping and Aggregation":"// Find posts with more than 10 likes\n// Note: SurrealDB doesn't support HAVING clause, so filter in JavaScript\nconst allPosts = await perspective.querySurrealDB(\n \"SELECT out.uri as post, count() as like_count FROM link WHERE predicate = 'likes' GROUP BY out.uri\"\n);\nconst popularPosts = allPosts.filter(p => p.like_count > 10);\n// Count followers per user\nconst followerCounts = await perspective.querySurrealDB(\n \"SELECT out.uri as user, count() as followers FROM link WHERE predicate = 'follows' GROUP BY out.uri ORDER BY followers DESC\"\n);","distinct-values#DISTINCT Values":"// Get all unique predicates used\n// Note: Use GROUP BY instead of SELECT DISTINCT\nconst predicates = await perspective.querySurrealDB(\n \"SELECT predicate FROM link GROUP BY predicate\"\n);\n// Get unique authors\nconst authors = await perspective.querySurrealDB(\n \"SELECT author FROM link GROUP BY author\"\n);","sorting-and-pagination#Sorting and Pagination":"// Recent links first, paginated\nconst recentLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link ORDER BY timestamp DESC LIMIT 20 START 0\"\n);\n// Next page\nconst nextPage = await perspective.querySurrealDB(\n \"SELECT * FROM link ORDER BY timestamp DESC LIMIT 20 START 20\"\n);","string-operations#String Operations":"// Find links with predicates containing \"follow\"\nconst followLinks = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate CONTAINS 'follow'\"\n);\n// Case-insensitive search\nconst searchResults = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE string::lowercase(predicate) CONTAINS 'like'\"\n);","security-note#Security Note":"Important: querySurrealDB() only allows read-only operations for security reasons. The following operations are blocked:\n❌ DELETE - Use perspective.remove() instead\n❌ UPDATE - Use perspective.update() instead\n❌ INSERT / CREATE - Use perspective.add() instead\n❌ DROP / DEFINE - Not applicable to link data\nAllowed operations:\n✅ SELECT - Query data\n✅ RETURN - Return expressions\n✅ Aggregations (COUNT, SUM, AVG, etc.)\n✅ Graph traversal operators\nIf you need to modify links, use the standard AD4M methods:\n// Adding links\nawait perspective.add({ source: \"user://alice\", predicate: \"follows\", target: \"user://bob\" });\n// Removing links \nawait perspective.remove({ source: \"user://alice\", predicate: \"follows\", target: \"user://bob\" });","migration-from-prolog#Migration from Prolog":"If you have existing code using Prolog queries, here's how to migrate:","before-prolog#Before (Prolog)":"const results = await perspective.infer(\n 'triple(Post, \"likes\", User), triple(User, \"follows\", \"user://alice\")'\n);","after-surrealdb---graph-traversal#After (SurrealDB - Graph Traversal)":"// Use graph traversal to find posts liked by Alice's followers (2-hop)\nconst results = await perspective.querySurrealDB(`\n SELECT \n in.uri AS Post,\n out.uri AS User\n FROM link\n WHERE out.uri = 'user://alice'\n AND predicate = 'follows'\n AND in->link[WHERE predicate = 'likes'].out.uri IS NOT NONE\n`);\n// Alternative: Get all liked posts by traversing from followers\nconst likedPosts = await perspective.querySurrealDB(`\n SELECT \n out.uri AS follower,\n out->link[WHERE predicate = 'likes'].out.uri AS liked_posts\n FROM link\n WHERE out.uri = 'user://alice' AND predicate = 'follows'\n`);","ad4mmodel-migration#Ad4mModel Migration":"Good news! If you're using Ad4mModel, you don't need to change anything:\n// This automatically uses SurrealDB now (no code changes needed!)\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n});\nIf you need Prolog for backward compatibility:\n// Explicitly use Prolog\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false","when-to-use-which#When to Use Which?":"","use-surrealdb-default-when#Use SurrealDB (Default) When:":"✅ You need fast queries (most cases)\n✅ You're using Ad4mModel (automatic)\n✅ You need graph traversal (with -> operator)\n✅ You need multi-hop pattern matching\n✅ You need aggregations and analytics\n✅ You have large datasets\n✅ You need to parse literal values","use-prolog-when#Use Prolog When:":"⚠️ You have complex custom SDNA rules\n⚠️ You need backward compatibility with existing code\n⚠️ You're using advanced Prolog-specific features\n⚠️ You need logic programming capabilities beyond graph queries","best-practices#Best Practices":"Avoid Subqueries: Never use IN (SELECT ...) patterns - they're very slow. Use the -> traversal operator instead\nUse Graph Traversal Operators:\nin.uri / out.uri for direct node access (indexed)\nnode->link[WHERE predicate = 'x'][0].out.uri for multi-hop patterns\nChain multiple -> operators for deeper traversals\nMuch faster than subqueries\nUse fn::parse_literal(): Extract values from AD4M literal URIs automatically\nFilter on Traversals: Filter within traversals using [WHERE ...] for efficiency\nUse Ad4mModel: Let it handle query generation automatically with SurrealDB\nArray Indexing: Use [0] for first result, [-1] for last result on traversed links\nLimit Results: Always use LIMIT for large result sets\nProfile Performance: Use browser DevTools to measure query performance\nIndex Awareness: predicate, source, and target are independently indexed. (in, predicate) and (out, predicate) have composite indexes — always pair in.uri/out.uri with predicate for best performance\nTraversal Depth: You can safely traverse 2-4 hops in a single query with good performance","examples-repository#Examples Repository":"For more examples, check out these real-world use cases:\nSocial Graph: Finding connections and recommendations\nContent Discovery: Filtering and ranking posts\nAnalytics Dashboard: Aggregating metrics and statistics\nHierarchical Data: Navigating tree structures\nSee the AD4M examples repository for complete implementations.","related-resources#Related Resources":"Model Classes Guide - Using Ad4mModel with SurrealDB\nPerspectives - Understanding perspectives and links\nSocial DNA - Advanced query patterns with SDNA\nSurrealDB Documentation - Complete SurrealQL reference"}},"/jsdoc/classes/AIClient":{"title":"Class: AIClient","data":{"":"@coasys/ad4m / Exports / AIClient","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#apolloClient\n#transcriptionSubscriptions","methods#Methods":"addModel\naddTask\ncloseTranscriptionStream\nembed\nfeedTranscriptionStream\ngetDefaultModel\ngetModels\nmodelLoadingStatus\nopenTranscriptionStream\nprompt\nremoveModel\nremoveTask\nsetDefaultModel\ntasks\nupdateModel\nupdateTask","constructors-1#Constructors":"","constructor#constructor":"• new AIClient(apolloClient, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tapolloClient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"ai/AIClient.ts:12","properties-1#Properties":"","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-1#Defined in":"ai/AIClient.ts:9","transcriptionsubscriptions##transcriptionSubscriptions":"• Private #transcriptionSubscriptions: Map","defined-in-2#Defined in":"ai/AIClient.ts:10","methods-1#Methods":"","addmodel#addModel":"▸ addModel(model): Promise","parameters-1#Parameters":"Name\tType\tmodel\tModelInput","returns#Returns":"Promise","defined-in-3#Defined in":"ai/AIClient.ts:47","addtask#addTask":"▸ addTask(name, modelId, systemPrompt, promptExamples, metaData?): Promise","parameters-2#Parameters":"Name\tType\tname\tstring\tmodelId\tstring\tsystemPrompt\tstring\tpromptExamples\t{ input: string ; output: string }[]\tmetaData?\tstring","returns-1#Returns":"Promise","defined-in-4#Defined in":"ai/AIClient.ts:151","closetranscriptionstream#closeTranscriptionStream":"▸ closeTranscriptionStream(streamId): Promise","parameters-3#Parameters":"Name\tType\tstreamId\tstring","returns-2#Returns":"Promise","defined-in-5#Defined in":"ai/AIClient.ts:339","embed#embed":"▸ embed(modelId, text): Promise","parameters-4#Parameters":"Name\tType\tmodelId\tstring\ttext\tstring","returns-3#Returns":"Promise","defined-in-6#Defined in":"ai/AIClient.ts:276","feedtranscriptionstream#feedTranscriptionStream":"▸ feedTranscriptionStream(streamIds, audio): Promise","parameters-5#Parameters":"Name\tType\tstreamIds\tstring | string[]\taudio\tFloat32Array","returns-4#Returns":"Promise","defined-in-7#Defined in":"ai/AIClient.ts:360","getdefaultmodel#getDefaultModel":"▸ getDefaultModel(modelType): Promise","parameters-6#Parameters":"Name\tType\tmodelType\tModelType","returns-5#Returns":"Promise","defined-in-8#Defined in":"ai/AIClient.ts:95","getmodels#getModels":"▸ getModels(): Promise","returns-6#Returns":"Promise","defined-in-9#Defined in":"ai/AIClient.ts:16","modelloadingstatus#modelLoadingStatus":"▸ modelLoadingStatus(model): Promise","parameters-7#Parameters":"Name\tType\tmodel\tstring","returns-7#Returns":"Promise","defined-in-10#Defined in":"ai/AIClient.ts:239","opentranscriptionstream#openTranscriptionStream":"▸ openTranscriptionStream(modelId, streamCallback, params?): Promise","parameters-8#Parameters":"Name\tType\tmodelId\tstring\tstreamCallback\t(text: string) => void\tparams?\tObject\tparams.endThreshold?\tnumber\tparams.endWindow?\tnumber\tparams.startThreshold?\tnumber\tparams.startWindow?\tnumber\tparams.timeBeforeSpeech?\tnumber","returns-8#Returns":"Promise","defined-in-11#Defined in":"ai/AIClient.ts:296","prompt#prompt":"▸ prompt(taskId, prompt): Promise","parameters-9#Parameters":"Name\tType\ttaskId\tstring\tprompt\tstring","returns-9#Returns":"Promise","defined-in-12#Defined in":"ai/AIClient.ts:260","removemodel#removeModel":"▸ removeModel(modelId): Promise","parameters-10#Parameters":"Name\tType\tmodelId\tstring","returns-10#Returns":"Promise","defined-in-13#Defined in":"ai/AIClient.ts:71","removetask#removeTask":"▸ removeTask(taskId): Promise","parameters-11#Parameters":"Name\tType\ttaskId\tstring","returns-11#Returns":"Promise","defined-in-14#Defined in":"ai/AIClient.ts:179","setdefaultmodel#setDefaultModel":"▸ setDefaultModel(modelType, modelId): Promise","parameters-12#Parameters":"Name\tType\tmodelType\tModelType\tmodelId\tstring","returns-12#Returns":"Promise","defined-in-15#Defined in":"ai/AIClient.ts:83","tasks#tasks":"▸ tasks(): Promise","returns-13#Returns":"Promise","defined-in-16#Defined in":"ai/AIClient.ts:127","updatemodel#updateModel":"▸ updateModel(modelId, model): Promise","parameters-13#Parameters":"Name\tType\tmodelId\tstring\tmodel\tModelInput","returns-14#Returns":"Promise","defined-in-17#Defined in":"ai/AIClient.ts:59","updatetask#updateTask":"▸ updateTask(taskId, task): Promise","parameters-14#Parameters":"Name\tType\ttaskId\tstring\ttask\tAITask","returns-15#Returns":"Promise","defined-in-18#Defined in":"ai/AIClient.ts:206"}},"/jsdoc/classes/AIPromptExamples":{"title":"Class: AIPromptExamples","data":{"":"@coasys/ad4m / Exports / AIPromptExamples","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"input\noutput","constructors-1#Constructors":"","constructor#constructor":"• new AIPromptExamples(input, output)","parameters#Parameters":"Name\tType\tinput\tstring\toutput\tstring","defined-in#Defined in":"ai/Tasks.ts:27","properties-1#Properties":"","input#input":"• input: string","defined-in-1#Defined in":"ai/Tasks.ts:22","output#output":"• output: string","defined-in-2#Defined in":"ai/Tasks.ts:25"}},"/jsdoc/classes/AIModelLoadingStatus":{"title":"Class: AIModelLoadingStatus","data":{"":"@coasys/ad4m / Exports / AIModelLoadingStatus","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"downloaded\nloaded\nmodel\nprogress\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new AIModelLoadingStatus(model, status, progress, downloaded, loaded)","parameters#Parameters":"Name\tType\tmodel\tstring\tstatus\tstring\tprogress\tnumber\tdownloaded\tboolean\tloaded\tboolean","defined-in#Defined in":"ai/Tasks.ts:114","properties-1#Properties":"","downloaded#downloaded":"• downloaded: boolean","defined-in-1#Defined in":"ai/Tasks.ts:109","loaded#loaded":"• loaded: boolean","defined-in-2#Defined in":"ai/Tasks.ts:112","model#model":"• model: string","defined-in-3#Defined in":"ai/Tasks.ts:100","progress#progress":"• progress: number","defined-in-4#Defined in":"ai/Tasks.ts:106","status#status":"• status: string","defined-in-5#Defined in":"ai/Tasks.ts:103"}},"/jsdoc/classes/AIPromptExamplesInput":{"title":"Class: AIPromptExamplesInput","data":{"":"@coasys/ad4m / Exports / AIPromptExamplesInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"input\noutput","constructors-1#Constructors":"","constructor#constructor":"• new AIPromptExamplesInput(input, output)","parameters#Parameters":"Name\tType\tinput\tstring\toutput\tstring","defined-in#Defined in":"ai/Tasks.ts:12","properties-1#Properties":"","input#input":"• input: string","defined-in-1#Defined in":"ai/Tasks.ts:7","output#output":"• output: string","defined-in-2#Defined in":"ai/Tasks.ts:10"}},"/jsdoc/classes/AITaskInput":{"title":"Class: AITaskInput","data":{"":"@coasys/ad4m / Exports / AITaskInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"metaData\nmodelId\nname\npromptExamples\nsystemPrompt","constructors-1#Constructors":"","constructor#constructor":"• new AITaskInput(name, model_id, system_prompt, prompt_examples, metaData?)","parameters#Parameters":"Name\tType\tname\tstring\tmodel_id\tstring\tsystem_prompt\tstring\tprompt_examples\tAIPromptExamplesInput[]\tmetaData?\tstring","defined-in#Defined in":"ai/Tasks.ts:50","properties-1#Properties":"","metadata#metaData":"• metaData: string","defined-in-1#Defined in":"ai/Tasks.ts:48","modelid#modelId":"• modelId: string","defined-in-2#Defined in":"ai/Tasks.ts:39","name#name":"• name: string","defined-in-3#Defined in":"ai/Tasks.ts:36","promptexamples#promptExamples":"• promptExamples: AIPromptExamplesInput[]","defined-in-4#Defined in":"ai/Tasks.ts:45","systemprompt#systemPrompt":"• systemPrompt: string","defined-in-5#Defined in":"ai/Tasks.ts:42"}},"/jsdoc/classes/AITask":{"title":"Class: AITask","data":{"":"@coasys/ad4m / Exports / AITask","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"createdAt\nmetaData\nmodelId\nname\npromptExamples\nsystemPrompt\ntaskId\nupdatedAt","constructors-1#Constructors":"","constructor#constructor":"• new AITask(name, model_id, task_id, system_prompt, prompt_examples, metaData?, created_at?, updated_at?)","parameters#Parameters":"Name\tType\tname\tstring\tmodel_id\tstring\ttask_id\tstring\tsystem_prompt\tstring\tprompt_examples\tAIPromptExamples[]\tmetaData?\tstring\tcreated_at?\tstring\tupdated_at?\tstring","defined-in#Defined in":"ai/Tasks.ts:85","properties-1#Properties":"","createdat#createdAt":"• createdAt: string","defined-in-1#Defined in":"ai/Tasks.ts:80","metadata#metaData":"• Optional metaData: string","defined-in-2#Defined in":"ai/Tasks.ts:77","modelid#modelId":"• modelId: string","defined-in-3#Defined in":"ai/Tasks.ts:65","name#name":"• name: string","defined-in-4#Defined in":"ai/Tasks.ts:62","promptexamples#promptExamples":"• promptExamples: AIPromptExamples[]","defined-in-5#Defined in":"ai/Tasks.ts:74","systemprompt#systemPrompt":"• systemPrompt: string","defined-in-6#Defined in":"ai/Tasks.ts:71","taskid#taskId":"• taskId: string","defined-in-7#Defined in":"ai/Tasks.ts:68","updatedat#updatedAt":"• updatedAt: string","defined-in-8#Defined in":"ai/Tasks.ts:83"}},"/jsdoc/classes/Ad4mModel":{"title":"Class: Ad4mModel","data":{"":"@coasys/ad4m / Exports / Ad4mModelBase class for defining data models in AD4M.DescriptionAd4mModel provides the foundation for creating data models that are stored in AD4M perspectives.\nEach model instance is represented as a subgraph in the perspective, with properties and relations\nmapped to links in that graph. The class uses Prolog-based queries to efficiently search and filter\ninstances based on their properties and relationships.Key concepts:\nEach model instance has a unique base expression that serves as its identifier\nProperties are stored as links with predicates defined by the through option\nRelations represent one-to-many relationships as sets of links\nQueries are translated to Prolog for efficient graph pattern matching\nChanges are tracked through the perspective's subscription system\nExample\n// Define a recipe model\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n // Required property with literal value\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n // Optional property with custom initial value\n @Optional({\n through: \"recipe://status\",\n initial: \"recipe://draft\"\n })\n status: string = \"\";\n // Read-only computed property\n @ReadOnly({\n through: \"recipe://rating\",\n getter: `\n findall(Rating, triple(Base, \"recipe://user_rating\", Rating), Ratings),\n sum_list(Ratings, Sum),\n length(Ratings, Count),\n Value is Sum / Count\n `\n })\n averageRating: number = 0;\n // Relation of ingredients\n * @HasMany({ through: \"recipe://ingredient\" })\n * ingredients: string[] = [];\n // Relation of comments linked to another model\n @HasMany(() => Comment, { through: \"recipe://comment\" })\n comments: Comment[] = [];\n}\n// Create and save a new recipe\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nawait recipe.save();\n// Query recipes in different ways\n// Get all recipes\nconst allRecipes = await Recipe.findAll(perspective);\n// Find recipes with specific criteria\nconst desserts = await Recipe.findAll(perspective, {\n where: { \n status: \"recipe://published\",\n averageRating: { gt: 4 }\n },\n order: { name: \"ASC\" },\n limit: 10\n});\n// Use the fluent query builder\nconst popularRecipes = await Recipe.query(perspective)\n .where({ averageRating: { gt: 4.5 } })\n .order({ averageRating: \"DESC\" })\n .limit(5)\n .get();\n// Subscribe to real-time updates\nawait Recipe.query(perspective)\n .where({ status: \"recipe://cooking\" })\n .subscribe(recipes => {\n console.log(\"Currently being cooked:\", recipes);\n });\n// Paginate results\nconst { results, totalCount, pageNumber } = await Recipe.query(perspective)\n .where({ status: \"recipe://published\" })\n .paginate(10, 1);","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"_baseExpression\n_perspective\n_snapshot\n_subjectClassName\nauthor\ncreatedAt\nupdatedAt\nCreateOptions\n_linkShape\nclassNamesByClass","accessors#Accessors":"baseExpression\nid\nperspective\ntimestamp","methods#Methods":"addRelationValue\nchangedFields\ncleanCopy\ndelete\ngeneratePropertySetterAction\ngenerateRelationAction\nget\ngetData\ngetPropertyMetadata\ngetRelationOptions\ninnerUpdate\nisDirty\nremoveRelationValue\nresolveRelationId\nsave\nsetProperty\nsetRelationValues\ntakeSnapshot\nassignValuesToInstance\nbuildConformanceGetter\nbuildGraphTraversalWhereClause\nbuildSurrealSelectFields\nbuildSurrealSelectFieldsWithAggregation\nbuildSurrealWhereClause\ncount\ncountQueryToProlog\ncountQueryToSurrealQL\ncreate\ndelete\ndetermineNamespace\ndeterminePredicate\nevaluateCustomGettersForInstance\nfindAll\nfindAllAndCount\nfindOne\nformatSurrealValue\nfromJSONSchema\ngenerateSDNA\ngenerateSHACL\ngetClassName\ngetDefaultValueForType\ngetModelMetadata\ngetPropertyOption\nhydrateFromLinks\nhydratePropertyValue\nhydrateRelations\ninstancesFromPrologResult\nmatchesCondition\nnormalizeValue\npaginate\nquery\nqueryToProlog\nqueryToSurrealQL\nregister\nremove\ntransaction\nupdate","constructors-1#Constructors":"","constructor#constructor":"• new Ad4mModel(perspective, baseExpression?)Constructs a new model instance.","parameters#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective where this model will be stored\tbaseExpression?\tstring\tOptional expression URI for this instance. If omitted, a random Literal URL is generated.\t\nExample\n// Create a new recipe with auto-generated base expression\nconst recipe = new Recipe(perspective);\n// Create with specific base expression\nconst recipe = new Recipe(perspective, \"literal://...\");","defined-in#Defined in":"model/Ad4mModel.ts:747","properties-1#Properties":"","_baseexpression#_baseExpression":"• Private _baseExpression: string","defined-in-1#Defined in":"model/Ad4mModel.ts:523","_perspective#_perspective":"• Private _perspective: PerspectiveProxy","defined-in-2#Defined in":"model/Ad4mModel.ts:525","_snapshot#_snapshot":"• Private _snapshot: Record = null","defined-in-3#Defined in":"model/Ad4mModel.ts:526","_subjectclassname#_subjectClassName":"• Private _subjectClassName: string","defined-in-4#Defined in":"model/Ad4mModel.ts:524","author#author":"• author: string","defined-in-5#Defined in":"model/Ad4mModel.ts:527","createdat#createdAt":"• createdAt: any","defined-in-6#Defined in":"model/Ad4mModel.ts:528","updatedat#updatedAt":"• updatedAt: any","defined-in-7#Defined in":"model/Ad4mModel.ts:529","createoptions#CreateOptions":"▪ Static Readonly CreateOptions: undefinedOptions for Ad4mModel.create().","defined-in-8#Defined in":"model/Ad4mModel.ts:3386","_linkshape#_linkShape":"▪ Static Private Readonly _linkShape: undefinedLink shape accepted by hydrateFromLinks.\nBoth getData() and instancesFromSurrealResult() produce this shape.","defined-in-9#Defined in":"model/Ad4mModel.ts:941","classnamesbyclass#classNamesByClass":"▪ Static Private classNamesByClass: WeakMap","defined-in-10#Defined in":"model/Ad4mModel.ts:531","accessors-1#Accessors":"","baseexpression#baseExpression":"• get baseExpression(): string","returns#Returns":"stringDeprecatedUse .id instead. Will be removed in a future version.","defined-in-11#Defined in":"model/Ad4mModel.ts:762","id#id":"• get id(): stringThe unique identifier (expression URI) of this model instance.","returns-1#Returns":"string","defined-in-12#Defined in":"model/Ad4mModel.ts:755","perspective#perspective":"• Protected get perspective(): PerspectiveProxyProtected getter for the perspective.\nAllows subclasses to access the perspective while keeping it private from external code.","returns-2#Returns":"PerspectiveProxy","defined-in-13#Defined in":"model/Ad4mModel.ts:770","timestamp#timestamp":"• get timestamp(): anyBackwards compatibility alias for createdAt.","returns-3#Returns":"anyDeprecatedUse createdAt instead. This will be removed in a future version.","defined-in-14#Defined in":"model/Ad4mModel.ts:581","methods-1#Methods":"","addrelationvalue#addRelationValue":"▸ Private addRelationValue(key, value, batchId?): Promise","parameters-1#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-4#Returns":"Promise","defined-in-15#Defined in":"model/Ad4mModel.ts:2993","changedfields#changedFields":"▸ changedFields(): string[]Returns the names of properties/relations that differ from the\nsnapshot taken at the last hydration.Returns all field names if no snapshot exists.","returns-5#Returns":"string[]Example\nrecipe.name = \"New Name\";\nrecipe.changedFields(); // [\"name\"]","defined-in-16#Defined in":"model/Ad4mModel.ts:1281","cleancopy#cleanCopy":"▸ Private cleanCopy(): Record","returns-6#Returns":"Record","defined-in-17#Defined in":"model/Ad4mModel.ts:3166","delete#delete":"▸ delete(batchId?): PromiseDeletes the model instance from the perspective.","parameters-2#Parameters":"Name\tType\tDescription\tbatchId?\tstring\tOptional batch ID for batch operations","returns-7#Returns":"PromiseThrowsWill throw if removal failsExample\nconst recipe = await Recipe.findAll(perspective)[0];\nawait recipe.delete();\n// Or with batch operations:\nconst batchId = await perspective.createBatch();\nawait recipe.delete(batchId);\nawait perspective.commitBatch(batchId);","defined-in-18#Defined in":"model/Ad4mModel.ts:3324","generatepropertysetteraction#generatePropertySetterAction":"▸ Private generatePropertySetterAction(key, metadata): any[]Generate property setter action from metadata (Phase 1: Prolog-free refactor)\nReplaces Prolog query: property_setter(C, key, Setter)","parameters-3#Parameters":"Name\tType\tkey\tstring\tmetadata\tPropertyMetadataEntry","returns-8#Returns":"any[]","defined-in-19#Defined in":"model/Ad4mModel.ts:799","generaterelationaction#generateRelationAction":"▸ Private generateRelationAction(key, actionType): any[]Generate relation action from metadata (Phase 1: Prolog-free refactor)\nReplaces Prolog queries: collection_adder, collection_remover, collection_setter","parameters-4#Parameters":"Name\tType\tkey\tstring\tactionType\t\"setter\" | \"adder\" | \"remover\"","returns-9#Returns":"any[]","defined-in-20#Defined in":"model/Ad4mModel.ts:839","get#get":"▸ get(optsOrInclude?): PromiseGets the model instance with all properties and relations populated.","parameters-5#Parameters":"Name\tType\tDescription\toptsOrInclude?\tIncludeMap | GetOptions\tOptional hydration options. Accepts two forms: - GetOptions wrapper: { include: { comments: true }, properties: ['title'] } - IncludeMap shorthand: { comments: true } (equivalent to { include: { comments: true } })","returns-10#Returns":"PromiseThe populated model instanceThrowsWill throw if data retrieval failsExample\nconst recipe = new Recipe(perspective, existingId);\nawait recipe.get();\nconsole.log(recipe.name, recipe.ingredients);\n// Shorthand — pass IncludeMap directly:\nawait recipe.get({ ingredients: true });\n// Full options — includes sparse fieldset:\nawait recipe.get({ include: { ingredients: true }, properties: ['name'] });","defined-in-21#Defined in":"model/Ad4mModel.ts:3290","getdata#getData":"▸ Private getData(opts?): Promise","parameters-6#Parameters":"Name\tType\topts?\tGetOptions","returns-11#Returns":"Promise","defined-in-22#Defined in":"model/Ad4mModel.ts:1325","getpropertymetadata#getPropertyMetadata":"▸ Private getPropertyMetadata(key): PropertyMetadataEntryGet property metadata from decorator (Phase 1: Prolog-free refactor)","parameters-7#Parameters":"Name\tType\tkey\tstring","returns-12#Returns":"PropertyMetadataEntry","defined-in-23#Defined in":"model/Ad4mModel.ts:778","getrelationoptions#getRelationOptions":"▸ Private getRelationOptions(key): RelationMetadataEntryGet relation options from decorator","parameters-8#Parameters":"Name\tType\tkey\tstring","returns-13#Returns":"RelationMetadataEntry","defined-in-24#Defined in":"model/Ad4mModel.ts:788","innerupdate#innerUpdate":"▸ Private innerUpdate(setProperties?, batchId?): Promise","parameters-9#Parameters":"Name\tType\tDefault value\tsetProperties\tboolean\ttrue\tbatchId?\tstring\tundefined","returns-14#Returns":"Promise","defined-in-25#Defined in":"model/Ad4mModel.ts:3188","isdirty#isDirty":"▸ isDirty(): booleanReturns true if any tracked property or relation has changed\nsince the last hydration (or since takeSnapshot() was last called).Always returns true if no snapshot exists (e.g. a freshly\nconstructed instance that hasn't been fetched yet).","returns-15#Returns":"booleanExample\nconst recipe = await Recipe.create(perspective, { name: \"Pasta\" });\nrecipe.isDirty(); // false — just hydrated\nrecipe.name = \"Risotto\";\nrecipe.isDirty(); // true","defined-in-26#Defined in":"model/Ad4mModel.ts:1264","removerelationvalue#removeRelationValue":"▸ Private removeRelationValue(key, value, batchId?): Promise","parameters-10#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-16#Returns":"Promise","defined-in-27#Defined in":"model/Ad4mModel.ts:3017","resolverelationid#resolveRelationId":"▸ Private resolveRelationId(value): stringResolve a relation argument to a plain string ID. Accepts either a raw\nstring ID or an Ad4mModel instance (in which case .id is used).","parameters-11#Parameters":"Name\tType\tvalue\tany","returns-17#Returns":"string","defined-in-28#Defined in":"model/Ad4mModel.ts:2962","save#save":"▸ save(batchId?): PromiseSaves the model instance to the perspective.New instances (no snapshot yet): creates the subject via\ncreateSubject with initial scalar values, then sets relations\nvia innerUpdate.Existing instances (snapshot present, i.e. fetched via get()\nor a query): updates only dirty fields via innerUpdate, then\nrefreshes from the perspective.","parameters-12#Parameters":"Name\tType\tDescription\tbatchId?\tstring\tOptional batch ID for batch operations","returns-18#Returns":"PromiseThrowsWill throw if instance creation, linking, or updating failsExample\n// Create\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Spaghetti\";\nawait recipe.save();\n// Update\nrecipe.rating = 10;\nawait recipe.save();","defined-in-29#Defined in":"model/Ad4mModel.ts:3067","setproperty#setProperty":"▸ Private setProperty(key, value, batchId?): Promise","parameters-13#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-19#Returns":"Promise","defined-in-30#Defined in":"model/Ad4mModel.ts:2934","setrelationvalues#setRelationValues":"▸ Private setRelationValues(key, value, batchId?): Promise","parameters-14#Parameters":"Name\tType\tkey\tstring\tvalue\tany\tbatchId?\tstring","returns-20#Returns":"Promise","defined-in-31#Defined in":"model/Ad4mModel.ts:2968","takesnapshot#takeSnapshot":"▸ Private takeSnapshot(includedRelations?): void","parameters-15#Parameters":"Name\tType\tDescription\tincludedRelations?\tRecord\tControls which relation fields are recorded in the snapshot for dirty-tracking: • undefined (default) — snapshot ALL relations (used by .get(), .create(), .save() etc. where full hydration has occurred). • IncludeMap object (e.g. { views: true }) — only snapshot the relations named in the map. Fields not listed are omitted from the snapshot so that changedFields() ignores them. • null / empty object — skip ALL relations (used by bare subscriptions that don't eagerly load relations).","returns-21#Returns":"void","defined-in-32#Defined in":"model/Ad4mModel.ts:1208","assignvaluestoinstance#assignValuesToInstance":"▸ Static assignValuesToInstance(perspective, instance, values): Promise","parameters-16#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tinstance\tAd4mModel\tvalues\tValueTuple[]","returns-22#Returns":"Promise","defined-in-33#Defined in":"model/Ad4mModel.ts:1100","buildconformancegetter#buildConformanceGetter":"▸ Static Private buildConformanceGetter(relationPredicate, targetClass): stringBuilds a SurrealQL conformance getter for a relation whose target model\nis known but no explicit getter string was supplied.The generated getter traverses outgoing links matching the relation's\npredicate and then filters the target nodes to only those that conform to\nthe target model's shape (required properties / flags).Delegates to the shared buildConformanceFilter() utility in decorators.ts\nso the same logic is used at shape-definition time and at query time.","parameters-17#Parameters":"Name\tType\tDescription\trelationPredicate\tstring\tThe relation's predicate URI (e.g. \"flux://entry_type\")\ttargetClass\tany\tThe target model class (result of calling the target() thunk)","returns-23#Returns":"stringA SurrealQL expression string, or undefined if no conformance\nconditions could be derived from the target model.","defined-in-34#Defined in":"model/Ad4mModel.ts:1433","buildgraphtraversalwhereclause#buildGraphTraversalWhereClause":"▸ Static Private buildGraphTraversalWhereClause(metadata, where?): stringBuilds the WHERE clause for SurrealQL queries using graph traversal syntax.","parameters-18#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property predicates\twhere?\tWhere\tWhere conditions from the query","returns-24#Returns":"stringGraph traversal WHERE clause filters, or empty string if no conditionsDescriptionTranslates where conditions into graph traversal filters: ->link[WHERE ...]\nThis is more efficient than nested SELECTs because SurrealDB can optimize graph traversals.Handles several condition types:\nSimple equality: { name: \"Pasta\" } → ->link[WHERE predicate = 'X' AND out.uri = 'Pasta']\nArrays (IN clause): { name: [\"Pasta\", \"Pizza\"] } → ->link[WHERE predicate = 'X' AND out.uri IN [...]]\nNOT operators: Use NOT prefix\nComparison operators (gt, gte, lt, lte, etc.): Handled in post-query JavaScript filtering\nSpecial fields: base uses uri directly, author/timestamp handled post-query","defined-in-35#Defined in":"model/Ad4mModel.ts:1966","buildsurrealselectfields#buildSurrealSelectFields":"▸ Static Private buildSurrealSelectFields(metadata, properties?, relations?): stringBuilds the SELECT fields for SurrealQL queries.","parameters-19#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property and relation predicates\tproperties?\tstring[]\tOptional array of property names to include (default: all)\trelations?\tstring[]\tOptional array of relation names to include (default: all)","returns-25#Returns":"stringComma-separated SELECT field listDescriptionGenerates the field list for the SELECT clause, resolving properties and relations\nvia subqueries. Each property is fetched with a subquery that finds the link with the\nappropriate predicate and returns its target. Relations are similar but don't use LIMIT 1.Field types:\nProperties: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X' LIMIT 1) AS propName\nRelations: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X') AS relName\nAuthor/Timestamp: Always included to provide metadata about each instance\nIf properties or relations arrays are provided, only those fields are included.\nOtherwise, all properties/relations from metadata are included.","defined-in-36#Defined in":"model/Ad4mModel.ts:2273","buildsurrealselectfieldswithaggregation#buildSurrealSelectFieldsWithAggregation":"▸ Static Private buildSurrealSelectFieldsWithAggregation(metadata, properties?, relations?): stringBuilds the SELECT fields for SurrealQL queries using aggregation functions.\nCompatible with GROUP BY source queries.","parameters-20#Parameters":"Name\tType\tmetadata\tModelMetadata\tproperties?\tstring[]\trelations?\tstring[]","returns-26#Returns":"string","defined-in-37#Defined in":"model/Ad4mModel.ts:2312","buildsurrealwhereclause#buildSurrealWhereClause":"▸ Static Private buildSurrealWhereClause(metadata, where?): stringBuilds the WHERE clause for SurrealQL queries.","parameters-21#Parameters":"Name\tType\tDescription\tmetadata\tModelMetadata\tModel metadata containing property predicates\twhere?\tWhere\tWhere conditions from the query","returns-27#Returns":"stringWHERE clause string (without the \"WHERE\" keyword), or empty string if no conditionsDescriptionTranslates the where conditions from the Query object into SurrealQL WHERE clause fragments.\nFor each property filter, generates a subquery that checks for links with the appropriate\npredicate and target value.Handles several condition types:\nSimple equality: { name: \"Pasta\" } → subquery checking for predicate and target match\nArrays (IN clause): { name: [\"Pasta\", \"Pizza\"] } → target IN [...]\nOperators: { rating: { gt: 4 } } → target > '4'\ngt, gte, lt, lte: comparison operators\nnot: negation (single value or array)\nbetween: range check\ncontains: substring/element check (uses SurrealQL CONTAINS)\nSpecial fields: base, author, timestamp are accessed directly, not via subqueries\nAll conditions are joined with AND.","defined-in-38#Defined in":"model/Ad4mModel.ts:2144","count#count":"▸ Static count(perspective, query?, useSurrealDB?): anyGets a count of all matching instances.","parameters-22#Parameters":"Name\tType\tDefault value\tDescription\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-28#Returns":"anyTotal count of matching entitiesExample\nconst totalRecipes = await Recipe.count(perspective);\nconst activeRecipes = await Recipe.count(perspective, {\n where: { status: \"active\" }\n});\n// Use Prolog explicitly (legacy)\nconst countProlog = await Recipe.count(perspective, {}, false);","defined-in-39#Defined in":"model/Ad4mModel.ts:2919","countquerytoprolog#countQueryToProlog":"▸ Static countQueryToProlog(perspective, query?, modelClassName?): Promise","parameters-23#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tquery\tQuery\tmodelClassName?\tstring","returns-29#Returns":"Promise","defined-in-40#Defined in":"model/Ad4mModel.ts:2861","countquerytosurrealql#countQueryToSurrealQL":"▸ Static Private countQueryToSurrealQL(perspective, query): PromiseGenerates a SurrealQL COUNT query for the model.","parameters-24#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective context\tquery\tQuery\tQuery parameters to filter the count","returns-30#Returns":"PromiseSurrealQL COUNT query string","defined-in-41#Defined in":"model/Ad4mModel.ts:2891","create#create":"▸ Static create(this, perspective, data?, options?): PromiseCreates and saves a new model instance in one step.","type-parameters#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-25#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\t-\tperspective\tPerspectiveProxy\tThe perspective to create the instance in\tdata\tRecord\tProperty values to assign before saving\toptions?\tObject\tOptional settings: - parent — a ParentScope (model form or raw form) whose id will be used to create an incoming link from the parent to the new instance. - batchId — an existing batch id; when provided the link write and save() are added to the batch instead of committed immediately.\toptions.batchId?\tstring\t-\toptions.parent?\tParentScope\t-","returns-31#Returns":"PromiseThe saved model instanceExample\n// Simple create\nconst recipe = await Recipe.create(perspective, {\n name: \"Spaghetti\",\n rating: 5,\n});\n// Create under a parent (link auto-created)\nconst comment = await Comment.create(perspective, { text: \"Great!\" }, {\n parent: { model: Post, id: postId },\n});\n// Create inside a transaction\nawait Ad4mModel.transaction(perspective, async (tx) => {\n await Recipe.create(perspective, { name: \"Pasta\" }, { batchId: tx.batchId });\n});","defined-in-42#Defined in":"model/Ad4mModel.ts:3419","delete-1#delete":"▸ Static delete(this, perspective, id): PromiseDeletes an existing model instance identified by id.Also cleans up any incoming links that point to this instance.","parameters-26#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => Ad4mModel\t-\tperspective\tPerspectiveProxy\tThe perspective containing the instance\tid\tstring\tThe expression URI of the instance to delete","returns-32#Returns":"PromiseExample\nawait Recipe.delete(perspective, recipeId);","defined-in-43#Defined in":"model/Ad4mModel.ts:3532","determinenamespace#determineNamespace":"▸ Static Private determineNamespace(schema, options): stringDetermines the namespace for predicates using cascading precedence","parameters-27#Parameters":"Name\tType\tschema\tJSONSchema\toptions\tJSONSchemaToModelOptions","returns-33#Returns":"string","defined-in-44#Defined in":"model/Ad4mModel.ts:3847","determinepredicate#determinePredicate":"▸ Static Private determinePredicate(schema, propertyName, propertySchema, namespace, options): stringDetermines the predicate for a specific property using cascading precedence","parameters-28#Parameters":"Name\tType\tschema\tJSONSchema\tpropertyName\tstring\tpropertySchema\tJSONSchemaProperty\tnamespace\tstring\toptions\tJSONSchemaToModelOptions","returns-34#Returns":"string","defined-in-45#Defined in":"model/Ad4mModel.ts:3891","evaluatecustomgettersforinstance#evaluateCustomGettersForInstance":"▸ Static Private evaluateCustomGettersForInstance(instance, perspective, metadata, options?): PromiseEvaluates custom SurrealQL getters for properties and relations on a specific instance.For relations that declare a target but no explicit getter, a conformance\ngetter is auto-generated from the target model's metadata (unless filter: false).","parameters-29#Parameters":"Name\tType\tinstance\tany\tperspective\tPerspectiveProxy\tmetadata\tany\toptions?\tObject\toptions.include?\tRecord\toptions.requestedProperties?\tstring[]","returns-35#Returns":"Promise","defined-in-46#Defined in":"model/Ad4mModel.ts:1453","findall#findAll":"▸ Static findAll(this, perspective, query?, useSurrealDB?): PromiseGets all instances of the model in the perspective that match the query params.","type-parameters-1#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-30#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-36#Returns":"PromiseArray of matching modelsExample\n// Get all recipes (uses SurrealDB by default)\nconst allRecipes = await Recipe.findAll(perspective);\n// Get recipes with specific criteria (uses SurrealDB)\nconst recipes = await Recipe.findAll(perspective, {\n where: { \n name: \"Pasta\",\n rating: { gt: 4 }\n },\n order: { createdAt: \"DESC\" },\n limit: 10\n});\n// Explicitly use Prolog (legacy, for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {}, false);","defined-in-47#Defined in":"model/Ad4mModel.ts:2728","findallandcount#findAllAndCount":"▸ Static findAllAndCount(this, perspective, query?, useSurrealDB?): Promise>Gets all instances with count of total matches without offset & limit applied.","type-parameters-2#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-31#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-37#Returns":"Promise>Object containing results array and total countExample\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {\n where: { category: \"Dessert\" },\n limit: 10\n});\nconsole.log(`Showing 10 of ${totalCount} dessert recipes`);\n// Use Prolog explicitly (legacy)\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {}, false);","defined-in-48#Defined in":"model/Ad4mModel.ts:2801","findone#findOne":"▸ Static findOne(this, perspective, query?, useSurrealDB?): PromiseFinds the first instance matching the query, or null if none exists.Equivalent to findAll with limit: 1 — only one instance is hydrated.","type-parameters-3#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-32#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tquery\tQuery\t{}\tOptional query parameters to filter results\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true) or Prolog (legacy)","returns-38#Returns":"PromiseThe first matching instance, or nullExample\nconst recipe = await Recipe.findOne(perspective, {\n where: { name: \"Pasta\" }\n});\nif (recipe) {\n console.log(recipe.name);\n}","defined-in-49#Defined in":"model/Ad4mModel.ts:2770","formatsurrealvalue#formatSurrealValue":"▸ Static Private formatSurrealValue(value): stringFormats a value for use in SurrealQL queries.","parameters-33#Parameters":"Name\tType\tDescription\tvalue\tany\tThe value to format","returns-39#Returns":"stringFormatted value string ready for SurrealQLDescriptionHandles different value types:\nStrings: Wrapped in single quotes with backslash-escaped special characters\nNumbers/booleans: Converted to string\nArrays: Recursively formatted and wrapped in brackets","defined-in-50#Defined in":"model/Ad4mModel.ts:2360","fromjsonschema#fromJSONSchema":"▸ Static fromJSONSchema(schema, options): typeof Ad4mModelCreates an Ad4mModel class from a JSON Schema definition.","parameters-34#Parameters":"Name\tType\tDescription\tschema\tJSONSchema\tJSON Schema definition\toptions\tJSONSchemaToModelOptions\tConfiguration options","returns-40#Returns":"typeof Ad4mModelGenerated Ad4mModel subclassDescriptionThis method dynamically generates an Ad4mModel subclass from a JSON Schema,\nenabling integration with systems that use JSON Schema for type definitions.The method follows a cascading approach for determining predicates:\nExplicit configuration in options parameter (highest precedence)\nx-ad4m metadata in the JSON Schema\nInference from schema title and property names\nError if no namespace can be determined\nExample\n// With explicit configuration\nconst PersonClass = Ad4mModel.fromJSONSchema(schema, {\n name: \"Person\",\n namespace: \"person://\",\n resolveLanguage: \"literal\"\n});\n// With property mapping\nconst ContactClass = Ad4mModel.fromJSONSchema(schema, {\n name: \"Contact\",\n namespace: \"contact://\",\n propertyMapping: {\n \"name\": \"foaf://name\",\n \"email\": \"foaf://mbox\"\n }\n});\n// With x-ad4m metadata in schema\nconst schema = {\n \"title\": \"Product\",\n \"x-ad4m\": { \"namespace\": \"product://\" },\n \"properties\": {\n \"name\": { \n \"type\": \"string\",\n \"x-ad4m\": { \"through\": \"product://title\" }\n }\n }\n};\nconst ProductClass = Ad4mModel.fromJSONSchema(schema, { name: \"Product\" });\nThrowsError when namespace cannot be inferred","defined-in-51#Defined in":"model/Ad4mModel.ts:3682","generatesdna#generateSDNA":"▸ Static generateSDNA(): ObjectGenerates the SDNA (Subject DNA) Prolog rules for this model class.\nInjected at class-definition time by the @Model decorator.\nReturns a default value on un-decorated base classes.","returns-41#Returns":"Object\nName\tType\tname\tstring\tsdna\tstring","defined-in-52#Defined in":"model/Ad4mModel.ts:538","generateshacl#generateSHACL":"▸ Static generateSHACL(): ObjectGenerates the SHACL shape graph for this model class.\nInjected at class-definition time by the @Model decorator.\nReturns { shape: null, name: '' } on un-decorated base classes —\nthe decorator's parentSHACL?.shape?.nodeShapeUri check handles this.","returns-42#Returns":"Object\nName\tType\tname\tstring\tshape\tany","defined-in-53#Defined in":"model/Ad4mModel.ts:548","getclassname#getClassName":"▸ Static getClassName(perspective): Promise","parameters-35#Parameters":"Name\tType\tperspective\tPerspectiveProxy","returns-43#Returns":"Promise","defined-in-54#Defined in":"model/Ad4mModel.ts:552","getdefaultvaluefortype#getDefaultValueForType":"▸ Static Private getDefaultValueForType(type?): anyGets default value for a JSON Schema type","parameters-36#Parameters":"Name\tType\ttype?\tstring","returns-44#Returns":"any","defined-in-55#Defined in":"model/Ad4mModel.ts:3968","getmodelmetadata#getModelMetadata":"▸ Static getModelMetadata(): ModelMetadataExtracts metadata from decorators for query building.","returns-45#Returns":"ModelMetadataStructured metadata object containing className, properties, and relationsDescriptionThis method reads the metadata stored by decorators (@Property, @HasMany, etc.)\nand returns it in a structured format that's easier to work with for query builders\nand other systems that need to introspect model structure.The metadata includes:\nClass name from\nModel\nProperty metadata (predicates, types, constraints, etc.)\nRelation metadata (predicates, filters, etc.)\nFor models created via fromJSONSchema(), this method will derive metadata from\nthe WeakMap registries that were populated during the dynamic class creation.\nIf these structures are empty but a JSON schema was attached to the class,\nit can fall back to deriving metadata from that schema.ThrowsError if the class doesn't haveModeldecoratorExample\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\", resolveLanguage: \"literal\" })\n name: string = \"\";\n \n @HasMany({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n}\nconst metadata = Recipe.getModelMetadata();\nconsole.log(metadata.className); // \"Recipe\"\nconsole.log(metadata.properties.name.predicate); // \"recipe://name\"\nconsole.log(metadata.relations.ingredients.predicate); // \"recipe://ingredient\"","defined-in-56#Defined in":"model/Ad4mModel.ts:623","getpropertyoption#getPropertyOption":"▸ Static Private getPropertyOption(propertyName, propertySchema, options, optionName, defaultValue?): anyGets property-specific options using cascading precedence","parameters-37#Parameters":"Name\tType\tpropertyName\tstring\tpropertySchema\tJSONSchemaProperty\toptions\tJSONSchemaToModelOptions\toptionName\tkeyof PropertyOptions\tdefaultValue?\tany","returns-46#Returns":"any","defined-in-57#Defined in":"model/Ad4mModel.ts:3939","hydratefromlinks#hydrateFromLinks":"▸ Static Private hydrateFromLinks(instance, links, metadata, perspective, requestedProperties?): PromiseHydrates an instance from an array of raw links.Processes properties (latest-wins semantics), relations\n(chronological accumulation), and timestamps/author in a single\npass over the links array.","parameters-38#Parameters":"Name\tType\tDescription\tinstance\tany\tThe blank model instance to populate\tlinks\t{ author?: string ; predicate: string ; target: string ; timestamp?: string | number }[]\tArray of link objects (predicate, target, author?, timestamp?)\tmetadata\tModelMetadata\tModel metadata from getModelMetadata()\tperspective\tPerspectiveProxy\tThe perspective for expression resolution\trequestedProperties?\tstring[]\tOptional sparse fieldset; when provided, only these property names are hydrated (relations are unaffected). Omit or pass undefined to hydrate all properties.","returns-47#Returns":"Promise","defined-in-58#Defined in":"model/Ad4mModel.ts:959","hydratepropertyvalue#hydratePropertyValue":"▸ Static Private hydratePropertyValue(target, propMeta, perspective, expectedType?): PromiseResolves a raw link target value into a hydrated property value.Handles, in order:\nNon-literal expression resolution (perspective.getExpression)\nLiteral URI parsing (Literal.fromUrl(…).get())\nPrimitive type coercion (string → number / boolean)\nTransform function application","parameters-39#Parameters":"Name\tType\tDescription\ttarget\tstring\tThe raw target string from the link\tpropMeta\tPropertyMetadata\tProperty metadata from the decorator registry\tperspective\tPerspectiveProxy\tThe perspective for expression resolution\texpectedType?\tstring\tOptional JS typeof hint for coercion (e.g. 'number')","returns-48#Returns":"PromiseThe resolved value","defined-in-59#Defined in":"model/Ad4mModel.ts:884","hydraterelations#hydrateRelations":"▸ Static Private hydrateRelations(instances, perspective, includeMap): PromiseHydrates relation fields on instances according to the provided IncludeMap.For each relation listed in includeMap, the raw expression-URI strings\nstored on the instance are replaced with fully-hydrated model instances\n(fetched via the relation's target() class). Nested IncludeMaps are\nsupported for multi-level eager loading.","type-parameters-4#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-40#Parameters":"Name\tType\tDescription\tinstances\tT[]\tThe instances whose relations should be hydrated\tperspective\tPerspectiveProxy\tThe perspective to fetch related instances from\tincludeMap\tIncludeMap\tDescribes which relations to hydrate","returns-49#Returns":"Promise","defined-in-60#Defined in":"model/Ad4mModel.ts:1563","instancesfromprologresult#instancesFromPrologResult":"▸ Static instancesFromPrologResult(this, perspective, query, result): Promise>","type-parameters-5#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-41#Parameters":"Name\tType\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tperspective\tPerspectiveProxy\tquery\tQuery\tresult\tAllInstancesResult","returns-50#Returns":"Promise>","defined-in-61#Defined in":"model/Ad4mModel.ts:2364","matchescondition#matchesCondition":"▸ Static Private matchesCondition(value, condition): booleanChecks if a value matches a condition (for post-query filtering).","parameters-42#Parameters":"Name\tType\tvalue\tany\tcondition\tWhereCondition","returns-51#Returns":"boolean","defined-in-62#Defined in":"model/Ad4mModel.ts:2640","normalizevalue#normalizeValue":"▸ Static Private normalizeValue(value): anyNormalize a value for snapshot storage.\nArrays of model instances are reduced to their .id strings so that\ndirty-tracking compares stable identifiers instead of object references.","parameters-43#Parameters":"Name\tType\tvalue\tany","returns-52#Returns":"any","defined-in-63#Defined in":"model/Ad4mModel.ts:1188","paginate#paginate":"▸ Static paginate(this, perspective, pageSize, pageNumber, query?, useSurrealDB?): Promise>Helper function for pagination with explicit page size and number.","type-parameters-6#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-44#Parameters":"Name\tType\tDefault value\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\tundefined\t-\tperspective\tPerspectiveProxy\tundefined\tThe perspective to search in\tpageSize\tnumber\tundefined\tNumber of items per page\tpageNumber\tnumber\tundefined\tWhich page to retrieve (1-based)\tquery?\tQuery\tundefined\tOptional additional query parameters\tuseSurrealDB\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-53#Returns":"Promise>Paginated results with metadataExample\nconst page = await Recipe.paginate(perspective, 10, 1, {\n where: { category: \"Main Course\" }\n});\nconsole.log(`Page ${page.pageNumber} of recipes, ${page.results.length} items`);\n// Use Prolog explicitly (legacy)\nconst pageProlog = await Recipe.paginate(perspective, 10, 1, {}, false);","defined-in-64#Defined in":"model/Ad4mModel.ts:2839","query#query":"▸ Static query(this, perspective, query?): ModelQueryBuilderCreates a query builder for fluent query construction.","type-parameters-7#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-45#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\t-\tperspective\tPerspectiveProxy\tThe perspective to query\tquery?\tQuery\tOptional initial query parameters","returns-54#Returns":"ModelQueryBuilderA new query builder instanceExample\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .order({ rating: \"DESC\" })\n .limit(5)\n .run();\n// With real-time updates\nawait Recipe.query(perspective)\n .where({ status: \"cooking\" })\n .subscribe(recipes => {\n console.log(\"Currently cooking:\", recipes);\n });","defined-in-65#Defined in":"model/Ad4mModel.ts:3623","querytoprolog#queryToProlog":"▸ Static queryToProlog(perspective, query, modelClassName?): Promise","parameters-46#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tquery\tQuery\tmodelClassName?\tstring","returns-55#Returns":"Promise","defined-in-66#Defined in":"model/Ad4mModel.ts:1386","querytosurrealql#queryToSurrealQL":"▸ Static queryToSurrealQL(perspective, query): PromiseGenerates a SurrealQL query from a Query object.","parameters-47#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective to query (used for metadata extraction)\tquery\tQuery\tQuery parameters (where, order, limit, offset, properties, relations)","returns-56#Returns":"PromiseComplete SurrealQL query string ready for executionDescriptionThis method translates high-level query parameters into a SurrealQL query string\nthat can be executed against the SurrealDB backend. Unlike Prolog queries which\noperate on SDNA-aware predicates, SurrealQL queries operate directly on raw links\nstored in SurrealDB.The generated query uses a CTE (Common Table Expression) pattern:\nFirst, identify candidate base expressions by filtering links based on where conditions\nThen, for each candidate base, resolve properties and relations via subqueries\nFinally, apply ordering, pagination (LIMIT/START) at the SQL level\nKey architectural notes:\nSurrealDB stores only raw links (source, predicate, target, author, timestamp)\nNo SDNA knowledge at the database level\nProperties are resolved via subqueries that look for links with specific predicates\nRelations are similar but return multiple values instead of one\nSpecial fields (base, author, timestamp) are accessed directly, not via subqueries\nExample\nconst query = Recipe.queryToSurrealQL(perspective, {\n where: { name: \"Pasta\", rating: { gt: 4 } },\n order: { timestamp: \"DESC\" },\n limit: 10\n});\n// Returns: SELECT source AS base, array::first(target[WHERE predicate = ...]) AS name, ...\n// FROM link WHERE ... GROUP BY source ORDER BY timestamp DESC LIMIT 10","defined-in-67#Defined in":"model/Ad4mModel.ts:1832","register#register":"▸ Static register(this, perspective): PromiseRegisters this model's SHACL schema on the given perspective.This ensures the perspective knows about the model's shape\n(properties, relations, constraints) so instances can be\ncreated, queried, and validated.","parameters-48#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel\t-\tperspective\tPerspectiveProxy\tThe perspective to register the model on","returns-57#Returns":"PromiseExample\nawait Recipe.register(perspective);\n// Now you can create / query Recipe instances on this perspective","defined-in-68#Defined in":"model/Ad4mModel.ts:3556","remove#remove":"▸ Static remove(this, perspective, id): PromiseDeletes an existing model instance identified by id.Also cleans up any incoming links that point to this instance.","parameters-49#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => Ad4mModel\t-\tperspective\tPerspectiveProxy\tThe perspective containing the instance\tid\tstring\tThe expression URI of the instance to delete","returns-58#Returns":"PromiseExample\nawait Recipe.delete(perspective, recipeId);\nDeprecatedUse the name delete — remove is preserved as an alias.","defined-in-69#Defined in":"model/Ad4mModel.ts:3511","transaction#transaction":"▸ Static transaction(perspective, fn): PromiseExecutes a set of model operations inside a single batch (transaction).All save, update, and delete calls made via the provided batchId\nare buffered and flushed atomically when the callback completes.\nIf the callback throws, the batch is not committed, preventing\npartial writes.","type-parameters-8#Type parameters":"Name\tType\tR\tvoid","parameters-50#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective to operate on\tfn\t(tx: { batchId: string }) => Promise\tAsync callback that receives a TransactionContext object. Pass tx.batchId to save(tx.batchId), update(tx.batchId), delete(tx.batchId), etc.","returns-59#Returns":"PromiseThe value returned by fnExample\nawait Ad4mModel.transaction(perspective, async (tx) => {\n const recipe = new Recipe(perspective);\n recipe.name = \"Spaghetti\";\n await recipe.save(tx.batchId);\n const old = await Recipe.query(perspective).where({ name: \"Stale\" }).run();\n for (const r of old) await r.delete(tx.batchId);\n});\n// All changes committed atomically here","defined-in-70#Defined in":"model/Ad4mModel.ts:3590","update#update":"▸ Static update(this, perspective, id, data): PromiseUpdates an existing model instance identified by id.Fetches the instance, applies the provided changes, calls save(),\nand returns the refreshed instance.","type-parameters-9#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters-51#Parameters":"Name\tType\tDescription\tthis\ttypeof Ad4mModel & (...args: any[]) => T\t-\tperspective\tPerspectiveProxy\tThe perspective containing the instance\tid\tstring\tThe expression URI of the instance to update\tdata\tRecord\tProperty values to merge before saving","returns-60#Returns":"PromiseThe updated model instanceExample\nconst recipe = await Recipe.update(perspective, recipeId, {\n rating: 10,\n});","defined-in-71#Defined in":"model/Ad4mModel.ts:3483"}},"/jsdoc/classes/Agent":{"title":"Class: Agent","data":{"":"@coasys/ad4m / Exports / AgentAD4M's representation of an AgentAD4M Agents are build around DIDs, which are used to identify and authenticate the Agent.\nConceptually, an Agent is regarded as something that can speak and that can listen.Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key,\nAnd they also speak (broadcast) by putting semantic statements into their public \"Agent Perspective\".\nThey listen (can receive messages) through their \"direct message Language\".These three aspects are represented by the three fields of this class.This class is used as format for the Expressions in the Agent language.\nSince AD4M treats DID URIs as addresses for the Agent Language,\nDIDs are resolved to Expressions that are objects of this class.\nThus, this is how agents see (other) agents.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\ndirectMessageLanguage\nperspective","constructors-1#Constructors":"","constructor#constructor":"• new Agent(did, perspective?)","parameters#Parameters":"Name\tType\tdid\tstring\tperspective?\tPerspective","defined-in#Defined in":"agent/Agent.ts:42","properties-1#Properties":"","did#did":"• did: stringThe DID of the Agent\nAll epxressions authored by them are signed with the keys mentioned\nin the DID document behind this DID URI.","defined-in-1#Defined in":"agent/Agent.ts:28","directmessagelanguage#directMessageLanguage":"• Optional directMessageLanguage: stringAddress of the Language by which the Agent will receive DMs","defined-in-2#Defined in":"agent/Agent.ts:40","perspective#perspective":"• Optional perspective: PerspectiveThe Perspective that holds the public-facing semantics/statements of the Agent\nHolds and shares a Perspective that links all information\nthis agent wants to offer as public-facing semantics.\nThis should be used for any kind of user profile information.","defined-in-3#Defined in":"agent/Agent.ts:36"}},"/jsdoc/classes/AgentClient":{"title":"Class: AgentClient","data":{"":"@coasys/ad4m / Exports / AgentClientProvides access to all functions regarding the local agent,\nsuch as generating, locking, unlocking, importing the DID keystore,\nas well as updating the publicly shared Agent expression.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#agentStatusChangedCallbacks\n#apolloClient\n#appsChangedCallback\n#updatedCallbacks","methods#Methods":"addAgentStatusChangedListener\naddAppChangedListener\naddEntanglementProofs\naddUpdatedListener\nbyDID\ncreateUser\ndeleteEntanglementProofs\nentanglementProofPreFlight\ngenerate\ngenerateJwt\ngetApps\ngetEntanglementProofs\nimport\nisLocked\nlock\nloginUser\nme\nmutatePublicPerspective\npermitCapability\nremoveApp\nrequestCapability\nrequestLoginVerification\nrevokeToken\nsignMessage\nstatus\nsubscribeAgentStatusChanged\nsubscribeAgentUpdated\nsubscribeAppsChanged\nunlock\nupdateDirectMessageLanguage\nupdatePublicPerspective\nverifyEmailCode","constructors-1#Constructors":"","constructor#constructor":"• new AgentClient(client, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tclient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"agent/AgentClient.ts:95","properties-1#Properties":"","agentstatuschangedcallbacks##agentStatusChangedCallbacks":"• Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]","defined-in-1#Defined in":"agent/AgentClient.ts:93","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-2#Defined in":"agent/AgentClient.ts:90","appschangedcallback##appsChangedCallback":"• Private #appsChangedCallback: AgentAppsUpdatedCallback[]","defined-in-3#Defined in":"agent/AgentClient.ts:91","updatedcallbacks##updatedCallbacks":"• Private #updatedCallbacks: AgentUpdatedCallback[]","defined-in-4#Defined in":"agent/AgentClient.ts:92","methods-1#Methods":"","addagentstatuschangedlistener#addAgentStatusChangedListener":"▸ addAgentStatusChangedListener(listener): void","parameters-1#Parameters":"Name\tType\tlistener\tany","returns#Returns":"void","defined-in-5#Defined in":"agent/AgentClient.ts:401","addappchangedlistener#addAppChangedListener":"▸ addAppChangedListener(listener): void","parameters-2#Parameters":"Name\tType\tlistener\tany","returns-1#Returns":"void","defined-in-6#Defined in":"agent/AgentClient.ts:358","addentanglementproofs#addEntanglementProofs":"▸ addEntanglementProofs(proofs): Promise","parameters-3#Parameters":"Name\tType\tproofs\tEntanglementProofInput[]","returns-2#Returns":"Promise","defined-in-7#Defined in":"agent/AgentClient.ts:292","addupdatedlistener#addUpdatedListener":"▸ addUpdatedListener(listener): void","parameters-4#Parameters":"Name\tType\tlistener\tany","returns-3#Returns":"void","defined-in-8#Defined in":"agent/AgentClient.ts:354","bydid#byDID":"▸ byDID(did): Promise","parameters-5#Parameters":"Name\tType\tdid\tstring","returns-4#Returns":"Promise","defined-in-9#Defined in":"agent/AgentClient.ts:202","createuser#createUser":"▸ createUser(email, password, appInfo?): Promise","parameters-6#Parameters":"Name\tType\temail\tstring\tpassword\tstring\tappInfo?\tAuthInfoInput","returns-5#Returns":"Promise","defined-in-10#Defined in":"agent/AgentClient.ts:535","deleteentanglementproofs#deleteEntanglementProofs":"▸ deleteEntanglementProofs(proofs): Promise","parameters-7#Parameters":"Name\tType\tproofs\tEntanglementProofInput[]","returns-6#Returns":"Promise","defined-in-11#Defined in":"agent/AgentClient.ts:308","entanglementproofpreflight#entanglementProofPreFlight":"▸ entanglementProofPreFlight(deviceKey, deviceKeyType): Promise","parameters-8#Parameters":"Name\tType\tdeviceKey\tstring\tdeviceKeyType\tstring","returns-7#Returns":"Promise","defined-in-12#Defined in":"agent/AgentClient.ts:337","generate#generate":"▸ generate(passphrase): Promise","parameters-9#Parameters":"Name\tType\tpassphrase\tstring","returns-8#Returns":"Promise","defined-in-13#Defined in":"agent/AgentClient.ts:138","generatejwt#generateJwt":"▸ generateJwt(requestId, rand): Promise","parameters-10#Parameters":"Name\tType\trequestId\tstring\trand\tstring","returns-9#Returns":"Promise","defined-in-14#Defined in":"agent/AgentClient.ts:452","getapps#getApps":"▸ getApps(): Promise","returns-10#Returns":"Promise","defined-in-15#Defined in":"agent/AgentClient.ts:466","getentanglementproofs#getEntanglementProofs":"▸ getEntanglementProofs(): Promise","returns-11#Returns":"Promise","defined-in-16#Defined in":"agent/AgentClient.ts:324","import#import":"▸ import(args): Promise","parameters-11#Parameters":"Name\tType\targs\tInitializeArgs","returns-12#Returns":"Promise","defined-in-17#Defined in":"agent/AgentClient.ts:154","islocked#isLocked":"▸ isLocked(): Promise","returns-13#Returns":"Promise","defined-in-18#Defined in":"agent/AgentClient.ts:507","lock#lock":"▸ lock(passphrase): Promise","parameters-12#Parameters":"Name\tType\tpassphrase\tstring","returns-14#Returns":"Promise","defined-in-19#Defined in":"agent/AgentClient.ts:174","loginuser#loginUser":"▸ loginUser(email, password): Promise","parameters-13#Parameters":"Name\tType\temail\tstring\tpassword\tstring","returns-15#Returns":"Promise","defined-in-20#Defined in":"agent/AgentClient.ts:551","me#me":"▸ me(): PromiseReturns the Agent expression of the local agent as it is shared\npublicly via the AgentLanguage.I.e. this is the users profile.","returns-16#Returns":"Promise","defined-in-21#Defined in":"agent/AgentClient.ts:114","mutatepublicperspective#mutatePublicPerspective":"▸ mutatePublicPerspective(mutations): Promise","parameters-14#Parameters":"Name\tType\tmutations\tLinkMutations","returns-17#Returns":"Promise","defined-in-22#Defined in":"agent/AgentClient.ts:242","permitcapability#permitCapability":"▸ permitCapability(auth): Promise","parameters-15#Parameters":"Name\tType\tauth\tstring","returns-18#Returns":"Promise","defined-in-23#Defined in":"agent/AgentClient.ts:438","removeapp#removeApp":"▸ removeApp(requestId): Promise","parameters-16#Parameters":"Name\tType\trequestId\tstring","returns-19#Returns":"Promise","defined-in-24#Defined in":"agent/AgentClient.ts:479","requestcapability#requestCapability":"▸ requestCapability(authInfo): Promise","parameters-17#Parameters":"Name\tType\tauthInfo\tAuthInfoInput","returns-20#Returns":"Promise","defined-in-25#Defined in":"agent/AgentClient.ts:424","requestloginverification#requestLoginVerification":"▸ requestLoginVerification(email, appInfo?): Promise","parameters-18#Parameters":"Name\tType\temail\tstring\tappInfo?\tAuthInfoInput","returns-21#Returns":"Promise","defined-in-26#Defined in":"agent/AgentClient.ts:563","revoketoken#revokeToken":"▸ revokeToken(requestId): Promise","parameters-19#Parameters":"Name\tType\trequestId\tstring","returns-22#Returns":"Promise","defined-in-27#Defined in":"agent/AgentClient.ts:493","signmessage#signMessage":"▸ signMessage(message): Promise","parameters-20#Parameters":"Name\tType\tmessage\tstring","returns-23#Returns":"Promise","defined-in-28#Defined in":"agent/AgentClient.ts:520","status#status":"▸ status(): Promise","returns-24#Returns":"Promise","defined-in-29#Defined in":"agent/AgentClient.ts:125","subscribeagentstatuschanged#subscribeAgentStatusChanged":"▸ subscribeAgentStatusChanged(): void","returns-25#Returns":"void","defined-in-30#Defined in":"agent/AgentClient.ts:405","subscribeagentupdated#subscribeAgentUpdated":"▸ subscribeAgentUpdated(): void","returns-26#Returns":"void","defined-in-31#Defined in":"agent/AgentClient.ts:362","subscribeappschanged#subscribeAppsChanged":"▸ subscribeAppsChanged(): void","returns-27#Returns":"void","defined-in-32#Defined in":"agent/AgentClient.ts:381","unlock#unlock":"▸ unlock(passphrase, holochain?): Promise","parameters-21#Parameters":"Name\tType\tDefault value\tpassphrase\tstring\tundefined\tholochain\tboolean\ttrue","returns-28#Returns":"Promise","defined-in-33#Defined in":"agent/AgentClient.ts:188","updatedirectmessagelanguage#updateDirectMessageLanguage":"▸ updateDirectMessageLanguage(directMessageLanguage): Promise","parameters-22#Parameters":"Name\tType\tdirectMessageLanguage\tstring","returns-29#Returns":"Promise","defined-in-34#Defined in":"agent/AgentClient.ts:273","updatepublicperspective#updatePublicPerspective":"▸ updatePublicPerspective(perspective): Promise","parameters-23#Parameters":"Name\tType\tperspective\tPerspectiveInput","returns-30#Returns":"Promise","defined-in-35#Defined in":"agent/AgentClient.ts:216","verifyemailcode#verifyEmailCode":"▸ verifyEmailCode(email, code, verificationType): Promise","parameters-24#Parameters":"Name\tType\temail\tstring\tcode\tstring\tverificationType\tstring","returns-31#Returns":"Promise","defined-in-36#Defined in":"agent/AgentClient.ts:580"}},"/jsdoc/classes/AgentExpression":{"title":"Class: AgentExpression","data":{"":"@coasys/ad4m / Exports / AgentExpression","hierarchy#Hierarchy":"any↳ AgentExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new AgentExpression()","inherited-from#Inherited from":"ExpressionGeneric(Agent).constructor"}},"/jsdoc/classes/AgentSignature":{"title":"Class: AgentSignature","data":{"":"@coasys/ad4m / Exports / AgentSignature","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"publicKey\nsignature","constructors-1#Constructors":"","constructor#constructor":"• new AgentSignature(signature, publicKey)","parameters#Parameters":"Name\tType\tsignature\tstring\tpublicKey\tstring","defined-in#Defined in":"agent/Agent.ts:137","properties-1#Properties":"","publickey#publicKey":"• publicKey: string","defined-in-1#Defined in":"agent/Agent.ts:135","signature#signature":"• signature: string","defined-in-2#Defined in":"agent/Agent.ts:132"}},"/jsdoc/classes/AgentStatus":{"title":"Class: AgentStatus","data":{"":"@coasys/ad4m / Exports / AgentStatus","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\ndidDocument\nerror\nisInitialized\nisUnlocked","constructors-1#Constructors":"","constructor#constructor":"• new AgentStatus(obj?)","parameters#Parameters":"Name\tType\tobj?\tobject","defined-in#Defined in":"agent/AgentStatus.ts:20","properties-1#Properties":"","did#did":"• Optional did: string","defined-in-1#Defined in":"agent/AgentStatus.ts:12","diddocument#didDocument":"• Optional didDocument: string","defined-in-2#Defined in":"agent/AgentStatus.ts:15","error#error":"• Optional error: string","defined-in-3#Defined in":"agent/AgentStatus.ts:18","isinitialized#isInitialized":"• isInitialized: Boolean","defined-in-4#Defined in":"agent/AgentStatus.ts:6","isunlocked#isUnlocked":"• isUnlocked: Boolean","defined-in-5#Defined in":"agent/AgentStatus.ts:9"}},"/jsdoc/classes/Apps":{"title":"Class: Apps","data":{"":"@coasys/ad4m / Exports / Apps","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"auth\nrequestId\nrevoked\ntoken","constructors-1#Constructors":"","constructor#constructor":"• new Apps(requestId, auth, token, revoked?)","parameters#Parameters":"Name\tType\trequestId\tstring\tauth\tAuthInfo\ttoken\tstring\trevoked?\tboolean","defined-in#Defined in":"agent/Agent.ts:217","properties-1#Properties":"","auth#auth":"• auth: AuthInfo","defined-in-1#Defined in":"agent/Agent.ts:215","requestid#requestId":"• requestId: string","defined-in-2#Defined in":"agent/Agent.ts:206","revoked#revoked":"• Optional revoked: boolean","defined-in-3#Defined in":"agent/Agent.ts:212","token#token":"• token: string","defined-in-4#Defined in":"agent/Agent.ts:209"}},"/jsdoc/classes/AuthInfo":{"title":"Class: AuthInfo","data":{"":"@coasys/ad4m / Exports / AuthInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appDesc\nappIconPath\nappName\nappUrl\ncapabilities","constructors-1#Constructors":"","constructor#constructor":"• new AuthInfo(appName, appDesc, appUrl, capabilities, appIconPath?)","parameters#Parameters":"Name\tType\tappName\tstring\tappDesc\tstring\tappUrl\tstring\tcapabilities\tCapability[]\tappIconPath?\tstring","defined-in#Defined in":"agent/Agent.ts:188","properties-1#Properties":"","appdesc#appDesc":"• appDesc: string","defined-in-1#Defined in":"agent/Agent.ts:177","appiconpath#appIconPath":"• Optional appIconPath: string","defined-in-2#Defined in":"agent/Agent.ts:183","appname#appName":"• appName: string","defined-in-3#Defined in":"agent/Agent.ts:174","appurl#appUrl":"• appUrl: string","defined-in-4#Defined in":"agent/Agent.ts:180","capabilities#capabilities":"• capabilities: Capability[]","defined-in-5#Defined in":"agent/Agent.ts:186"}},"/jsdoc/classes/AuthInfoInput":{"title":"Class: AuthInfoInput","data":{"":"@coasys/ad4m / Exports / AuthInfoInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appDesc\nappDomain\nappIconPath\nappName\nappUrl\ncapabilities","constructors-1#Constructors":"","constructor#constructor":"• new AuthInfoInput(appName, appDesc, appDomain, appUrl?, appIconPath?, capabilities?)","parameters#Parameters":"Name\tType\tappName\tstring\tappDesc\tstring\tappDomain\tstring\tappUrl?\tstring\tappIconPath?\tstring\tcapabilities?\tCapabilityInput[]","defined-in#Defined in":"agent/Agent.ts:278","properties-1#Properties":"","appdesc#appDesc":"• appDesc: string","defined-in-1#Defined in":"agent/Agent.ts:264","appdomain#appDomain":"• appDomain: string","defined-in-2#Defined in":"agent/Agent.ts:267","appiconpath#appIconPath":"• Optional appIconPath: string","defined-in-3#Defined in":"agent/Agent.ts:273","appname#appName":"• appName: string","defined-in-4#Defined in":"agent/Agent.ts:261","appurl#appUrl":"• Optional appUrl: string","defined-in-5#Defined in":"agent/Agent.ts:270","capabilities#capabilities":"• Optional capabilities: CapabilityInput[]","defined-in-6#Defined in":"agent/Agent.ts:276"}},"/jsdoc/classes/Capability":{"title":"Class: Capability","data":{"":"@coasys/ad4m / Exports / Capability","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"can\nwith","constructors-1#Constructors":"","constructor#constructor":"• new Capability(withF, can)","parameters#Parameters":"Name\tType\twithF\tResource\tcan\tstring[]","defined-in#Defined in":"agent/Agent.ts:165","properties-1#Properties":"","can#can":"• can: string[]","defined-in-1#Defined in":"agent/Agent.ts:163","with#with":"• with: Resource","defined-in-2#Defined in":"agent/Agent.ts:160"}},"/jsdoc/classes/CapabilityInput":{"title":"Class: CapabilityInput","data":{"":"@coasys/ad4m / Exports / CapabilityInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"can\nwith","constructors-1#Constructors":"","constructor#constructor":"• new CapabilityInput(withF, can)","parameters#Parameters":"Name\tType\twithF\tResourceInput\tcan\tstring[]","defined-in#Defined in":"agent/Agent.ts:252","properties-1#Properties":"","can#can":"• can: string[]","defined-in-1#Defined in":"agent/Agent.ts:250","with#with":"• with: ResourceInput","defined-in-2#Defined in":"agent/Agent.ts:247"}},"/jsdoc/classes/Dna":{"title":"Class: Dna","data":{"":"@coasys/ad4m / Exports / Dna","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"file\nnick\nzomeCalls","constructors-1#Constructors":"","constructor#constructor":"• new Dna()","properties-1#Properties":"","file#file":"• file: Buffer","defined-in#Defined in":"language/LanguageContext.ts:23","nick#nick":"• nick: string","defined-in-1#Defined in":"language/LanguageContext.ts:24","zomecalls#zomeCalls":"• zomeCalls: [string, string][]","defined-in-2#Defined in":"language/LanguageContext.ts:25"}},"/jsdoc/classes/EntanglementProof":{"title":"Class: EntanglementProof","data":{"":"@coasys/ad4m / Exports / EntanglementProof","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"deviceKey\ndeviceKeySignedByDid\ndeviceKeyType\ndid\ndidSignedByDeviceKey\ndidSigningKeyId","constructors-1#Constructors":"","constructor#constructor":"• new EntanglementProof(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey?)","parameters#Parameters":"Name\tType\tdid\tstring\tdidSigningKeyId\tstring\tdeviceKeyType\tstring\tdeviceKey\tstring\tdeviceKeySignedByDid\tstring\tdidSignedByDeviceKey?\tstring","defined-in#Defined in":"agent/Agent.ts:75","properties-1#Properties":"","devicekey#deviceKey":"• deviceKey: string","defined-in-1#Defined in":"agent/Agent.ts:67","devicekeysignedbydid#deviceKeySignedByDid":"• deviceKeySignedByDid: string","defined-in-2#Defined in":"agent/Agent.ts:70","devicekeytype#deviceKeyType":"• deviceKeyType: string","defined-in-3#Defined in":"agent/Agent.ts:64","did#did":"• did: string","defined-in-4#Defined in":"agent/Agent.ts:58","didsignedbydevicekey#didSignedByDeviceKey":"• Optional didSignedByDeviceKey: string","defined-in-5#Defined in":"agent/Agent.ts:73","didsigningkeyid#didSigningKeyId":"• didSigningKeyId: string","defined-in-6#Defined in":"agent/Agent.ts:61"}},"/jsdoc/classes/EntanglementProofInput":{"title":"Class: EntanglementProofInput","data":{"":"@coasys/ad4m / Exports / EntanglementProofInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"deviceKey\ndeviceKeySignedByDid\ndeviceKeyType\ndid\ndidSignedByDeviceKey\ndidSigningKeyId","constructors-1#Constructors":"","constructor#constructor":"• new EntanglementProofInput(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey)","parameters#Parameters":"Name\tType\tdid\tstring\tdidSigningKeyId\tstring\tdeviceKeyType\tstring\tdeviceKey\tstring\tdeviceKeySignedByDid\tstring\tdidSignedByDeviceKey\tstring","defined-in#Defined in":"agent/Agent.ts:112","properties-1#Properties":"","devicekey#deviceKey":"• deviceKey: string","defined-in-1#Defined in":"agent/Agent.ts:104","devicekeysignedbydid#deviceKeySignedByDid":"• deviceKeySignedByDid: string","defined-in-2#Defined in":"agent/Agent.ts:107","devicekeytype#deviceKeyType":"• deviceKeyType: string","defined-in-3#Defined in":"agent/Agent.ts:101","did#did":"• did: string","defined-in-4#Defined in":"agent/Agent.ts:95","didsignedbydevicekey#didSignedByDeviceKey":"• didSignedByDeviceKey: string","defined-in-5#Defined in":"agent/Agent.ts:110","didsigningkeyid#didSigningKeyId":"• didSigningKeyId: string","defined-in-6#Defined in":"agent/Agent.ts:98"}},"/jsdoc/classes/Expression":{"title":"Class: Expression","data":{"":"@coasys/ad4m / Exports / Expression","hierarchy#Hierarchy":"any↳ Expression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new Expression()","inherited-from#Inherited from":"ExpressionGeneric(Object).constructor"}},"/jsdoc/classes/ExpressionProof":{"title":"Class: ExpressionProof","data":{"":"@coasys/ad4m / Exports / ExpressionProof","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"invalid\nkey\nsignature\nvalid","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionProof(sig, k)","parameters#Parameters":"Name\tType\tsig\tstring\tk\tstring","defined-in#Defined in":"expression/Expression.ts:20","properties-1#Properties":"","invalid#invalid":"• Optional invalid: boolean","defined-in-1#Defined in":"expression/Expression.ts:18","key#key":"• key: string","defined-in-2#Defined in":"expression/Expression.ts:12","signature#signature":"• signature: string","defined-in-3#Defined in":"expression/Expression.ts:9","valid#valid":"• Optional valid: boolean","defined-in-4#Defined in":"expression/Expression.ts:15"}},"/jsdoc/classes/ExpressionProofInput":{"title":"Class: ExpressionProofInput","data":{"":"@coasys/ad4m / Exports / ExpressionProofInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"invalid\nkey\nsignature\nvalid","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionProofInput()","properties-1#Properties":"","invalid#invalid":"• Optional invalid: boolean","defined-in#Defined in":"expression/Expression.ts:38","key#key":"• key: string","defined-in-1#Defined in":"expression/Expression.ts:32","signature#signature":"• signature: string","defined-in-2#Defined in":"expression/Expression.ts:29","valid#valid":"• Optional valid: boolean","defined-in-3#Defined in":"expression/Expression.ts:35"}},"/jsdoc/classes/ExpressionRendered":{"title":"Class: ExpressionRendered","data":{"":"@coasys/ad4m / Exports / ExpressionRendered","hierarchy#Hierarchy":"any↳ ExpressionRendered","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"icon\nlanguage","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionRendered()","inherited-from#Inherited from":"ExpressionGeneric(String).constructor","properties-1#Properties":"","icon#icon":"• icon: Icon","defined-in#Defined in":"expression/Expression.ts:94","language#language":"• language: LanguageRef","defined-in-1#Defined in":"expression/Expression.ts:91"}},"/jsdoc/classes/Icon":{"title":"Class: Icon","data":{"":"@coasys/ad4m / Exports / Icon","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"code","constructors-1#Constructors":"","constructor#constructor":"• new Icon(code)","parameters#Parameters":"Name\tType\tcode\tstring","defined-in#Defined in":"language/Icon.ts:8","properties-1#Properties":"","code#code":"• code: string","defined-in-1#Defined in":"language/Icon.ts:6"}},"/jsdoc/classes/ExpressionRef":{"title":"Class: ExpressionRef","data":{"":"@coasys/ad4m / Exports / ExpressionRef","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"expression\nlanguage","constructors-1#Constructors":"","constructor#constructor":"• new ExpressionRef(lang, expr)","parameters#Parameters":"Name\tType\tlang\tLanguageRef\texpr\tstring","defined-in#Defined in":"expression/ExpressionRef.ts:14","properties-1#Properties":"","expression#expression":"• expression: string","defined-in-1#Defined in":"expression/ExpressionRef.ts:12","language#language":"• language: LanguageRef","defined-in-2#Defined in":"expression/ExpressionRef.ts:9"}},"/jsdoc/classes/InteractionCall":{"title":"Class: InteractionCall","data":{"":"@coasys/ad4m / Exports / InteractionCall","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\nparametersStringified","accessors#Accessors":"parameters","constructors-1#Constructors":"","constructor#constructor":"• new InteractionCall(name, parameters)","parameters#Parameters":"Name\tType\tname\tstring\tparameters\tobject","defined-in#Defined in":"language/Language.ts:256","properties-1#Properties":"","name#name":"• name: string","defined-in-1#Defined in":"language/Language.ts:248","parametersstringified#parametersStringified":"• parametersStringified: string","defined-in-2#Defined in":"language/Language.ts:250","accessors-1#Accessors":"","parameters-1#parameters":"• get parameters(): object","returns#Returns":"object","defined-in-3#Defined in":"language/Language.ts:252"}},"/jsdoc/classes/InteractionMeta":{"title":"Class: InteractionMeta","data":{"":"@coasys/ad4m / Exports / InteractionMeta","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"label\nname\nparameters","constructors-1#Constructors":"","constructor#constructor":"• new InteractionMeta()","properties-1#Properties":"","label#label":"• label: string","defined-in#Defined in":"language/Language.ts:230","name#name":"• name: string","defined-in-1#Defined in":"language/Language.ts:233","parameters#parameters":"• parameters: InteractionParameter[]","defined-in-2#Defined in":"language/Language.ts:236"}},"/jsdoc/classes/LanguageLanguageInput":{"title":"Class: LanguageLanguageInput","data":{"":"@coasys/ad4m / Exports / LanguageLanguageInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"bundle\nmeta","constructors-1#Constructors":"","constructor#constructor":"• new LanguageLanguageInput()","properties-1#Properties":"","bundle#bundle":"• bundle: string","defined-in#Defined in":"language/LanguageMeta.ts:68","meta#meta":"• meta: LanguageMetaInternal","defined-in-1#Defined in":"language/LanguageMeta.ts:69"}},"/jsdoc/classes/LanguageExpression":{"title":"Class: LanguageExpression","data":{"":"@coasys/ad4m / Exports / LanguageExpression","hierarchy#Hierarchy":"any↳ LanguageExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new LanguageExpression()","inherited-from#Inherited from":"ExpressionGeneric(LanguageMetaInternal).constructor"}},"/jsdoc/classes/LanguageHandle":{"title":"Class: LanguageHandle","data":{"":"@coasys/ad4m / Exports / LanguageHandle","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nconstructorIcon\nicon\nname\nsettings\nsettingsIcon","constructors-1#Constructors":"","constructor#constructor":"• new LanguageHandle()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageHandle.ts:10","constructoricon#constructorIcon":"• Optional constructorIcon: Icon","defined-in-1#Defined in":"language/LanguageHandle.ts:19","icon#icon":"• Optional icon: Icon","defined-in-2#Defined in":"language/LanguageHandle.ts:16","name#name":"• name: string","defined-in-3#Defined in":"language/LanguageHandle.ts:7","settings#settings":"• Optional settings: string","defined-in-4#Defined in":"language/LanguageHandle.ts:13","settingsicon#settingsIcon":"• Optional settingsIcon: Icon","defined-in-5#Defined in":"language/LanguageHandle.ts:22"}},"/jsdoc/classes/LanguageMeta":{"title":"Class: LanguageMeta","data":{"":"@coasys/ad4m / Exports / LanguageMeta","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nauthor\ndescription\nname\npossibleTemplateParams\nsourceCodeLink\ntemplateAppliedParams\ntemplateSourceLanguageAddress\ntemplated","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMeta()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageMeta.ts:10","author#author":"• author: string","defined-in-1#Defined in":"language/LanguageMeta.ts:16","description#description":"• description: string","defined-in-2#Defined in":"language/LanguageMeta.ts:13","name#name":"• name: string","defined-in-3#Defined in":"language/LanguageMeta.ts:7","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-4#Defined in":"language/LanguageMeta.ts:28","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-5#Defined in":"language/LanguageMeta.ts:31","templateappliedparams#templateAppliedParams":"• Optional templateAppliedParams: string","defined-in-6#Defined in":"language/LanguageMeta.ts:25","templatesourcelanguageaddress#templateSourceLanguageAddress":"• Optional templateSourceLanguageAddress: string","defined-in-7#Defined in":"language/LanguageMeta.ts:22","templated#templated":"• templated: boolean","defined-in-8#Defined in":"language/LanguageMeta.ts:19"}},"/jsdoc/classes/LanguageMetaInternal":{"title":"Class: LanguageMetaInternal","data":{"":"@coasys/ad4m / Exports / LanguageMetaInternal","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\ndescription\nname\npossibleTemplateParams\nsourceCodeLink\ntemplateAppliedParams\ntemplateSourceLanguageAddress","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMetaInternal()","properties-1#Properties":"","address#address":"• address: string","defined-in#Defined in":"language/LanguageMeta.ts:57","description#description":"• description: string","defined-in-1#Defined in":"language/LanguageMeta.ts:58","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageMeta.ts:56","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-3#Defined in":"language/LanguageMeta.ts:61","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-4#Defined in":"language/LanguageMeta.ts:62","templateappliedparams#templateAppliedParams":"• Optional templateAppliedParams: string","defined-in-5#Defined in":"language/LanguageMeta.ts:60","templatesourcelanguageaddress#templateSourceLanguageAddress":"• Optional templateSourceLanguageAddress: string","defined-in-6#Defined in":"language/LanguageMeta.ts:59"}},"/jsdoc/classes/LanguageRef":{"title":"Class: LanguageRef","data":{"":"@coasys/ad4m / Exports / LanguageRef","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"address\nname","constructors-1#Constructors":"","constructor#constructor":"• new LanguageRef(address?, name?)","parameters#Parameters":"Name\tType\taddress?\tstring\tname?\tstring","defined-in#Defined in":"language/LanguageRef.ts:14","properties-1#Properties":"","address#address":"• address: string","defined-in-1#Defined in":"language/LanguageRef.ts:9","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageRef.ts:12"}},"/jsdoc/classes/LanguageMetaInput":{"title":"Class: LanguageMetaInput","data":{"":"@coasys/ad4m / Exports / LanguageMetaInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"description\nname\npossibleTemplateParams\nsourceCodeLink","constructors-1#Constructors":"","constructor#constructor":"• new LanguageMetaInput(name?, description?)","parameters#Parameters":"Name\tType\tname?\tstring\tdescription?\tstring","defined-in#Defined in":"language/LanguageMeta.ts:48","properties-1#Properties":"","description#description":"• description: string","defined-in-1#Defined in":"language/LanguageMeta.ts:40","name#name":"• name: string","defined-in-2#Defined in":"language/LanguageMeta.ts:37","possibletemplateparams#possibleTemplateParams":"• Optional possibleTemplateParams: string[]","defined-in-3#Defined in":"language/LanguageMeta.ts:43","sourcecodelink#sourceCodeLink":"• Optional sourceCodeLink: string","defined-in-4#Defined in":"language/LanguageMeta.ts:46"}},"/jsdoc/classes/LinkExpression":{"title":"Class: LinkExpression","data":{"":"@coasys/ad4m / Exports / LinkExpression","hierarchy#Hierarchy":"any↳ LinkExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"status","methods#Methods":"hash","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpression()","inherited-from#Inherited from":"ExpressionGeneric(Link).constructor","properties-1#Properties":"","status#status":"• Optional status: LinkStatus","defined-in#Defined in":"links/Links.ts:72","methods-1#Methods":"","hash#hash":"▸ hash(): number","returns#Returns":"number","defined-in-1#Defined in":"links/Links.ts:59"}},"/jsdoc/classes/Link":{"title":"Class: Link","data":{"":"@coasys/ad4m / Exports / Link","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"predicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new Link(obj)","parameters#Parameters":"Name\tType\tobj\tany","defined-in#Defined in":"links/Links.ts:16","properties-1#Properties":"","predicate#predicate":"• Optional predicate: string","defined-in-1#Defined in":"links/Links.ts:14","source#source":"• source: string","defined-in-2#Defined in":"links/Links.ts:8","target#target":"• target: string","defined-in-3#Defined in":"links/Links.ts:11"}},"/jsdoc/classes/LinkExpressionInput":{"title":"Class: LinkExpressionInput","data":{"":"@coasys/ad4m / Exports / LinkExpressionInput","hierarchy#Hierarchy":"any↳ LinkExpressionInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"hash\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionInput()","inherited-from#Inherited from":"ExpressionGenericInput(LinkInput).constructor","properties-1#Properties":"","hash#hash":"• hash: () => number","type-declaration#Type declaration":"▸ (): number","returns#Returns":"number","defined-in#Defined in":"links/Links.ts:77","status#status":"• Optional status: LinkStatus","defined-in-1#Defined in":"links/Links.ts:80"}},"/jsdoc/classes/LinkExpressionUpdated":{"title":"Class: LinkExpressionUpdated","data":{"":"@coasys/ad4m / Exports / LinkExpressionUpdated","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"newLink\noldLink","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionUpdated(oldLink, newLink)","parameters#Parameters":"Name\tType\toldLink\tLinkExpression\tnewLink\tLinkExpression","defined-in#Defined in":"links/Links.ts:103","properties-1#Properties":"","newlink#newLink":"• newLink: LinkExpression","defined-in-1#Defined in":"links/Links.ts:101","oldlink#oldLink":"• oldLink: LinkExpression","defined-in-2#Defined in":"links/Links.ts:98"}},"/jsdoc/classes/LinkExpressionMutations":{"title":"Class: LinkExpressionMutations","data":{"":"@coasys/ad4m / Exports / LinkExpressionMutations","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new LinkExpressionMutations(additions, removals)","parameters#Parameters":"Name\tType\tadditions\tLinkExpression[]\tremovals\tLinkExpression[]","defined-in#Defined in":"links/Links.ts:39","properties-1#Properties":"","additions#additions":"• additions: LinkExpression[]","defined-in-1#Defined in":"links/Links.ts:34","removals#removals":"• removals: LinkExpression[]","defined-in-2#Defined in":"links/Links.ts:37"}},"/jsdoc/classes/InteractionParameter":{"title":"Class: InteractionParameter","data":{"":"@coasys/ad4m / Exports / InteractionParameter","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\ntype","constructors-1#Constructors":"","constructor#constructor":"• new InteractionParameter()","properties-1#Properties":"","name#name":"• name: string","defined-in#Defined in":"language/Language.ts:221","type#type":"• type: string","defined-in-1#Defined in":"language/Language.ts:224"}},"/jsdoc/classes/LinkMutations":{"title":"Class: LinkMutations","data":{"":"@coasys/ad4m / Exports / LinkMutations","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new LinkMutations()","properties-1#Properties":"","additions#additions":"• additions: LinkInput[]","defined-in#Defined in":"links/Links.ts:26","removals#removals":"• removals: LinkExpressionInput[]","defined-in-1#Defined in":"links/Links.ts:29"}},"/jsdoc/classes/Literal":{"title":"Class: Literal","data":{"":"@coasys/ad4m / Exports / Literal","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#literal\n#url","methods#Methods":"get\ntoUrl\nfrom\nfromUrl","constructors-1#Constructors":"","constructor#constructor":"• new Literal()","properties-1#Properties":"","literal##literal":"• Private Optional #literal: any","defined-in#Defined in":"Literal.ts:10","url##url":"• Private Optional #url: string","defined-in-1#Defined in":"Literal.ts:11","methods-1#Methods":"","get#get":"▸ get(): any","returns#Returns":"any","defined-in-2#Defined in":"Literal.ts:52","tourl#toUrl":"▸ toUrl(): string","returns-1#Returns":"string","defined-in-3#Defined in":"Literal.ts:27","from#from":"▸ Static from(literal): Literal","parameters#Parameters":"Name\tType\tliteral\tany","returns-2#Returns":"Literal","defined-in-4#Defined in":"Literal.ts:21","fromurl#fromUrl":"▸ Static fromUrl(url): Literal","parameters-1#Parameters":"Name\tType\turl\tstring","returns-3#Returns":"Literal","defined-in-5#Defined in":"Literal.ts:13"}},"/jsdoc/classes/LinkQuery":{"title":"Class: LinkQuery","data":{"":"@coasys/ad4m / Exports / LinkQuery","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"fromDate\nlimit\npredicate\nsource\ntarget\nuntilDate","methods#Methods":"isMatch","constructors-1#Constructors":"","constructor#constructor":"• new LinkQuery(obj)","parameters#Parameters":"Name\tType\tobj\tobject","defined-in#Defined in":"perspectives/LinkQuery.ts:25","properties-1#Properties":"","fromdate#fromDate":"• Optional fromDate: Date","defined-in-1#Defined in":"perspectives/LinkQuery.ts:17","limit#limit":"• Optional limit: number","defined-in-2#Defined in":"perspectives/LinkQuery.ts:23","predicate#predicate":"• Optional predicate: string","defined-in-3#Defined in":"perspectives/LinkQuery.ts:14","source#source":"• Optional source: string","defined-in-4#Defined in":"perspectives/LinkQuery.ts:8","target#target":"• Optional target: string","defined-in-5#Defined in":"perspectives/LinkQuery.ts:11","untildate#untilDate":"• Optional untilDate: Date","defined-in-6#Defined in":"perspectives/LinkQuery.ts:20","methods-1#Methods":"","ismatch#isMatch":"▸ isMatch(l): boolean","parameters-1#Parameters":"Name\tType\tl\tLink","returns#Returns":"boolean","defined-in-7#Defined in":"perspectives/LinkQuery.ts:51"}},"/jsdoc/classes/LinkInput":{"title":"Class: LinkInput","data":{"":"@coasys/ad4m / Exports / LinkInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"predicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new LinkInput()","properties-1#Properties":"","predicate#predicate":"• Optional predicate: string","defined-in#Defined in":"links/Links.ts:54","source#source":"• source: string","defined-in-1#Defined in":"links/Links.ts:48","target#target":"• target: string","defined-in-2#Defined in":"links/Links.ts:51"}},"/jsdoc/classes/Neighbourhood":{"title":"Class: Neighbourhood","data":{"":"@coasys/ad4m / Exports / Neighbourhood","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"linkLanguage\nmeta","constructors-1#Constructors":"","constructor#constructor":"• new Neighbourhood(linkLanguage, meta)","parameters#Parameters":"Name\tType\tlinkLanguage\tstring\tmeta\tPerspective","defined-in#Defined in":"neighbourhood/Neighbourhood.ts:15","properties-1#Properties":"","linklanguage#linkLanguage":"• linkLanguage: string","defined-in-1#Defined in":"neighbourhood/Neighbourhood.ts:10","meta#meta":"• meta: Perspective","defined-in-2#Defined in":"neighbourhood/Neighbourhood.ts:13"}},"/jsdoc/classes/NeighbourhoodExpression":{"title":"Class: NeighbourhoodExpression","data":{"":"@coasys/ad4m / Exports / NeighbourhoodExpression","hierarchy#Hierarchy":"any↳ NeighbourhoodExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new NeighbourhoodExpression()","inherited-from#Inherited from":"ExpressionGeneric(Neighbourhood).constructor"}},"/jsdoc/classes/OnlineAgent":{"title":"Class: OnlineAgent","data":{"":"@coasys/ad4m / Exports / OnlineAgent","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\nstatus","constructors-1#Constructors":"","constructor#constructor":"• new OnlineAgent()","properties-1#Properties":"","did#did":"• did: string","defined-in#Defined in":"language/Language.ts:265","status#status":"• status: PerspectiveExpression","defined-in-1#Defined in":"language/Language.ts:267"}},"/jsdoc/classes/NeighbourhoodProxy":{"title":"Class: NeighbourhoodProxy","data":{"":"@coasys/ad4m / Exports / NeighbourhoodProxy","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#client\n#pID","methods#Methods":"addSignalHandler\nhasTelepresenceAdapter\nonlineAgents\notherAgents\nremoveSignalHandler\nsendBroadcast\nsendBroadcastU\nsendSignal\nsendSignalU\nsetOnlineStatus\nsetOnlineStatusU","constructors-1#Constructors":"","constructor#constructor":"• new NeighbourhoodProxy(client, pID)","parameters#Parameters":"Name\tType\tclient\tNeighbourhoodClient\tpID\tstring","defined-in#Defined in":"neighbourhood/NeighbourhoodProxy.ts:10","properties-1#Properties":"","client##client":"• Private #client: NeighbourhoodClient","defined-in-1#Defined in":"neighbourhood/NeighbourhoodProxy.ts:7","pid##pID":"• Private #pID: string","defined-in-2#Defined in":"neighbourhood/NeighbourhoodProxy.ts:8","methods-1#Methods":"","addsignalhandler#addSignalHandler":"▸ addSignalHandler(handler): Promise","parameters-1#Parameters":"Name\tType\thandler\t(payload: PerspectiveExpression) => void","returns#Returns":"Promise","defined-in-3#Defined in":"neighbourhood/NeighbourhoodProxy.ts:51","hastelepresenceadapter#hasTelepresenceAdapter":"▸ hasTelepresenceAdapter(): Promise","returns-1#Returns":"Promise","defined-in-4#Defined in":"neighbourhood/NeighbourhoodProxy.ts:19","onlineagents#onlineAgents":"▸ onlineAgents(): Promise","returns-2#Returns":"Promise","defined-in-5#Defined in":"neighbourhood/NeighbourhoodProxy.ts:23","otheragents#otherAgents":"▸ otherAgents(): Promise","returns-3#Returns":"Promise","defined-in-6#Defined in":"neighbourhood/NeighbourhoodProxy.ts:15","removesignalhandler#removeSignalHandler":"▸ removeSignalHandler(handler): void","parameters-2#Parameters":"Name\tType\thandler\t(payload: PerspectiveExpression) => void","returns-4#Returns":"void","defined-in-7#Defined in":"neighbourhood/NeighbourhoodProxy.ts:55","sendbroadcast#sendBroadcast":"▸ sendBroadcast(payload, loopback?): Promise","parameters-3#Parameters":"Name\tType\tDefault value\tpayload\tPerspective\tundefined\tloopback\tboolean\tfalse","returns-5#Returns":"Promise","defined-in-8#Defined in":"neighbourhood/NeighbourhoodProxy.ts:43","sendbroadcastu#sendBroadcastU":"▸ sendBroadcastU(payload, loopback?): Promise","parameters-4#Parameters":"Name\tType\tDefault value\tpayload\tPerspectiveUnsignedInput\tundefined\tloopback\tboolean\tfalse","returns-6#Returns":"Promise","defined-in-9#Defined in":"neighbourhood/NeighbourhoodProxy.ts:47","sendsignal#sendSignal":"▸ sendSignal(remoteAgentDid, payload): Promise","parameters-5#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspective","returns-7#Returns":"Promise","defined-in-10#Defined in":"neighbourhood/NeighbourhoodProxy.ts:35","sendsignalu#sendSignalU":"▸ sendSignalU(remoteAgentDid, payload): Promise","parameters-6#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspectiveUnsignedInput","returns-8#Returns":"Promise","defined-in-11#Defined in":"neighbourhood/NeighbourhoodProxy.ts:39","setonlinestatus#setOnlineStatus":"▸ setOnlineStatus(status): Promise","parameters-7#Parameters":"Name\tType\tstatus\tPerspective","returns-9#Returns":"Promise","defined-in-12#Defined in":"neighbourhood/NeighbourhoodProxy.ts:27","setonlinestatusu#setOnlineStatusU":"▸ setOnlineStatusU(status): Promise","parameters-8#Parameters":"Name\tType\tstatus\tPerspectiveUnsignedInput","returns-10#Returns":"Promise","defined-in-13#Defined in":"neighbourhood/NeighbourhoodProxy.ts:31"}},"/jsdoc/classes/Perspective":{"title":"Class: Perspective","data":{"":"@coasys/ad4m / Exports / PerspectiveA Perspective represents subjective meaning, encoded through\nassociations between expressions, a.k.a. Links, that is a graph\nover the objective Expressions of any subset of Languages.This type represents the clean onotological concept of a Perspective.\nAn instance of this class can be regarded as an immutable snapshot of\na mutable perspective.The types PerspectiveProxy and PerspectiveHandle are used when dealing\nwith an instantiated mutable perspective as is done through most of\nthe GraphQL mutations.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","methods#Methods":"get\ngetSingleTarget","constructors-1#Constructors":"","constructor#constructor":"• new Perspective(links?)","parameters#Parameters":"Name\tType\tlinks?\tLinkExpression[]","defined-in#Defined in":"perspectives/Perspective.ts:24","properties-1#Properties":"","links#links":"• links: LinkExpression[]The content of the perspective, a list/graph of links","defined-in-1#Defined in":"perspectives/Perspective.ts:22","methods-1#Methods":"","get#get":"▸ get(query): LinkExpression[]Convenience function for filtering links just like with PerspectiveProxy","parameters-1#Parameters":"Name\tType\tquery\tLinkQuery","returns#Returns":"LinkExpression[]","defined-in-2#Defined in":"perspectives/Perspective.ts:33","getsingletarget#getSingleTarget":"▸ getSingleTarget(query): string | voidConvenience function to get the target of the first link that matches the given query\nThis makes sense when the query is expected to return only one link\nand the target of that link is what you are looking for.","parameters-2#Parameters":"Name\tType\tquery\tLinkQuery","returns-1#Returns":"string | void","defined-in-3#Defined in":"perspectives/Perspective.ts:81"}},"/jsdoc/classes/ModelQueryBuilder":{"title":"Class: ModelQueryBuilder","data":{"":"@coasys/ad4m / Exports / ModelQueryBuilderQuery builder for Ad4mModel queries.\nAllows building queries with a fluent interface and either running them once\nor subscribing to updates.Example\nconst builder = Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .order({ rating: \"DESC\" })\n .limit(10);\n// Run once\nconst recipes = await builder.run();\n// Or subscribe to updates\nawait builder.subscribe(recipes => {\n console.log(\"Updated recipes:\", recipes);\n});","type-parameters#Type parameters":"Name\tType\tT\textends Ad4mModel","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"ctor\ncurrentSubscription\nmodelClassName\nperspective\nqueryParams\nuseSurrealDBFlag","methods#Methods":"count\ncountSubscribe\ndispose\nfirst\nget\ninclude\nlimit\noffset\norder\noverrideModelClassName\npaginate\npaginateSubscribe\nparent\nproperties\nsubscribe\nuseSurrealDB\nwhere","constructors-1#Constructors":"","constructor#constructor":"• new ModelQueryBuilder(perspective, ctor, query?)","type-parameters-1#Type parameters":"Name\tType\tT\textends Ad4mModel","parameters#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tctor\ttypeof Ad4mModel\tquery?\tQuery","defined-in#Defined in":"model/Ad4mModel.ts:4009","properties-1#Properties":"","ctor#ctor":"• Private ctor: typeof Ad4mModel","defined-in-1#Defined in":"model/Ad4mModel.ts:4005","currentsubscription#currentSubscription":"• Private Optional currentSubscription: any","defined-in-2#Defined in":"model/Ad4mModel.ts:4006","modelclassname#modelClassName":"• Private modelClassName: string = null","defined-in-3#Defined in":"model/Ad4mModel.ts:4004","perspective#perspective":"• Private perspective: PerspectiveProxy","defined-in-4#Defined in":"model/Ad4mModel.ts:4002","queryparams#queryParams":"• Private queryParams: Query = {}","defined-in-5#Defined in":"model/Ad4mModel.ts:4003","usesurrealdbflag#useSurrealDBFlag":"• Private useSurrealDBFlag: boolean = true","defined-in-6#Defined in":"model/Ad4mModel.ts:4007","methods-1#Methods":"","count#count":"▸ count(): PromiseGets the total count of matching entities.","returns#Returns":"PromiseTotal countExample\nconst totalDesserts = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .count();","defined-in-7#Defined in":"model/Ad4mModel.ts:4396","countsubscribe#countSubscribe":"▸ countSubscribe(callback): PromiseSubscribes to count updates for matching entities.This method:\nCreates and initializes a SurrealDB live query subscription for the count (default)\nSets up the callback to process future count updates\nReturns the initial count immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-1#Parameters":"Name\tType\tDescription\tcallback\t(count: number) => void\tFunction to call with updated count","returns-1#Returns":"PromiseInitial countExample\nconst builder = Recipe.query(perspective)\n .where({ status: \"active\" });\nconst initialCount = await builder.countSubscribe(count => {\n console.log(\"Active items:\", count);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-8#Defined in":"model/Ad4mModel.ts:4443","dispose#dispose":"▸ dispose(): voidDisposes of the current subscription if one exists.This method:\nStops the keepalive signals to the subscription\nUnsubscribes from GraphQL subscription updates\nNotifies the backend to clean up subscription resources\nClears the subscription reference\nYou should call this method when you're done with a subscription\nto prevent memory leaks and ensure proper cleanup.","returns-2#Returns":"void","defined-in-9#Defined in":"model/Ad4mModel.ts:4027","first#first":"▸ first(): PromiseReturns the first matching instance, or null if none match.Internally sets limit: 1 and delegates to get().","returns-3#Returns":"PromiseThe first matching instance, or nullExample\nconst recipe = await Recipe.query(perspective)\n .where({ name: \"Pasta\" })\n .first();","defined-in-10#Defined in":"model/Ad4mModel.ts:4300","get#get":"▸ get(): PromiseExecutes the query once and returns the results.","returns-4#Returns":"PromiseArray of matching entitiesExample\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .get();","defined-in-11#Defined in":"model/Ad4mModel.ts:4271","include#include":"▸ include(map): ModelQueryBuilderSpecifies which relations to eager-load (hydrate into model instances).Without include, relation fields contain raw expression URIs (strings).\nWith include, the URIs are resolved into fully-hydrated model instances\nusing the target class declared in the relation decorator.Supports nested includes for multi-level eager loading.","parameters-2#Parameters":"Name\tType\tDescription\tmap\tIncludeMap\tAn IncludeMap describing which relations to hydrate","returns-5#Returns":"ModelQueryBuilderThe query builder for chainingExample\n// Hydrate comments one level deep\nconst recipes = await Recipe.query(perspective)\n .include({ comments: true })\n .run();\n// recipe.comments is now Comment[] (model instances), not string[]\n// Nested: hydrate comments AND each comment's author\nconst recipes = await Recipe.query(perspective)\n .include({ comments: { author: true } })\n .run();","defined-in-12#Defined in":"model/Ad4mModel.ts:4219","limit#limit":"▸ limit(limit): ModelQueryBuilderSets the maximum number of results to return.","parameters-3#Parameters":"Name\tType\tDescription\tlimit\tnumber\tMaximum number of results","returns-6#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.limit(10)","defined-in-13#Defined in":"model/Ad4mModel.ts:4082","offset#offset":"▸ offset(offset): ModelQueryBuilderSets the number of results to skip.","parameters-4#Parameters":"Name\tType\tDescription\toffset\tnumber\tNumber of results to skip","returns-7#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.offset(20) // Skip first 20 results","defined-in-14#Defined in":"model/Ad4mModel.ts:4098","order#order":"▸ order(orderBy): ModelQueryBuilderSets the order for the query results.","parameters-5#Parameters":"Name\tType\tDescription\torderBy\tOrder\tThe ordering criteria","returns-8#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.order({ createdAt: \"DESC\" })","defined-in-15#Defined in":"model/Ad4mModel.ts:4066","overridemodelclassname#overrideModelClassName":"▸ overrideModelClassName(className): ModelQueryBuilder","parameters-6#Parameters":"Name\tType\tclassName\tstring","returns-9#Returns":"ModelQueryBuilder","defined-in-16#Defined in":"model/Ad4mModel.ts:4224","paginate#paginate":"▸ paginate(pageSize, pageNumber): Promise>Gets a page of results with pagination metadata.","parameters-7#Parameters":"Name\tType\tDescription\tpageSize\tnumber\tNumber of items per page\tpageNumber\tnumber\tWhich page to retrieve (1-based)","returns-10#Returns":"Promise>Paginated results with metadataExample\nconst page = await Recipe.query(perspective)\n .where({ category: \"Main\" })\n .paginate(10, 1);\nconsole.log(`Page ${page.pageNumber}, ${page.results.length} of ${page.totalCount}`);","defined-in-17#Defined in":"model/Ad4mModel.ts:4495","paginatesubscribe#paginateSubscribe":"▸ paginateSubscribe(pageSize, pageNumber, callback): Promise>Subscribes to paginated results updates.This method:\nCreates and initializes a SurrealDB live query subscription for the paginated results (default)\nSets up the callback to process future page updates\nReturns the initial page immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-8#Parameters":"Name\tType\tDescription\tpageSize\tnumber\tNumber of items per page\tpageNumber\tnumber\tWhich page to retrieve (1-based)\tcallback\t(results: PaginationResult) => void\tFunction to call with updated pagination results","returns-11#Returns":"Promise>Initial pagination resultsExample\nconst builder = Recipe.query(perspective)\n .where({ category: \"Main\" });\nconst initialPage = await builder.paginateSubscribe(10, 1, page => {\n console.log(\"Updated page:\", page.results);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-18#Defined in":"model/Ad4mModel.ts:4543","parent#parent":"▸ parent(idOrInstance, modelOrPredicate?, options?): ModelQueryBuilderScopes the query to instances linked from a parent.The predicate is resolved in order of precedence:\nInstance only — the parent's constructor is used as the model\nclass; its relation metadata is scanned for a relation whose\ntarget() matches the queried model class.\nInstance + options with field — direct field-name lookup on\nthe parent model's relation metadata (disambiguates when a parent\nhas multiple relations targeting the same child class).\nString id + model class — same metadata scan (or field lookup if\noptions include field).\nString id + string predicate — raw escape hatch, no metadata lookup.\nPassing a plain string id with no second argument throws because the\npredicate cannot be resolved without a model class.","parameters-9#Parameters":"Name\tType\tDescription\tidOrInstance\tstring | Ad4mModel\tThe parent's expression URI or an Ad4mModel instance\tmodelOrPredicate?\tstring | typeof Ad4mModel | { field: string }\tA model class (predicate auto-resolved) or a raw predicate string\toptions?\tObject\tOptional settings: field for direct relation-name lookup\toptions.field?\tstring\t-","returns-12#Returns":"ModelQueryBuilderThe query builder for chainingExample\n// Instance — predicate auto-resolved from Cookbook's @HasMany(() => Recipe)\nRecipe.query(perspective).parent(cookbook).get();\n// Instance + field — disambiguate when parent has multiple relations to same child\nRecipe.query(perspective).parent(cookbook, { field: \"recipes\" }).get();\n// String id + model class\nRecipe.query(perspective).parent(cookbookId, Cookbook).get();\n// String id + model class + field\nRecipe.query(perspective).parent(cookbookId, Cookbook, { field: \"recipes\" }).get();\n// String id + raw predicate (escape hatch)\nRecipe.query(perspective).parent(cookbookId, \"cookbook://recipe\").get();","defined-in-19#Defined in":"model/Ad4mModel.ts:4143","properties-2#properties":"▸ properties(properties): ModelQueryBuilderSpecifies which properties to include in the results.","parameters-10#Parameters":"Name\tType\tDescription\tproperties\tstring[]\tArray of property names to include","returns-13#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.properties([\"name\", \"description\", \"rating\"])","defined-in-20#Defined in":"model/Ad4mModel.ts:4188","subscribe#subscribe":"▸ subscribe(callback): PromiseSubscribes to the query and receives updates when results change.This method:\nCreates and initializes a SurrealDB live query subscription (default)\nSets up the callback to process future updates\nReturns the initial results immediately\nRemember to call dispose() when you're done with the subscription\nto clean up resources.","parameters-11#Parameters":"Name\tType\tDescription\tcallback\t(results: T[]) => void\tFunction to call with updated results","returns-14#Returns":"PromiseInitial results arrayExample\nconst builder = Recipe.query(perspective)\n .where({ status: \"cooking\" });\nconst initialRecipes = await builder.subscribe(recipes => {\n console.log(\"Updated recipes:\", recipes);\n});\n// When done with subscription:\nbuilder.dispose();\nRemarksBy default, this uses SurrealDB live queries for real-time updates.\nProlog subscriptions remain available via .useSurrealDB(false).","defined-in-21#Defined in":"model/Ad4mModel.ts:4337","usesurrealdb#useSurrealDB":"▸ useSurrealDB(enabled?): ModelQueryBuilderEnables or disables SurrealDB query path.","parameters-12#Parameters":"Name\tType\tDefault value\tDescription\tenabled\tboolean\ttrue\tWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)","returns-15#Returns":"ModelQueryBuilderThe query builder for chainingExample\n// Use SurrealDB (default)\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .useSurrealDB(true)\n .get();\n// Use Prolog (legacy)\nconst recipesProlog = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .useSurrealDB(false)\n .get();\nRemarksNote: Subscriptions (subscribe(), countSubscribe(), paginateSubscribe()) default to SurrealDB live queries\nif useSurrealDB(true) is set (default).","defined-in-22#Defined in":"model/Ad4mModel.ts:4254","where#where":"▸ where(conditions): ModelQueryBuilderAdds where conditions to the query.","parameters-13#Parameters":"Name\tType\tDescription\tconditions\tWhere\tThe conditions to filter by","returns-16#Returns":"ModelQueryBuilderThe query builder for chainingExample\n.where({\n category: \"Dessert\",\n rating: { gt: 4 },\n tags: [\"vegan\", \"quick\"],\n published: true\n})","defined-in-23#Defined in":"model/Ad4mModel.ts:4050"}},"/jsdoc/classes/PerspectiveDiff":{"title":"Class: PerspectiveDiff","data":{"":"@coasys/ad4m / Exports / PerspectiveDiff","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"additions\nremovals","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveDiff()","properties-1#Properties":"","additions#additions":"• additions: LinkExpression[]","defined-in#Defined in":"perspectives/PerspectiveDiff.ts:8","removals#removals":"• removals: LinkExpression[]","defined-in-1#Defined in":"perspectives/PerspectiveDiff.ts:11"}},"/jsdoc/classes/PerspectiveAction":{"title":"Class: PerspectiveAction","data":{"":"@coasys/ad4m / Exports / PerspectiveAction","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"action\npredicate\nsource\ntarget","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveAction()","properties-1#Properties":"","action#action":"• action: string","defined-in#Defined in":"model/decorators.ts:226","predicate#predicate":"• predicate: string","defined-in-1#Defined in":"model/decorators.ts:228","source#source":"• source: string","defined-in-2#Defined in":"model/decorators.ts:227","target#target":"• target: string","defined-in-3#Defined in":"model/decorators.ts:229"}},"/jsdoc/classes/PerspectiveDiffExpression":{"title":"Class: PerspectiveDiffExpression","data":{"":"@coasys/ad4m / Exports / PerspectiveDiffExpression","hierarchy#Hierarchy":"any↳ PerspectiveDiffExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveDiffExpression()","inherited-from#Inherited from":"ExpressionGeneric(PerspectiveDiff).constructor"}},"/jsdoc/classes/PerspectiveExpression":{"title":"Class: PerspectiveExpression","data":{"":"@coasys/ad4m / Exports / PerspectiveExpression","hierarchy#Hierarchy":"any↳ PerspectiveExpression","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveExpression()","inherited-from#Inherited from":"ExpressionGeneric(Perspective).constructor"}},"/jsdoc/classes/PerspectiveHandle":{"title":"Class: PerspectiveHandle","data":{"":"@coasys/ad4m / Exports / PerspectiveHandle","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"name\nneighbourhood\nowners\nsharedUrl\nstate\nuuid","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveHandle(uuid?, name?, state?)","parameters#Parameters":"Name\tType\tuuid?\tstring\tname?\tstring\tstate?\tPerspectiveState","defined-in#Defined in":"perspectives/PerspectiveHandle.ts:33","properties-1#Properties":"","name#name":"• name: string","defined-in-1#Defined in":"perspectives/PerspectiveHandle.ts:20","neighbourhood#neighbourhood":"• Optional neighbourhood: NeighbourhoodExpression","defined-in-2#Defined in":"perspectives/PerspectiveHandle.ts:28","owners#owners":"• Optional owners: string[]","defined-in-3#Defined in":"perspectives/PerspectiveHandle.ts:31","sharedurl#sharedUrl":"• Optional sharedUrl: string","defined-in-4#Defined in":"perspectives/PerspectiveHandle.ts:25","state#state":"• state: PerspectiveState","defined-in-5#Defined in":"perspectives/PerspectiveHandle.ts:22","uuid#uuid":"• uuid: string","defined-in-6#Defined in":"perspectives/PerspectiveHandle.ts:18"}},"/jsdoc/classes/PerspectiveInput":{"title":"Class: PerspectiveInput","data":{"":"@coasys/ad4m / Exports / PerspectiveInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveInput()","properties-1#Properties":"","links#links":"• links: LinkExpressionInput[]","defined-in#Defined in":"perspectives/Perspective.ts:95"}},"/jsdoc/classes/PerspectiveProxy":{"title":"Class: PerspectiveProxy","data":{"":"@coasys/ad4m / Exports / PerspectiveProxyPerspectiveProxy provides a high-level interface for working with AD4M Perspectives - agent-centric semantic graphs\nthat store and organize links between expressions.A Perspective is fundamentally a collection of links (subject-predicate-object triples) that represent an agent's view\nof their digital world. Through PerspectiveProxy, you can:\nAdd, remove, and query links\nWork with Social DNA (subject classes and flows)\nSubscribe to real-time updates\nShare perspectives as Neighbourhoods\nExecute Prolog queries for complex graph patterns\nExample\n// Create and work with links\nconst perspective = await ad4m.perspective.add(\"My Space\");\nawait perspective.add({\n source: \"did:key:alice\",\n predicate: \"knows\",\n target: \"did:key:bob\"\n});\n// Query links\nconst friends = await perspective.get({\n source: \"did:key:alice\",\n predicate: \"knows\"\n});\n// Use Social DNA\nawait perspective.addSdna(todoClass, \"subject_class\");\nconst todo = await perspective.createSubject(\"Todo\", \"expression://123\");\n// Subscribe to changes\nperspective.addListener(\"link-added\", (link) => {\n console.log(\"New link added:\", link);\n});","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#client\n#handle\n#perspectiveLinkAddedCallbacks\n#perspectiveLinkRemovedCallbacks\n#perspectiveLinkUpdatedCallbacks\n#perspectiveSyncStateChangeCallbacks\nname\nneighbourhood\nowners\nsharedUrl\nstate\nuuid","accessors#Accessors":"ai","methods#Methods":"add\naddFlow\naddLinkExpression\naddLinks\naddListener\naddSdna\naddShacl\naddSyncStateChangeListener\navailableFlows\nbatchCheckSubjectInstances\ncommitBatch\ncreateBatch\ncreateExpression\ncreateSubject\nensureSDNASubjectClass\nescapeRegExp\nexecuteAction\nexpressionsInFlowState\nfilterInstancesSequential\nfindClassByProperties\nflowActions\nflowState\ngenerateSurrealInstanceQuery\nget\ngetActionsFromSHACL\ngetAllShacl\ngetAllSubjectInstances\ngetAllSubjectProxies\ngetExpression\ngetFlow\ngetNeighbourhoodProxy\ngetPropertyValueViaSurreal\ngetRelationValuesViaSurreal\ngetSdna\ngetSdnaForClass\ngetShacl\ngetSingleTarget\ngetSubjectClassMetadataFromSDNA\ngetSubjectData\ngetSubjectProxy\ninfer\nisSubjectInstance\nlinkMutations\nloadSnapshot\nquerySurrealDB\nremove\nremoveLinks\nremoveListener\nremoveSubject\nrunFlowAction\nsdnaFlows\nsetSingleTarget\nsnapshot\nstartFlow\nstringOrTemplateObjectToSubjectClassName\nsubjectClasses\nsubjectClassesByTemplate\nsubscribeInfer\nsubscribeSurrealDB\nupdate","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveProxy(handle, ad4m)Creates a new PerspectiveProxy instance.\nNote: Don't create this directly, use ad4m.perspective.add() instead.","parameters#Parameters":"Name\tType\thandle\tPerspectiveHandle\tad4m\tPerspectiveClient","defined-in#Defined in":"perspectives/PerspectiveProxy.ts:399","properties-1#Properties":"","client##client":"• Private #client: PerspectiveClient","defined-in-1#Defined in":"perspectives/PerspectiveProxy.ts:389","handle##handle":"• Private #handle: PerspectiveHandle","defined-in-2#Defined in":"perspectives/PerspectiveProxy.ts:388","perspectivelinkaddedcallbacks##perspectiveLinkAddedCallbacks":"• Private #perspectiveLinkAddedCallbacks: LinkCallback[]","defined-in-3#Defined in":"perspectives/PerspectiveProxy.ts:390","perspectivelinkremovedcallbacks##perspectiveLinkRemovedCallbacks":"• Private #perspectiveLinkRemovedCallbacks: LinkCallback[]","defined-in-4#Defined in":"perspectives/PerspectiveProxy.ts:391","perspectivelinkupdatedcallbacks##perspectiveLinkUpdatedCallbacks":"• Private #perspectiveLinkUpdatedCallbacks: LinkCallback[]","defined-in-5#Defined in":"perspectives/PerspectiveProxy.ts:392","perspectivesyncstatechangecallbacks##perspectiveSyncStateChangeCallbacks":"• Private #perspectiveSyncStateChangeCallbacks: SyncStateChangeCallback[]","defined-in-6#Defined in":"perspectives/PerspectiveProxy.ts:393","name#name":"• name: stringHuman-readable name of this perspective","defined-in-7#Defined in":"perspectives/PerspectiveProxy.ts:374","neighbourhood#neighbourhood":"• neighbourhood: NeighbourhoodExpressionIf this perspective is shared, this contains the Neighbourhood metadata","defined-in-8#Defined in":"perspectives/PerspectiveProxy.ts:380","owners#owners":"• Optional owners: string[]List of owners of this perspective","defined-in-9#Defined in":"perspectives/PerspectiveProxy.ts:386","sharedurl#sharedUrl":"• sharedUrl: stringIf this perspective is shared as a Neighbourhood, this is its URL","defined-in-10#Defined in":"perspectives/PerspectiveProxy.ts:377","state#state":"• state: PerspectiveStateCurrent sync state if this perspective is shared","defined-in-11#Defined in":"perspectives/PerspectiveProxy.ts:383","uuid#uuid":"• uuid: stringUnique identifier of this perspective","defined-in-12#Defined in":"perspectives/PerspectiveProxy.ts:371","accessors-1#Accessors":"","ai#ai":"• get ai(): AIClientReturns a proxy object for working with AI capabilities.","returns#Returns":"AIClientAIClient instanceExample\n// Use AI to analyze perspective content\nconst summary = await perspective.ai.summarize();\n// Generate new content\nconst suggestion = await perspective.ai.suggest(\"next action\");","defined-in-13#Defined in":"perspectives/PerspectiveProxy.ts:2118","methods-1#Methods":"","add#add":"▸ add(link, status?, batchId?): PromiseAdds a new link to the perspective.","parameters-1#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLink\tundefined\tThe link to add\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared in a Neighbourhood\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-1#Returns":"PromiseThe created LinkExpressionExample\n// Add a simple relationship\nawait perspective.add({\n source: \"did:key:alice\",\n predicate: \"follows\",\n target: \"did:key:bob\"\n});\n// Add a local-only link\nawait perspective.add({\n source: \"note://123\",\n predicate: \"tag\",\n target: \"private\"\n}, \"local\");","defined-in-14#Defined in":"perspectives/PerspectiveProxy.ts:603","addflow#addFlow":"▸ addFlow(name, flow): PromiseRecommended way to add Flow definitions.Store a SHACL Flow (state machine) in this Perspective using the type-safe SHACLFlow class.\nThe flow is serialized as RDF triples (links) for native AD4M storage and querying.","parameters-2#Parameters":"Name\tType\tDescription\tname\tstring\tFlow name (e.g., 'TODO', 'Approval')\tflow\tSHACLFlow\tSHACLFlow instance defining the state machine","returns-2#Returns":"PromiseExample\nimport { SHACLFlow } from '@coasys/ad4m';\nconst todoFlow = new SHACLFlow('TODO', 'todo://');\ntodoFlow.flowable = 'any';\n// Define states\ntodoFlow.addState({ name: 'ready', value: 0, stateCheck: { predicate: 'todo://state', target: 'todo://ready' }});\ntodoFlow.addState({ name: 'done', value: 1, stateCheck: { predicate: 'todo://state', target: 'todo://done' }});\n// Define start action\ntodoFlow.startAction = [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }];\n// Define transitions\ntodoFlow.addTransition({\n actionName: 'Complete',\n fromState: 'ready',\n toState: 'done',\n actions: [\n { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },\n { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }\n ]\n});\nawait perspective.addFlow('TODO', todoFlow);","defined-in-15#Defined in":"perspectives/PerspectiveProxy.ts:1234","addlinkexpression#addLinkExpression":"▸ addLinkExpression(link, status?, batchId?): PromiseAdds a pre-signed LinkExpression to the perspective.","parameters-3#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLinkExpression\tundefined\tThe signed LinkExpression to add\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-3#Returns":"PromiseThe added LinkExpression","defined-in-16#Defined in":"perspectives/PerspectiveProxy.ts:651","addlinks#addLinks":"▸ addLinks(links, status?, batchId?): PromiseAdds multiple links to the perspective in a single operation.\nMore efficient than adding links one by one.","parameters-4#Parameters":"Name\tType\tDefault value\tDescription\tlinks\tLink[]\tundefined\tArray of links to add\tstatus\tLinkStatus\t'shared'\tWhether the links should be shared\tbatchId?\tstring\tundefined\tOptional batch ID to group this operation with others","returns-4#Returns":"PromiseArray of created LinkExpressions","defined-in-17#Defined in":"perspectives/PerspectiveProxy.ts:616","addlistener#addListener":"▸ addListener(type, cb): PromiseSubscribes to link changes in the perspective.","parameters-5#Parameters":"Name\tType\tDescription\ttype\tPerspectiveListenerTypes\tType of change to listen for\tcb\tLinkCallback\tCallback function","returns-5#Returns":"PromiseExample\n// Listen for new links\nperspective.addListener(\"link-added\", (link) => {\n console.log(\"New link:\", link);\n});\n// Listen for removed links\nperspective.addListener(\"link-removed\", (link) => {\n console.log(\"Link removed:\", link);\n});","defined-in-18#Defined in":"perspectives/PerspectiveProxy.ts:727","addsdna#addSdna":"▸ addSdna(name, sdnaCode, sdnaType, shaclJson?): PromiseAdds Social DNA code to the perspective.Recommended: Use addShacl instead, which accepts the SHACLShape type directly.\nThis method is primarily for the GraphQL layer and legacy Prolog code.","parameters-6#Parameters":"Name\tType\tDescription\tname\tstring\tUnique name for this SDNA definition\tsdnaCode\tstring\tProlog SDNA code (legacy, can be empty string if shaclJson provided)\tsdnaType\t\"subject_class\" | \"flow\" | \"custom\"\tType of SDNA: \"subject_class\", \"flow\", or \"custom\"\tshaclJson?\tstring\tSHACL JSON string (use addShacl() for type-safe alternative)","returns-6#Returns":"PromiseExample\n// Recommended: Use addShacl() with SHACLShape type\nconst shape = new SHACLShape('recipe://Recipe');\nshape.addProperty({ name: 'title', path: 'recipe://title', datatype: 'xsd:string' });\nawait perspective.addShacl('Recipe', shape);\n// Legacy: Prolog code is auto-converted to SHACL\nawait perspective.addSdna('Recipe', prologCode, 'subject_class');","defined-in-19#Defined in":"perspectives/PerspectiveProxy.ts:1074","addshacl#addShacl":"▸ addShacl(name, shape): PromiseRecommended way to add SDNA schemas.Store a SHACL shape in this Perspective using the type-safe SHACLShape class.\nThe shape is serialized as RDF triples (links) for native AD4M storage and querying.","parameters-7#Parameters":"Name\tType\tDescription\tname\tstring\tUnique name for this schema (e.g., 'Recipe', 'Task')\tshape\tSHACLShape\tSHACLShape instance defining the schema","returns-7#Returns":"PromiseExample\nimport { SHACLShape } from '@coasys/ad4m';\nconst shape = new SHACLShape('recipe://Recipe');\nshape.addProperty({ \n name: 'title', \n path: 'recipe://title', \n datatype: 'xsd:string',\n minCount: 1 \n});\nshape.addProperty({\n name: 'ingredients',\n path: 'recipe://has_ingredient',\n // No maxCount = relation\n});\nawait perspective.addShacl('Recipe', shape);","defined-in-20#Defined in":"perspectives/PerspectiveProxy.ts:1105","addsyncstatechangelistener#addSyncStateChangeListener":"▸ addSyncStateChangeListener(cb): PromiseSubscribes to sync state changes if this perspective is shared.","parameters-8#Parameters":"Name\tType\tDescription\tcb\tSyncStateChangeCallback\tCallback function","returns-8#Returns":"PromiseExample\nperspective.addSyncStateChangeListener((state) => {\n console.log(\"Sync state:\", state);\n});","defined-in-21#Defined in":"perspectives/PerspectiveProxy.ts:749","availableflows#availableFlows":"▸ availableFlows(exprAddr): PromiseReturns all Social DNA flows that can be started from the given expression","parameters-9#Parameters":"Name\tType\texprAddr\tstring","returns-9#Returns":"Promise","defined-in-22#Defined in":"perspectives/PerspectiveProxy.ts:876","batchchecksubjectinstances#batchCheckSubjectInstances":"▸ batchCheckSubjectInstances(expressions, metadata): PromiseBatch-checks multiple expressions against subject class metadata using a single or limited SurrealDB queries.\nThis avoids N+1 query problems by checking all values at once.","parameters-10#Parameters":"Name\tType\texpressions\tstring[]\tmetadata\tObject\tmetadata.properties\tMap\tmetadata.relations\tMap\tmetadata.requiredPredicates\tstring[]\tmetadata.requiredTriples\t{ predicate: string ; target?: string }[]","returns-10#Returns":"Promise","defined-in-23#Defined in":"perspectives/PerspectiveProxy.ts:1766","commitbatch#commitBatch":"▸ commitBatch(batchId): PromiseCommits a batch of operations","parameters-11#Parameters":"Name\tType\tbatchId\tstring","returns-11#Returns":"Promise","defined-in-24#Defined in":"perspectives/PerspectiveProxy.ts:682","createbatch#createBatch":"▸ createBatch(): PromiseCreates a new batch for grouping operations","returns-12#Returns":"Promise","defined-in-25#Defined in":"perspectives/PerspectiveProxy.ts:677","createexpression#createExpression":"▸ createExpression(content, languageAddress): PromiseCreates a new Expression in the specified Language.","parameters-12#Parameters":"Name\tType\tDescription\tcontent\tany\tContent for the new Expression\tlanguageAddress\tstring\tAddress of the Language to use","returns-13#Returns":"PromiseURI of the created Expression","defined-in-26#Defined in":"perspectives/PerspectiveProxy.ts:704","createsubject#createSubject":"▸ createSubject(subjectClass, exprAddr, initialValues?, batchId?): PromiseCreates a new subject instance of the given subject class","type-parameters#Type parameters":"Name\tType\tT\tT\tB\textends string = undefined","parameters-13#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class.\texprAddr\tstring\tThe address of the expression to be turned into a subject instance\tinitialValues?\tRecord\tOptional initial values for properties. If provided, these will be merged with constructor actions for better performance.\tbatchId?\tB\tOptional batch ID for grouping operations. If provided, returns the expression address instead of the subject proxy since the subject won't exist until the batch is committed.","returns-14#Returns":"PromiseA proxy object for the created subject, or just the expression address if in batch mode","defined-in-27#Defined in":"perspectives/PerspectiveProxy.ts:1357","ensuresdnasubjectclass#ensureSDNASubjectClass":"▸ ensureSDNASubjectClass(jsClass): PromiseTakes a JS class (its constructor) and assumes that it was decorated by\nthe","parameters-14#Parameters":"Name\tType\tjsClass\tany","returns-15#Returns":"PromiseSubject Classetc. decorators. It then tests if there is a subject class\nalready present in the perspective's SDNA that matches the given class.\nIf there is no such class, it gets the JS class's SDNA by calling its\nstatic generateSDNA() function and adds it to the perspective's SDNA.","defined-in-28#Defined in":"perspectives/PerspectiveProxy.ts:2078","escaperegexp#escapeRegExp":"▸ Private escapeRegExp(str): stringEscapes special regex characters in a string to prevent ReDoS attacks\nand regex injection when building dynamic regular expressions.","parameters-15#Parameters":"Name\tType\tDescription\tstr\tstring\tThe string to escape","returns-16#Returns":"stringThe escaped string safe for use in RegExp constructor","defined-in-29#Defined in":"perspectives/PerspectiveProxy.ts:427","executeaction#executeAction":"▸ executeAction(actions, expression, parameters, batchId?): PromiseExecutes a set of actions on an expression with optional parameters.\nUsed internally by Social DNA flows and subject class operations.Actions are specified as an array of commands that modify links in the perspective.\nEach action is an object with the following format:\n{\n action: \"addLink\" | \"removeLink\" | \"setSingleTarget\" | \"collectionSetter\",\n source: string, // Usually \"this\" to reference the current expression\n predicate: string, // The predicate URI\n target: string // The target value or \"value\" for parameters\n}\nAvailable commands:\naddLink: Creates a new link\nremoveLink: Removes an existing link\nsetSingleTarget: Removes all existing links with the same source/predicate and adds a new one\ncollectionSetter: Special command for setting relation properties\nWhen used with parameters, the special value \"value\" in the target field will be\nreplaced with the actual parameter value.","parameters-16#Parameters":"Name\tType\tDescription\tactions\tany\tArray of action objects to execute\texpression\tany\tTarget expression address (replaces \"this\" in actions)\tparameters\tParameter[]\tOptional parameters that replace \"value\" in actions\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-17#Returns":"PromiseExample\n// Add a state link and remove an old one\nawait perspective.executeAction([\n {\n action: \"addLink\",\n source: \"this\",\n predicate: \"todo://state\", \n target: \"todo://doing\"\n },\n {\n action: \"removeLink\",\n source: \"this\",\n predicate: \"todo://state\",\n target: \"todo://ready\"\n }\n], \"expression://123\");\n// Set a property using a parameter\nawait perspective.executeAction([\n {\n action: \"setSingleTarget\",\n source: \"this\",\n predicate: \"todo://title\",\n target: \"value\"\n }\n], \"expression://123\", [\n { name: \"title\", value: \"New Title\" }\n]);","defined-in-30#Defined in":"perspectives/PerspectiveProxy.ts:491","expressionsinflowstate#expressionsInFlowState":"▸ expressionsInFlowState(flowName, flowState): PromiseReturns all expressions in the given state of given Social DNA flow","parameters-17#Parameters":"Name\tType\tflowName\tstring\tflowState\tnumber","returns-18#Returns":"Promise","defined-in-31#Defined in":"perspectives/PerspectiveProxy.ts:910","filterinstancessequential#filterInstancesSequential":"▸ Private filterInstancesSequential(values, instanceFilter): PromiseFallback sequential instance checking when batch checking isn't available.","parameters-18#Parameters":"Name\tType\tvalues\tstring[]\tinstanceFilter\tstring","returns-19#Returns":"Promise","defined-in-32#Defined in":"perspectives/PerspectiveProxy.ts:1826","findclassbyproperties#findClassByProperties":"▸ Private findClassByProperties(obj): PromiseFind a subject class by matching an object's properties/relations against SHACL shapes.\nQueries SHACL links client-side to find a class whose properties contain all required ones.","parameters-19#Parameters":"Name\tType\tobj\tobject","returns-20#Returns":"PromiseThe matching class name, or null if no match found.","defined-in-33#Defined in":"perspectives/PerspectiveProxy.ts:1941","flowactions#flowActions":"▸ flowActions(flowName, exprAddr): PromiseReturns available action names, with regard to Social DNA flow and expression's flow state","parameters-20#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring","returns-21#Returns":"Promise","defined-in-34#Defined in":"perspectives/PerspectiveProxy.ts:945","flowstate#flowState":"▸ flowState(flowName, exprAddr): PromiseReturns the given expression's flow state with regard to given Social DNA flow","parameters-21#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring","returns-22#Returns":"Promise","defined-in-35#Defined in":"perspectives/PerspectiveProxy.ts:927","generatesurrealinstancequery#generateSurrealInstanceQuery":"▸ Private generateSurrealInstanceQuery(metadata): stringGenerates a SurrealDB query to find instances based on class metadata.","parameters-22#Parameters":"Name\tType\tmetadata\tObject\tmetadata.properties\tMap\tmetadata.relations\tMap\tmetadata.requiredPredicates\tstring[]\tmetadata.requiredTriples\t{ predicate: string ; target?: string }[]","returns-23#Returns":"string","defined-in-36#Defined in":"perspectives/PerspectiveProxy.ts:1617","get#get":"▸ get(query): PromiseRetrieves links from the perspective that match the given query.","parameters-23#Parameters":"Name\tType\tDescription\tquery\tLinkQuery\tQuery parameters to filter links","returns-24#Returns":"PromiseArray of matching LinkExpressionsExample\n// Get all links where Alice knows someone\nconst links = await perspective.get({\n source: \"did:key:alice\",\n predicate: \"knows\"\n});\n// Get all comments on a post\nconst comments = await perspective.get({\n source: \"post://123\",\n predicate: \"comment\"\n});","defined-in-37#Defined in":"perspectives/PerspectiveProxy.ts:516","getactionsfromshacl#getActionsFromSHACL":"▸ Private getActionsFromSHACL(className, predicate): PromiseGets actions from SHACL links for a given predicate (e.g., ad4m://constructor, ad4m://destructor).\nReturns the parsed action array if found, or null if not found.","parameters-24#Parameters":"Name\tType\tclassName\tstring\tpredicate\tstring","returns-25#Returns":"Promise","defined-in-38#Defined in":"perspectives/PerspectiveProxy.ts:1421","getallshacl#getAllShacl":"▸ getAllShacl(): Promise<{ name: string ; shape: SHACLShape }[]>Get all SHACL shapes stored in this Perspective","returns-26#Returns":"Promise<{ name: string ; shape: SHACLShape }[]>","defined-in-39#Defined in":"perspectives/PerspectiveProxy.ts:1176","getallsubjectinstances#getAllSubjectInstances":"▸ getAllSubjectInstances(subjectClass): PromiseReturns all subject instances of the given subject class as proxy objects.","type-parameters-1#Type parameters":"Name\tT","parameters-25#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.","returns-27#Returns":"Promise","defined-in-40#Defined in":"perspectives/PerspectiveProxy.ts:1847","getallsubjectproxies#getAllSubjectProxies":"▸ getAllSubjectProxies(subjectClass): PromiseReturns all subject proxies of the given subject class as proxy objects.","type-parameters-2#Type parameters":"Name\tT","parameters-26#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.","returns-28#Returns":"Promise","defined-in-41#Defined in":"perspectives/PerspectiveProxy.ts:1905","getexpression#getExpression":"▸ getExpression(expressionURI): PromiseRetrieves and renders an Expression referenced in this perspective.","parameters-27#Parameters":"Name\tType\tDescription\texpressionURI\tstring\tURI of the Expression to retrieve","returns-29#Returns":"PromiseThe rendered Expression","defined-in-42#Defined in":"perspectives/PerspectiveProxy.ts:693","getflow#getFlow":"▸ getFlow(name): PromiseRetrieve a Flow definition by name from this Perspective","parameters-28#Parameters":"Name\tType\tDescription\tname\tstring\tFlow name to retrieve","returns-30#Returns":"PromiseThe SHACLFlow or null if not found","defined-in-43#Defined in":"perspectives/PerspectiveProxy.ts:1268","getneighbourhoodproxy#getNeighbourhoodProxy":"▸ getNeighbourhoodProxy(): NeighbourhoodProxy","returns-31#Returns":"NeighbourhoodProxy","defined-in-44#Defined in":"perspectives/PerspectiveProxy.ts:2100","getpropertyvalueviasurreal#getPropertyValueViaSurreal":"▸ getPropertyValueViaSurreal(baseExpression, className, propertyName): PromiseGets a property value using SurrealDB when Prolog fails.\nThis is used as a fallback in SdnaOnly mode where link data isn't in Prolog.","parameters-29#Parameters":"Name\tType\tbaseExpression\tstring\tclassName\tstring\tpropertyName\tstring","returns-32#Returns":"Promise","defined-in-45#Defined in":"perspectives/PerspectiveProxy.ts:1648","getrelationvaluesviasurreal#getRelationValuesViaSurreal":"▸ getRelationValuesViaSurreal(baseExpression, className, relationName): PromiseGets relation values using SurrealDB when Prolog fails.\nThis is used as a fallback in SdnaOnly mode where link data isn't in Prolog.\nNote: This is used by Subject.ts (legacy pattern). Ad4mModel.ts uses getModelMetadata() instead.","parameters-30#Parameters":"Name\tType\tbaseExpression\tstring\tclassName\tstring\trelationName\tstring","returns-33#Returns":"Promise","defined-in-46#Defined in":"perspectives/PerspectiveProxy.ts:1692","getsdna#getSdna":"▸ getSdna(): PromiseReturns the perspective's Social DNA code\nThis will return all SDNA code elements in an array.","returns-34#Returns":"Promise","defined-in-47#Defined in":"perspectives/PerspectiveProxy.ts:982","getsdnaforclass#getSdnaForClass":"▸ getSdnaForClass(className): PromiseReturns the Social DNA code for a specific class\nThis will return the SDNA code for the specified class, or null if not found.","parameters-31#Parameters":"Name\tType\tclassName\tstring","returns-35#Returns":"Promise","defined-in-48#Defined in":"perspectives/PerspectiveProxy.ts:1025","getshacl#getShacl":"▸ getShacl(name): PromiseRetrieve a SHACL shape by name from this Perspective","parameters-32#Parameters":"Name\tType\tname\tstring","returns-36#Returns":"Promise","defined-in-49#Defined in":"perspectives/PerspectiveProxy.ts:1136","getsingletarget#getSingleTarget":"▸ getSingleTarget(query): PromiseGets a single target value matching a query.\nUseful when you expect only one result.","parameters-33#Parameters":"Name\tType\tDescription\tquery\tLinkQuery\tQuery to find the target","returns-37#Returns":"PromiseTarget value or void if not foundExample\n// Get a user's name\nconst name = await perspective.getSingleTarget({\n source: \"did:key:alice\",\n predicate: \"name\"\n});","defined-in-50#Defined in":"perspectives/PerspectiveProxy.ts:819","getsubjectclassmetadatafromsdna#getSubjectClassMetadataFromSDNA":"▸ getSubjectClassMetadataFromSDNA(className): Promise<{ properties: Map ; relations: Map ; requiredPredicates: string[] ; requiredTriples: { predicate: string ; target?: string }[] }>Gets subject class metadata from SHACL links using SHACLShape.fromLinks().\nRetrieves the SHACL shape and extracts metadata for instance queries.","parameters-34#Parameters":"Name\tType\tclassName\tstring","returns-38#Returns":"Promise<{ properties: Map ; relations: Map ; requiredPredicates: string[] ; requiredTriples: { predicate: string ; target?: string }[] }>","defined-in-51#Defined in":"perspectives/PerspectiveProxy.ts:1554","getsubjectdata#getSubjectData":"▸ getSubjectData(subjectClass, exprAddr): Promise","type-parameters-3#Type parameters":"Name\tT","parameters-35#Parameters":"Name\tType\tsubjectClass\tT\texprAddr\tstring","returns-39#Returns":"Promise","defined-in-52#Defined in":"perspectives/PerspectiveProxy.ts:1404","getsubjectproxy#getSubjectProxy":"▸ getSubjectProxy(base, subjectClass): PromiseFor an existing subject instance (existing in the perspective's links)\nthis function returns a proxy object that can be used to access the subject's\nproperties and methods.","type-parameters-4#Type parameters":"Name\tT","parameters-36#Parameters":"Name\tType\tDescription\tbase\tstring\tURI of the subject's root expression\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.","returns-40#Returns":"Promise","defined-in-53#Defined in":"perspectives/PerspectiveProxy.ts:1540","infer#infer":"▸ infer(query): PromiseExecutes a Prolog query against the perspective's knowledge base.\nThis is a powerful way to find complex patterns in the graph.","parameters-37#Parameters":"Name\tType\tDescription\tquery\tstring\tProlog query string","returns-41#Returns":"PromiseQuery results or false if no resultsExample\n// Find friends of friends\nconst results = await perspective.infer(`\n triple(A, \"knows\", B),\n triple(B, \"knows\", C),\n A \\= C\n`);\n// Find all active todos\nconst todos = await perspective.infer(`\n instance(Todo, \"Todo\"),\n property_getter(\"Todo\", Todo, \"state\", \"active\")\n`);","defined-in-54#Defined in":"perspectives/PerspectiveProxy.ts:543","issubjectinstance#isSubjectInstance":"▸ isSubjectInstance(expression, subjectClass): PromiseChecks if the given expression is a subject instance of the given subject class","type-parameters-5#Type parameters":"Name\tT","parameters-38#Parameters":"Name\tType\tDescription\texpression\tstring\tThe expression to be checked\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.","returns-42#Returns":"Promise","defined-in-55#Defined in":"perspectives/PerspectiveProxy.ts:1479","linkmutations#linkMutations":"▸ linkMutations(mutations, status?): PromiseApplies a set of link mutations (adds and removes) in a single operation.\nUseful for atomic updates to the perspective.","parameters-39#Parameters":"Name\tType\tDefault value\tDescription\tmutations\tLinkMutations\tundefined\tObject containing links to add and remove\tstatus\tLinkStatus\t'shared'\tWhether new links should be shared","returns-43#Returns":"PromiseObject containing results of the mutations","defined-in-56#Defined in":"perspectives/PerspectiveProxy.ts:639","loadsnapshot#loadSnapshot":"▸ loadSnapshot(snapshot): PromiseLoads a perspective snapshot, replacing current content.","parameters-40#Parameters":"Name\tType\tDescription\tsnapshot\tPerspective\tPerspective snapshot to load","returns-44#Returns":"Promise","defined-in-57#Defined in":"perspectives/PerspectiveProxy.ts:790","querysurrealdb#querySurrealDB":"▸ querySurrealDB(query): PromiseExecutes a SurrealQL query against the perspective's link cache.\nThis allows powerful SQL-like queries on the link data stored in SurrealDB.Security Note: Only read-only queries (SELECT, RETURN, etc.) are permitted.\nMutating operations (DELETE, UPDATE, INSERT, CREATE, DROP, DEFINE, etc.) are\nblocked for security reasons. Use the perspective's add/remove methods to modify links.","parameters-41#Parameters":"Name\tType\tDescription\tquery\tstring\tSurrealQL query string (read-only operations only)","returns-45#Returns":"PromiseQuery results as parsed JSONExample\n// Get all links\nconst links = await perspective.querySurrealDB('SELECT * FROM link');\n// Filter links by predicate\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Complex aggregation query\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);","defined-in-58#Defined in":"perspectives/PerspectiveProxy.ts:574","remove#remove":"▸ remove(link, batchId?): PromiseRemoves a link from the perspective.","parameters-42#Parameters":"Name\tType\tDescription\tlink\tLinkExpressionInput\tThe link to remove\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-46#Returns":"Promise","defined-in-59#Defined in":"perspectives/PerspectiveProxy.ts:672","removelinks#removeLinks":"▸ removeLinks(links, batchId?): PromiseRemoves multiple links from the perspective.","parameters-43#Parameters":"Name\tType\tDescription\tlinks\tLinkExpressionInput[]\tArray of links to remove\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-47#Returns":"PromiseArray of removed LinkExpressions","defined-in-60#Defined in":"perspectives/PerspectiveProxy.ts:627","removelistener#removeListener":"▸ removeListener(type, cb): PromiseUnsubscribes from link changes.","parameters-44#Parameters":"Name\tType\tDescription\ttype\tPerspectiveListenerTypes\tType of change to stop listening for\tcb\tLinkCallback\tThe callback function to remove","returns-48#Returns":"Promise","defined-in-61#Defined in":"perspectives/PerspectiveProxy.ts:759","removesubject#removeSubject":"▸ removeSubject(subjectClass, exprAddr, batchId?): PromiseRemoves a subject instance by running its (SDNA defined) destructor,\nwhich means removing links around the given expression address","type-parameters-6#Type parameters":"Name\tT","parameters-45#Parameters":"Name\tType\tDescription\tsubjectClass\tT\tEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.\texprAddr\tstring\tThe address of the expression to be turned into a subject instance\tbatchId?\tstring\tOptional batch ID for grouping operations. If provided, the removal will be part of the batch and won't be executed until the batch is committed.","returns-49#Returns":"Promise","defined-in-62#Defined in":"perspectives/PerspectiveProxy.ts:1460","runflowaction#runFlowAction":"▸ runFlowAction(flowName, exprAddr, actionName): PromiseRuns given Social DNA flow action","parameters-46#Parameters":"Name\tType\tflowName\tstring\texprAddr\tstring\tactionName\tstring","returns-50#Returns":"Promise","defined-in-63#Defined in":"perspectives/PerspectiveProxy.ts:971","sdnaflows#sdnaFlows":"▸ sdnaFlows(): PromiseReturns all the Social DNA flows defined in this perspective","returns-51#Returns":"Promise","defined-in-64#Defined in":"perspectives/PerspectiveProxy.ts:860","setsingletarget#setSingleTarget":"▸ setSingleTarget(link, status?): PromiseSets a single target value, removing any existing targets.","parameters-47#Parameters":"Name\tType\tDefault value\tDescription\tlink\tLink\tundefined\tLink defining the new target\tstatus\tLinkStatus\t'shared'\tWhether the link should be shared","returns-52#Returns":"PromiseExample\n// Set a user's status\nawait perspective.setSingleTarget({\n source: \"did:key:alice\",\n predicate: \"status\",\n target: \"online\"\n});","defined-in-65#Defined in":"perspectives/PerspectiveProxy.ts:844","snapshot#snapshot":"▸ snapshot(): PromiseCreates a snapshot of the current perspective state.\nUseful for backup or sharing.","returns-53#Returns":"PromisePerspective object containing all links","defined-in-66#Defined in":"perspectives/PerspectiveProxy.ts:781","startflow#startFlow":"▸ startFlow(flowName, exprAddr): PromiseStarts the Social DNA flow","parameters-48#Parameters":"Name\tType\tDescription\tflowName\tstring\ton the expression\texprAddr\tstring","returns-54#Returns":"Promise","defined-in-67#Defined in":"perspectives/PerspectiveProxy.ts:902","stringortemplateobjecttosubjectclassname#stringOrTemplateObjectToSubjectClassName":"▸ stringOrTemplateObjectToSubjectClassName(subjectClass): Promise","type-parameters-7#Type parameters":"Name\tT","parameters-49#Parameters":"Name\tType\tsubjectClass\tT","returns-55#Returns":"Promise","defined-in-68#Defined in":"perspectives/PerspectiveProxy.ts:1331","subjectclasses#subjectClasses":"▸ subjectClasses(): PromiseReturns all the Subject classes defined in this perspectives SDNAUses SHACL-based lookup (Prolog-free implementation).","returns-56#Returns":"Promise","defined-in-69#Defined in":"perspectives/PerspectiveProxy.ts:1307","subjectclassesbytemplate#subjectClassesByTemplate":"▸ subjectClassesByTemplate(obj): PromiseReturns all subject classes that match the given template object.\nThis function looks at the properties of the template object and\nits setters and relations to create a Prolog query that finds\nall subject classes that would be converted to a proxy object\nwith exactly the same properties and relations.Since there could be multiple subject classes that match the given\ncriteria, this function returns a list of class names.","parameters-50#Parameters":"Name\tType\tDescription\tobj\tobject\tThe template object","returns-57#Returns":"Promise","defined-in-70#Defined in":"perspectives/PerspectiveProxy.ts:2038","subscribeinfer#subscribeInfer":"▸ subscribeInfer(query): PromiseCreates a subscription for a Prolog query that updates in real-time.This method:\nCreates the subscription on the Rust side\nSets up the subscription callback\nWaits for the initial result to come through the subscription channel\nReturns a fully initialized QuerySubscriptionProxy\nThe returned subscription is guaranteed to be ready to receive updates,\nas this method waits for the initialization process to complete.The subscription will be automatically cleaned up on both frontend and backend\nwhen dispose() is called. Make sure to call dispose() when you're done to\nprevent memory leaks and ensure proper cleanup of resources.","parameters-51#Parameters":"Name\tType\tDescription\tquery\tstring\tProlog query string","returns-58#Returns":"PromiseInitialized QuerySubscriptionProxy instanceExample\n// Subscribe to active todos\nconst subscription = await perspective.subscribeInfer(`\n instance(Todo, \"Todo\"),\n property_getter(\"Todo\", Todo, \"state\", \"active\")\n`);\n// Subscription is already initialized here\nconsole.log(\"Initial result:\", subscription.result);\n// Set up callback for future updates\nsubscription.onResult((todos) => {\n console.log(\"Active todos:\", todos);\n});\n// Clean up subscription when done\nsubscription.dispose();","defined-in-71#Defined in":"perspectives/PerspectiveProxy.ts:2161","subscribesurrealdb#subscribeSurrealDB":"▸ subscribeSurrealDB(query): PromiseCreates a subscription for a SurrealQL query that updates in real-time.This method:\nCreates the subscription on the Rust side\nSets up the subscription callback\nWaits for the initial result to come through the subscription channel\nReturns a fully initialized QuerySubscriptionProxy\nThe returned subscription is guaranteed to be ready to receive updates,\nas this method waits for the initialization process to complete.The subscription will be automatically cleaned up on both frontend and backend\nwhen dispose() is called. Make sure to call dispose() when you're done to\nprevent memory leaks and ensure proper cleanup of resources.","parameters-52#Parameters":"Name\tType\tDescription\tquery\tstring\tSurrealQL query string","returns-59#Returns":"PromiseInitialized QuerySubscriptionProxy instance","defined-in-72#Defined in":"perspectives/PerspectiveProxy.ts:2196","update#update":"▸ update(oldLink, newLink, batchId?): PromiseUpdates an existing link with new data.","parameters-53#Parameters":"Name\tType\tDescription\toldLink\tLinkExpressionInput\tThe existing link to update\tnewLink\tLink\tThe new link data\tbatchId?\tstring\tOptional batch ID to group this operation with others","returns-60#Returns":"Promise","defined-in-73#Defined in":"perspectives/PerspectiveProxy.ts:662"}},"/jsdoc/classes/ResourceInput":{"title":"Class: ResourceInput","data":{"":"@coasys/ad4m / Exports / ResourceInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"domain\npointers","constructors-1#Constructors":"","constructor#constructor":"• new ResourceInput(domain, pointers)","parameters#Parameters":"Name\tType\tdomain\tstring\tpointers\tstring[]","defined-in#Defined in":"agent/Agent.ts:238","properties-1#Properties":"","domain#domain":"• domain: string","defined-in-1#Defined in":"agent/Agent.ts:233","pointers#pointers":"• pointers: string[]","defined-in-2#Defined in":"agent/Agent.ts:236"}},"/jsdoc/classes/Resource":{"title":"Class: Resource","data":{"":"@coasys/ad4m / Exports / Resource","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"domain\npointers","constructors-1#Constructors":"","constructor#constructor":"• new Resource(domain, pointers)","parameters#Parameters":"Name\tType\tdomain\tstring\tpointers\tstring[]","defined-in#Defined in":"agent/Agent.ts:151","properties-1#Properties":"","domain#domain":"• domain: string","defined-in-1#Defined in":"agent/Agent.ts:146","pointers#pointers":"• pointers: string[]","defined-in-2#Defined in":"agent/Agent.ts:149"}},"/jsdoc/classes/PerspectiveUnsignedInput":{"title":"Class: PerspectiveUnsignedInput","data":{"":"@coasys/ad4m / Exports / PerspectiveUnsignedInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"links","methods#Methods":"fromLink","constructors-1#Constructors":"","constructor#constructor":"• new PerspectiveUnsignedInput(links?)","parameters#Parameters":"Name\tType\tlinks?\tLinkInput[]","defined-in#Defined in":"perspectives/Perspective.ts:103","properties-1#Properties":"","links#links":"• links: LinkInput[]","defined-in-1#Defined in":"perspectives/Perspective.ts:101","methods-1#Methods":"","fromlink#fromLink":"▸ Static fromLink(link): PerspectiveUnsignedInput","parameters-1#Parameters":"Name\tType\tlink\tLink","returns#Returns":"PerspectiveUnsignedInput","defined-in-2#Defined in":"perspectives/Perspective.ts:110"}},"/jsdoc/classes/SHACLFlow":{"title":"Class: SHACLFlow","data":{"":"@coasys/ad4m / Exports / SHACLFlowSHACL Flow - represents a state machine for AD4M expressionsFlows define:\nWhich expressions can enter the flow (flowable condition)\nWhat states exist and how to detect them (via link patterns)\nHow to transition between states (via actions)\nExample\nconst todoFlow = new SHACLFlow('todo://TODO', 'todo://');\n// Any expression can become a TODO\ntodoFlow.flowable = 'any';\n// Define states\ntodoFlow.addState({\n name: 'ready',\n value: 0,\n stateCheck: { predicate: 'todo://state', target: 'todo://ready' }\n});\ntodoFlow.addState({\n name: 'doing', \n value: 0.5,\n stateCheck: { predicate: 'todo://state', target: 'todo://doing' }\n});\ntodoFlow.addState({\n name: 'done',\n value: 1,\n stateCheck: { predicate: 'todo://state', target: 'todo://done' }\n});\n// Define start action\ntodoFlow.startAction = [{\n action: 'addLink',\n source: 'this',\n predicate: 'todo://state',\n target: 'todo://ready'\n}];\n// Define transitions\ntodoFlow.addTransition({\n actionName: 'Start',\n fromState: 'ready',\n toState: 'doing',\n actions: [\n { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' },\n { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }\n ]\n});\n// Store in perspective\nawait perspective.addFlow('TODO', todoFlow);","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"_states\n_transitions\nflowable\nname\nnamespace\nstartAction","accessors#Accessors":"flowUri\nstates\ntransitions","methods#Methods":"addState\naddTransition\nstateUri\ntoJSON\ntoLinks\ntransitionUri\nfromJSON\nfromLinks","constructors-1#Constructors":"","constructor#constructor":"• new SHACLFlow(name, namespace)Create a new SHACL Flow","parameters#Parameters":"Name\tType\tDescription\tname\tstring\tFlow name (e.g., \"TODO\")\tnamespace\tstring\tNamespace for URIs (e.g., \"todo://\")","defined-in#Defined in":"shacl/SHACLFlow.ts:135","properties-1#Properties":"","_states#_states":"• Private _states: FlowState[] = []States in this flow","defined-in-1#Defined in":"shacl/SHACLFlow.ts:125","_transitions#_transitions":"• Private _transitions: FlowTransition[] = []Transitions between states","defined-in-2#Defined in":"shacl/SHACLFlow.ts:128","flowable#flowable":"• flowable: FlowableCondition = \"any\"Condition for which expressions can start this flow","defined-in-3#Defined in":"shacl/SHACLFlow.ts:119","name#name":"• name: stringFlow name (e.g., \"TODO\")","defined-in-4#Defined in":"shacl/SHACLFlow.ts:113","namespace#namespace":"• namespace: stringNamespace for generated URIs","defined-in-5#Defined in":"shacl/SHACLFlow.ts:116","startaction#startAction":"• startAction: AD4MAction[] = []Actions to execute when starting the flow","defined-in-6#Defined in":"shacl/SHACLFlow.ts:122","accessors-1#Accessors":"","flowuri#flowUri":"• get flowUri(): stringGet the flow shape URI","returns#Returns":"string","defined-in-7#Defined in":"shacl/SHACLFlow.ts:169","states#states":"• get states(): FlowState[]Get all states","returns-1#Returns":"FlowState[]","defined-in-8#Defined in":"shacl/SHACLFlow.ts:141","transitions#transitions":"• get transitions(): FlowTransition[]Get all transitions","returns-2#Returns":"FlowTransition[]","defined-in-9#Defined in":"shacl/SHACLFlow.ts:146","methods-1#Methods":"","addstate#addState":"▸ addState(state): voidAdd a state to the flow","parameters-1#Parameters":"Name\tType\tDescription\tstate\tFlowState\tState definition","returns-3#Returns":"void","defined-in-10#Defined in":"shacl/SHACLFlow.ts:154","addtransition#addTransition":"▸ addTransition(transition): voidAdd a transition to the flow","parameters-2#Parameters":"Name\tType\tDescription\ttransition\tFlowTransition\tTransition definition","returns-4#Returns":"void","defined-in-11#Defined in":"shacl/SHACLFlow.ts:162","stateuri#stateUri":"▸ stateUri(stateName): stringGet a state URI","parameters-3#Parameters":"Name\tType\tstateName\tstring","returns-5#Returns":"string","defined-in-12#Defined in":"shacl/SHACLFlow.ts:176","tojson#toJSON":"▸ toJSON(): objectConvert to JSON representation","returns-6#Returns":"object","defined-in-13#Defined in":"shacl/SHACLFlow.ts:477","tolinks#toLinks":"▸ toLinks(): Link[]Serialize the flow to AD4M links\nThese links can be stored in a perspective and queried via SurrealDB","returns-7#Returns":"Link[]Array of Link objects representing the flow","defined-in-14#Defined in":"shacl/SHACLFlow.ts:193","transitionuri#transitionUri":"▸ transitionUri(fromState, toState): stringGet a transition URI","parameters-4#Parameters":"Name\tType\tfromState\tstring\ttoState\tstring","returns-8#Returns":"string","defined-in-15#Defined in":"shacl/SHACLFlow.ts:183","fromjson#fromJSON":"▸ Static fromJSON(json): SHACLFlowCreate from JSON representation","parameters-5#Parameters":"Name\tType\tjson\tany","returns-9#Returns":"SHACLFlow","defined-in-16#Defined in":"shacl/SHACLFlow.ts:491","fromlinks#fromLinks":"▸ Static fromLinks(links, flowUri): SHACLFlowReconstruct a SHACLFlow from links","parameters-6#Parameters":"Name\tType\tDescription\tlinks\tLink[]\tArray of links containing the flow definition\tflowUri\tstring\tThe URI of the flow to reconstruct","returns-10#Returns":"SHACLFlowReconstructed SHACLFlow","defined-in-17#Defined in":"shacl/SHACLFlow.ts:334"}},"/jsdoc/classes/QuerySubscriptionProxy":{"title":"Class: QuerySubscriptionProxy","data":{"":"@coasys/ad4m / Exports / QuerySubscriptionProxyProxy object for a subscribed Prolog query that provides real-time updatesThis class handles:\nKeeping the subscription alive by sending periodic keepalive signals\nManaging callbacks for result updates\nSubscribing to query updates via GraphQL subscriptions\nMaintaining the latest query result\nEnsuring subscription is fully initialized before allowing access\nCleaning up resources when disposed\nThe subscription will remain active as long as keepalive signals are sent.\nMake sure to call dispose() when you're done with the subscription to clean up\nresources, stop keepalive signals, and notify the backend to remove the subscription.The subscription goes through an initialization process where it waits for the first\nresult to come through the subscription channel. You can await the initialized\npromise to ensure the subscription is ready. The initialization will timeout after\n30 seconds if no result is received.Example usage:\nconst subscription = await perspective.subscribeInfer(\"my_query(X)\");\n// At this point the subscription is already initialized since subscribeInfer waits\n// Set up callback for future updates\nconst removeCallback = subscription.onResult(result => {\n console.log(\"New result:\", result);\n});\n// Later: clean up subscription and notify backend\nsubscription.dispose();","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#callbacks\n#client\n#disposed\n#initReject\n#initResolve\n#initTimeoutId\n#initialized\n#keepaliveTimer\n#latestResult\n#query\n#subscriptionId\n#unsubscribe\n#uuid\nisSurrealDB","accessors#Accessors":"id\ninitialized\nresult","methods#Methods":"#notifyCallbacks\ndispose\nonResult\nsubscribe","constructors-1#Constructors":"","constructor#constructor":"• new QuerySubscriptionProxy(uuid, query, client)Creates a new query subscription","parameters#Parameters":"Name\tType\tDescription\tuuid\tstring\tThe UUID of the perspective\tquery\tstring\tThe Prolog query to subscribe to\tclient\tPerspectiveClient\tThe PerspectiveClient instance to use for communication","defined-in#Defined in":"perspectives/PerspectiveProxy.ts:81","properties-1#Properties":"","callbacks##callbacks":"• Private #callbacks: Set","defined-in-1#Defined in":"perspectives/PerspectiveProxy.ts:64","client##client":"• Private #client: PerspectiveClient","defined-in-2#Defined in":"perspectives/PerspectiveProxy.ts:63","disposed##disposed":"• Private #disposed: boolean = false","defined-in-3#Defined in":"perspectives/PerspectiveProxy.ts:68","initreject##initReject":"• Private Optional #initReject: (reason?: any) => void","type-declaration#Type declaration":"▸ (reason?): void","parameters-1#Parameters":"Name\tType\treason?\tany","returns#Returns":"void","defined-in-4#Defined in":"perspectives/PerspectiveProxy.ts:71","initresolve##initResolve":"• Private Optional #initResolve: (value: boolean) => void","type-declaration-1#Type declaration":"▸ (value): void","parameters-2#Parameters":"Name\tType\tvalue\tboolean","returns-1#Returns":"void","defined-in-5#Defined in":"perspectives/PerspectiveProxy.ts:70","inittimeoutid##initTimeoutId":"• Private Optional #initTimeoutId: Timeout","defined-in-6#Defined in":"perspectives/PerspectiveProxy.ts:72","initialized##initialized":"• Private #initialized: Promise","defined-in-7#Defined in":"perspectives/PerspectiveProxy.ts:69","keepalivetimer##keepaliveTimer":"• Private #keepaliveTimer: number","defined-in-8#Defined in":"perspectives/PerspectiveProxy.ts:65","latestresult##latestResult":"• Private #latestResult: AllInstancesResult","defined-in-9#Defined in":"perspectives/PerspectiveProxy.ts:67","query##query":"• Private #query: string","defined-in-10#Defined in":"perspectives/PerspectiveProxy.ts:73","subscriptionid##subscriptionId":"• Private #subscriptionId: string","defined-in-11#Defined in":"perspectives/PerspectiveProxy.ts:62","unsubscribe##unsubscribe":"• Private Optional #unsubscribe: () => void","type-declaration-2#Type declaration":"▸ (): void","returns-2#Returns":"void","defined-in-12#Defined in":"perspectives/PerspectiveProxy.ts:66","uuid##uuid":"• Private #uuid: string","defined-in-13#Defined in":"perspectives/PerspectiveProxy.ts:61","issurrealdb#isSurrealDB":"• isSurrealDB: boolean = false","defined-in-14#Defined in":"perspectives/PerspectiveProxy.ts:74","accessors-1#Accessors":"","id#id":"• get id(): stringGet the subscription ID for this query subscriptionThis is a unique identifier assigned when the subscription was created.\nIt can be used to reference this specific subscription, for example when\nsending keepalive signals.","returns-3#Returns":"stringThe subscription ID string","defined-in-15#Defined in":"perspectives/PerspectiveProxy.ts:220","initialized-1#initialized":"• get initialized(): PromisePromise that resolves when the subscription has received its first result\nthrough the subscription channel. This ensures the subscription is fully\nset up before allowing access to results or updates.If no result is received within 30 seconds, the subscription will automatically\nretry. The promise will remain pending until a subscription message successfully\narrives, or until a fatal error occurs during subscription setup.Note: You typically don't need to await this directly since the subscription\ncreation methods (like subscribeInfer) already wait for initialization.","returns-4#Returns":"Promise","defined-in-16#Defined in":"perspectives/PerspectiveProxy.ts:235","result#result":"• get result(): AllInstancesResultGet the latest query resultThis returns the most recent result from the query, which could be either:\nThe initial result from when the subscription was created\nThe latest update received through the subscription","returns-5#Returns":"AllInstancesResultThe latest query result as a string (usually a JSON array of bindings)","defined-in-17#Defined in":"perspectives/PerspectiveProxy.ts:247","methods-1#Methods":"","notifycallbacks##notifyCallbacks":"▸ Private #notifyCallbacks(result): voidInternal method to notify all callbacks of a new result","parameters-3#Parameters":"Name\tType\tresult\tAllInstancesResult","returns-6#Returns":"void","defined-in-18#Defined in":"perspectives/PerspectiveProxy.ts:276","dispose#dispose":"▸ dispose(): voidClean up the subscription and stop keepalive signalsThis method:\nStops the keepalive timer\nUnsubscribes from GraphQL subscription updates\nClears all registered callbacks\nCleans up any pending initialization timeout\nAfter calling this method, the subscription is no longer active and\nwill not receive any more updates. The instance should be discarded.","returns-7#Returns":"void","defined-in-19#Defined in":"perspectives/PerspectiveProxy.ts:297","onresult#onResult":"▸ onResult(callback): () => voidAdd a callback that will be called whenever new results arriveThe callback will be called immediately with the current result,\nand then again each time the query results change.","parameters-4#Parameters":"Name\tType\tDescription\tcallback\tQueryCallback\tFunction that takes a result string and processes it","returns-8#Returns":"fnA function that can be called to remove this callbackExample:\nconst removeCallback = subscription.onResult(result => {\n const bindings = JSON.parse(result);\n console.log(\"New bindings:\", bindings);\n});\n// Later: stop receiving updates\nremoveCallback();\n▸ (): voidAdd a callback that will be called whenever new results arriveThe callback will be called immediately with the current result,\nand then again each time the query results change.","returns-9#Returns":"voidA function that can be called to remove this callbackExample:\nconst removeCallback = subscription.onResult(result => {\n const bindings = JSON.parse(result);\n console.log(\"New bindings:\", bindings);\n});\n// Later: stop receiving updates\nremoveCallback();","defined-in-20#Defined in":"perspectives/PerspectiveProxy.ts:270","subscribe#subscribe":"▸ subscribe(): Promise","returns-10#Returns":"Promise","defined-in-21#Defined in":"perspectives/PerspectiveProxy.ts:95"}},"/jsdoc/classes/SHACLShape":{"title":"Class: SHACLShape","data":{"":"@coasys/ad4m / Exports / SHACLShapeSHACL Node Shape\nDefines constraints for instances of a class","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"constructor_actions\ndestructor_actions\nnodeShapeUri\nparentShapes\nproperties\ntargetClass","methods#Methods":"addParentShape\naddProperty\nsetConstructorActions\nsetDestructorActions\ntoJSON\ntoLinks\ntoTurtle\nfromJSON\nfromLinks","constructors-1#Constructors":"","constructor#constructor":"• new SHACLShape(targetClassOrShapeUri, targetClass?)Create a new SHACL Shape","parameters#Parameters":"Name\tType\tDescription\ttargetClassOrShapeUri\tstring\tIf one argument: the target class (shape URI auto-derived as {class}Shape) If two arguments: first is shape URI, second is target class\ttargetClass?\tstring\tOptional target class when first arg is shape URI","defined-in#Defined in":"shacl/SHACLShape.ts:208","properties-1#Properties":"","constructor_actions#constructor_actions":"• Optional constructor_actions: AD4MAction[]AD4M-specific: Constructor actions for creating instances","defined-in-1#Defined in":"shacl/SHACLShape.ts:194","destructor_actions#destructor_actions":"• Optional destructor_actions: AD4MAction[]AD4M-specific: Destructor actions for removing instances","defined-in-2#Defined in":"shacl/SHACLShape.ts:197","nodeshapeuri#nodeShapeUri":"• nodeShapeUri: stringURI of this shape (e.g., recipe:RecipeShape)","defined-in-3#Defined in":"shacl/SHACLShape.ts:185","parentshapes#parentShapes":"• parentShapes: string[]Parent shape URIs for model inheritance (sh:node references)","defined-in-4#Defined in":"shacl/SHACLShape.ts:200","properties-2#properties":"• properties: SHACLPropertyShape[]Property constraints","defined-in-5#Defined in":"shacl/SHACLShape.ts:191","targetclass#targetClass":"• Optional targetClass: stringTarget class this shape applies to (e.g., recipe:Recipe)","defined-in-6#Defined in":"shacl/SHACLShape.ts:188","methods-1#Methods":"","addparentshape#addParentShape":"▸ addParentShape(parentShapeUri): voidAdd a parent shape reference (sh:node) for model inheritance.\nWhen a","parameters-1#Parameters":"Name\tType\tparentShapeUri\tstring","returns#Returns":"voidModelclass extends another @Model, the child shape\nreferences the parent shape so SHACL validators can walk the\nclass hierarchy.","defined-in-7#Defined in":"shacl/SHACLShape.ts:231","addproperty#addProperty":"▸ addProperty(prop): voidAdd a property constraint to this shape","parameters-2#Parameters":"Name\tType\tprop\tSHACLPropertyShape","returns-1#Returns":"void","defined-in-8#Defined in":"shacl/SHACLShape.ts:240","setconstructoractions#setConstructorActions":"▸ setConstructorActions(actions): voidSet constructor actions for this shape","parameters-3#Parameters":"Name\tType\tactions\tAD4MAction[]","returns-2#Returns":"void","defined-in-9#Defined in":"shacl/SHACLShape.ts:247","setdestructoractions#setDestructorActions":"▸ setDestructorActions(actions): voidSet destructor actions for this shape","parameters-4#Parameters":"Name\tType\tactions\tAD4MAction[]","returns-3#Returns":"void","defined-in-10#Defined in":"shacl/SHACLShape.ts:254","tojson#toJSON":"▸ toJSON(): objectConvert the shape to a JSON-serializable object.\nUseful for passing to addSdna() as shaclJson parameter.","returns-4#Returns":"objectJSON-serializable object representing the shape","defined-in-11#Defined in":"shacl/SHACLShape.ts:790","tolinks#toLinks":"▸ toLinks(): Link[]Serialize shape to AD4M Links (RDF triples)\nStores the shape as a graph of links in a Perspective","returns-5#Returns":"Link[]","defined-in-12#Defined in":"shacl/SHACLShape.ts:340","toturtle#toTurtle":"▸ toTurtle(): stringSerialize shape to Turtle (RDF) format","returns-6#Returns":"string","defined-in-13#Defined in":"shacl/SHACLShape.ts:261","fromjson#fromJSON":"▸ Static fromJSON(json): SHACLShapeCreate a shape from a JSON object (inverse of toJSON)","parameters-5#Parameters":"Name\tType\tjson\tany","returns-7#Returns":"SHACLShape","defined-in-14#Defined in":"shacl/SHACLShape.ts:824","fromlinks#fromLinks":"▸ Static fromLinks(links, shapeUri): SHACLShapeReconstruct shape from AD4M Links","parameters-6#Parameters":"Name\tType\tlinks\tLink[]\tshapeUri\tstring","returns-8#Returns":"SHACLShape","defined-in-15#Defined in":"shacl/SHACLShape.ts:556"}},"/jsdoc/classes/Subject":{"title":"Class: Subject","data":{"":"@coasys/ad4m / Exports / SubjectRepresents a subject in the perspective.\nA subject is an entity that has properties and relations.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#baseExpression\n#perspective\n#subjectClassName","accessors#Accessors":"baseExpression","methods#Methods":"init","constructors-1#Constructors":"","constructor#constructor":"• new Subject(perspective, baseExpression, subjectClassName)Constructs a new subject.","parameters#Parameters":"Name\tType\tDescription\tperspective\tPerspectiveProxy\tThe perspective that the subject belongs to.\tbaseExpression\tstring\tThe base expression of the subject.\tsubjectClassName\tstring\tThe class name of the subject.","defined-in#Defined in":"model/Subject.ts:19","properties-1#Properties":"","baseexpression##baseExpression":"• Private #baseExpression: string","defined-in-1#Defined in":"model/Subject.ts:9","perspective##perspective":"• Private #perspective: PerspectiveProxy","defined-in-2#Defined in":"model/Subject.ts:11","subjectclassname##subjectClassName":"• Private #subjectClassName: string","defined-in-3#Defined in":"model/Subject.ts:10","accessors-1#Accessors":"","baseexpression-1#baseExpression":"• get baseExpression(): stringGets the base expression of the subject.","returns#Returns":"string","defined-in-4#Defined in":"model/Subject.ts:28","methods-1#Methods":"","init#init":"▸ init(): PromiseInitializes the subject by validating it and defining its properties and relations dynamically.NOTE: This method should be called before using the subject. All the properties and relations of the subject defined are not type-checked.","returns-1#Returns":"Promise","defined-in-5#Defined in":"model/Subject.ts:37"}},"/jsdoc/classes/SmartLiteral":{"title":"Class: SmartLiteral","data":{"":"@coasys/ad4m / Exports / SmartLiteral","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#base\n#perspective","accessors#Accessors":"base","methods#Methods":"get\nset\ncreate\ngetAllSmartLiterals\nisSmartLiteralBase","constructors-1#Constructors":"","constructor#constructor":"• new SmartLiteral(perspective, base)","parameters#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tbase\tstring","defined-in#Defined in":"SmartLiteral.ts:23","properties-1#Properties":"","base##base":"• Private #base: string","defined-in-1#Defined in":"SmartLiteral.ts:21","perspective##perspective":"• Private #perspective: PerspectiveProxy","defined-in-2#Defined in":"SmartLiteral.ts:20","accessors-1#Accessors":"","base-1#base":"• get base(): string","returns#Returns":"string","defined-in-3#Defined in":"SmartLiteral.ts:28","methods-1#Methods":"","get#get":"▸ get(): Promise","returns-1#Returns":"Promise","defined-in-4#Defined in":"SmartLiteral.ts:54","set#set":"▸ set(content): Promise","parameters-1#Parameters":"Name\tType\tcontent\tany","returns-2#Returns":"Promise","defined-in-5#Defined in":"SmartLiteral.ts:67","create#create":"▸ Static create(perspective, literal): Promise","parameters-2#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tliteral\tany","returns-3#Returns":"Promise","defined-in-6#Defined in":"SmartLiteral.ts:32","getallsmartliterals#getAllSmartLiterals":"▸ Static getAllSmartLiterals(perspective): Promise","parameters-3#Parameters":"Name\tType\tperspective\tPerspectiveProxy","returns-4#Returns":"Promise","defined-in-7#Defined in":"SmartLiteral.ts:47","issmartliteralbase#isSmartLiteralBase":"▸ Static isSmartLiteralBase(perspective, base): Promise","parameters-4#Parameters":"Name\tType\tperspective\tPerspectiveProxy\tbase\tstring","returns-5#Returns":"Promise","defined-in-8#Defined in":"SmartLiteral.ts:39"}},"/jsdoc/classes/UserCreationResult":{"title":"Class: UserCreationResult","data":{"":"@coasys/ad4m / Exports / UserCreationResult","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\nerror\nsuccess","constructors-1#Constructors":"","constructor#constructor":"• new UserCreationResult(did, success, error?)","parameters#Parameters":"Name\tType\tdid\tstring\tsuccess\tboolean\terror?\tstring","defined-in#Defined in":"agent/Agent.ts:307","properties-1#Properties":"","did#did":"• did: string","defined-in-1#Defined in":"agent/Agent.ts:299","error#error":"• Optional error: string","defined-in-2#Defined in":"agent/Agent.ts:305","success#success":"• success: boolean","defined-in-3#Defined in":"agent/Agent.ts:302"}},"/jsdoc/enums/ExceptionType":{"title":"Enumeration: ExceptionType","data":{"":"@coasys/ad4m / Exports / ExceptionType","table-of-contents#Table of contents":"","enumeration-members#Enumeration Members":"AgentIsUntrusted\nCapabilityRequested\nExpressionIsNotVerified\nInstallNotificationRequest\nLanguageIsNotLoaded","enumeration-members-1#Enumeration Members":"","agentisuntrusted#AgentIsUntrusted":"• AgentIsUntrusted = \"AGENT_IS_UNTRUSTED\"","defined-in#Defined in":"Exception.ts:4","capabilityrequested#CapabilityRequested":"• CapabilityRequested = \"CAPABILITY_REQUESTED\"","defined-in-1#Defined in":"Exception.ts:5","expressionisnotverified#ExpressionIsNotVerified":"• ExpressionIsNotVerified = \"EXPRESSION_IS_NOT_VERIFIED\"","defined-in-2#Defined in":"Exception.ts:3","installnotificationrequest#InstallNotificationRequest":"• InstallNotificationRequest = \"INSTALL_NOTIFICATION_REQUEST\"","defined-in-3#Defined in":"Exception.ts:6","languageisnotloaded#LanguageIsNotLoaded":"• LanguageIsNotLoaded = \"LANGUAGE_IS_NOT_LOADED\"","defined-in-4#Defined in":"Exception.ts:2"}},"/jsdoc/enums/PerspectiveState":{"title":"Enumeration: PerspectiveState","data":{"":"@coasys/ad4m / Exports / PerspectiveState","table-of-contents#Table of contents":"","enumeration-members#Enumeration Members":"LinkLanguageFailedToInstall\nLinkLanguageInstalledButNotSynced\nNeighboudhoodCreationInitiated\nNeighbourhoodJoinInitiated\nPrivate\nSynced","enumeration-members-1#Enumeration Members":"","linklanguagefailedtoinstall#LinkLanguageFailedToInstall":"• LinkLanguageFailedToInstall = \"LINK_LANGUAGE_FAILED_TO_INSTALL\"","defined-in#Defined in":"perspectives/PerspectiveHandle.ts:8","linklanguageinstalledbutnotsynced#LinkLanguageInstalledButNotSynced":"• LinkLanguageInstalledButNotSynced = \"LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED\"","defined-in-1#Defined in":"perspectives/PerspectiveHandle.ts:9","neighboudhoodcreationinitiated#NeighboudhoodCreationInitiated":"• NeighboudhoodCreationInitiated = \"NEIGHBOURHOOD_CREATION_INITIATED\"","defined-in-2#Defined in":"perspectives/PerspectiveHandle.ts:6","neighbourhoodjoininitiated#NeighbourhoodJoinInitiated":"• NeighbourhoodJoinInitiated = \"NEIGHBOURHOOD_JOIN_INITIATED\"","defined-in-3#Defined in":"perspectives/PerspectiveHandle.ts:7","private#Private":"• Private = \"PRIVATE\"","defined-in-4#Defined in":"perspectives/PerspectiveHandle.ts:5","synced#Synced":"• Synced = \"SYNCED\"","defined-in-5#Defined in":"perspectives/PerspectiveHandle.ts:10"}},"/jsdoc/interfaces/Ad4mModelLike":{"title":"Interface: Ad4mModelLike","data":{"":"@coasys/ad4m / Exports / Ad4mModelLikeInterface for any class that looks like an Ad4mModel (used in circular-ref-safe typings).","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"className\ngenerateSDNA\ngenerateSHACL","constructors-1#Constructors":"","constructor#constructor":"• new Ad4mModelLike(...args)","parameters#Parameters":"Name\tType\t...args\tany[]","defined-in#Defined in":"model/decorators.ts:128","properties-1#Properties":"","classname#className":"• Optional className: string","defined-in-1#Defined in":"model/decorators.ts:129","generatesdna#generateSDNA":"• Optional generateSDNA: () => any","type-declaration#Type declaration":"▸ (): any","returns#Returns":"any","defined-in-2#Defined in":"model/decorators.ts:130","generateshacl#generateSHACL":"• Optional generateSHACL: () => any","type-declaration-1#Type declaration":"▸ (): any","returns-1#Returns":"any","defined-in-3#Defined in":"model/decorators.ts:131"}},"/jsdoc/interfaces/AD4MAction":{"title":"Interface: AD4MAction","data":{"":"@coasys/ad4m / Exports / AD4MActionAD4M Action - represents a link operation","table-of-contents#Table of contents":"","properties#Properties":"action\nlocal\npredicate\nsource\ntarget","properties-1#Properties":"","action#action":"• action: string","defined-in#Defined in":"shacl/SHACLShape.ts:91","local#local":"• Optional local: boolean","defined-in-1#Defined in":"shacl/SHACLShape.ts:95","predicate#predicate":"• predicate: string","defined-in-2#Defined in":"shacl/SHACLShape.ts:93","source#source":"• source: string","defined-in-3#Defined in":"shacl/SHACLShape.ts:92","target#target":"• target: string","defined-in-4#Defined in":"shacl/SHACLShape.ts:94"}},"/jsdoc/interfaces/AgentService":{"title":"Interface: AgentService","data":{"":"@coasys/ad4m / Exports / AgentService","table-of-contents#Table of contents":"","properties#Properties":"did","methods#Methods":"createSignedExpression","properties-1#Properties":"","did#did":"• Readonly did: string","defined-in#Defined in":"language/LanguageContext.ts:5","methods-1#Methods":"","createsignedexpression#createSignedExpression":"▸ createSignedExpression(data): Expression","parameters#Parameters":"Name\tType\tdata\tany","returns#Returns":"Expression","defined-in-1#Defined in":"language/LanguageContext.ts:6"}},"/jsdoc/interfaces/ConformanceCondition":{"title":"Interface: ConformanceCondition","data":{"":"@coasys/ad4m / Exports / ConformanceConditionA single structured conformance condition for relation filtering.\nDB-agnostic representation that can be translated to any query language.","table-of-contents#Table of contents":"","properties#Properties":"predicate\ntype\nvalue","properties-1#Properties":"","predicate#predicate":"• predicate: stringThe predicate URI to check on the target node","defined-in#Defined in":"shacl/SHACLShape.ts:106","type#type":"• type: \"flag\" | \"required\"Type of check: 'flag' (predicate + value) or 'required' (predicate exists)","defined-in-1#Defined in":"shacl/SHACLShape.ts:104","value#value":"• Optional value: stringFor 'flag' conditions: the expected value","defined-in-2#Defined in":"shacl/SHACLShape.ts:108"}},"/jsdoc/interfaces/DirectMessageAdapter":{"title":"Interface: DirectMessageAdapter","data":{"":"@coasys/ad4m / Exports / DirectMessageAdapter","table-of-contents#Table of contents":"","methods#Methods":"addMessageCallback\ninbox\nrecipient\nsendInbox\nsendP2P\nsetStatus\nstatus","methods-1#Methods":"","addmessagecallback#addMessageCallback":"▸ addMessageCallback(callback): any","parameters#Parameters":"Name\tType\tcallback\tMessageCallback","returns#Returns":"any","defined-in#Defined in":"language/Language.ts:215","inbox#inbox":"▸ inbox(filter?): Promise","parameters-1#Parameters":"Name\tType\tfilter?\tstring","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:214","recipient#recipient":"▸ recipient(): string","returns-2#Returns":"string","defined-in-2#Defined in":"language/Language.ts:207","sendinbox#sendInbox":"▸ sendInbox(message): Promise","parameters-2#Parameters":"Name\tType\tmessage\tPerspective","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:211","sendp2p#sendP2P":"▸ sendP2P(message): Promise","parameters-3#Parameters":"Name\tType\tmessage\tPerspective","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:210","setstatus#setStatus":"▸ setStatus(status): any","parameters-4#Parameters":"Name\tType\tstatus\tPerspectiveExpression","returns-5#Returns":"any","defined-in-5#Defined in":"language/Language.ts:213","status#status":"▸ status(): Promise","returns-6#Returns":"Promise","defined-in-6#Defined in":"language/Language.ts:209"}},"/jsdoc/interfaces/ExpressionAdapter":{"title":"Interface: ExpressionAdapter","data":{"":"@coasys/ad4m / Exports / ExpressionAdapterInterface for the most common Expression Languages","table-of-contents#Table of contents":"","properties#Properties":"putAdapter","methods#Methods":"get","properties-1#Properties":"","putadapter#putAdapter":"• putAdapter: PublicSharing | ReadOnlyLanguageStrategy for putting an expression with needs to be different\nfor those two cases:\nPublicSharing means that this language supports the creation\nand sharing of Expressions, which is the common use-case\nReadOnlyLanguage means that the Language implements a pre-defined\nset of expressions (which can be infinite or finite).\nFor example the url-iframe Language which directly maps URLs to\naddresses - meaning every well formed URL is an address in this\nLanguage. Or a potential Language implementing the verbs/predicates\nof a spec like FOAF.","defined-in#Defined in":"language/Language.ts:106","methods-1#Methods":"","get#get":"▸ get(address): PromiseReturns an Expression by address, or null if there is no Expression\nwith that given address","parameters#Parameters":"Name\tType\taddress\tstring","returns#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:93"}},"/jsdoc/interfaces/ExpressionUI":{"title":"Interface: ExpressionUI","data":{"":"@coasys/ad4m / Exports / ExpressionUIUI factories returning web components","table-of-contents#Table of contents":"","methods#Methods":"constructorIcon\nicon","methods-1#Methods":"","constructoricon#constructorIcon":"▸ constructorIcon(): stringReturns JS code of a web component used to create new expressions","returns#Returns":"string","defined-in#Defined in":"language/Language.ts:82","icon#icon":"▸ icon(): stringReturns JS code of a web component that renders the given expression","returns-1#Returns":"string","defined-in-1#Defined in":"language/Language.ts:80"}},"/jsdoc/interfaces/FlagOptions":{"title":"Interface: FlagOptions","data":{"":"@coasys/ad4m / Exports / FlagOptions","table-of-contents#Table of contents":"","properties#Properties":"through\nvalue","properties-1#Properties":"","through#through":"• through: stringThe predicate of the property. All properties must have this option.","defined-in#Defined in":"model/decorators.ts:369","value#value":"• value: stringThe value of the property.","defined-in-1#Defined in":"model/decorators.ts:374"}},"/jsdoc/interfaces/FlowState":{"title":"Interface: FlowState","data":{"":"@coasys/ad4m / Exports / FlowStateFlow State definition\nRepresents a single state in the flow state machine","table-of-contents#Table of contents":"","properties#Properties":"name\nstateCheck\nvalue","properties-1#Properties":"","name#name":"• name: stringState name (e.g., \"ready\", \"doing\", \"done\")","defined-in#Defined in":"shacl/SHACLFlow.ts:27","statecheck#stateCheck":"• stateCheck: LinkPatternLink pattern that indicates this state","defined-in-1#Defined in":"shacl/SHACLFlow.ts:31","value#value":"• value: numberNumeric state value for ordering (e.g., 0, 0.5, 1)","defined-in-2#Defined in":"shacl/SHACLFlow.ts:29"}},"/jsdoc/interfaces/FlowTransition":{"title":"Interface: FlowTransition","data":{"":"@coasys/ad4m / Exports / FlowTransitionFlow Transition definition\nRepresents a transition between two states","table-of-contents#Table of contents":"","properties#Properties":"actionName\nactions\nfromState\ntoState","properties-1#Properties":"","actionname#actionName":"• actionName: stringName of this action (shown to users, e.g., \"Start\", \"Finish\")","defined-in#Defined in":"shacl/SHACLFlow.ts:40","actions#actions":"• actions: AD4MAction[]Actions to execute for this transition","defined-in-1#Defined in":"shacl/SHACLFlow.ts:46","fromstate#fromState":"• fromState: stringState to transition from","defined-in-2#Defined in":"shacl/SHACLFlow.ts:42","tostate#toState":"• toState: stringState to transition to","defined-in-3#Defined in":"shacl/SHACLFlow.ts:44"}},"/jsdoc/interfaces/HolochainLanguageDelegate":{"title":"Interface: HolochainLanguageDelegate","data":{"":"@coasys/ad4m / Exports / HolochainLanguageDelegate","table-of-contents#Table of contents":"","methods#Methods":"call\ncallAsync\nregisterDNAs","methods-1#Methods":"","call#call":"▸ call(dnaNick, zomeName, fnName, params): PromiseMakes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue","parameters#Parameters":"Name\tType\tdnaNick\tstring\tzomeName\tstring\tfnName\tstring\tparams\tstring | object","returns#Returns":"Promise","defined-in#Defined in":"language/LanguageContext.ts:32","callasync#callAsync":"▸ callAsync(calls, timeoutMs?): PromiseMakes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors","parameters-1#Parameters":"Name\tType\tcalls\t{ dnaNick: string ; fnName: string ; params: string | object ; zomeName: string }[]\ttimeoutMs?\tnumber","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/LanguageContext.ts:34","registerdnas#registerDNAs":"▸ registerDNAs(dnas, holochainSignalCallback?): PromiseInstalls/registers a given DNA in the ad4m-executor","parameters-2#Parameters":"Name\tType\tdnas\tDna[]\tholochainSignalCallback?\tAppSignalCb","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/LanguageContext.ts:30"}},"/jsdoc/interfaces/GetByAuthorAdapter":{"title":"Interface: GetByAuthorAdapter","data":{"":"@coasys/ad4m / Exports / GetByAuthorAdapter","table-of-contents#Table of contents":"","methods#Methods":"getByAuthor","methods-1#Methods":"","getbyauthor#getByAuthor":"▸ getByAuthor(author, count, page): Promise","parameters#Parameters":"Name\tType\tauthor\tstring\tcount\tnumber\tpage\tnumber","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:139"}},"/jsdoc/interfaces/IncludeMap":{"title":"Interface: IncludeMap","data":{"":"@coasys/ad4m / Exports / IncludeMapDescribes which relations to eager-load when querying.Each value is either:\ntrue — hydrate the relation one level deep\nA RelationSubQuery — scoped sub-query (filter / sort / paginate / nested include)\nExample\n// One level deep\n{ comments: true }\n// Sub-query: only the 5 most-recent comments\n{ comments: { order: { createdAt: 'DESC' }, limit: 5 } }\n// Nested eager-load\n{ comments: { include: { author: true } } }","indexable#Indexable":"▪ [relation: string]: boolean | RelationSubQuery"}},"/jsdoc/interfaces/InitializeArgs":{"title":"Interface: InitializeArgs","data":{"":"@coasys/ad4m / Exports / InitializeArgs","table-of-contents#Table of contents":"","properties#Properties":"did\ndidDocument\nkeystore\npassphrase","properties-1#Properties":"","did#did":"• did: string","defined-in#Defined in":"agent/AgentClient.ts:75","diddocument#didDocument":"• didDocument: string","defined-in-1#Defined in":"agent/AgentClient.ts:76","keystore#keystore":"• keystore: string","defined-in-2#Defined in":"agent/AgentClient.ts:77","passphrase#passphrase":"• passphrase: string","defined-in-3#Defined in":"agent/AgentClient.ts:78"}},"/jsdoc/interfaces/Interaction":{"title":"Interface: Interaction","data":{"":"@coasys/ad4m / Exports / Interaction","table-of-contents#Table of contents":"","properties#Properties":"label\nname\nparameters","methods#Methods":"execute","properties-1#Properties":"","label#label":"• Readonly label: string","defined-in#Defined in":"language/Language.ts:239","name#name":"• Readonly name: string","defined-in-1#Defined in":"language/Language.ts:240","parameters#parameters":"• Readonly parameters: InteractionParameter[]","defined-in-2#Defined in":"language/Language.ts:241","methods-1#Methods":"","execute#execute":"▸ execute(parameters): Promise","parameters-1#Parameters":"Name\tType\tparameters\tobject","returns#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:242"}},"/jsdoc/interfaces/Language":{"title":"Interface: Language","data":{"":"@coasys/ad4m / Exports / LanguageInterface of AD4M LanguagesAny JavaScript module that implements a create() function that returns an object that implements this interface\nis a valid AD4M language.\nSo the AD4M-internal representation of a language is an object that implements this interface.Since there are a few different kinds of languages, this interface is split into optional sub-interfaces.\nThe only required property is the name of the language.The most usual kind of language is the \"Expression Language\", which is a language that can be used to create\nand share Expressions.\nFor that, implement the expressionsAdapter and expressionUI interface.The second most common kind of language is the \"Link Language\", which is a language that builds the core\nof AD4M Neighbourhoods.\nFor that, implement the linksAdapter interface.","table-of-contents#Table of contents":"","properties#Properties":"directMessageAdapter\nexpressionAdapter\nexpressionUI\ngetAllAdapter\ngetByAuthorAdapter\nlanguageAdapter\nlinksAdapter\nname\nsettingsUI\nteardown\ntelepresenceAdapter","methods#Methods":"interactions\nisImmutableExpression","properties-1#Properties":"","directmessageadapter#directMessageAdapter":"• Optional Readonly directMessageAdapter: DirectMessageAdapterOptional adapter for direct messaging between agents","defined-in#Defined in":"language/Language.ts:65","expressionadapter#expressionAdapter":"• Optional Readonly expressionAdapter: ExpressionAdapterExpressionAdapter implements means of getting an Expression\nby address and putting an expression","defined-in-1#Defined in":"language/Language.ts:39","expressionui#expressionUI":"• Optional Readonly expressionUI: ExpressionUIInterface for getting UI/web components for rendering Expressions of this Language","defined-in-2#Defined in":"language/Language.ts:42","getalladapter#getAllAdapter":"• Optional Readonly getAllAdapter: GetAllAdapterOptional adapter for getting all Expressions","defined-in-3#Defined in":"language/Language.ts:62","getbyauthoradapter#getByAuthorAdapter":"• Optional Readonly getByAuthorAdapter: GetByAuthorAdapterOptional adapter for getting Expressions by author","defined-in-4#Defined in":"language/Language.ts:60","languageadapter#languageAdapter":"• Optional Readonly languageAdapter: LanguageAdapterImplementation of a Language that defines and stores Languages","defined-in-5#Defined in":"language/Language.ts:57","linksadapter#linksAdapter":"• Optional Readonly linksAdapter: LinkSyncAdapterInterface of LinkLanguages for the core implementation of Neighbourhoods","defined-in-6#Defined in":"language/Language.ts:45","name#name":"• Readonly name: string","defined-in-7#Defined in":"language/Language.ts:27","settingsui#settingsUI":"• Optional Readonly settingsUI: SettingsUIInterface for providing UI components for the settings of this Language","defined-in-8#Defined in":"language/Language.ts:68","teardown#teardown":"• Optional Readonly teardown: () => void","type-declaration#Type declaration":"▸ (): voidOptional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor","returns#Returns":"void","defined-in-9#Defined in":"language/Language.ts:71","telepresenceadapter#telepresenceAdapter":"• Optional Readonly telepresenceAdapter: TelepresenceAdapterAdditional Interface of LinkLanguages that support telepresence features,\nthat is:\nseeing who is online and getting a status\nsending/receiveing p2p signals to other online agents without affecting\nthe shared Perspective of the Neighbourhood\n(see TelepresenceAdapter for more details)","defined-in-10#Defined in":"language/Language.ts:54","methods-1#Methods":"","interactions#interactions":"▸ interactions(expression): Interaction[]All available interactions this agent could execute on given expression","parameters#Parameters":"Name\tType\texpression\tstring","returns-1#Returns":"Interaction[]","defined-in-11#Defined in":"language/Language.ts:74","isimmutableexpression#isImmutableExpression":"▸ Optional isImmutableExpression(expression): booleanFlagging expressions as immutable to enable\nexpression caching in the ad4m-executor","parameters-1#Parameters":"Name\tType\texpression\tstring","returns-2#Returns":"boolean","defined-in-12#Defined in":"language/Language.ts:32"}},"/jsdoc/interfaces/LanguageContext":{"title":"Interface: LanguageContext","data":{"":"@coasys/ad4m / Exports / LanguageContext","table-of-contents#Table of contents":"","properties#Properties":"Holochain\nad4mSignal\nagent\ncustomSettings\nsignatures\nstorageDirectory","properties-1#Properties":"","holochain#Holochain":"• Holochain: HolochainLanguageDelegate","defined-in#Defined in":"language/LanguageContext.ts:18","ad4msignal#ad4mSignal":"• ad4mSignal: Ad4mSignalCB","defined-in-1#Defined in":"language/LanguageContext.ts:19","agent#agent":"• agent: AgentService","defined-in-2#Defined in":"language/LanguageContext.ts:14","customsettings#customSettings":"• customSettings: object","defined-in-3#Defined in":"language/LanguageContext.ts:17","signatures#signatures":"• signatures: SignaturesService","defined-in-4#Defined in":"language/LanguageContext.ts:15","storagedirectory#storageDirectory":"• storageDirectory: string","defined-in-5#Defined in":"language/LanguageContext.ts:16"}},"/jsdoc/interfaces/LanguageAdapter":{"title":"Interface: LanguageAdapter","data":{"":"@coasys/ad4m / Exports / LanguageAdapter","table-of-contents#Table of contents":"","methods#Methods":"getLanguageSource","methods-1#Methods":"","getlanguagesource#getLanguageSource":"▸ getLanguageSource(address): Promise","parameters#Parameters":"Name\tType\taddress\tstring","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:132"}},"/jsdoc/interfaces/LinkPattern":{"title":"Interface: LinkPattern","data":{"":"@coasys/ad4m / Exports / LinkPatternLink pattern for state detection\nUsed to check if an expression is in a particular state","table-of-contents#Table of contents":"","properties#Properties":"predicate\nsource\ntarget","properties-1#Properties":"","predicate#predicate":"• predicate: stringRequired predicate to match","defined-in#Defined in":"shacl/SHACLFlow.ts:16","source#source":"• Optional source: stringOptional source pattern (if omitted, uses the expression address)","defined-in-1#Defined in":"shacl/SHACLFlow.ts:14","target#target":"• target: stringRequired target value to match","defined-in-2#Defined in":"shacl/SHACLFlow.ts:18"}},"/jsdoc/interfaces/LinkSyncAdapter":{"title":"Interface: LinkSyncAdapter","data":{"":"@coasys/ad4m / Exports / LinkSyncAdapterInterface for \"Link Languages\" that facilitate the synchronization\nbetween agents' local Perspectives inside a Neighbourhood.\nThe assumption is that every version of the shared Perspective\nis labeled with a unique revision string.\nChanges are committed and retrieved through diffs.\nThink of a LinkSyncAdapter as a git branch to which agents commit\ntheir changes to and pull diffs from their current revision\nto the latest one.","table-of-contents#Table of contents":"","methods#Methods":"addCallback\naddSyncStateChangeCallback\ncommit\ncurrentRevision\nothers\npublic\nrender\nsetLocalAgents\nsync\nwritable","methods-1#Methods":"","addcallback#addCallback":"▸ addCallback(callback): anyGet push notification when a diff got published","parameters#Parameters":"Name\tType\tcallback\tPerspectiveDiffObserver","returns#Returns":"any","defined-in#Defined in":"language/Language.ts:186","addsyncstatechangecallback#addSyncStateChangeCallback":"▸ addSyncStateChangeCallback(callback): anyAdd a sync state callback method","parameters-1#Parameters":"Name\tType\tcallback\tSyncStateChangeObserver","returns-1#Returns":"any","defined-in-1#Defined in":"language/Language.ts:189","commit#commit":"▸ commit(diff): PromisePublish changes","parameters-2#Parameters":"Name\tType\tdiff\tPerspectiveDiff","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/Language.ts:183","currentrevision#currentRevision":"▸ currentRevision(): PromiseWhat revision are we on now -> what changes are included in output of render()","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:169","others#others":"▸ others(): Promise","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:166","public#public":"▸ public(): boolean","returns-5#Returns":"boolean","defined-in-5#Defined in":"language/Language.ts:165","render#render":"▸ render(): PromiseReturns the full, rendered Perspective at currentRevision","returns-6#Returns":"Promise","defined-in-6#Defined in":"language/Language.ts:180","setlocalagents#setLocalAgents":"▸ Optional setLocalAgents(agents): voidSet the local agents (DIDs) that own this perspective/neighbourhood.\nThis is used to determine which agents should be registered in the DHT.\nOptional - if not implemented, all local agents may be registered.This is a temporary hack to support multiple users on one node joining the same neighbourhood.\nOnce we migrate the LanguageController to Rust and run Languages per user, each user will get their\nown language instance and we won't need to explicitly set local agents. This will provide better\nisolation and avoid the need to share language state between users.","parameters-3#Parameters":"Name\tType\tagents\tstring[]","returns-7#Returns":"void","defined-in-7#Defined in":"language/Language.ts:201","sync#sync":"▸ sync(): PromiseCheck for and get new changes,\nnotify others of local changes.\nThis function will be called every\nfew seconds by the ad4m-executor.","returns-8#Returns":"Promise","defined-in-8#Defined in":"language/Language.ts:177","writable#writable":"▸ writable(): boolean","returns-9#Returns":"boolean","defined-in-9#Defined in":"language/Language.ts:164"}},"/jsdoc/interfaces/ModelConfig":{"title":"Interface: ModelConfig","data":{"":"@coasys/ad4m / Exports / ModelConfig","table-of-contents#Table of contents":"","properties#Properties":"name","properties-1#Properties":"","name#name":"• name: stringThe name of the entity.","defined-in#Defined in":"model/decorators.ts:471"}},"/jsdoc/interfaces/PropertyMetadata":{"title":"Interface: PropertyMetadata","data":{"":"@coasys/ad4m / Exports / PropertyMetadataMetadata for a single property extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"flag\ngetter\ninitial\nlocal\nname\npredicate\nprologGetter\nprologSetter\nreadOnly\nrequired\nresolveLanguage\ntransform","properties-1#Properties":"","flag#flag":"• Optional flag: booleanWhether this is a flag property","defined-in#Defined in":"model/Ad4mModel.ts:162","getter#getter":"• Optional getter: stringCustom SurrealQL getter code","defined-in-1#Defined in":"model/Ad4mModel.ts:156","initial#initial":"• Optional initial: stringInitial value if specified","defined-in-2#Defined in":"model/Ad4mModel.ts:148","local#local":"• Optional local: booleanWhether stored locally only","defined-in-3#Defined in":"model/Ad4mModel.ts:158","name#name":"• name: stringThe property name","defined-in-4#Defined in":"model/Ad4mModel.ts:140","predicate#predicate":"• predicate: stringThe predicate URI (through value)","defined-in-5#Defined in":"model/Ad4mModel.ts:142","prologgetter#prologGetter":"• Optional prologGetter: stringCustom Prolog getter code","defined-in-6#Defined in":"model/Ad4mModel.ts:152","prologsetter#prologSetter":"• Optional prologSetter: stringCustom Prolog setter code","defined-in-7#Defined in":"model/Ad4mModel.ts:154","readonly#readOnly":"• readOnly: booleanWhether the property is read-only","defined-in-8#Defined in":"model/Ad4mModel.ts:146","required#required":"• required: booleanWhether the property is required","defined-in-9#Defined in":"model/Ad4mModel.ts:144","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringLanguage for resolution (e.g., \"literal\")","defined-in-10#Defined in":"model/Ad4mModel.ts:150","transform#transform":"• Optional transform: (value: any) => any","type-declaration#Type declaration":"▸ (value): anyTransform function","parameters#Parameters":"Name\tType\tvalue\tany","returns#Returns":"any","defined-in-11#Defined in":"model/Ad4mModel.ts:160"}},"/jsdoc/interfaces/PropertyMetadataEntry":{"title":"Interface: PropertyMetadataEntry","data":{"":"@coasys/ad4m / Exports / PropertyMetadataEntryMetadata stored for each property viaProperty/Optional/Read Only/Flag","hierarchy#Hierarchy":"PropertyOptions↳ PropertyMetadataEntry","table-of-contents#Table of contents":"","properties#Properties":"flag\ngetter\ninitial\nlocal\nprologGetter\nprologSetter\nreadOnly\nrequired\nresolveLanguage\nthrough\ntransform\nwritable","properties-1#Properties":"","flag#flag":"• Optional flag: boolean","defined-in#Defined in":"model/decorators.ts:18","getter#getter":"• Optional getter: stringCustom SurrealQL getter to resolve the property value. Use this for custom graph traversals.\nThe expression can reference 'Base' which will be replaced with the instance's base expression.\nExample: \"(<-link[WHERE predicate = 'flux://has_reply'].in.uri)[0]\"","inherited-from#Inherited from":"PropertyOptions.getter","defined-in-1#Defined in":"model/decorators.ts:288","initial#initial":"• Optional initial: stringThe initial value of the property. Required if the property is marked as required.","inherited-from-1#Inherited from":"PropertyOptions.initial","defined-in-2#Defined in":"model/decorators.ts:255","local#local":"• Optional local: booleanIndicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.","inherited-from-2#Inherited from":"PropertyOptions.local","defined-in-3#Defined in":"model/decorators.ts:293","prologgetter#prologGetter":"• Optional prologGetter: stringCustom Prolog getter to get the value of the property. If not provided, the default getter will be used.","inherited-from-3#Inherited from":"PropertyOptions.prologGetter","defined-in-4#Defined in":"model/decorators.ts:276","prologsetter#prologSetter":"• Optional prologSetter: stringCustom Prolog setter to set the value of the property. Only available if the property is writable.","inherited-from-4#Inherited from":"PropertyOptions.prologSetter","defined-in-5#Defined in":"model/decorators.ts:281","readonly#readOnly":"• Optional readOnly: booleanIndicates whether the property is read-only. If true, no setter will be generated.\nDefaults to false (property is writable).","inherited-from-5#Inherited from":"PropertyOptions.readOnly","defined-in-6#Defined in":"model/decorators.ts:266","required#required":"• Optional required: booleanIndicates whether the property is required. If true, an initial value must be provided.","inherited-from-6#Inherited from":"PropertyOptions.required","defined-in-7#Defined in":"model/decorators.ts:260","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringThe language used to store the property. Can be the default Literal Language or a custom language address.","inherited-from-7#Inherited from":"PropertyOptions.resolveLanguage","defined-in-8#Defined in":"model/decorators.ts:271","through#through":"• Optional through: stringThe predicate of the property. All properties must have this option.","inherited-from-8#Inherited from":"PropertyOptions.through","defined-in-9#Defined in":"model/decorators.ts:250","transform#transform":"• Optional transform: (value: any) => any","type-declaration#Type declaration":"▸ (value): anyOptional transform function to modify the property value after it is retrieved.\nThis is useful for transforming raw data into a more usable format.\nThe function takes the raw value as input and returns the transformed value.","parameters#Parameters":"Name\tType\tvalue\tany","returns#Returns":"any","inherited-from-9#Inherited from":"PropertyOptions.transform","defined-in-10#Defined in":"model/decorators.ts:300","writable#writable":"• Optional writable: booleanInternal computed writable flag (inverse of readOnly) for SDNA/SHACL compatibility","defined-in-11#Defined in":"model/decorators.ts:17"}},"/jsdoc/interfaces/ModelMetadata":{"title":"Interface: ModelMetadata","data":{"":"@coasys/ad4m / Exports / ModelMetadataComplete model metadata extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"className\nproperties\nrelations","properties-1#Properties":"","classname#className":"• className: stringThe model class name fromModel","defined-in#Defined in":"model/Ad4mModel.ts:197","properties-2#properties":"• properties: RecordMap of property name to metadata","defined-in-1#Defined in":"model/Ad4mModel.ts:199","relations#relations":"• relations: RecordMap of relation name to metadata","defined-in-2#Defined in":"model/Ad4mModel.ts:201"}},"/jsdoc/interfaces/PublicSharing":{"title":"Interface: PublicSharing","data":{"":"@coasys/ad4m / Exports / PublicSharingImplement this interface if your Language supports creation of sharing\nof Expressions.\nSee ExpressionAdapter","table-of-contents#Table of contents":"","methods#Methods":"createPublic","methods-1#Methods":"","createpublic#createPublic":"▸ createPublic(content): PromiseCreate an Expression and shares it.\nReturn the Expression's address.","parameters#Parameters":"Name\tType\tDescription\tcontent\tobject\tis the object created by the constructorIcon component","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:118"}},"/jsdoc/interfaces/PropertyOptions":{"title":"Interface: PropertyOptions","data":{"":"@coasys/ad4m / Exports / PropertyOptions","hierarchy#Hierarchy":"PropertyOptions↳ PropertyMetadataEntry","table-of-contents#Table of contents":"","properties#Properties":"getter\ninitial\nlocal\nprologGetter\nprologSetter\nreadOnly\nrequired\nresolveLanguage\nthrough\ntransform","properties-1#Properties":"","getter#getter":"• Optional getter: stringCustom SurrealQL getter to resolve the property value. Use this for custom graph traversals.\nThe expression can reference 'Base' which will be replaced with the instance's base expression.\nExample: \"(<-link[WHERE predicate = 'flux://has_reply'].in.uri)[0]\"","defined-in#Defined in":"model/decorators.ts:288","initial#initial":"• Optional initial: stringThe initial value of the property. Required if the property is marked as required.","defined-in-1#Defined in":"model/decorators.ts:255","local#local":"• Optional local: booleanIndicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.","defined-in-2#Defined in":"model/decorators.ts:293","prologgetter#prologGetter":"• Optional prologGetter: stringCustom Prolog getter to get the value of the property. If not provided, the default getter will be used.","defined-in-3#Defined in":"model/decorators.ts:276","prologsetter#prologSetter":"• Optional prologSetter: stringCustom Prolog setter to set the value of the property. Only available if the property is writable.","defined-in-4#Defined in":"model/decorators.ts:281","readonly#readOnly":"• Optional readOnly: booleanIndicates whether the property is read-only. If true, no setter will be generated.\nDefaults to false (property is writable).","defined-in-5#Defined in":"model/decorators.ts:266","required#required":"• Optional required: booleanIndicates whether the property is required. If true, an initial value must be provided.","defined-in-6#Defined in":"model/decorators.ts:260","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringThe language used to store the property. Can be the default Literal Language or a custom language address.","defined-in-7#Defined in":"model/decorators.ts:271","through#through":"• Optional through: stringThe predicate of the property. All properties must have this option.","defined-in-8#Defined in":"model/decorators.ts:250","transform#transform":"• Optional transform: (value: any) => any","type-declaration#Type declaration":"▸ (value): anyOptional transform function to modify the property value after it is retrieved.\nThis is useful for transforming raw data into a more usable format.\nThe function takes the raw value as input and returns the transformed value.","parameters#Parameters":"Name\tType\tvalue\tany","returns#Returns":"any","defined-in-9#Defined in":"model/decorators.ts:300"}},"/jsdoc/interfaces/RelationMetadata":{"title":"Interface: RelationMetadata","data":{"":"@coasys/ad4m / Exports / RelationMetadataMetadata for a single relation extracted from decorators.","table-of-contents#Table of contents":"","properties#Properties":"direction\nfilter\ngetter\nlocal\nname\npredicate\ntarget\nwhere","properties-1#Properties":"","direction#direction":"• Optional direction: \"reverse\" | \"forward\"Link direction: 'forward' for HasMany/HasOne, 'reverse' for BelongsToMany/BelongsToOne","defined-in#Defined in":"model/Ad4mModel.ts:178","filter#filter":"• Optional filter: booleanWhether to auto-generate a conformance filter when target is set.\nDefaults to true — set to false to opt out of DB-level type filtering.","defined-in-1#Defined in":"model/Ad4mModel.ts:185","getter#getter":"• Optional getter: stringCustom SurrealQL getter code","defined-in-2#Defined in":"model/Ad4mModel.ts:174","local#local":"• Optional local: booleanWhether stored locally only","defined-in-3#Defined in":"model/Ad4mModel.ts:176","name#name":"• name: stringThe relation name","defined-in-4#Defined in":"model/Ad4mModel.ts:170","predicate#predicate":"• predicate: stringThe predicate URI (through value)","defined-in-5#Defined in":"model/Ad4mModel.ts:172","target#target":"• Optional target: () => any","type-declaration#Type declaration":"▸ (): anyTarget model class thunk for hydration and type filtering","returns#Returns":"any","defined-in-6#Defined in":"model/Ad4mModel.ts:180","where#where":"• Optional where: WhereWhere clause for relation filtering (query DSL)","defined-in-7#Defined in":"model/Ad4mModel.ts:187"}},"/jsdoc/interfaces/ReadOnlyLanguage":{"title":"Interface: ReadOnlyLanguage","data":{"":"@coasys/ad4m / Exports / ReadOnlyLanguageImplement this interface if your Language is defined over a static\nset of pre-defined Expressions.","table-of-contents#Table of contents":"","methods#Methods":"addressOf","methods-1#Methods":"","addressof#addressOf":"▸ addressOf(content): PromiseThis just calculates the address of an object","parameters#Parameters":"Name\tType\tDescription\tcontent\tobject\tis the object created by the constructorIcon component","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:128"}},"/jsdoc/interfaces/RelationMetadataEntry":{"title":"Interface: RelationMetadataEntry","data":{"":"@coasys/ad4m / Exports / RelationMetadataEntryMetadata stored for each relation viaHas Many/Has One/Belongs To One/Belongs To Many","table-of-contents#Table of contents":"","properties#Properties":"filter\ngetter\nkind\nlocal\nmaxCount\npredicate\ntarget\nwhere","properties-1#Properties":"","filter#filter":"• Optional filter: booleanWhether to auto-generate a conformance filter when target is set.\nDefaults to true — set to false to opt out of DB-level type filtering\nwhile keeping hydration capability via include.","defined-in#Defined in":"model/decorators.ts:43","getter#getter":"• Optional getter: stringCustom SurrealQL getter to resolve the relation values.\nThe expression can reference 'Base' which will be replaced with the instance's base expression.","defined-in-1#Defined in":"model/decorators.ts:37","kind#kind":"• kind: \"hasMany\" | \"hasOne\" | \"belongsToOne\" | \"belongsToMany\"","defined-in-2#Defined in":"model/decorators.ts:26","local#local":"• Optional local: boolean","defined-in-3#Defined in":"model/decorators.ts:32","maxcount#maxCount":"• Optional maxCount: numberMaximum number of related instances.\nSet automatically: 1 for @HasOne/@BelongsToOne, undefined (unlimited) for *Many.","defined-in-4#Defined in":"model/decorators.ts:31","predicate#predicate":"• predicate: string","defined-in-5#Defined in":"model/decorators.ts:23","target#target":"• Optional target: () => Ad4mModelLike","type-declaration#Type declaration":"▸ (): Ad4mModelLikeTarget model class thunk. Optional for untyped string relations.","returns#Returns":"Ad4mModelLike","defined-in-6#Defined in":"model/decorators.ts:25","where#where":"• Optional where: WhereFilter constraints on linked target nodes using the query DSL.\nProperty names reference the target model's properties.\nOverrides auto-derived conformance when set.","defined-in-7#Defined in":"model/decorators.ts:49"}},"/jsdoc/interfaces/RelationOptions":{"title":"Interface: RelationOptions","data":{"":"@coasys/ad4m / Exports / RelationOptionsOptions for relation decorators (@HasMany, @HasOne, @BelongsToOne, @BelongsToMany).","table-of-contents#Table of contents":"","properties#Properties":"filter\ngetter\nlocal\ntarget\nthrough\nwhere","properties-1#Properties":"","filter#filter":"• Optional filter: booleanWhether to auto-generate a DB-level conformance filter when target is set.\nDefaults to true when target is present — the query will only return linked\nnodes whose shape matches the target model (required properties, flags, etc.).\nSet to false to opt out of filtering while keeping hydration capability.","defined-in#Defined in":"model/decorators.ts:1136","getter#getter":"• Optional getter: stringCustom SurrealQL getter to resolve the relation values. Use this for custom graph traversals.\nThe expression can reference 'Base' which will be replaced with the instance's base expression.\nExample: \"(<-link[WHERE predicate = 'flux://has_reply'].out.uri)\"Mutually exclusive with through and target. When getter is provided the\nrelation is read-only (no adder/remover actions are generated).","defined-in-1#Defined in":"model/decorators.ts:1127","local#local":"• Optional local: booleanWhether the link is stored locally (not shared on the network)","defined-in-2#Defined in":"model/decorators.ts:1129","target#target":"• Optional target: () => Ad4mModelLike","type-declaration#Type declaration":"▸ (): Ad4mModelLikeThe target model class (use a thunk to avoid circular-dependency issues). Optional for untyped string relations.\nCannot be combined with getter.","returns#Returns":"Ad4mModelLike","defined-in-3#Defined in":"model/decorators.ts:1118","through#through":"• Optional through: stringThe predicate URI used to link the two models.\nDefaults to 'ad4m://has_child' when omitted.\nCannot be combined with getter.","defined-in-4#Defined in":"model/decorators.ts:1115","where#where":"• Optional where: WhereFilter constraints on the linked target nodes, using the same query DSL\nas Model.query().where(...). Property names reference the target\nmodel's properties (resolved via target metadata).When target is set and where is omitted, conformance conditions are\nauto-derived from the target shape (flags + required properties).\nProviding where overrides this auto-derivation.Mutually exclusive with getter and filter: false.Example\n@HasMany(() => Message, {\n through: \"flux://entry_type\",\n where: { status: \"active\", priority: { gte: 3 } }\n})\nactiveMessages: Message[] = []","defined-in-5#Defined in":"model/decorators.ts:1157"}},"/jsdoc/interfaces/SettingsUI":{"title":"Interface: SettingsUI","data":{"":"@coasys/ad4m / Exports / SettingsUI","table-of-contents#Table of contents":"","methods#Methods":"settingsIcon","methods-1#Methods":"","settingsicon#settingsIcon":"▸ settingsIcon(): string","returns#Returns":"string","defined-in#Defined in":"language/Language.ts:86"}},"/jsdoc/interfaces/SignaturesService":{"title":"Interface: SignaturesService","data":{"":"@coasys/ad4m / Exports / SignaturesService","table-of-contents#Table of contents":"","methods#Methods":"verify","methods-1#Methods":"","verify#verify":"▸ verify(expr): boolean","parameters#Parameters":"Name\tType\texpr\tExpression","returns#Returns":"boolean","defined-in#Defined in":"language/LanguageContext.ts:10"}},"/jsdoc/interfaces/TelepresenceAdapter":{"title":"Interface: TelepresenceAdapter","data":{"":"@coasys/ad4m / Exports / TelepresenceAdapter","table-of-contents#Table of contents":"","methods#Methods":"getOnlineAgents\nregisterSignalCallback\nsendBroadcast\nsendSignal\nsetOnlineStatus","methods-1#Methods":"","getonlineagents#getOnlineAgents":"▸ getOnlineAgents(): Promise","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:273","registersignalcallback#registerSignalCallback":"▸ registerSignalCallback(callback): Promise","parameters#Parameters":"Name\tType\tcallback\tTelepresenceSignalCallback","returns-1#Returns":"Promise","defined-in-1#Defined in":"language/Language.ts:277","sendbroadcast#sendBroadcast":"▸ sendBroadcast(payload): Promise","parameters-1#Parameters":"Name\tType\tpayload\tPerspectiveExpression","returns-2#Returns":"Promise","defined-in-2#Defined in":"language/Language.ts:276","sendsignal#sendSignal":"▸ sendSignal(remoteAgentDid, payload): Promise","parameters-2#Parameters":"Name\tType\tremoteAgentDid\tstring\tpayload\tPerspectiveExpression","returns-3#Returns":"Promise","defined-in-3#Defined in":"language/Language.ts:275","setonlinestatus#setOnlineStatus":"▸ setOnlineStatus(status): Promise","parameters-3#Parameters":"Name\tType\tstatus\tPerspectiveExpression","returns-4#Returns":"Promise","defined-in-4#Defined in":"language/Language.ts:272"}},"/perspectives":{"title":"Perspectives: Agent-Centric Knowledge Graphs","data":{"understanding-perspectives#Understanding Perspectives":"Perspectives are semantic knowledge graphs inspired by the Semantic Web and Linked Data principles, but reimagined through an agent-centric lens. While traditional RDF graphs and Solid PODs are designed around data ownership, Perspectives emphasize that all knowledge is inherently subjective and tied to the agent who claims it.","objective-vs-subjective-data#Objective vs. Subjective Data":"In AD4M, we distinguish between two types of data:\nObjective Data (Expressions):\nStored in Languages\nSame content for any agent requesting a given URL\nCryptographically signed by their author\nExample: A post stored at QmSocial123://post789\nSubjective Data (Perspectives):\nPersonal associations between Expressions\nOwned by a specific agent\nRepresent that agent's view of relationships\nExample: Agent Alice linking a post as \"important\" or \"related-to\" another post","links-agent-centric-triples#Links: Agent-Centric Triples":"Perspectives consist of Links – our agent-centric version of RDF triples. Each Link connects three URIs:\ninterface Link {\n source: string; // Subject Expression URL\n predicate: string; // Predicate Expression URL\n target: string; // Object Expression URL\n}\nThese Links are stored as LinkExpressions – special Expressions where the data field contains a Link:\n{\n author: \"did:key:z6Mk...\", // Who made this association\n timestamp: \"2023-06-21...\",\n data: {\n source: \"QmSocial123://post789\",\n predicate: \"sioc://likes\",\n target: \"did:key:z6Mk...\"\n },\n proof: { ... } // Cryptographic proof of the claim\n}","subjective-overlays#Subjective Overlays":"Perspectives act as subjective overlays on the objective Expression layer:\nEvery node in the graph must be a URI pointing to an Expression\nThe same Expressions can appear in many Perspectives with different relationships\nEach agent can maintain multiple Perspectives for different contexts\nLinks in a Perspective represent an agent's claims about relationships\nFor example:\nAgent Alice's Perspective:\nPost1 --likes--> Post2\nPost2 --related-to--> Post3\nAgent Bob's Perspective:\nPost1 --disagrees-with--> Post2\nPost2 --authored-by--> Carol","storage-and-sharing#Storage and Sharing":"Perspectives are stored locally in your AD4M instance's database, but can be shared in several ways:\nSnapshots:\nExport a Perspective as an Expression\nContains a JSON rendering of all Links\nUseful for point-in-time sharing\nNeighbourhoods:\nCollaborative spaces where multiple agents share and sync Perspectives\nReal-time updates and p2p synchronization\nSee Neighbourhoods for more details","future-standards-integration#Future Standards Integration":"While AD4M currently uses its own formats to accommodate agent-centric features, we plan to implement W3C, RDF, and Solid compatibility:\nEvery Perspective will be accessible as a Solid POD\nLinks will be expressible as RDF triples\nStandard SPARQL queries will be supported","working-with-perspectives#Working with Perspectives":"The PerspectiveProxy class provides a rich interface for working with Perspectives:\n// Create a new Perspective\nconst perspective = await ad4m.perspective.add(\"My Knowledge Graph\");\n// Add a Link\nawait perspective.add({\n source: \"QmSocial123://post789\",\n predicate: \"sioc://likes\",\n target: \"did:key:z6Mk...\"\n});\n// Query Links\nconst links = await perspective.get({\n source: \"QmSocial123://post789\"\n});","surrealdb-integration-recommended#SurrealDB Integration (Recommended)":"Every Perspective includes a high-performance SurrealDB query engine that provides 10-100x faster performance than traditional Prolog queries. SurrealDB is the recommended query method for most use cases:\n// Direct SurrealQL query - fast and powerful\nconst follows = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'follows'\"\n);\n// Graph traversal using indexed fields (in.uri = source, out.uri = target)\nconst aliceFollows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find who follows Alice (reverse traversal)\nconst aliceFollowers = await perspective.querySurrealDB(\n \"SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Aggregations and analytics\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\nPerformance Note: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they can be very slow.Security Note: querySurrealDB() only allows read-only operations (SELECT, RETURN, etc.). Use perspective.add() and perspective.remove() to modify links.For comprehensive examples and graph traversal patterns, see the SurrealDB Queries Guide.","prolog-integration-legacy#Prolog Integration (Legacy)":"Perspectives also include a Prolog engine for backward compatibility and advanced logic programming:\n// Basic Prolog query\nconst results = await perspective.queryProlog(\n 'triple(Post, \"sioc://likes\", Agent), triple(Agent, \"foaf://knows\", \"did:key:z6Mk...\")'\n);\n// Finds posts liked by agents who know a specific person\n// Real-time query subscription\nconst subscription = await perspective.subscribeInfer(\n 'triple(Post, \"sioc://status\", \"active\"), triple(Post, \"sioc://author\", Author)'\n);\n// Set up callback for updates\nsubscription.onResult(results => {\n console.log(\"Active posts and their authors:\", results);\n});\n// Important: Clean up subscription when done\nsubscription.dispose();\nQuery subscriptions provide real-time updates but require proper cleanup:\nInitialization: When you create a subscription, it waits for the first result before becoming active\nKeepalive: The subscription stays active through periodic keepalive signals\nUpdates: Receive real-time updates through your callback as the data changes\nCleanup: Call dispose() when done to:\nStop keepalive signals\nUnsubscribe from updates\nNotify the backend to clean up resources\nPrevent memory leaks\nAlways remember to call dispose() when you're done with a subscription.Recommendation: Use SurrealDB for most queries (faster), and reserve Prolog for complex logic programming or custom SDNA rules.","advanced-data-modeling#Advanced Data Modeling":"AD4M provides a sophisticated data modeling system built on SHACL (Shapes Constraint Language) schemas. This allows you to:\nDefine TypeScript classes that map to semantic structures\nUse decorators to specify relationships\nQuery with type safety and IDE support\nFor details on this powerful feature, see our guide on Model Classes.","basic-usage-examples#Basic Usage Examples":"Creating a Perspective:\nconst myNotes = ad4m.perspective.add(\"My private notes\");\nThe returning object will be an instance of PerspectiveProxy\n– which essentially will work as your database instance.Adding a Link:\nconst link = {\n subject: \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n predicate: \"sioc://likes\",\n target: \"literal://ad4m\",\n};\nmyNotes.add(link);\nQuery Links:\nconst allLinks = await myNotes.get(\n new LinkQuery({ predicate: \"sioc://likes\" })\n);\nWhat you get back will be an array of LinkExpressions:\n[\n {\n \"author\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"timestamp\": \"2023-06-21T14:47:48.935Z\",\n \"data\": {\n \"subject\": \"did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2\",\n \"predicate\": \"sioc://likes\",\n \"target\": \"literal://ad4m\"\n },\n \"proof\": {\n \"key\": \"#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n \"signature\": \"xxxx\"\n }\n }\n]\nEven though this Perspective is not shared (yet) but just our private, local\ngraph database, we might want to share it as Neighbourhood."}},"/jsdoc/modules":{"title":"@coasys/ad4m","data":{"":"@coasys/ad4m / Exports","table-of-contents#Table of contents":"","enumerations#Enumerations":"ExceptionType\nPerspectiveState","classes#Classes":"AIClient\nAIModelLoadingStatus\nAIPromptExamples\nAIPromptExamplesInput\nAITask\nAITaskInput\nAd4mClient\nAd4mModel\nAgent\nAgentClient\nAgentExpression\nAgentSignature\nAgentStatus\nApps\nAuthInfo\nAuthInfoInput\nCapability\nCapabilityInput\nDna\nEntanglementProof\nEntanglementProofInput\nExceptionInfo\nExpression\nExpressionProof\nExpressionProofInput\nExpressionRef\nExpressionRendered\nIcon\nImportResult\nImportStats\nInteractionCall\nInteractionMeta\nInteractionParameter\nLanguageExpression\nLanguageHandle\nLanguageLanguageInput\nLanguageMeta\nLanguageMetaInput\nLanguageMetaInternal\nLanguageRef\nLink\nLinkExpression\nLinkExpressionInput\nLinkExpressionMutations\nLinkExpressionUpdated\nLinkInput\nLinkMutations\nLinkQuery\nLiteral\nModelQueryBuilder\nNeighbourhood\nNeighbourhoodExpression\nNeighbourhoodProxy\nNotification\nNotificationInput\nOnlineAgent\nPerspective\nPerspectiveAction\nPerspectiveDiff\nPerspectiveDiffExpression\nPerspectiveExpression\nPerspectiveHandle\nPerspectiveInput\nPerspectiveProxy\nPerspectiveUnsignedInput\nQuerySubscriptionProxy\nResource\nResourceInput\nRuntimeInfo\nSHACLFlow\nSHACLShape\nSentMessage\nSmartLiteral\nSubject\nTriggeredNotification\nUserCreationResult\nUserStatistics\nVerificationRequestResult","interfaces#Interfaces":"AD4MAction\nAd4mModelLike\nAgentService\nConformanceCondition\nDirectMessageAdapter\nExpressionAdapter\nExpressionUI\nFlagOptions\nFlowState\nFlowTransition\nGetAllAdapter\nGetByAuthorAdapter\nHolochainLanguageDelegate\nIncludeMap\nInitializeArgs\nInteraction\nLanguage\nLanguageAdapter\nLanguageContext\nLinkPattern\nLinkSyncAdapter\nModelConfig\nModelMetadata\nPropertyMetadata\nPropertyMetadataEntry\nPropertyOptions\nPublicSharing\nReadOnlyLanguage\nRelationMetadata\nRelationMetadataEntry\nRelationOptions\nSHACLPropertyShape\nSettingsUI\nSignaturesService\nTelepresenceAdapter","type-aliases#Type Aliases":"Ad4mSignalCB\nAddress\nAgentAppsUpdatedCallback\nAgentStatusChangedCallback\nAgentUpdatedCallback\nAllInstancesResult\nDID\nFlowableCondition\nGetOptions\nHasManyMethods\nLinkStatus\nMessageCallback\nPaginationResult\nParentScope\nPerspectiveDiffObserver\nQuery\nRelationSubQuery\nResultsWithTotalCount\nStatusCallback\nSyncStateChangeObserver\nTelepresenceSignalCallback\nWhere\nWhereCondition\nWhereOps","variables#Variables":"SMART_LITERAL_CONTENT_PREDICATE\ntypeDefsString","decorators-functions#Decorators Functions":"BelongsToMany\nBelongsToOne\nFlag\nHasMany\nHasOne\nModel\nOptional\nProperty\nReadOnly","other-functions#Other Functions":"ExpressionGeneric\nExpressionGenericInput\naddLink\nbuildConformanceFilter\ncapSentence\nescapeSurrealString\nexprRef2String\nformatList\ngeneratePrologFacts\ngetPropertiesMetadata\ngetRelationsMetadata\nhasLink\ninstanceToSerializable\nisExpression\nisLink\nlinkEqual\nmakeRandomId\nparseExprUrl\nsetPropertyRegistryEntry\nsetRelationRegistryEntry","type-aliases-1#Type Aliases":"","ad4msignalcb#Ad4mSignalCB":"Ƭ Ad4mSignalCB: (signal: any) => void","type-declaration#Type declaration":"▸ (signal): void","parameters#Parameters":"Name\tType\tsignal\tany","returns#Returns":"void","defined-in#Defined in":"language/LanguageContext.ts:37","address#Address":"Ƭ Address: string","defined-in-1#Defined in":"Address.ts:1","agentappsupdatedcallback#AgentAppsUpdatedCallback":"Ƭ AgentAppsUpdatedCallback: () => null","type-declaration-1#Type declaration":"▸ (): null","returns-1#Returns":"null","defined-in-2#Defined in":"agent/AgentClient.ts:83","agentstatuschangedcallback#AgentStatusChangedCallback":"Ƭ AgentStatusChangedCallback: (agent: Agent) => null","type-declaration-2#Type declaration":"▸ (agent): null","parameters-1#Parameters":"Name\tType\tagent\tAgent","returns-2#Returns":"null","defined-in-3#Defined in":"agent/AgentClient.ts:82","agentupdatedcallback#AgentUpdatedCallback":"Ƭ AgentUpdatedCallback: (agent: Agent) => null","type-declaration-3#Type declaration":"▸ (agent): null","parameters-2#Parameters":"Name\tType\tagent\tAgent","returns-3#Returns":"null","defined-in-4#Defined in":"agent/AgentClient.ts:81","allinstancesresult#AllInstancesResult":"Ƭ AllInstancesResult: Object","type-declaration-4#Type declaration":"Name\tType\tAllInstances\tAd4mModel[]\tTotalCount?\tnumber\tisInit?\tboolean","defined-in-5#Defined in":"model/Ad4mModel.ts:131","did#DID":"Ƭ DID: string","defined-in-6#Defined in":"DID.ts:1","flowablecondition#FlowableCondition":"Ƭ FlowableCondition: \"any\" | LinkPatternFlowable condition - determines which expressions can enter this flow\n\"any\" means all expressions can start this flow\nOtherwise, a link pattern to check","defined-in-7#Defined in":"shacl/SHACLFlow.ts:54","getoptions#GetOptions":"Ƭ GetOptions: PickOptions accepted by the instance get() method.A subset of Query — only hydration controls apply to a single known instance.","defined-in-8#Defined in":"model/Ad4mModel.ts:129","hasmanymethods#HasManyMethods":"Ƭ HasManyMethods: { [K in Keys as `add${Capitalize}`]: Function } & { [K in Keys as `remove${Capitalize}`]: Function } & { [K in Keys as `set${Capitalize}`]: Function }Utility type that describes the auto-generated helper methods for a HasMany\nrelation. For a property named comments on a class Post, the following\nmethods will be available on instances:post.addComment(value)\npost.removeComment(value)\npost.setComment(values)","type-parameters#Type parameters":"Name\tType\tKeys\textends string","defined-in-9#Defined in":"model/decorators.ts:1169","linkstatus#LinkStatus":"Ƭ LinkStatus: \"shared\" | \"local\"","defined-in-10#Defined in":"perspectives/PerspectiveProxy.ts:324","messagecallback#MessageCallback":"Ƭ MessageCallback: (message: PerspectiveExpression) => void","type-declaration-5#Type declaration":"▸ (message): void","parameters-3#Parameters":"Name\tType\tmessage\tPerspectiveExpression","returns-4#Returns":"void","defined-in-11#Defined in":"language/Language.ts:204","paginationresult#PaginationResult":"Ƭ PaginationResult: Object","type-parameters-1#Type parameters":"Name\tT","type-declaration-6#Type declaration":"Name\tType\tpageNumber\tnumber\tpageSize\tnumber\tresults\tT[]\ttotalCount?\tnumber","defined-in-12#Defined in":"model/Ad4mModel.ts:133","parentscope#ParentScope":"Ƭ ParentScope: { field?: string ; id: string ; model: typeof Ad4mModel } | { id: string ; predicate: string }Discriminated union for parent-scoped queries.Model form (preferred) — predicate auto-resolved from the parent model's\nrelation metadata. Use field to disambiguate when the parent has multiple\nrelations targeting the same child class.Raw form — explicit predicate string, no metadata lookup.","defined-in-13#Defined in":"model/Ad4mModel.ts:72","perspectivediffobserver#PerspectiveDiffObserver":"Ƭ PerspectiveDiffObserver: (diff: PerspectiveDiff) => void","type-declaration-7#Type declaration":"▸ (diff): void","parameters-4#Parameters":"Name\tType\tdiff\tPerspectiveDiff","returns-5#Returns":"void","defined-in-14#Defined in":"language/Language.ts:151","query#Query":"Ƭ Query: Object","type-declaration-8#Type declaration":"Name\tType\tDescription\tcount?\tboolean\t-\tinclude?\tIncludeMap\t-\tlimit?\tnumber\t-\toffset?\tnumber\t-\torder?\tOrder\t-\tparent?\tParentScope\tFilter to instances that are the target of a link from a given parent.\tproperties?\tstring[]\t-\twhere?\tWhere\t-","defined-in-15#Defined in":"model/Ad4mModel.ts:99","relationsubquery#RelationSubQuery":"Ƭ RelationSubQuery: OmitSub-query options for a specific relation inside an IncludeMap.Equivalent to Query without top-level scoping (parent) or count,\nsince the result set is already constrained to the linked relation.Example\nawait post.get({ include: { comments: { order: { createdAt: 'DESC' }, limit: 5 } } });","defined-in-16#Defined in":"model/Ad4mModel.ts:122","resultswithtotalcount#ResultsWithTotalCount":"Ƭ ResultsWithTotalCount: Object","type-parameters-2#Type parameters":"Name\tT","type-declaration-9#Type declaration":"Name\tType\tresults\tT[]\ttotalCount?\tnumber","defined-in-17#Defined in":"model/Ad4mModel.ts:132","statuscallback#StatusCallback":"Ƭ StatusCallback: (caller: DID) => Perspective","type-declaration-10#Type declaration":"▸ (caller): Perspective","parameters-5#Parameters":"Name\tType\tcaller\tDID","returns-6#Returns":"Perspective","defined-in-18#Defined in":"language/Language.ts:205","syncstatechangeobserver#SyncStateChangeObserver":"Ƭ SyncStateChangeObserver: (state: PerspectiveState) => void","type-declaration-11#Type declaration":"▸ (state): void","parameters-6#Parameters":"Name\tType\tstate\tPerspectiveState","returns-7#Returns":"void","defined-in-19#Defined in":"language/Language.ts:152","telepresencesignalcallback#TelepresenceSignalCallback":"Ƭ TelepresenceSignalCallback: (payload: PerspectiveExpression, recipientDid?: string) => void","type-declaration-12#Type declaration":"▸ (payload, recipientDid?): void","parameters-7#Parameters":"Name\tType\tpayload\tPerspectiveExpression\trecipientDid?\tstring","returns-8#Returns":"void","defined-in-20#Defined in":"language/Language.ts:270","where#Where":"Ƭ Where: Object","index-signature#Index signature":"▪ [propertyName: string]: WhereCondition","defined-in-21#Defined in":"model/Ad4mModel.ts:60","wherecondition#WhereCondition":"Ƭ WhereCondition: string | number | boolean | string[] | number[] | { [K in keyof WhereOps]?: WhereOps[K] }","defined-in-22#Defined in":"model/Ad4mModel.ts:59","whereops#WhereOps":"Ƭ WhereOps: Object","type-declaration-13#Type declaration":"Name\tType\tbetween\t[number, number]\tcontains\tstring | number\tgt\tnumber\tgte\tnumber\tlt\tnumber\tlte\tnumber\tnot\tstring | number | boolean | string[] | number[]","defined-in-23#Defined in":"model/Ad4mModel.ts:50","variables-1#Variables":"","smart_literal_content_predicate#SMART_LITERAL_CONTENT_PREDICATE":"• Const SMART_LITERAL_CONTENT_PREDICATE: \"smart_literal://content\"","defined-in-24#Defined in":"SmartLiteral.ts:6","typedefsstring#typeDefsString":"• Const typeDefsString: \"\"","defined-in-25#Defined in":"typeDefs.ts:6","decorators-functions-1#Decorators Functions":"","belongstomany#BelongsToMany":"▸ BelongsToMany(opts): PropertyDecoratorDecorator for defining the inverse side of a many-to-many relation.","parameters-8#Parameters":"Name\tType\topts\tRelationOptions","returns-9#Returns":"PropertyDecoratorDescriptionDeclares the non-owning (inverse) side of a many-to-many relationship.\nThe property is a read-only relation since the owning side manages links.Supports two calling conventions:\n@BelongsToMany({ through: \"post://tag\", target: () => Post })\n@BelongsToMany(() => Post, { through: \"post://tag\" })\nExample\n@Model({ name: \"Tag\" })\nclass Tag extends Ad4mModel {\n @BelongsToMany(() => Post, { through: \"post://tag\" })\n posts: string[] = [];\n}","defined-in-26#Defined in":"model/decorators.ts:1456▸ BelongsToMany(target, opts?): PropertyDecorator","parameters-9#Parameters":"Name\tType\ttarget\t() => Ad4mModelLike\topts?\tOmit","returns-10#Returns":"PropertyDecorator","defined-in-27#Defined in":"model/decorators.ts:1457","belongstoone#BelongsToOne":"▸ BelongsToOne(opts): PropertyDecoratorDecorator for defining the inverse side of a one-to-one relation.","parameters-10#Parameters":"Name\tType\topts\tRelationOptions","returns-11#Returns":"PropertyDecoratorDescriptionDeclares the non-owning (inverse) side of a one-to-one relationship.\nThe property is read-only since the owning side manages the link.Supports two calling conventions:\n@BelongsToOne({ through: \"post://author\", target: () => Post })\n@BelongsToOne(() => Post, { through: \"post://author\" })\nExample\n@Model({ name: \"Author\" })\nclass Author extends Ad4mModel {\n @BelongsToOne(() => Post, { through: \"post://author\" })\n post: string = \"\";\n}","defined-in-28#Defined in":"model/decorators.ts:1398▸ BelongsToOne(target, opts?): PropertyDecorator","parameters-11#Parameters":"Name\tType\ttarget\t() => Ad4mModelLike\topts?\tOmit","returns-12#Returns":"PropertyDecorator","defined-in-29#Defined in":"model/decorators.ts:1399","flag#Flag":"▸ Flag(opts): (target: T, key: keyof T) => voidDecorator for defining flags on model classes.","parameters-12#Parameters":"Name\tType\tDescription\topts\tFlagOptions\tFlag configuration","returns-13#Returns":"fn▸ (target, key): void","type-parameters-3#Type parameters":"Name\tT","parameters-13#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-14#Returns":"voidDescriptionA specialized property decorator for defining immutable type flags or markers on model instances.\nFlags are always required properties with a fixed value that cannot be changed after creation.Common uses for flags:\nType discrimination between different kinds of models\nMarking models with specific capabilities or features\nVersioning or compatibility markers\nNote: Use of Flag is discouraged unless you specifically need type-based filtering or\ndiscrimination between different kinds of models. For most cases, regular properties\nwithPropertyorOptionalare more appropriate.Example\nclass Message extends Ad4mModel {\n // Type flag to identify message models\n @Flag({\n through: \"ad4m://type\",\n value: \"ad4m://message\"\n })\n type: string = \"\";\n // Version flag for compatibility\n @Flag({\n through: \"ad4m://version\",\n value: \"1.0.0\"\n })\n version: string = \"\";\n // Feature flag\n @Flag({\n through: \"message://feature\",\n value: \"message://encrypted\"\n })\n feature: string = \"\";\n}\n// Later you can query for specific types:\nconst messages = await Message.query(perspective)\n .where({ type: \"ad4m://message\" })\n .run();","defined-in-30#Defined in":"model/decorators.ts:430","hasmany#HasMany":"▸ HasMany(opts): PropertyDecoratorDecorator for defining a one-to-many relation.","parameters-14#Parameters":"Name\tType\topts\tRelationOptions","returns-15#Returns":"PropertyDecoratorDescriptionDeclares that the decorated property is an array of related model instances.\nUnder the hood it registers the relation in the relation registry and also\ncreates the corresponding relation entry so that the SDNA / SHACL\ngenerators continue to emit the correct subject-class code.Supports two calling conventions:\n// Options-object style\n@HasMany({ through: \"post://comment\", target: () => Comment })\n// Target-first shorthand\n@HasMany(() => Comment, { through: \"post://comment\" })\nExample\n@Model({ name: \"Post\" })\nclass Post extends Ad4mModel {\n @HasMany(() => Comment, { through: \"post://comment\" })\n comments: string[] = [];\n}","defined-in-31#Defined in":"model/decorators.ts:1264▸ HasMany(target, opts?): PropertyDecorator","parameters-15#Parameters":"Name\tType\ttarget\t() => Ad4mModelLike\topts?\tOmit","returns-16#Returns":"PropertyDecorator","defined-in-32#Defined in":"model/decorators.ts:1265","hasone#HasOne":"▸ HasOne(opts): PropertyDecoratorDecorator for defining a one-to-one relation (owning side).","parameters-16#Parameters":"Name\tType\topts\tRelationOptions","returns-17#Returns":"PropertyDecoratorDescriptionDeclares that the decorated property holds a single related model instance.\nThe owning side manages the link.Supports two calling conventions:\n@HasOne({ through: \"post://author\", target: () => Author })\n@HasOne(() => Author, { through: \"post://author\" })\nExample\n@Model({ name: \"Post\" })\nclass Post extends Ad4mModel {\n @HasOne(() => Author, { through: \"post://author\" })\n author: string = \"\";\n}","defined-in-33#Defined in":"model/decorators.ts:1328▸ HasOne(target, opts?): PropertyDecorator","parameters-17#Parameters":"Name\tType\ttarget\t() => Ad4mModelLike\topts?\tOmit","returns-18#Returns":"PropertyDecorator","defined-in-34#Defined in":"model/decorators.ts:1329","model#Model":"▸ Model(opts): (target: any) => voidDecorator for defining model classes in AD4M.","parameters-18#Parameters":"Name\tType\tDescription\topts\tModelConfig\tModel configuration","returns-19#Returns":"fn▸ (target): void","parameters-19#Parameters":"Name\tType\ttarget\tany","returns-20#Returns":"voidDescriptionThe root decorator that must be applied to any class that represents a model in AD4M.\nIt registers the class as a Social DNA (SDNA) subject class and provides the infrastructure\nfor storing and retrieving instances.This decorator:\nRegisters the class with a unique name in the AD4M system\nGenerates the necessary SDNA code for the model's properties and relations\nEnables the use of other model decorators (@Property, @HasMany, etc.)\nProvides static query methods through the Ad4mModel base class\nExample\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n resolveLanguage: \"literal\"\n })\n name: string = \"\";\n @HasMany({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n // Static query methods from Ad4mModel:\n static async findByName(perspective: PerspectiveProxy, name: string) {\n return Recipe.query(perspective)\n .where({ name })\n .run();\n }\n}\n// Using the model:\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nawait recipe.save();\n// Querying instances:\nconst recipes = await Recipe.query(perspective)\n .where({ name: \"Chocolate Cake\" })\n .run();\n// Using with PerspectiveProxy:\nawait perspective.ensureSDNASubjectClass(Recipe);","defined-in-35#Defined in":"model/decorators.ts:528","optional#Optional":"▸ Optional(opts): (target: T, key: keyof T) => voidConvenience decorator for defining optional (not required) properties.","parameters-20#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration (same options as @Property)","returns-21#Returns":"fn▸ (target, key): void","type-parameters-4#Type parameters":"Name\tT","parameters-21#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-22#Returns":"voidDescriptionEquivalent to @Property but defaults required to false and does not\napply resolveLanguage or initial defaults. Use this when a property\nmay or may not have a value, and you want full control over its configuration.Example\nclass Recipe extends Ad4mModel {\n @Optional({ through: \"recipe://description\" })\n description?: string;\n}","defined-in-36#Defined in":"model/decorators.ts:357","property#Property":"▸ Property(opts): (target: T, key: keyof T) => voidThe primary property decorator for AD4M model classes.","parameters-22#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration","returns-23#Returns":"fn▸ (target, key): void","type-parameters-5#Type parameters":"Name\tT","parameters-23#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-24#Returns":"voidDescriptionThe core property decorator with smart defaults. All other property decorators\n(@Optional, @ReadOnly) are thin wrappers that adjust these defaults.Smart defaults (all overridable):\nrequired → false\nreadOnly → false\nresolveLanguage → \"literal\"\ninitial → undefined (no link created until a value is explicitly set)\nProperties are optional by default. When a model instance is created without\nproviding a value for an optional property, no link is added to the graph.\nSet required: true explicitly when a property must always be present (this\nalso adds a \"literal://string:uninitialized\" sentinel as the initial value\nso that the SDNA constructor creates a placeholder link).Example\nclass User extends Ad4mModel {\n // Optional property (default) — no link created until a value is set\n @Property({\n through: \"user://name\"\n })\n name: string = \"\";\n // Explicitly required property with sentinel initial value\n @Property({\n through: \"user://status\",\n required: true\n })\n status: string = \"\";\n // Required property with custom initial value\n @Property({\n through: \"user://role\",\n required: true,\n initial: \"user://member\"\n })\n role: string = \"\";\n // Optional property with literal resolution\n @Property({\n through: \"user://bio\",\n resolveLanguage: \"literal\"\n })\n bio: string = \"\";\n}","defined-in-37#Defined in":"model/decorators.ts:1029","readonly#ReadOnly":"▸ ReadOnly(opts): (target: T, key: keyof T) => voidDecorator for defining read-only properties on model classes.","parameters-24#Parameters":"Name\tType\tDescription\topts\tPropertyOptions\tProperty configuration","returns-25#Returns":"fn▸ (target, key): void","type-parameters-6#Type parameters":"Name\tT","parameters-25#Parameters":"Name\tType\ttarget\tT\tkey\tkeyof T","returns-26#Returns":"voidDescriptionA convenience decorator that defines a read-only property.\nEquivalent to @Property with readOnly: true.Read-only properties are ideal for:\nComputed or derived values\nProperties that should never change after creation\nProperties that are set by the system\nProperties that represent immutable data\nExample\nclass Post extends Ad4mModel {\n // Read-only property with custom getter for computed value\n @ReadOnly({\n through: \"post://likes\",\n getter: `findall(User, triple(Base, \"post://liked_by\", User), Users), length(Users, Value)`\n })\n likeCount: number = 0;\n // Read-only property for creation timestamp\n @ReadOnly({\n through: \"post://created_at\",\n initial: new Date().toISOString()\n })\n createdAt: string = \"\";\n // Read-only property that resolves to a Literal\n @ReadOnly({\n through: \"post://author\",\n resolveLanguage: \"literal\"\n })\n author: string = \"\";\n // Read-only property for system-managed data\n @ReadOnly({\n through: \"post://version\",\n initial: \"1.0.0\"\n })\n version: string = \"\";\n}","defined-in-38#Defined in":"model/decorators.ts:1095","other-functions-1#Other Functions":"","expressiongeneric#ExpressionGeneric":"▸ ExpressionGeneric(DataTypeClass): any","type-parameters-7#Type parameters":"Name\tDataType","parameters-26#Parameters":"Name\tType\tDataTypeClass\tClassType","returns-27#Returns":"any","defined-in-39#Defined in":"expression/Expression.ts:42","expressiongenericinput#ExpressionGenericInput":"▸ ExpressionGenericInput(DataTypeClass): any","type-parameters-8#Type parameters":"Name\tDataType","parameters-27#Parameters":"Name\tType\tDataTypeClass\tClassType","returns-28#Returns":"any","defined-in-40#Defined in":"expression/Expression.ts:67","addlink#addLink":"▸ addLink(source, predicate, target): PerspectiveAction","parameters-28#Parameters":"Name\tType\tsource\tstring\tpredicate\tstring\ttarget\tstring","returns-29#Returns":"PerspectiveAction","defined-in-41#Defined in":"model/decorators.ts:232","buildconformancefilter#buildConformanceFilter":"▸ buildConformanceFilter(relationPredicate, targetClass): { conformanceConditions: ConformanceCondition[] ; getter: string } | undefinedBuild a conformance filter for a relation whose target model is known.Inspects the target class's property metadata to derive:\nconformanceConditions: Structured, DB-agnostic conditions (flag & required checks)\ngetter: Pre-computed SurrealQL expression that traverses outgoing links and filters\ntarget nodes to only those conforming to the target shape.","parameters-29#Parameters":"Name\tType\tDescription\trelationPredicate\tstring\tThe relation's predicate URI (e.g. \"flux://entry_type\")\ttargetClass\tAd4mModelLike\tThe target model class (resolved from the target() thunk)","returns-30#Returns":"{ conformanceConditions: ConformanceCondition[] ; getter: string } | undefined{ getter, conformanceConditions } or undefined if no conditions could be derived","defined-in-42#Defined in":"model/decorators.ts:146","capsentence#capSentence":"▸ capSentence(cap): string","parameters-30#Parameters":"Name\tType\tcap\tany","returns-31#Returns":"string","defined-in-43#Defined in":"utils.ts:15","escapesurrealstring#escapeSurrealString":"▸ escapeSurrealString(value): stringEscapes a string value for safe use in SurrealQL queries.","parameters-31#Parameters":"Name\tType\tDescription\tvalue\tstring\tThe string value to escape","returns-32#Returns":"stringThe escaped string safe for SurrealQL interpolation (without surrounding quotes)DescriptionPrevents SQL injection by properly escaping special characters in string values\nthat will be interpolated into SurrealQL queries. This handles the most common\nspecial characters that could break SQL queries or enable injection attacks.Single quotes, backslashes, and other special characters are escaped using\nbackslash notation, which is the standard escaping mechanism for SurrealQL.Example\nconst userInput = \"user's input with 'quotes'\";\nconst escaped = escapeSurrealString(userInput);\nconst query = `SELECT * FROM link WHERE uri = '${escaped}'`;\n// Results in: SELECT * FROM link WHERE uri = 'user\\'s input with \\'quotes\\''","defined-in-44#Defined in":"utils.ts:49","exprref2string#exprRef2String":"▸ exprRef2String(ref): string","parameters-32#Parameters":"Name\tType\tref\tExpressionRef","returns-33#Returns":"string","defined-in-45#Defined in":"expression/ExpressionRef.ts:22","formatlist#formatList":"▸ formatList(list): any","parameters-33#Parameters":"Name\tType\tlist\tany","returns-34#Returns":"any","defined-in-46#Defined in":"utils.ts:1","generateprologfacts#generatePrologFacts":"▸ generatePrologFacts(ModelClass): stringGenerate Prolog predicate facts from a model class's decorator metadata.Given a model class decorated with @Model (and its @Flag, @Property,\n@HasMany, @BelongsToMany decorators), this function emits a string of\nProlog clauses that can be prepended to any perspective.infer() call.The generated predicates are:\nInstance recognizer — modelName(X) — matches instances of the model\nProperty getters — modelName_propName(X, Value) — one per property\nRelation getters — modelName_relName(X, Values) — one per relation","parameters-34#Parameters":"Name\tType\tDescription\tModelClass\ttypeof Ad4mModel\tA class decorated with @Model that extends Ad4mModel","returns-35#Returns":"stringA multi-line Prolog string ready for use with perspective.infer()Example\nimport { generatePrologFacts } from '@coasys/ad4m';\nconst facts = generatePrologFacts(Poll);\nconst result = await perspective.infer(\\`\n \\${facts}\n recent_popular_poll(X) :-\n poll(X),\n poll_vote_count(X, N), N > 10.\n\\`);","defined-in-47#Defined in":"model/Ad4mModel.ts:4680","getpropertiesmetadata#getPropertiesMetadata":"▸ getPropertiesMetadata(ctor): RecordRetrieve property metadata for a given class constructor.\nWalks the prototype chain so subclass decorators compose with parent decorators.","parameters-35#Parameters":"Name\tType\tctor\tFunction","returns-36#Returns":"Record","defined-in-48#Defined in":"model/decorators.ts:63","getrelationsmetadata#getRelationsMetadata":"▸ getRelationsMetadata(ctor): RecordRetrieve relation metadata for a given class constructor.\nWalks the prototype chain so subclass decorators compose with parent decorators.","parameters-36#Parameters":"Name\tType\tctor\tFunction","returns-37#Returns":"Record","defined-in-49#Defined in":"model/decorators.ts:82","haslink#hasLink":"▸ hasLink(predicate): string","parameters-37#Parameters":"Name\tType\tpredicate\tstring","returns-38#Returns":"string","defined-in-50#Defined in":"model/decorators.ts:241","instancetoserializable#instanceToSerializable":"▸ instanceToSerializable(instance): RecordConvert a model instance to a plain serializable object.\nReads the property metadata and extracts values from the instance.","parameters-38#Parameters":"Name\tType\tinstance\tany","returns-39#Returns":"Record","defined-in-51#Defined in":"model/decorators.ts:201","isexpression#isExpression":"▸ isExpression(e): boolean","parameters-39#Parameters":"Name\tType\te\tany","returns-40#Returns":"boolean","defined-in-52#Defined in":"expression/Expression.ts:97","islink#isLink":"▸ isLink(l): boolean","parameters-40#Parameters":"Name\tType\tl\tany","returns-41#Returns":"boolean","defined-in-53#Defined in":"links/Links.ts:91","linkequal#linkEqual":"▸ linkEqual(l1, l2): boolean","parameters-41#Parameters":"Name\tType\tl1\tLinkExpression\tl2\tLinkExpression","returns-42#Returns":"boolean","defined-in-54#Defined in":"links/Links.ts:83","makerandomid#makeRandomId":"▸ makeRandomId(length): stringGenerate a random identifier string (lowercase alpha).\nGenerate a random identifier string of the given length (lowercase alpha).","parameters-42#Parameters":"Name\tType\tlength\tnumber","returns-43#Returns":"string","defined-in-55#Defined in":"model/decorators.ts:215","parseexprurl#parseExprUrl":"▸ parseExprUrl(url): ExpressionRef","parameters-43#Parameters":"Name\tType\turl\tstring","returns-44#Returns":"ExpressionRef","defined-in-56#Defined in":"expression/ExpressionRef.ts:29","setpropertyregistryentry#setPropertyRegistryEntry":"▸ setPropertyRegistryEntry(ctor, propName, meta): voidProgrammatically register property metadata for a given constructor.\nUsed by fromJSONSchema() and other dynamic model builders.","parameters-44#Parameters":"Name\tType\tctor\tFunction\tpropName\tstring\tmeta\tPropertyMetadataEntry & { writable?: boolean }","returns-45#Returns":"void","defined-in-57#Defined in":"model/decorators.ts:102","setrelationregistryentry#setRelationRegistryEntry":"▸ setRelationRegistryEntry(ctor, relName, meta): voidProgrammatically register relation metadata for a given constructor.\nUsed by fromJSONSchema() and other dynamic model builders.","parameters-45#Parameters":"Name\tType\tctor\tFunction\trelName\tstring\tmeta\tRelationMetadataEntry","returns-46#Returns":"void","defined-in-58#Defined in":"model/decorators.ts:115"}},"/social-dna":{"title":"Social DNA: Making Social Interaction Patterns Explicit","data":{"what-is-social-dna#What is Social DNA?":"Social DNA represents the core interaction patterns and social contracts within a digital space. Just as biological DNA encodes the rules for how cells interact and function, Social DNA encodes the rules for how agents (users) interact and collaborate in a digital space.Think of it as the \"business logic\" of social applications, but with a crucial difference: instead of being buried in application code, these patterns are made explicit and separated from both:\nThe storage layer (Languages) - how data is actually stored and shared\nThe UI layer - how these interactions are presented to users","why-social-dna#Why \"Social DNA\"?":"In traditional applications, social interaction patterns are often:\nImplicit in the application code\nTied to specific storage implementations\nMixed with UI concerns\nHard to modify or extend\nNot portable between applications\nSocial DNA makes these patterns:\nExplicit and declarative\nIndependent of storage details\nSeparated from UI concerns\nEasy to modify and extend\nPortable between applications","example-a-simple-social-space#Example: A Simple Social Space":"Let's look at a common social interaction pattern: posting and liking content. In a traditional app, this might be scattered across:\nDatabase schemas\nAPI endpoints\nUI components\nBusiness logic\nWith Social DNA, we can express this as a clear social contract:\n// Define what a \"post\" means in this space\nconst postClass = {\n properties: {\n content: \"string\",\n author: \"did\",\n timestamp: \"datetime\"\n },\n actions: {\n like: \"any agent can like a post once\",\n comment: \"any agent can comment on a post\",\n edit: \"only the author can edit their post\"\n }\n}\n// Define what \"trending\" means in this space\nconst trendingRule = {\n condition: \"post has more than 5 likes in last 24 hours\",\n action: \"mark post as trending\"\n}\nThis is just pseudo-code, but it illustrates how Social DNA makes interaction patterns explicit and declarative.","how-social-dna-works#How Social DNA Works":"AD4M implements Social DNA through two main mechanisms:\nSubject Classes: Define what things mean in a space\nGraph patterns that represent specific types of data\nProperties and relationships between data\nValidation rules for data integrity\nFlows: Define what agents can do in a space\nPreconditions for actions\nState transitions\nEffects of actions\nSubject Classes are defined using SHACL (Shapes Constraint Language), a W3C standard for describing and validating RDF graphs. SHACL is a natural fit for AD4M because:\nIt's a standard for describing graph shapes — exactly what perspectives are\nIt's declarative and machine-readable\nIt supports property constraints, cardinality, and data types\nIt enables interoperability with the broader semantic web ecosystem\nYou typically won't write SHACL by hand. AD4M provides Model Classes — TypeScript decorators\nthat automatically generate SHACL definitions from your class declarations.\n(Think of ORMs vs raw SQL. See Model Classes for details.)","subject-classes-defining-things#Subject Classes: Defining Things":"","understanding-subject-classes#Understanding Subject Classes":"The term \"Subject Class\" was deliberately chosen to emphasize the subjective nature of pattern recognition in semantic graphs. Unlike traditional object-oriented programming where classes define objective structures, Subject Classes represent subjective interpretations of graph patterns – different ways of \"seeing\" meaning in the connections between expressions.","subjective-pattern-recognition#Subjective Pattern Recognition":"Think of a Subject Class as a lens through which an application views and interprets graph patterns:\nDifferent apps can have different \"opinions\" about what constitutes a meaningful pattern\nThe same base expression can be interpreted through multiple Subject Classes\nEach Subject Class defines what properties and relationships are important to its perspective\nFor example, consider a base expression representing some content:\nexpression://xyz123\nDifferent applications might interpret this through different Subject Classes:\nA chat app might see it as a \"Message\" with replies and reactions\nA task app might see it as a \"Todo\" with state and assignments\nA social app might see it as a \"Post\" with likes and shares\nA wiki might see it as a \"Document\" with citations and revisions\nEach of these interpretations is equally valid – they're just different subjective lenses on the same underlying graph structure.","subject-oriented-programming#Subject-Oriented Programming":"This approach is inspired by subject-oriented programming, where:\nBehavior and structure are separated from the base objects\nDifferent subjects can have different views of the same object\nMultiple interpretations can coexist without conflict\nNew interpretations can be added without modifying existing ones\nIn AD4M, this means:\nSubject Classes define patterns around base expressions\nMultiple Subject Classes can match the same expression\nNew Subject Classes can be added without changing existing ones\nApplications can choose which patterns matter to them","base-expressions-and-graph-patterns#Base Expressions and Graph Patterns":"Every Subject Class instance is anchored to a base expression, but its properties and relationships are defined by patterns in the surrounding graph:\nBase Expression: expression://xyz123\n │\n ┌───────────────┬──┴──┬───────────────┐\n │ │ │ │\n state author title comments\n │ │ │ │\n \"done\" did:123 \"Hi\" [expr1, expr2]\nDifferent Subject Classes might look for different patterns around this same base:\n// A Todo class looks for state and assignments\nclass Todo {\n state: string; // Looks for todo://state links\n assignee: string; // Looks for todo://assigned-to links\n}\n// A Post class looks for social interactions\nclass Post {\n likes: string[]; // Looks for social://like links\n comments: string[]; // Looks for social://comment links\n}\n// Both can exist simultaneously on the same base expression\nconst todo = await perspective.getSubjectProxy(baseExpr, \"Todo\");\nconst post = await perspective.getSubjectProxy(baseExpr, \"Post\");","how-subject-classes-are-defined-shacl#How Subject Classes are Defined (SHACL)":"Subject Classes are stored as SHACL shapes in the perspective's link graph. A SHACL NodeShape describes a class, and PropertyShapes describe its properties.Here's how a Todo class maps to SHACL:\n@Model({ name: \"Todo\" })\nclass Todo extends Ad4mModel {\n @Property({ through: \"todo://state\", initial: \"todo://ready\" })\n state: string = \"\";\n @Property({ through: \"todo://has_title\" })\n title?: string;\n @HasMany({ through: \"todo://comment\" })\n comments: string[] = [];\n}\n@prefix sh: .\n@prefix xsd: .\n@prefix ad4m: .\n a sh:NodeShape ;\n sh:targetClass ;\n # Scalar property: state (required, has initial value)\n sh:property [\n sh:path ;\n sh:datatype xsd:string ;\n sh:maxCount 1 ;\n sh:minCount 1 ;\n ad4m:initial \"todo://ready\" ;\n ] ;\n # Scalar property: title (optional, resolved via \"literal\" language)\n sh:property [\n sh:path ;\n sh:datatype xsd:string ;\n sh:maxCount 1 ;\n ad4m:resolveLanguage \"literal\" ;\n ] ;\n # Collection: comments (unbounded)\n sh:property [\n sh:path ;\n sh:datatype xsd:string ;\n ] .\n# SHACL shapes are stored as links in the perspective:\n(ad4m://self) --ad4m://has_sdna--> (ad4m://sdna_Todo)\n(ad4m://sdna_Todo) --ad4m://sdna_type--> (literal://string:subject_class)\n# The shape URI and its properties:\n(ad4m://sdna_Todo) --sh:targetClass--> (todo://Todo)\n(ad4m://sdna_Todo) --sh:property--> (ad4m://sdna_Todo_prop_0)\n# Property shape for \"state\":\n(ad4m://sdna_Todo_prop_0) --sh:path--> (todo://state)\n(ad4m://sdna_Todo_prop_0) --sh:datatype--> (xsd:string)\n(ad4m://sdna_Todo_prop_0) --sh:maxCount--> (literal://number:1)\n(ad4m://sdna_Todo_prop_0) --sh:minCount--> (literal://number:1)\n(ad4m://sdna_Todo_prop_0) --ad4m://initial--> (todo://ready)\n# ... and so on for each property","key-shacl-concepts-for-ad4m#Key SHACL Concepts for AD4M":"SHACL Constraint\tAD4M Meaning\tExample\tsh:maxCount 1\tScalar property (single value)\tstate, title, name\tNo sh:maxCount\tCollection (multiple values)\tcomments, tags, members\tsh:minCount 1\tRequired property\tMust be set on creation\tsh:datatype xsd:string\tString value\tStored as literal://string:...\tsh:class \tReference to another Subject Class\tTyped relationship\tad4m://initial\tDefault value on creation\tInitial state\tad4m://resolveLanguage\tExpression language for values\t\"literal\" for inline values\tad4m://readOnly\tProperty is read-only\tComputed/immutable property","using-subject-classes-in-code#Using Subject Classes in Code":"While the PerspectiveProxy provides low-level methods for working with Subject Classes,\nwe strongly recommend using our high-level Ad4mModel system\n(described in detail in the Model Classes guide).\nThis TypeScript-based approach provides:\nAutomatic SHACL generation from decorated classes\nType safety and IDE support\nRich ActiveRecord-style semantics\nClean, declarative syntax\nHere's how to define and use Subject Classes the recommended way:\nimport { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m';\n@Model({ name: \"Todo\" })\nclass Todo extends Ad4mModel {\n @Property({ through: \"todo://state\", initial: \"todo://ready\" })\n state: string = \"\";\n @Property({ through: \"todo://has_title\" })\n title?: string;\n @HasMany({ through: \"todo://comment\" })\n comments: string[] = [];\n}\n// Register the class with a perspective (once at app startup)\nawait Todo.register(perspective);\n// Use it with full type safety and ActiveRecord patterns\nconst todo = new Todo(perspective);\ntodo.state = \"todo://doing\";\nawait todo.save();\n// Query with the fluent API\nconst todos = await Todo.findAll(perspective);\nconst doneTodos = await Todo.query(perspective)\n .where({ state: \"todo://done\" })\n .get();\nThis approach automatically generates SHACL and provides a rich development experience.","working-with-shacl-directly#Working with SHACL Directly":"For advanced use cases, you can work with SHACL shapes directly using the SHACLShape class:\nimport { SHACLShape } from '@coasys/ad4m';\n// Create a shape programmatically\nconst shape = new SHACLShape('recipe://Recipe');\nshape.addProperty({\n path: 'recipe://name',\n datatype: 'xsd:string',\n maxCount: 1,\n minCount: 1,\n});\nshape.addProperty({\n path: 'recipe://ingredient',\n datatype: 'xsd:string',\n // No maxCount = collection\n});\n// Store in perspective\nawait perspective.addShacl('Recipe', shape);\n// Retrieve\nconst retrieved = await perspective.getShacl('Recipe');\n// List all shapes\nconst allShapes = await perspective.getAllShacl();","understanding-the-lower-level#Understanding the Lower Level":"For a complete understanding, here are the basic PerspectiveProxy methods that power the above abstractions:\n// Add a subject class definition (SHACL) to a perspective\nawait Todo.register(perspective);\n// Or add SHACL directly\nawait perspective.addShacl(\"Todo\", shape);\n// List all available subject classes\nconst classes = await perspective.subjectClasses();\n// Returns: [\"Todo\"]\n// Create a new subject instance\nawait perspective.createSubject(\"Todo\", \"expression://123\");\n// Check if an expression is an instance of a class\nconst isTodo = await perspective.isSubjectInstance(\"expression://123\", \"Todo\");\n// Get subject data\nconst todoData = await perspective.getSubjectData(\"Todo\", \"expression://123\");\n// Remove a subject (runs destructor if defined)\nawait perspective.removeSubject(\"Todo\", \"expression://123\");\n// Get all instances of a class\nconst allTodos = await perspective.getAllSubjectInstances(\"Todo\");\n// Get a proxy object\nconst todo = await perspective.getSubjectProxy(\"expression://123\", \"Todo\");\nWhile these methods are available, we recommend using the Ad4mModel system for most use cases. It provides a more maintainable and type-safe way to work with Subject Classes while handling all the low-level details automatically.","flows-defining-actions#Flows: Defining Actions":"Flows define what agents can do in a space and under what conditions. They manage state machines over expressions — defining states, transitions, and the actions that trigger them.\nFlows still use link-based state tracking internally. The flow state is determined\nby querying links in the perspective, and actions modify links to change state.\nHere's a complete example of a Todo flow:\n// Define flow states and transitions\nconst todoFlow = {\n name: \"TODO\",\n states: {\n ready: 0,\n doing: 0.5,\n done: 1\n },\n // State is determined by todo://state links\n stateQuery: (base) => `todo://state`,\n transitions: [\n {\n from: \"ready\",\n to: \"doing\",\n action: \"Start\",\n effects: [\n { action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://doing\" },\n { action: \"removeLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\" }\n ]\n },\n {\n from: \"doing\",\n to: \"done\",\n action: \"Finish\",\n effects: [\n { action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://done\" },\n { action: \"removeLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://doing\" }\n ]\n }\n ]\n};\nThis flow defines:\nA named flow (\"TODO\") with states (0 = ready, 0.5 = doing, 1 = done)\nHow states are determined (by checking todo://state links)\nAvailable actions for each state with their transitions and effects","using-flows-in-code#Using Flows in Code":"// Get all flows defined in a perspective\nconst flows = await perspective.sdnaFlows();\n// Returns: [\"TODO\"]\n// Check what flows are available for an expression\nconst availableFlows = await perspective.availableFlows(\"expression://123\");\n// Start a flow on an expression\nawait perspective.startFlow(\"TODO\", \"expression://123\");\n// Get expressions in a specific flow state\nconst readyTodos = await perspective.expressionsInFlowState(\"TODO\", 0);\n// Get current state of an expression in a flow\nconst state = await perspective.flowState(\"TODO\", \"expression://123\");\n// Returns: 0, 0.5, or 1\n// Get available actions for current state\nconst actions = await perspective.flowActions(\"TODO\", \"expression://123\");\n// Returns: [\"Start\"] if in ready state\n// Execute an action\nawait perspective.runFlowAction(\"TODO\", \"expression://123\", \"Start\");\n// Transitions from ready (0) to doing (0.5)","adding-flows-to-a-perspective#Adding Flows to a Perspective":"await perspective.addSdna(\"Todo\", flowDefinition, \"flow\");\nconst flows = await perspective.sdnaFlows();\nconsole.log(flows); // Should include \"TODO\"","query-engines-surrealdb--prolog#Query Engines: SurrealDB & Prolog":"AD4M provides two query engines for working with Social DNA and perspective data:","surrealdb-high-performance-queries-recommended#SurrealDB: High-Performance Queries (Recommended)":"For most query needs, SurrealDB provides 10-100x faster performance than Prolog. It's especially powerful for:\nFast filtering and searching\nGraph traversal queries using indexed in.uri and out.uri fields\nAggregations and analytics\nLarge dataset handling\n// Fast query - find all todos in \"done\" state\nconst doneTodos = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'todo://done'\"\n);\n// Graph traversal - find all posts by Alice\nconst alicePosts = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'\"\n);\n// Aggregation - count by type\nconst stats = await perspective.querySurrealDB(\n \"SELECT predicate, count() as total FROM link GROUP BY predicate\"\n);\nPerformance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed.Note: Ad4mModel uses SurrealDB by default for findAll() and query builder operations. See the SurrealDB Queries Guide for comprehensive examples.","the-prolog-engine-legacy#The Prolog Engine (Legacy)":"The Prolog engine is maintained for backward compatibility. For new development,\nuse SurrealDB queries or the Ad4mModel system (which uses SurrealDB by default).\nFor custom logic programming and backward compatibility, AD4M includes a Prolog engine:","core-predicates#Core Predicates":"// Basic graph predicates\ntriple(Subject, Predicate, Object). // Access raw triples\nlink(Subject, Predicate, Object, Timestamp, Author). // Access links with metadata\n// Graph traversal\nreachable(A, B). // True if B can be reached from A through any predicates\nWhen to use which?\nUse SurrealDB for: Fast queries, graph traversal, analytics (most use cases)\nUse Prolog for: Complex logic rules, backward compatibility","using-social-dna-in-your-space#Using Social DNA in Your Space":"To add Social DNA to a Perspective:\n// Recommended: Use Model Classes (auto-generates SHACL)\nawait Todo.register(perspective);\n// Or add SHACL shapes directly\nconst shape = new SHACLShape('todo://Todo');\nshape.addProperty({ path: 'todo://state', datatype: 'xsd:string', maxCount: 1, minCount: 1 });\nawait perspective.addShacl('Todo', shape);\n// Add a flow definition\nawait perspective.addSdna(\"Todo\", flowDefinition, \"flow\");\nThen query your data:\n// Option 1: Use Ad4mModel with SurrealDB (recommended, 10-100x faster)\nconst activeTodos = await Todo.findAll(perspective, {\n where: { state: \"active\" }\n});\n// Option 2: Direct SurrealQL query\nconst todos = await perspective.querySurrealDB(\n \"SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'active'\"\n);\n// Option 3: Prolog (legacy, for backward compatibility)\nconst todos = await perspective.infer(\n 'instance(Todo, \"Todo\"), property_getter(\"Todo\", Todo, \"state\", \"active\")'\n);","best-practices#Best Practices":"Start with Patterns\nIdentify common interaction patterns\nMake implicit rules explicit\nThink about preconditions and effects\nUse Subject Classes for:\nData validation\nComputed properties\nRelationship definitions\nUse Flows for:\nAction permissions\nState transitions\nComplex processes\nKeep it Simple\nStart with basic patterns\nAdd complexity gradually\nUse the high-level Model Classes when possible\nPrefer SHACL over Prolog\nSHACL is the standard for subject class definitions\nModel Classes generate SHACL automatically\nProlog is maintained for backward compatibility only"}},"/tutorial/1-perspective":{"title":"Tutorial","data":{"":"This will get you to a shared Neighbourhood on Holochain in less than 20\nminutes! The code assumes an ad4m variable was setup as described in\nGetting Started.","create-a-perspective-and-add-content#Create a Perspective and add content":"Adding a new perspective is as easy as\nconst myPerspective = await ad4m.perspective.add(\"My new perspective\");\nThe returned object is of type PerspectiveProxy,\nwhich hides all the remote calls to the AD4M executor and can be treated like a\nlocal database object.Perspectives are basically local graph databases.\nWe can query all links on that proxy object with get:\nconst allLinks = await myPerspective.get(new LinkQuery({})); // => []\nIn this case it should return an empty array since we just created that perspective.So let's add something!\nWith the following code I'm creating an adhoc semantic statement\nrepresenting what I think about AD4M...\nimport { Literal } from \"@coasys/ad4m\";\nconst me = await ad4m.agent.me();\nconst source = me.did;\nconst predicate = Literal.from(\"thinks\").toUrl();\nconst target = Literal.from(\"AD4M will be the last social network\").toUrl();\nconst linkExpresion = await myPerspective.add({ source, predicate, target });\nLinks consist of 3 URIs pointing to Expressions of Languages.\nFor this example, we made life easy by using the agent's DID and AD4M's Literal Language.","agent-did#Agent DID":"For the source of our link, we got the user's DID URI by first getting\nthe users Agent object with ad4m.agent.me().\nThat has a DID property and DID URIs are considered valid URIs in AD4M\n(they can be looked-up using the Agent bootstrap language which resolves\nto the same Agent object we got through ad4m.agent.me() - just even if\nthat agent behind the resolved DID isn't me).","literal#Literal":"The Literal Language is an AD4M Language without back-end.\nIt stores JavaScript literals (i.e. strings, numbers and objects)\nby encoding them into the Expression URL.\nSo,\nLiteral.from(\"thinks\").toUrl();\nreturns literal://string:thinks - which is a valid URI -\nand\nLiteral.from(\"AD4M will be the last social network\").toUrl();\nreturns literal://string:AD4M%20will%20be%20the%20last%20social%20network.\nThis is basically like URL parameters and let's us get around introducing Languages\nbefore using Perspectives and Links.We can decode the URL into a JavaScript literal like so:\nconst string = Literal.fromUrl(\"literal://string:thinks\").get();\n// string == 'thinks'","linkexpression#LinkExpression":"We have put in a Link object into myPerspective.add()\n({source, predicate, target}),\nbut what this function returns is a LinkExpression.Even though this Perspective is not shared (yet) but just our private, local\ngraph database, we might want to share it later\nas Neighbourhood.\nThen, all links added by some agent to their local Perspective will be shared\nwith the other agents using a LinkLanguage - a Language which defines Expressions\nrepresenting Links. That is LinkExpressions.Using the generic Expression template,\nLinkExpressions wrap Links with author, timestamp and signature:\n{\n author: \"did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n timestamp: \"Sun Oct 23 2022 15:31:52 GMT+0200 (Central European Summer Time)\",\n data: {\n source: \"did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n predicate: \"literal://string:thinks\",\n target: \"literal://string:AD4M%20will%20be%20the%20last%20social%20network\",\n },\n proof: {\n key: \"#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf\",\n signature: \"xxxx\",\n }\n}"}},"/tutorial/3-neighbourhood-join":{"title":"Joining a Neighbourhood (on another node/agent)","data":{"":"Assume everything above happened on Alice's agent.\nAlice now shares the Neighbourhood's URL with Bob.\nThis is what Bob does to join the Neigbourhood, access it as a (local) Perspective\nand retrieve the Expression Alice created and linked there:\nconst joinedNeighbourhood = await ad4m.neighbourhood.joinFromUrl(\n neighbourhoodUrl\n);\nconst myPerspective = await ad4m.perspective.byUUID(joinedNeighbourhood.uuid);\nconst links = await myPerspective.get(\n new LinkQuery({\n predicate: Literal.from(\"thinks\").toUrl(),\n })\n);\nlinks.forEach(async (link) => {\n const who = link.data.source;\n const what = Literal.fromUrl(link.data.target).get();\n console.log(who, \" thinks that \", what);\n});"}},"/tutorial/2-neighbourhood-publish":{"title":"Publish Perspective as Neighbourhood","data":{"":"The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing\nand thus synchronizing of links (see LinksAdapter).\nWhile there can and will be many different implementations\nwith different trade-offs and features (like membranes etc.),\nthere currently is one fully implemented and Holochain based LinkLanguage with the name Perspective Diff Sync.It is deployed on the current test network (Language Language v0.0.15, included in current network seed) under the address:\nQmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8.","creating-our-unique-linklanguage-clone-through-templating#Creating our unique LinkLanguage clone through templating":"But we should not just use this publicly known Language as the back-bone for our new Neighbourhood,\nif we don't want to have everybody following this guide end up in the same network.So what we want is to use this existing Language as a template and create a new copy with the same code\nbut different UUID and/name in order to create a fresh space for our new Neighbourhood.What parameters can we adjust when using it as template?\nLet's have a look at the Language's meta information:\nconst socialContextMeta = await ad4m.languages.meta(\n \"QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8\"\n);\nconsole.log(socialContextMeta);\nWhich should yield something like this:\n {\n name: 'Perspective Diff Sync',\n address: 'QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8',\n description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',\n author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',\n templated: false,\n templateSourceLanguageAddress: null,\n templateAppliedParams: null,\n possibleTemplateParams: [ 'uuid', 'name', 'description' ],\n sourceCodeLink: 'https://github.com/perspect3vism/perspective-diff-sync'\n}\nThe field possibleTemplateParams tells us that we can set a UUID and override name and description.\nLet's leave description but change the name.\nThe function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:\nconst uniqueLinkLanguage = await ad4m.languages.applyTemplateAndPublish(\n \"QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8\",\n JSON.stringify({\n uuid: \"84a329-77384c-1510fb\",\n name: \"Perspective Diff Sync clone for demo Neighbourhood\",\n })\n);\nThis function call has done a lot for us:\nIt took the source language (first parameter) and made sure we got the code,\ni.e. potentially downloading it from the Language of Languages.\nThe provided template parameters have been applied. In the case of a Language using Holochain, it has unpacked the Holochain DNA, changed the DNA variables according to the values given as template parameters and packed the DNA again (not touching the WASM code)\nThe resulting Language was published with meta information showing that it was templated, providing the source hash and template parameters.\nSo the new templated Language is ready to be used.","creating-the-neighbourhood#Creating the Neighbourhood":"With that new LinkLanguage, actually creating the Neighbourhood is simple.\nWe just have to provide the id of the perspective we want to upgrade to a\nNeighbourhood and the address of the LinkLanguage used for that:\nconst meta = new Perspective();\nconst neighbourhoodUrl = await ad4m.neighbourhood.publishFromPerspective(\n myPerspective.uuid,\n uniqueLinkLanguage.address,\n meta\n);\nconsole.log(neighbourhoodUrl); // => neighbourhood://Qm123456789abcdef\nThe meta field a (static/snapshotted) Perspective that is immutably stored with\nthe Neighbourhood. It can hold arbitrary/semantic meta information about the\nNeighbourhood but can technically stay empty, just like we did here."}},"/tutorial/4-change-listener":{"title":"Listening to Perspective changes","data":{"":"Perspectives that have been turned into Neighbourhoods are like entangled particles.\nEvery agent still has their local copy of the Perspective, but a change from any agent\nwill be shared with all other agents immediately,\nresulting in AD4M automatically updating the local Perspective with the changes by\nthe others.Even with Perspectives that are not shared as Neighbourhood,\na different UI could have access to the same Perspective and cause mutations\non it.Apps/UIs can simply register a listener function on that\nPerspectiveProxy object:\nmyPerspective.addListener(\"link-added\", (addedLink: LinkExpression) => {\n console.log(\"Got a new link:\", addedLink);\n});\nmyPerspective.addListener(\"link-removed\", (removedLink: LinkExpression) => {\n console.log(\"A link was removed:\", removedLink);\n});"}},"/jsdoc/interfaces/GetAllAdapter":{"title":"Interface: GetAllAdapter","data":{"":"@coasys/ad4m / Exports / GetAllAdapter","table-of-contents#Table of contents":"","methods#Methods":"getAll","methods-1#Methods":"","getall#getAll":"▸ getAll(filter, count, page): Promise","parameters#Parameters":"Name\tType\tfilter\tany\tcount\tnumber\tpage\tnumber","returns#Returns":"Promise","defined-in#Defined in":"language/Language.ts:148"}},"/agents":{"title":"Agents: The Foundation of AD4M","data":{"agent-centric-architecture#Agent-Centric Architecture":"In AD4M, we take a fundamentally different approach to building distributed systems. Instead of treating data as the primary building block, we place agents – humans and their computers – at the center of our architecture. This philosophical shift from \"data-centric\" to \"agent-centric\" has profound implications for how we build and interact with digital systems.","why-agent-centric#Why Agent-Centric?":"In traditional web architectures, data is treated as an objective, standalone entity that exists independently of its creators and consumers. This leads to centralized data silos, privacy concerns, and a disconnect between users and their digital footprint.AD4M's agent-centric approach recognizes that:\nAll data is fundamentally a claim or statement made by an agent\nTrust and context come from understanding who made a claim\nAgents should have sovereignty over their data and digital identity\nInteractions should be peer-to-peer between agents","technical-implementation#Technical Implementation":"","decentralized-identifiers-dids#Decentralized Identifiers (DIDs)":"Every agent in AD4M is identified by a Decentralized Identifier (DID). DIDs are globally unique identifiers that:\nAre fully controlled by the agent\nCan be resolved to cryptographic keys\nEnable verifiable, decentralized digital identity\n// Generate a new agent with associated DID\nawait ad4m.agent.generate(\"YourSecurePassword\");\n// Get your agent's DID and information\nconst { did, perspective } = await ad4m.agent.me();","agent-expressions#Agent Expressions":"AD4M comes with a built-in \"agent bootstrap language\" that resolves DIDs to AgentExpression objects. An AgentExpression contains:\nclass Agent {\n // The agent's DID - their unique identifier\n did: string;\n // The agent's public semantic profile\n perspective?: Perspective;\n // Address of the language used for direct messaging\n directMessageLanguage?: string;\n}\nThe perspective field is particularly important as it serves as the agent's \"homepage\" in the semantic web – a public space where they can share information about themselves using semantic links.","cryptographic-keys-and-signatures#Cryptographic Keys and Signatures":"AD4M manages cryptographic keys associated with an agent's DID. These keys are used to:\nSign expressions created by the agent\nVerify the authenticity of expressions from other agents\nEstablish secure communication channels\nWhen an agent creates an expression, AD4M automatically signs it with their private key:\n// The expression will be signed with the agent's key\nconst expression = await ad4m.expression.create(languageAddress, content);","communication-between-agents#Communication Between Agents":"Agents can communicate directly with each other through AD4M's messaging system. The runtime client provides convenient functions that handle the underlying direct message language mechanics:\n// Send a message to another agent\nawait ad4m.runtime.sendMessage(recipientDID, \"Hello!\");\n// Listen for incoming messages\nad4m.runtime.addMessageCallback((message) => {\n console.log(\"Message from:\", message.from);\n console.log(\"Content:\", message.content);\n});\nUnder the hood, AD4M uses the recipient's preferred direct message language (specified in their AgentExpression) to deliver the message. This abstraction ensures that:\nMessages are delivered using the recipient's chosen communication method\nThe underlying transport mechanism can be changed without affecting applications\nMessages are properly encrypted and signed\nYou can also check if an agent is available for messaging:\n// Get another agent's information\nconst otherAgent = await ad4m.agent.byDID(someDID);\n// Check if they have messaging capability\nif (otherAgent.directMessageLanguage) {\n // They can receive messages\n}","agent-perspectives#Agent Perspectives":"Every agent has a public perspective that acts as their semantic profile. This perspective can contain:\nPersonal information\nSocial connections\nPublished content\nPublic keys\nContact methods\nThe perspective uses semantic links to create a rich web of information:\n// Add information to your public perspective\nconst { did } = await ad4m.agent.me();\nawait ad4m.agent.updatePublicPerspective({\n links: [\n { source: did, predicate: \"foaf://name\", target: \"literal://string:Alice\" },\n { source: did, predicate: \"foaf://knows\", target: \"did:key:other-agent\" }\n ]\n});","security-and-privacy#Security and Privacy":"The agent-centric model provides several security benefits:\nAll expressions are cryptographically signed\nAgents have full control over their keys and identity\nCommunication can be encrypted end-to-end\nTrust is built on verifiable claims and signatures\nFor more details about working with agents programmatically, see the Agent class definition."}},"/developer-guides/cli":{"title":"AD4M Command Line Tools","data":{"":"AD4M provides two command-line tools that enable developers to work with AD4M in headless and scripting scenarios:\nad4m-executor: A full AD4M node implementation (similar to the Launcher but without UI)\nad4m: A client tool for interacting with any AD4M executor","installation#Installation":"For build and installation instructions, please refer to the CLI README.","the-ad4m-executor#The AD4M Executor":"The ad4m-executor binary runs a complete AD4M node, making it ideal for:\nServer deployments\nAutomated testing\nCI/CD pipelines\nHeadless applications\nSystem integration\nUnlike the Launcher which provides a GUI, the executor is designed for command-line and programmatic interaction.","authentication--security#Authentication & Security":"The executor uses a secure authentication handshake system. When a client attempts to connect, the executor generates a random number that must be used to complete the authentication. This number is printed in the executor's logs.For automated scenarios where manual authentication is impractical, you can provide an admin credential that bypasses the handshake:\nad4m-executor run --admin-credential your-secret-here\nThis is particularly useful for:\nScripts managing the executor\nCI/CD pipelines\nIntegration testing\nManagement UIs (the Launcher uses this internally)","configuration-parameters#Configuration Parameters":"The executor supports various configuration parameters to customize its behavior. Here are the key parameters:\n# Basic configuration\nad4m-executor run \\\n --gql-port 12000 \\ # Main GraphQL API port (default: 4000)\n --admin-credential secret \\ # Bypass authentication handshake\n --app-data-path ./data \\ # Custom data directory (default: ~/.ad4m)\n --run-dapp-server true # Run the DApp server (default: false)\n# Holochain-related configuration\n --hc-admin-port 1234 \\ # Holochain admin interface port (default: 1234)\n --hc-app-port 8888 \\ # Holochain app interface port (default: 8888)\n --hc-use-bootstrap true \\ # Use bootstrap service (default: true)\n --hc-use-proxy true \\ # Use proxy for Holochain (default: true)\n --hc-proxy-url url \\ # Custom proxy URL\n --hc-bootstrap-url url # Custom bootstrap URL","running-multiple-executors#Running Multiple Executors":"For development and testing, you might want to run multiple AD4M executors on the same machine. Here's how to configure two executors to run simultaneously:\n# First executor (default ports)\nad4m-executor run\n# Second executor (custom ports)\nad4m-executor run \\\n --gql-port 14000 \\ # Different GraphQL port\n --hc-admin-port 2234 \\ # Different Holochain admin port\n --hc-app-port 9888 \\ # Different Holochain app port\n --app-data-path ~/.ad4m2 # Separate data directory\nWhen connecting to the second executor with the client, specify the custom GraphQL port:\nad4m --executor-url http://localhost:14000 agent me","basic-usage#Basic Usage":"Initialize a new AD4M instance:\nad4m-executor init\nThis creates the necessary directory structure and configuration in ~/.ad4m.\nStart the executor:\nad4m-executor run\n(Optional) Run local Holochain services:\nad4m-executor run-local-hc-services\nThis starts the bootstrap and signaling services required by Holochain-based languages.","the-ad4m-client-a-tutorial#The AD4M Client: A Tutorial":"The ad4m client tool provides a complete interface to interact with a running executor. Let's explore its features through practical examples.","getting-started#Getting Started":"First, ensure you have an executor running (see above).\nFor a fresh installation, generate a new agent:\nad4m agent generate\nThis will prompt you for a password to encrypt your agent's keys.\nOn subsequent starts, unlock your agent:\nad4m agent unlock\nView your agent's information:\nad4m agent me\nThis shows your DID, public perspective, and messaging capabilities.","working-with-perspectives#Working with Perspectives":"Perspectives are semantic spaces where you can store and query linked data.\nCreate a new perspective:\nad4m perspectives create\nList all perspectives:\nad4m perspectives\nAdd links to a perspective:\nad4m perspectives add-link \"Alice\" \"knows\" \"Bob\"\nQuery links:\nad4m perspectives query-links --source \"Alice\"\nWatch for real-time changes:\nad4m perspectives watch ","interactive-data-manipulation#Interactive Data Manipulation":"The REPL provides an interactive environment for working with perspective data:\nad4m perspectives repl \nIn the REPL, you can:\n# Add links\nadd Alice knows Bob\n# Query with variables\n?Person knows Bob\n# Create subjects\nnew Person(alice)\nsubject(alice)[name] = \"Alice Smith\"\nsubject(alice)[interests] <= \"coding\"\n# View subject data\nsubject(alice)\n# Run Prolog queries\nfriend(X, Y), hobby(Y, 'coding')","managing-languages#Managing Languages":"Languages in AD4M are pluggable protocols that define how data is stored and shared.\nList installed languages:\nad4m languages all\nGet language details:\nad4m languages by-address \nPublish a new language:\nad4m languages publish ./my-language --name \"My Language\" --description \"A custom language\"","building-communities-with-neighborhoods#Building Communities with Neighborhoods":"Neighborhoods are shared spaces built on perspectives and languages.\nCreate a neighborhood:\nad4m neighbourhoods create \nThis publishes your perspective as a shared space others can join.\nJoin an existing neighborhood:\nad4m neighbourhoods join ","runtime-management#Runtime Management":"Monitor and manage your AD4M node:\nView runtime information:\nad4m runtime info\nManage trusted agents:\n# Add trusted agents\nad4m runtime add-trusted-agents did:key:123...\n# List trusted agents\nad4m runtime trusted-agents\nManage friends:\n# Add friends\nad4m runtime add-friends did:key:123...\n# List friends\nad4m runtime friends\nView logs:\nad4m log","expression-management#Expression Management":"Work with language-specific expressions:\nCreate an expression:\nad4m expression create '{\"key\": \"value\"}'\nRetrieve expressions:\n# Get parsed expression\nad4m expression get \n# Get raw data\nad4m expression get-raw ","advanced-features#Advanced Features":"For development and testing:\n# Generate bootstrap seed\nad4m dev generate-bootstrap \n# Test expression language\nad4m dev publish-and-test-expression-language \nFor a complete list of commands and their options:\nad4m --help\nad4m --help"}},"/developer-guides/mcp":{"title":"MCP Server (AI Agent Integration)","data":{"":"AD4M includes a built-in Model Context Protocol (MCP) server, enabling AI agents to interact with AD4M's spanning layer natively — creating perspectives, managing data models, joining neighbourhoods, and participating in distributed collective intelligence through a standardised protocol.\nWhat is MCP? The Model Context Protocol is an open standard that lets AI applications discover and use tools exposed by external services. Any MCP-compatible client (OpenClaw, Claude Desktop, Cursor, etc.) can connect to AD4M's MCP server.","why-mcp#Why MCP?":"While AD4M's GraphQL API provides full programmatic access, MCP is purpose-built for AI agents:\nTool discovery — agents automatically discover available operations and their parameters\nDynamic tools — SHACL subject classes generate domain-specific tools at runtime (e.g., channel_create, message_set_body)\nNatural descriptions — every tool includes LLM-optimised descriptions with examples\nAuthentication built-in — signup, login, and JWT management through MCP tools themselves","enabling-the-mcp-server#Enabling the MCP Server":"Option 1: AD4M Launcher — Open Settings and enable the \"MCP Server\" toggle. Configure the port (default: 3001). Restart the launcher for changes to take effect.Option 2: CLI — Pass --enable-mcp true when starting the executor:\nad4m-executor run \\\n --app-data-path ~/.ad4m \\\n --admin-credential my-secret \\\n --gql-port 12100 \\\n --enable-mcp true\nThe MCP server starts on port 3001 by default, serving Streamable HTTP at /mcp.","connecting-an-ai-agent#Connecting an AI Agent":"","openclaw#OpenClaw":"Add AD4M as an MCP server in your OpenClaw configuration:\n{\n \"mcpServers\": {\n \"ad4m\": {\n \"url\": \"http://localhost:3001/mcp\"\n }\n }\n}\nOnce connected, your agent can call any AD4M tool directly. An OpenClaw skill is also available with setup guides and reference material.","other-mcp-clients#Other MCP Clients":"Any MCP client supporting Streamable HTTP transport can connect to http://localhost:3001/mcp. Refer to your client's documentation for configuration.","authentication#Authentication":"AD4M's MCP server supports two authentication modes:","single-user-mode-local-development#Single-User Mode (Local Development)":"When running a personal executor, use the admin credential:\n# The same credential passed to --admin-credential when starting the executor\n# Include as Authorization: header in MCP transport config\nFor local development, this is the simplest approach — no signup/login needed.","multi-user-mode#Multi-User Mode":"For shared executors serving multiple users, AD4M provides a full auth flow through MCP tools:\nsignup — Create an account with email and password\nlogin_email — Authenticate and receive a JWT\nverify_email_code — Verify email (if SMTP is configured)\nauth_status — Check current authentication state\n→ signup(email: \"agent@example.com\", password: \"secure-pass\")\n← { did: \"did:key:z6Mk...\", success: true }\n→ login_email(email: \"agent@example.com\", password: \"secure-pass\")\n← { token: \"eyJ...\", success: true }\nAfter login, the JWT is stored in the MCP session and used automatically for all subsequent tool calls. Each user gets their own DID and isolated perspective space.\nUnauthenticated connections can only access auth tools (signup, login, verify, auth_status). All other tools require a valid JWT or admin credential.","available-tools#Available Tools":"Tools are organised by domain. Dynamic tools (generated from SHACL subject classes) appear alongside these core tools.","perspective--link-tools#Perspective & Link Tools":"Tool\tDescription\tperspective_create\tCreate a new perspective (personal knowledge graph)\tperspective_list\tList all perspectives with metadata\tadd_link\tAdd an RDF-like triple to a perspective\tget_links\tQuery links by source, predicate, or target\tremove_link\tRemove a specific link","subject-model-tools#Subject (Model) Tools":"Tool\tDescription\tget_models\tDiscover all SHACL-defined data models in a perspective\tget_subject_data\tGet a subject instance by URI\tcreate_subject\tCreate a new subject instance\tdelete_subject\tDelete a subject instance\tquery_subjects\tQuery subjects by class with optional filters","dynamic-shacl-tools#Dynamic SHACL Tools":"AD4M's MCP server introspects SHACL subject class definitions in perspectives and generates tools dynamically at runtime. This means:\nInstall or define SDNA (SHACL schemas) in a perspective\nMCP server discovers the classes and their properties/collections\nTools appear automatically — no manual registration needed\nAI agents can call get_models to discover available tools\nTool generation rules:\nScalar properties (sh:maxCount 1) → {class}_set_{property} (setter), {class}_get_{property} (getter)\nCollections (sh:maxCount > 1) → {class}_add_{collection} (add item), {class}_remove_{collection} (remove item)\nConstructors → {class}_create (required properties become parameters)\nActions (SHACL Flow) → {class}_{action_name} (state transitions, custom logic)\nExample: A Channel SDNA added via add_model(class_name: \"Channel\", shacl_json: ...):\n{\n \"target_class\": \"app://Channel\",\n \"properties\": [\n {\n \"path\": \"app://has_name\",\n \"name\": \"name\",\n \"datatype\": \"xsd:string\",\n \"min_count\": 1,\n \"max_count\": 1,\n \"writable\": true,\n \"resolve_language\": \"literal\"\n },\n {\n \"path\": \"app://has_description\",\n \"name\": \"description\",\n \"datatype\": \"xsd:string\",\n \"max_count\": 1,\n \"writable\": true,\n \"resolve_language\": \"literal\"\n },\n {\n \"path\": \"app://has_member\",\n \"name\": \"members\",\n \"node_kind\": \"sh:IRI\"\n },\n {\n \"path\": \"app://has_message\",\n \"name\": \"messages\",\n \"node_kind\": \"sh:IRI\"\n }\n ],\n \"constructor\": [\n { \"action\": \"addLink\", \"source\": \"this\", \"predicate\": \"rdf://type\", \"target\": \"app://Channel\" },\n { \"action\": \"setSingleTarget\", \"source\": \"this\", \"predicate\": \"app://has_name\", \"target\": \"name\" }\n ]\n}\nGenerates these MCP tools:\nchannel_create(perspective_id, name, description?) — name is required\nchannel_set_name(perspective_id, uri, value) — update name\nchannel_set_description(perspective_id, uri, value) — update description\nchannel_add_members(perspective_id, uri, value) — add an Agent to members\nchannel_remove_members(perspective_id, uri, value) — remove an Agent\nchannel_add_messages(perspective_id, uri, value) — add a Message\nchannel_remove_messages(perspective_id, uri, value) — remove a Message\nchannel_get(perspective_id, uri) — retrieve full Channel data\nAll tools include LLM-optimized descriptions with examples, data types, and constraints.","neighbourhood-tools#Neighbourhood Tools":"Tool\tDescription\tjoin_neighbourhood\tJoin a neighbourhood by URL\tpublish_neighbourhood\tPublish a perspective as a shared neighbourhood","agent--profile-tools#Agent & Profile Tools":"Tool\tDescription\tagent_me\tGet the current agent's DID and status\tagent_unlock\tUnlock the agent keystore\tget_agent_public_perspective\tRead any agent's public profile\tset_agent_public_perspective\tUpdate your public profile links","waker--subscription-tools#Waker / Subscription Tools":"Tool\tDescription\tsubscribe_to_model\tGenerate a reactive query configuration for monitoring model changes","example-workflow#Example Workflow":"Here's a typical AI agent workflow — discover models, create data, query it back:\n# 1. List perspectives\n→ perspective_list()\n← [{ uuid: \"ab23...\", name: \"My Space\", neighbourhood: null }]\n# 2. Discover available models\n→ get_models(perspective_id: \"ab23...\")\n← [{ name: \"Task\", properties: [\"title\", \"status\", \"assignee\"],\n collections: [\"tags\"] }]\n# 3. Create a task\n→ task_create(perspective_id: \"ab23...\", title: \"Review MCP docs\",\n status: \"open\", assignee: \"did:key:z6Mk...\")\n← { uri: \"ad4m://task_1234\", success: true }\n# 4. Add tags\n→ task_add_tags(perspective_id: \"ab23...\", uri: \"ad4m://task_1234\",\n value: \"documentation\")\n← { success: true }\n# 5. Query all open tasks\n→ query_subjects(perspective_id: \"ab23...\", class_name: \"Task\",\n filter: { status: \"open\" })\n← [{ uri: \"ad4m://task_1234\", title: \"Review MCP docs\", status: \"open\" }]","joining-a-neighbourhood#Joining a Neighbourhood":"AI agents can join shared spaces and participate alongside humans. Neighbourhoods are shared perspectives synced P2P via Holochain — they form the collaborative layer of AD4M's spanning architecture.\n# Join an existing neighbourhood\n→ join_neighbourhood(url: \"neighbourhood://Qm...\")\n← { perspective_id: \"cd45...\", state: \"SYNCED\" }\n# Discover what models (SHACL subject classes) exist in this community\n→ get_models(perspective_id: \"cd45...\")\n← [{ name: \"Message\", properties: [\"body\", \"author\", \"timestamp\"],\n collections: [\"reactions\"] }]\n# Send a message (uses the auto-generated message_create tool)\n→ message_create(perspective_id: \"cd45...\", body: \"Hello from an AI agent! 🖖\")\n← { uri: \"ad4m://msg_5678\", success: true }\nWhat just happened?\nYour agent joined a Holochain-backed shared space\nThe neighbourhood SDNA defined the data schema (Message class)\nMCP tools were generated from the schema automatically\nYour message was validated, signed with your DID, and synced to all members\nOther agents (human and AI) see your message in real-time\nThis is the spanning layer in action — your agent participates in a P2P network using SHACL-structured data, all through simple MCP tool calls.","understanding-the-spanning-layer-through-mcp#Understanding the Spanning Layer Through MCP":"When you use AD4M's MCP tools, you're interacting with multiple layers:","1-agent-layer-identity#1. Agent Layer (Identity)":"agent_me() → your DID (e.g., did:key:z6Mk...)\nEvery action is signed with your keys\nCryptographic provenance on all data","2-perspective-layer-knowledge-graph#2. Perspective Layer (Knowledge Graph)":"perspective_create(), add_link(), get_links()\nYour subjective view of data — links between expressions\nMix data from any protocol/language in one graph","3-language-layer-protocol-abstraction#3. Language Layer (Protocol Abstraction)":"Expressions have addresses like ://
\nLanguages wrap existing systems (HTTP, IPFS, Holochain)\nGlobal addressing scheme — reference any data from anywhere","4-subject-class-layer-structured-data#4. Subject Class Layer (Structured Data)":"SHACL SDNA defines models (Channel, Message, Task, etc.)\nTools auto-generate from schemas\nValidation rules enforced across the network","5-neighbourhood-layer-collaboration#5. Neighbourhood Layer (Collaboration)":"Shared perspectives synced P2P\nSDNA enforced by all members\nReal-time synchronization via Holochain\nThe key insight: You don't need to understand Holochain, SHACL, or RDF to use AD4M. The MCP tools provide a clean abstraction that hides complexity while preserving the power of the spanning layer architecture.","further-reading#Further Reading":"Model Classes — defining SHACL subject classes\nSocial DNA — understanding SDNA and SHACL schemas\nNeighbourhoods — how shared perspectives work\nAuthentication — AD4M's auth system in depth\nAI in AD4M — local AI model inference (complementary to MCP)"}},"/developer-guides/model-classes":{"title":"Model Classes in AD4M","data":{"":"Model classes in AD4M provide a way to define, store, and query structured data in your application. They follow familiar ORM conventions (ActiveRecord-style) and generate SHACL schemas automatically.","quick-start#Quick Start":"There are two ways to create model classes in AD4M:","option-1-using-decorators-recommended#Option 1: Using Decorators (Recommended)":"import { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m';\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\" })\n name: string = \"\";\n @HasMany({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n}\n// Register the model with a perspective (once at app startup)\nawait Recipe.register(perspective);\n// Using the model\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nawait recipe.save();\n// Reading it back\nconst recipes = await Recipe.findAll(perspective);\nconsole.log(recipes[0].name); // \"Chocolate Cake\"\n// Or use the static create shorthand\nconst cake = await Recipe.create(perspective, {\n name: \"Chocolate Cake\",\n ingredients: [\"flour\", \"sugar\", \"cocoa\"]\n});","option-2-from-json-schema-dynamic#Option 2: From JSON Schema (Dynamic)":"Perfect for integrating with external systems or when you have existing JSON Schema definitions:\nimport { Ad4mModel } from '@coasys/ad4m';\n// Define your data structure using JSON Schema\nconst recipeSchema = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Recipe\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"ingredients\": { \n \"type\": \"array\", \n \"items\": { \"type\": \"string\" } \n },\n \"difficulty\": { \"type\": \"number\" }\n },\n \"required\": [\"name\"]\n};\n// Dynamically create the model class\nconst Recipe = Ad4mModel.fromJSONSchema(recipeSchema, {\n name: \"Recipe\",\n namespace: \"recipe://\",\n resolveLanguage: \"literal\"\n});\n// Use exactly like decorator-based models\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nrecipe.ingredients = [\"flour\", \"sugar\", \"cocoa\"];\nrecipe.difficulty = 3;\nawait recipe.save();\nRegister your model before use:\nawait Recipe.register(perspective);\nAlways register your model classes with the perspective before use (typically once at app startup).\nThis installs the SHACL schema so that all consumers (JS, Rust, MCP, CLI) can discover and work with your model's shape.","basic-concepts#Basic Concepts":"","properties#Properties":"Properties are the basic building blocks of your models. They are optional by default — no link is created in the graph until you explicitly set a value.\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n // Optional property (default) — only stored when explicitly set\n @Property({ through: \"recipe://name\" })\n name: string = \"\";\n // Optional property — same behavior\n @Property({ through: \"recipe://description\" })\n description?: string;\n // Required property — a placeholder link is created on save\n @Property({ through: \"recipe://category\", required: true })\n category: string = \"\";\n // Read-only computed property — `through` acts as the SHACL predicate\n // identifier; the actual value comes from the custom `getter` expression.\n @ReadOnly({\n through: \"recipe://rating\",\n getter: `math::mean(->link[WHERE predicate = 'recipe://user_rating'].out.uri)`\n })\n averageRating: number = 0;\n}\n@Property smart defaults: required: false, readOnly: false, resolveLanguage: \"literal\".\nYou only need to specify through in the common case.\nthrough on computed properties: Even when using a custom getter, through is still required — it serves as the SHACL predicate identifier in the generated shape, making the property discoverable by other consumers (MCP, CLI, other apps). No link is written at this predicate; the value is entirely derived from the getter expression.","all-property-options#All property options":"Option\tType\tDefault\tDescription\tthrough\tstring\t(required)\tPredicate URI for the link\trequired\tboolean\tfalse\tIf true, a placeholder link is created on save even if the value is empty\treadOnly\tboolean\tfalse\tPrevents updates after creation\tresolveLanguage\tstring\t\"literal\"\tLanguage used to resolve the stored value. Use \"literal\" for simple values, or a Language address for richer content\tinitial\tany\t—\tDefault value written on creation. When required: true with no initial, the framework uses a sentinel value (\"literal://string:uninitialized\")\tlocal\tboolean\tfalse\tStore locally only — not synced to the network. Useful for user preferences or draft state\tgetter\tstring\t—\tRaw SurrealQL expression for computed values. Base is replaced with the instance's node ID at query time. Mutually exclusive with regular storage\ttransform\t(value: any) => any\t—\tPost-retrieval transformation function, called after the value is hydrated\t\nYou can also use the @Optional decorator as an alias for @Property with required: false (the default), if you want to be explicit:\n@Optional({ through: \"recipe://description\" })\ndescription?: string;","the-getter-option-in-detail#The getter option in detail":"The getter option accepts a raw SurrealQL expression. The framework wraps it as:\nSELECT ({getter}) AS value FROM node WHERE uri = {instanceId}\nUse Base as a placeholder for the current instance's node — it gets replaced at query time:\n@ReadOnly({\n through: \"recipe://rating\",\n getter: `math::mean(Base->link[WHERE predicate = 'recipe://user_rating'].out.uri)`\n})\naverageRating: number = 0;","the-transform-option#The transform option":"Apply a transformation after a value is retrieved from the graph:\n@Property({\n through: \"recipe://tags_raw\",\n transform: (value) => typeof value === 'string' ? value.split(',') : value\n})\ntags: string[] = [];","relations#Relations":"Relations represent associations between models. AD4M provides four relation decorators that make the relationship semantics explicit:\nimport {\n Ad4mModel, Model, Property,\n HasMany, HasOne, BelongsToOne, BelongsToMany\n} from '@coasys/ad4m';\n@Model({ name: \"Comment\" })\nclass Comment extends Ad4mModel {\n @Property({ through: \"comment://body\" })\n body: string = \"\";\n @BelongsToOne(() => Chef, { through: \"comment://chef\" })\n chef: string = \"\";\n}\n@Model({ name: \"Chef\" })\nclass Chef extends Ad4mModel {\n @Property({ through: \"chef://name\" })\n name: string = \"\";\n}\n@Model({ name: \"Image\" })\nclass Image extends Ad4mModel {\n @Property({ through: \"image://url\" })\n url: string = \"\";\n}\n@Model({ name: \"Category\" })\nclass Category extends Ad4mModel {\n @Property({ through: \"category://name\" })\n name: string = \"\";\n}\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({ through: \"recipe://name\" })\n name: string = \"\";\n // One-to-many: this recipe owns many comments\n @HasMany(() => Comment, { through: \"recipe://comment\" })\n comments: string[] = [];\n // One-to-one: this recipe has one featured image\n @HasOne({ through: \"recipe://featured_image\", target: () => Image })\n featuredImage: string = \"\";\n // Many-to-one: this recipe belongs to one chef (read-only reference)\n @BelongsToOne(() => Chef, { through: \"recipe://chef\" })\n chef: string = \"\";\n // Many-to-many: this recipe belongs to many categories (read-only)\n @BelongsToMany(() => Category, { through: \"recipe://category\" })\n categories: string[] = [];\n}\nEach relation decorator supports two calling conventions:\n// Target-first shorthand (recommended)\n@HasMany(() => Comment, { through: \"recipe://comment\" })\n// Options-object style\n@HasMany({ through: \"recipe://comment\", target: () => Comment })","relation-types-at-a-glance#Relation types at a glance":"Decorator\tCardinality\tGenerated methods\tOwnership\t@HasMany\tOne-to-many\tadd*, remove*, set*\tParent owns\t@HasOne\tOne-to-one\tProperty setter\tParent owns\t@BelongsToOne\tMany-to-one\tRead-only\tChild references\t@BelongsToMany\tMany-to-many\tRead-only\tChild references\t\nDefault through: When you omit through on a relation decorator, it defaults to 'ad4m://has_child'.\nThis is the standard AD4M parent-child predicate, so it works well for hierarchical data — but make sure it's intentional.\nRelation decorators also accept a local option (local: true) to store the relation links locally without syncing to the network.","using-relation-methods#Using relation methods":"@HasMany generates typed helper methods on the model instance:\nconst recipe = await Recipe.findOne(perspective, { where: { name: \"Chocolate Cake\" } });\n// Add a comment — accepts a model instance or a string ID\nconst comment = await Comment.create(perspective, { body: \"Delicious!\" });\nawait recipe.addComments(comment); // pass instance\nawait recipe.addComments(comment.id); // or pass ID\n// Remove\nawait recipe.removeComments(comment);\n// Replace all\nawait recipe.setComments([comment1.id, comment2.id]);\n// With batch support\nconst batchId = await perspective.createBatch();\nawait recipe.addComments(comment, batchId);\nawait perspective.commitBatch(batchId);","flags#Flags":"Flags are immutable type markers. They are automatically readOnly and required, and cannot be changed after creation:\n@Flag({ through: \"ad4m://type\", value: \"recipe://main-course\" })\ntype: string = \"\";\nAttempting to update a flag after creation throws an error.","how-it-works-under-the-hood#How It Works Under the Hood":"","graph-based-storage#Graph-Based Storage":"Each model instance is stored as a subgraph in an AD4M perspective. For example, our recipe is stored as:\nrecipe://chocolate-cake-123 -[recipe://name]-> literal://string:\"Chocolate Cake\"\nrecipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://flour\nrecipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://sugar\nEvery node in this graph is a URL pointing to an Expression in some language.","instance-identity#Instance Identity":"Each model instance has a unique id that serves as the root node of its subgraph. You can specify it or let AD4M generate one:\n// Auto-generated ID\nconst recipe = new Recipe(perspective);\n// Custom ID\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake-2024-03\");","literals-for-simple-values#Literals for Simple Values":"AD4M provides Literals for storing simple values without needing a full language:\n// These are equivalent:\nrecipe.name = \"Chocolate Cake\";\n// Stored as: literal://string:Chocolate Cake\nrecipe.cookingTime = 45;\n// Stored as: literal://number:45","social-dna-and-shacl#Social DNA and SHACL":"When you define a model class, AD4M generates a SHACL (Shapes Constraint Language) representation — a W3C standard for describing and validating RDF graph shapes:\n@Model({ name: \"Recipe\" })\nclass Recipe extends Ad4mModel {\n @Property({\n through: \"recipe://name\",\n required: true\n })\n name: string = \"\";\n @HasMany({ through: \"recipe://ingredient\" })\n ingredients: string[] = [];\n}\n@prefix sh: .\n@prefix xsd: .\n@prefix ad4m: .\n a sh:NodeShape ;\n sh:targetClass ;\n sh:property [\n sh:path ;\n sh:datatype xsd:string ;\n sh:maxCount 1 ; # Scalar property\n sh:minCount 1 ; # Required\n ad4m:resolveLanguage \"literal\" ;\n ] ;\n sh:property [\n sh:path ;\n sh:datatype xsd:string ;\n # No maxCount = relation (multiple values)\n ] .\nThe SHACL shape is stored as links in the perspective graph, making it discoverable and queryable by any agent or tool that joins the perspective.","how-shacl-maps-to-ad4m#How SHACL Maps to AD4M":"SHACL Concept\tAD4M Equivalent\tsh:NodeShape\tSubject Class definition\tsh:PropertyShape\tProperty or Relation definition\tsh:maxCount 1\tScalar property (single value, generates set_ tool)\tNo sh:maxCount or > 1\tRelation (generates add_/remove_ tools)\tsh:minCount 1\tRequired property (must exist on creation — when required: true is used without an explicit initial, the @Property decorator auto-supplies a \"literal://string:uninitialized\" placeholder)\tsh:datatype\tValue type constraint\tsh:class\tReference to another Subject Class (target model shape)\tsh:node\tParent shape reference (model inheritance)\tad4m://initial\tDefault value on instance creation\tad4m://resolveLanguage\tExpression language for value resolution\tad4m://readOnly\tRead-only computed property\tad4m://getter\tSurrealQL getter for conformance filtering\tad4m://conformanceConditions\tStructured filter conditions for relation targets\t\nAD4M extends standard SHACL with ad4m:// predicates for features specific to the AD4M runtime (initial values, language resolution, write permissions).","working-with-models#Working with Models":"","creating#Creating":"// Option 1: Instantiate and save\nconst recipe = new Recipe(perspective);\nrecipe.name = \"Chocolate Cake\";\nawait recipe.save();\n// Option 2: Static create (one-step)\nconst recipe = await Recipe.create(perspective, { name: \"Chocolate Cake\" });\n// Create with a specific ID\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake\");\nawait recipe.save();\n// Create with a parent relationship\nconst recipe = await Recipe.create(perspective, { name: \"Cake\" }, {\n parent: { model: Cookbook, id: cookbook.id }\n});","reading#Reading":"// Get by ID\nconst recipe = new Recipe(perspective, existingId);\nawait recipe.get();\n// Get with eager-loaded relations\nawait recipe.get({ include: { comments: true } });\n// Get with sparse fieldset (only hydrate specific properties)\nawait recipe.get({ properties: [\"name\", \"category\"] });","updating#Updating":"save() handles both creation and updates automatically. For existing instances (fetched via get() or a query), it only writes changed fields thanks to built-in dirty tracking:\nconst recipe = await Recipe.findOne(perspective, {\n where: { name: \"Chocolate Cake\" }\n});\nrecipe.name = \"Dark Chocolate Cake\";\nawait recipe.save(); // Only the name field is updated\n// Static update shorthand\nawait Recipe.update(perspective, recipe.id, { name: \"White Chocolate Cake\" });","deleting#Deleting":"// Instance method\nawait recipe.delete();\n// Static method\nawait Recipe.delete(perspective, recipeId);\nThe instance delete() also cleans up incoming links (e.g. a parent's hasMany reference to this instance).","dirty-tracking#Dirty Tracking":"After fetching an instance, AD4M takes a snapshot of all field values. You can inspect what changed:\nconst recipe = await Recipe.findOne(perspective);\nrecipe.name = \"Updated Name\";\nrecipe.isDirty(); // true\nrecipe.changedFields(); // [\"name\"]\nawait recipe.save(); // Only \"name\" is written","instance-identity-1#Instance Identity":"Every model instance has a unique id (a URI string):\nconst recipe = await Recipe.create(perspective, { name: \"Cake\" });\nconsole.log(recipe.id); // \"literal://...\"\n// Auto-generated when not specified\nconst recipe2 = new Recipe(perspective);\nconsole.log(recipe2.id); // random literal URI\n// Custom ID\nconst recipe3 = new Recipe(perspective, \"recipe://my-cake\");\nconsole.log(recipe3.id); // \"recipe://my-cake\"\nThe legacy .baseExpression getter still works but is deprecated. Use .id instead.","built-in-instance-properties#Built-in Instance Properties":"Every model instance automatically gets these properties, populated from link metadata:\nProperty\tType\tDescription\t.id\tstring\tUnique URI identifier\t.author\tstring\tDID of the agent who created the earliest link (e.g. \"did:key:z6Mk...\")\t.createdAt\tstring | number\tTimestamp of the earliest link (epoch ms or ISO string)\t.updatedAt\tstring | number\tTimestamp of the most recent link\t.timestamp\t(deprecated)\tAlias for .createdAt — use .createdAt instead\t\nThese are available after any fetch operation (get(), findAll(), findOne(), etc.) and can be used in queries:\n// Order by creation date\nconst recent = await Recipe.query(perspective)\n .order({ createdAt: \"DESC\" })\n .limit(10)\n .get();\nconsole.log(recent[0].author); // \"did:key:z6Mk...\"\nconsole.log(recent[0].createdAt); // 1709049600000\nconsole.log(recent[0].updatedAt); // 1709136000000","querying#Querying":"","basic-queries#Basic Queries":"// Get all (uses SurrealDB by default — 10-100x faster than Prolog)\nconst allRecipes = await Recipe.findAll(perspective);\n// With conditions\nconst cakes = await Recipe.findAll(perspective, { where: { category: \"Dessert\" } });\n// Find one\nconst recipe = await Recipe.findOne(perspective, { where: { name: \"Chocolate Cake\" } });\n// Count\nconst { results, totalCount } = await Recipe.findAllAndCount(perspective, {\n where: { category: \"Dessert\" }\n});\n// Pagination\nconst page = await Recipe.paginate(perspective, 10, 1, { where: { category: \"Dessert\" } });","query-builder#Query Builder":"The fluent query builder provides a chainable interface:\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"MainCourse\", rating: { gt: 4 } })\n .order({ createdAt: \"DESC\" })\n .limit(5)\n .get();\n// Get first match\nconst topRecipe = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .order({ rating: \"DESC\" })\n .first(); // Returns Recipe | null","where-operators#Where Operators":"const recipes = await Recipe.findAll(perspective, {\n where: {\n name: \"Exact Match\", // Equality\n rating: { gt: 4 }, // Greater than\n difficulty: { lte: 3 }, // Less than or equal\n servings: { between: [2, 6] }, // Range\n category: [\"Dessert\", \"Snack\"], // IN (array membership)\n status: { not: \"archived\" }, // Not equal\n tags: { contains: \"vegan\" }, // Contains\n }\n});","eager-loading-with-include#Eager Loading with include":"By default, relation fields contain raw URI strings. Use include to hydrate them into full model instances:\n// Eager-load comments on query results\nconst recipes = await Recipe.query(perspective)\n .where({ category: \"Dessert\" })\n .include({ comments: true })\n .get();\n// recipes[0].comments is now Comment[] instead of string[]\nconsole.log(recipes[0].comments[0].body); // \"Delicious!\"\n// Nested includes\nconst recipes = await Recipe.query(perspective)\n .include({ \n comments: { \n include: { chef: true } // Load comment chefs too\n } \n })\n .get();\n// Also works on findAll / findOne\nconst recipe = await Recipe.findOne(perspective, {\n where: { name: \"Cake\" },\n include: { comments: true }\n});\n// And on instance get()\nconst recipe = new Recipe(perspective, existingId);\nawait recipe.get({ include: { comments: true } });\n// Shorthand:\nawait recipe.get({ comments: true });","filtering-and-sorting-eager-loaded-relations#Filtering and sorting eager-loaded relations":"Instead of true, pass a sub-query object to filter, sort, or paginate the eager-loaded relation:\n// Only load the 5 most recent comments\nconst recipes = await Recipe.query(perspective)\n .include({\n comments: {\n where: { status: \"approved\" },\n order: { createdAt: \"DESC\" },\n limit: 5\n }\n })\n .get();\n// Combine with nested includes\nconst recipes = await Recipe.query(perspective)\n .include({\n comments: {\n order: { createdAt: \"DESC\" },\n limit: 10,\n include: { chef: true } // Also hydrate each comment's chef\n }\n })\n .get();\nThe sub-query accepts: where, order, limit, offset, include, and properties.","sparse-fieldsets-with-properties#Sparse Fieldsets with properties":"Only hydrate specific properties to avoid unnecessary work (especially useful for properties with non-literal resolveLanguage that trigger network calls):\nconst recipes = await Recipe.query(perspective)\n .properties([\"name\", \"category\"])\n .get();\n// Only name and category are hydrated; other fields stay at defaults","parent-scoped-queries#Parent-Scoped Queries":"Query instances that are linked from a specific parent:\n// From a model instance\nconst comments = await Comment.query(perspective)\n .parent(recipe)\n .get();\n// From an ID + model class (predicate auto-resolved from metadata)\nconst comments = await Comment.query(perspective)\n .parent(recipeId, Recipe)\n .get();\n// Raw predicate escape hatch\nconst comments = await Comment.query(perspective)\n .parent(recipeId, \"recipe://comment\")\n .get();","surrealdb-vs-prolog#SurrealDB vs Prolog":"Ad4mModel uses SurrealDB by default for all query operations, providing 10-100x faster performance compared to the legacy Prolog engine.\n// Uses SurrealDB by default (fast!)\nconst recipes = await Recipe.findAll(perspective, { where: { rating: { gt: 4 } } });\n// Explicitly use Prolog if needed (for backward compatibility)\nconst recipesProlog = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false\n// Or on the query builder\nconst recipesProlog = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .useSurrealDB(false)\n .get();\nFor advanced graph traversal queries and direct SurrealQL access, see the SurrealDB Queries Guide.","real-time-subscriptions#Real-time Subscriptions":"Subscribe to changes in your data:\nconst builder = Recipe.query(perspective)\n .where({ status: \"cooking\" });\n// Subscribe — callback fires immediately with initial results,\n// then again whenever matching data changes\nconst initialRecipes = await builder.subscribe(recipes => {\n console.log(\"Currently cooking:\", recipes);\n});\n// Count subscription\nconst initialCount = await builder.countSubscribe(count => {\n console.log(\"Number cooking:\", count);\n});\n// Paginated subscription\nconst initialPage = await builder.paginateSubscribe(10, 1, page => {\n console.log(\"Page 1:\", page.results);\n});\n// Important: Clean up when done\nbuilder.dispose();\nAlways call dispose() when you're done with a subscription to prevent memory leaks.","transactions#Transactions":"Group multiple operations into an atomic batch:\nawait Ad4mModel.transaction(perspective, async (tx) => {\n const recipe = await Recipe.create(perspective, { name: \"Cake\" }, {\n batchId: tx.batchId\n });\n const comment = new Comment(perspective);\n comment.body = \"Looks great!\";\n await comment.save(tx.batchId);\n await recipe.addComments(comment, tx.batchId);\n});\n// All operations commit together, or none do if an error is thrown\nFor lower-level batch control, see the Batch Operations Guide.","static-convenience-methods#Static Convenience Methods":"Method\tSignature\tDescription\tcreate\tcreate(perspective, data?, options?)\tCreate and save in one step. options supports parent and batchId\tupdate\tupdate(perspective, id, data)\tFetch by ID, merge data, save\tdelete\tdelete(perspective, id)\tDelete by ID with incoming link cleanup\tremove\tremove(perspective, id)\tDeprecated — alias for delete\tfindAll\tfindAll(perspective, query?, useSurrealDB?)\tQuery all matching instances\tfindOne\tfindOne(perspective, query?, useSurrealDB?)\tFirst matching instance or null\tfindAllAndCount\tfindAllAndCount(perspective, query?, useSurrealDB?)\tResults + total count\tpaginate\tpaginate(perspective, pageSize, page, query?, useSurrealDB?)\tPaginated results\tregister\tregister(perspective)\tInstall the SHACL schema in the perspective\ttransaction\ttransaction(perspective, fn)\tAtomic batch operation\tquery\tquery(perspective)\tReturns a ModelQueryBuilder\tgetModelMetadata\tgetModelMetadata()\tIntrospect property & relation metadata\tgenerateSDNA\tgenerateSDNA()\tReturns the generated Prolog SDNA rules (injected by @Model)\tgenerateSHACL\tgenerateSHACL()\tReturns the generated SHACL shape graph (injected by @Model)","introspection#Introspection":"Use getModelMetadata() to inspect a model's structure at runtime — useful for tooling, debugging, or dynamic UIs:\nconst meta = Recipe.getModelMetadata();\nconsole.log(meta.name); // \"Recipe\"\nconsole.log(meta.properties); // [{ name: \"name\", predicate: \"recipe://name\", ... }, ...]\nconsole.log(meta.relations); // [{ name: \"comments\", predicate: \"recipe://comment\", ... }, ...]\ngenerateSDNA() and generateSHACL() return the raw Prolog rules and SHACL shape respectively — primarily useful for debugging schema registration issues.","relation-filtering#Relation Filtering":"When a relation has a target model, AD4M can auto-generate a conformance filter that only returns linked instances matching the target model's shape (checking flags and required properties):\n@Model({ name: \"MainCourse\" })\nclass MainCourse extends Ad4mModel {\n @Flag({ through: \"ad4m://type\", value: \"recipe://main-course\" })\n type: string = \"\";\n @Property({ through: \"recipe://name\", required: true })\n name: string = \"\";\n}\n@Model({ name: \"Cookbook\" })\nclass Cookbook extends Ad4mModel {\n // Auto-filters: only returns linked items that match the MainCourse shape\n @HasMany(() => MainCourse, { through: \"cookbook://recipe\" })\n mainCourses: string[] = [];\n}","where-on-relations#where on Relations":"Add value-based filtering using the same where syntax as queries:\n@Model({ name: \"TaskBoard\" })\nclass TaskBoard extends Ad4mModel {\n // Only return tasks where status is \"active\"\n @HasMany(() => Task, { through: \"board://task\", where: { status: \"active\" } })\n activeTasks: string[] = [];\n}","filtering-options#Filtering options":"Option\tEffect\ttarget: () => Model\tAuto-generates conformance filter from model shape\twhere: { ... }\tValue-based filtering using query DSL\tfilter: false\tOpt out of auto-filtering even when target is set\tgetter: \"...\"\tRaw SurrealQL getter (escape hatch, mutually exclusive with target/through)","model-inheritance#Model Inheritance":"Models can extend other models. The child's SHACL shape references the parent via sh:node, ensuring inherited constraints are validated:\n@Model({ name: \"BaseRecipe\" })\nclass BaseRecipe extends Ad4mModel {\n @Property({ through: \"recipe://name\" })\n name: string = \"\";\n}\n@Model({ name: \"DetailedRecipe\" })\nclass DetailedRecipe extends BaseRecipe {\n @Property({ through: \"recipe://instructions\" })\n instructions: string = \"\";\n}\n// DetailedRecipe inherits the \"name\" property from BaseRecipe\nconst recipe = await DetailedRecipe.create(perspective, {\n name: \"Cake\",\n instructions: \"Mix and bake\"\n});","dynamic-models-from-json-schema#Dynamic Models from JSON Schema":"The fromJSONSchema() method dynamically creates AD4M model classes from JSON Schema definitions. This is perfect for integrating with external systems, runtime model generation, partner app integration (like Holons), and rapid prototyping.","basic-usage#Basic Usage":"import { Ad4mModel } from '@coasys/ad4m';\nconst schema = {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"BlogPost\",\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"tags\": { \n \"type\": \"array\", \n \"items\": { \"type\": \"string\" } \n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"author\": { \"type\": \"string\" },\n \"publishedAt\": { \"type\": \"string\" }\n }\n }\n },\n \"required\": [\"title\"]\n};\nconst BlogPost = Ad4mModel.fromJSONSchema(schema, {\n name: \"BlogPost\",\n namespace: \"blog://\",\n resolveLanguage: \"literal\"\n});\n// Use like any other Ad4mModel\nconst post = new BlogPost(perspective);\npost.title = \"My First Post\";\npost.tags = [\"ad4m\", \"tutorial\"];\npost.metadata = { author: \"Alice\", publishedAt: \"2025-09-23\" };\nawait post.save();","configuration-options#Configuration Options":"The second parameter to fromJSONSchema() is optional:\ninterface JSONSchemaToModelOptions {\n // Model configuration\n name?: string; // Class name override (falls back to x-ad4m.className → schema.title → schema.$id)\n namespace?: string; // Base namespace for predicates (falls back to x-ad4m.namespace → schema.title → schema.$id)\n // Predicate generation helpers (in order of precedence)\n propertyMapping?: Record; // Direct propertyName → predicate URI mapping\n predicateTemplate?: string; // Template: ${scheme}, ${namespace}/${ns}, ${title}, ${property}\n predicateGenerator?: (title: string, property: string) => string; // Custom callback\n // Global property settings\n resolveLanguage?: string; // Default language for all properties\n local?: boolean; // Whether properties are stored locally\n // Property-specific overrides (accepts any PropertyOptions fields)\n propertyOptions?: Record>;\n}","resolution-cascades#Resolution Cascades":"The class name, namespace, and per-property predicate are each resolved with a cascading priority:\nSetting\tPriority 1 (highest)\tPriority 2\tPriority 3\tPriority 4\tClass name\toptions.name\tx-ad4m.className\tschema.title\tschema.$id\tNamespace\toptions.namespace\tx-ad4m.namespace\tschema.title\tschema.$id\tPredicate\tpropertyMapping[name]\tx-ad4m.through\tpredicateTemplate\tpredicateGenerator → default ${namespace}/${property}\t\nFor example, to control predicate URIs directly:\nconst Product = Ad4mModel.fromJSONSchema(schema, {\n name: \"Product\",\n namespace: \"product://\",\n // Direct mapping: property name → predicate URI\n propertyMapping: {\n name: \"product://title\",\n price: \"product://cost\"\n },\n // Or use a template (lower priority than propertyMapping)\n // predicateTemplate: \"${namespace}/${property}\"\n});","x-ad4m-schema-extensions#x-ad4m Schema Extensions":"Add AD4M-specific metadata directly to your JSON Schema:\nconst schema = {\n \"title\": \"User\",\n \"x-ad4m\": {\n \"namespace\": \"user://\",\n \"resolveLanguage\": \"literal\"\n },\n \"properties\": {\n \"email\": { \n \"type\": \"string\",\n \"x-ad4m\": { \"through\": \"user://email_address\", \"local\": true }\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"x-ad4m\": { \"through\": \"user://interests\" }\n }\n },\n \"required\": [\"email\"]\n};","schema-type-mapping#Schema Type Mapping":"JSON Schema type\tAD4M treatment\tstring, number, boolean\tScalar @Property\tobject\tStored as JSON literal (limited semantic querying)\tarray\tRelation (@HasMany-style), with add*/remove* methods\t\nArrays automatically get relation helper methods:\nconst post = new BlogPost(perspective);\npost.tags = [\"ad4m\", \"tutorial\"];\nawait post.save();\n// Relation methods generated from the property name\npost.addTags(\"blockchain\");\npost.removeTags(\"tutorial\");","type-safety#Type Safety":"Since properties are added dynamically, TypeScript won't know about them at compile time. Use type assertions:\nconst BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & {\n new(perspective: PerspectiveProxy): Ad4mModel & {\n title: string;\n tags: string[];\n metadata: { author: string; publishedAt: string };\n }\n};","limitations#Limitations":"No author property: Conflicts with the built-in AD4M author field\nRequired properties: At least one property must be required or have an initial value\nComplex objects: Nested objects are stored as JSON literals, limiting semantic querying\nPerformance: For better querying, consider flattening complex objects into separate properties","best-practices#Best Practices":"Use Meaningful Predicates: Structure your predicate URIs logically:\nthrough: \"recipe://name\" // Good\nthrough: \"myapp://x\" // Bad\nType Safety: Always define proper TypeScript types:\n@Property({ through: \"recipe://servings\" })\nservings: number = 0; // Good\n@Property({ through: \"recipe://servings\" })\nservings: any; // Bad\nRelation Filtering: Use typed target to auto-filter relations:\n@HasMany(() => Review, { through: \"recipe://review\" })\nreviews: string[] = [];\nQuery Optimization: Use specific queries instead of filtering in memory, and leverage SurrealDB's performance:\n// Good - Let SurrealDB do the filtering (fast)\nconst topRated = await Recipe.query(perspective)\n .where({ rating: { gt: 4 } })\n .get();\n// Bad - Fetching all and filtering in memory (slow)\nconst all = await Recipe.findAll(perspective);\nconst topRated = all.filter(r => r.rating > 4);\nUse SurrealDB by Default: SurrealDB is 10-100x faster than Prolog for most queries:\n// Good - Uses SurrealDB by default\nconst recipes = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n});\n// Only use Prolog if you need backward compatibility\nconst recipesProlog = await Recipe.findAll(perspective, {\n where: { rating: { gt: 4 } }\n}, false); // useSurrealDB = false\nSubscriptions: Clean up subscriptions when they're no longer needed:\nconst builder = Recipe.query(perspective)\n .where({ status: \"active\" });\n \nawait builder.subscribe(recipes => {\n // Handle updates\n});\n// Later...\nbuilder.dispose();\nUse Literals Appropriately:\n// Good - Using literals for simple values (default resolveLanguage)\n@Property({ through: \"recipe://name\" })\nname: string = \"\";\n// Good - Using specific language for rich content\n@Property({\n through: \"recipe://instructions\",\n resolveLanguage: \"markdown\"\n})\ninstructions: string = \"\";\nMeaningful IDs:\n// Good - Descriptive ID\nconst recipe = new Recipe(perspective, \"recipe://chocolate-cake-2024-03\");\n// Fine - Auto-generated ID (most common)\nconst recipe = new Recipe(perspective);","error-handling#Error Handling":"Always handle potential errors when working with models:\ntry {\n const recipe = new Recipe(perspective);\n recipe.name = \"Failed Recipe\";\n await recipe.save();\n} catch (error) {\n console.error(\"Failed to save recipe:\", error);\n // Handle error appropriately\n}"}},"/":{"title":"Introduction","data":{"":"The internet has evolved from a platform for creating and sharing simple documents to highly social digital experiences,\nand now to an era dominated by centralized artificial intelligence systems. Yet, no social infrastructure is woven into its core.\nWithout a universal social protocol, companies have erected siloed networks, harvesting and profiting from user content—a problem\nintensified by centralized AI, which concentrates power and insight extraction, deepening data monopolies and eroding agency.AD4M (Agent-centric Distributed Application Meta-ontology) counters this by centering agents-primarily human users with\nDecentralized Identifiers (DIDs), though extensible to synthetic entities-and their social contexts in digital communication.Built on Holochain, AD4M forms an agent-centric spanning layer on top of the internet, harmonizing fragmented ecosystems into a distributed\nCollective Intelligence network. This deep implementation empowers agents to choose which Language they speak-bridging currently\ncompeting P2P, federated, and centralized approaches in synergy, whether it's a P2P protocol, a federated API, or HTTP itself.If you're versed in Holochain's distributed design and the semantic web's linked data paradigm (e.g., RDF, Solid), AD4M blends\nthe best of both, crafting an agent-centric semantic web where social relationships fuel a decentralized alternative to centralized\nAI dominance, aligned with the real human networks of its users through graph-based data and a global addressing scheme.","what-is-ad4m-practically#What is AD4M practically?":"AD4M, as an agent-centric spanning layer married with an app development framework,\nredefines how decentralized applications connect users, data, and ecosystems. Unlike traditional back-ends tied to centralized servers,\nAD4M runs as a distinct instance for every user-think of it as a personal, local runtime environment. Each instance, built on Holochain,\nholds the user's cryptographic keys (via their DID), stores their data in Perspectives (subjective RDF-based knowledge graphs),\nand executes code that interfaces with Languages-protocol-like abstractions that attach to existing systems, from HTTP to IPFS to custom P2P\nprotocols. This instance serves as the back-end that UIs and apps connect to, providing a unified, interoperable gateway to the user's digital world.At its core, AD4M inverts the typical app-centric model. Instead of apps owning your data and social graph, your AD4M instance owns them,\nrunning on your device (or a trusted host) and exposing a GraphQL API and an MCP server, for apps and AI agents alike to query and interact with.\nFor example, a chat app might connect to localhost:4000/graphql to fetch messages stored in a Perspective, addressed via a Language like\nQmXyz123://message789. This local runtime attaches to existing Languages-say, http for web content or solid for semantic triples-executing\ntheir logic to read or write Expressions (data objects). Developers don't rewrite the web; they extend it, with AD4M harmonizing these connections\ninto a single, agent-owned layer.\nAgent Autonomy: Each instance is sovereign, controlled by the user's DID (e.g., did:key:z6Mk...). It signs every action-links in Perspectives, joins to Neighbourhoods-ensuring data integrity and ownership without intermediaries.\nInteroperability Through Expressions and Perspectives:\nAD4M achieves seamless integration across ecosystems via two pillars: Expressions and Perspectives. Languages produce objective Expressions-data objects with global addresses like ://
(e.g., ), readable by any AD4M-connected app. Meanwhile, Perspectives are subjective knowledge graphs, built from RDF triples (e.g., ), representing an agent's unique view. Together, they enable portability and connection: an Expression can be linked across Perspectives, and a Perspective can pull in data from multiple Languages, bridging web, semantic web, and P2P systems effortlessly.\nRule-Based Distributed Consistency:\nUsing Holochain for its core backbone, each instance doesn't just store data-it enforces consistency through Language-defined rules and Social DNA (declarative schemas using SHACL). For example, a Neighbourhood can define subject classes that constrain what data looks like and how agents interact. This distributed validation ensures data aligns across the network without a central authority, giving developers a reliable, self-regulating foundation.\nPractically, this means every developer's user runs their own AD4M node. Install it, configure it (e.g., via a RuntimeConfig JSON), and it spins up a process holding their private keys, syncing their Perspectives, and running Language code-like a lightweight, personal cloud. A UI might then query:\n// Initialize the client\nconst ad4mClient = new Ad4mClient(\"ws://localhost:4000\", false);\n// Get the current agent\nconst agent = await ad4mClient.agent.me();\nconsole.log(agent.did); // did:key:z6Mk...\n// Create and work with a perspective\nconst perspective = await ad4mClient.perspective.add(\"MyPerspective\");\nconst link = await perspective.add(new Link({\n source: \"test://source\",\n predicate: \"test://predicate\",\n target: \"test://target\"\n}));\n// Query links\nconst links = await perspective.get({} as LinkQuery);\nconsole.log(links); // [{source: \"test://source\", predicate: \"test://predicate\", target: \"test://target\"}]\nThis spanning layer doesn't replace the internet-it augments it, giving agents control over their data and connections while enabling apps to tap into a distributed, interoperable network. AD4M is the engine behind a user's digital agency, the glue for ecosystem synergy, and the foundation for Collective Intelligence-all in one local instance.","ad4m-languages#AD4M Languages":"","protocols-with-a-global-addressing-scheme#Protocols with a Global Addressing Scheme":"At the heart of AD4M are Languages, which are more than just data formats-they're protocol-like abstractions that define how agents express,\nstore, and share data across ecosystems. Conceptually akin to protocols like HTTP or IPFS, each Language encapsulates the capacity of (AD4M-) agents\n(read: nodes/users) to spawn Expressions-that is: data-objects with cryptographic provenance- messages, posts, you name it.\nHow the Language implementation actually stores and shares these Expressions is up to the Language implementor.The key point here is to introduce a global addressing scheme, extending the familiar URI model.\nEvery Language is identified by a unique code hash (a cryptographic hash of its implementation), which becomes the scheme in a URL-like address:\n://. This mirrors the method resolution in Decentralized Identifiers (DIDs) but applies it to data\nobjects (Expressions) across the network.For example:\nA social context Language might have a hash like QmXyz123..., so an Expression could be addressed as QmXyz123://agent123/post456.HTTP, as a particular Language (read protocol), maps to http://example.com/resource, making AD4M backwards compatible with the web.Languages are implemented as JavaScript modules, that will be run in AD4M's integrated JavaScript runtime (an integrated build of Deno).\nThis scheme ensures that any Expression-whether a tweet, a post, a semantic triple, or a custom data object-is globally referenceable across Languages (protocols).\nDevelopers can thus integrate existing systems into the AD4M spanning layer by writing a Language that wraps and interfaces with given system (e.g. a database, blockchain, Holochain app...).","foundational-bootstrap-languages#Foundational Bootstrap Languages":"Out of the gate, AD4M relies on bootstrap Languages-pre-installed essentials like the agent, perspective, & language languages.\nThese provide the core grammar for identity (did:key:z6Mk...), knowledge graphs / perspectives (perspective://2f168edc-...)\nand their collaboratively shared pendandts, Neighbourhoods, (neighbourhood://2345d23...), and then languages themselves (lang://Qm3dgfw23...)\nThey standardize interactions across every AD4M instance, around the core ontology of AD4M itself.For instance:\nconst ad4mClient = await getAd4mClient(\"ws://localhost:4000\");\nconst agentExpression = await ad4mClient.expression.get(\"did:key:z6Mk...\");\nconsole.log(agentExpression.data); // { did: \"did:key:z6Mk...\" }\nresolves a DID to the Agent Expression, which contains some information about the referenced AD4M agent (read: user).Bootstrap Languages make AD4M a functional spanning layer from the start, an evolvable bare-bones social network that enables\nits users to spawn their own ontologies and spaces into this meta-space.","evolvability-through-the-language-language#Evolvability through the Language-Language":"The true genius of AD4M's Language system lies in its evolvability, driven by the language-language-a meta-Language through which new Languages are defined, published, and shared across the network.\nThis bootstrap Language acts as a registry and distribution mechanism: developers create a custom Language (e.g., my-social-app), its code is hashed (e.g., QmCustom321),\nand it's published as an Expression at language://QmCustom321. Other agents can then fetch and install it:\n// Publish a new language\nconst languageMeta = {\n name: \"my-social-app\",\n description: \"A custom social app language\"\n};\nconst published = await ad4mClient.languages.publish(\"./build/bundle.js\", languageMeta);\nconsole.log(published.address); // QmCustom321\n// Get all installed languages\nconst languages = await ad4mClient.languages.all();\nconsole.log(languages); // Includes the newly published language\nThis Language installation process happens automatically when AD4M tries to resolve an Expression of a new Language.\nWith the hash of the Language code being part of the Expression URL, AD4M will try to retrieve the Language throug the Language of Languages.\nSince every Expression contains its crytographic provenance, AD4M has a natural built-in way to apply code-signing and verification-only Languages of trusted agents\nwill be installed automatically.This makes the AD4M spanning layer a living, adaptive system. The language-language ensures that as new protocols or needs emerge-say, a federated messaging standard or a novel AI integration-agents can adopt them without centralized gatekeepers or hard forks.\nIt's the most critical aspect of Languages: not just connecting existing ecosystems, but enabling the entire framework to evolve with its users.\nA developer might extend AD4M with:\ninterface CustomLanguage {\n hash: \"QmCustom321\";\n name: \"my-social-app\";\n expressionTypes: {\n create: (content: { text: string }) => {\n /* handle any transformation required here, save the data, and return its address */\n return \"QmCustom321://post789\";\n },\n get: (address: string) => {\n /* fetch the data here, handle any transformation required, and return it to the UI */\n return { text: string };\n };\n };\n}\nBy rooting adaptability in the language-language, AD4M ensures its spanning layer isn't static-it grows, driven by the collective innovation of its agents, making it a future-proof foundation for Collective Intelligence.","perspectives-and-neighbourhoods#Perspectives and Neighbourhoods":"The local AD4M node stores, manages and provides access to an arbitrary number of Perspectives-subjective knowledge graphs of RDF triples.\nEach Perspective is similar to a Solid Pod, in that it's a (private) collection of semantic associations.\nThe main difference to semantic-web-style graphs is that each triple (called a Link in AD4M) is an Expression and thus has a cryptographic provenance.\nThese triples, like , store data such as .Agents share these local graph databases in a collaborative way with other AD4M agents via Neighbourhoods, app-independent social contexts that act as shared,\ncollaboratively edited graphs. Built on the same linked data principles as the semantic web or Solid, Neighbourhoods enable portability:\na community's social structure-its links and relationships-can move seamlessly across apps. For instance:\nconst perspective = await ad4mClient.perspective.add(\"MyCommunity\");\n// Add a link to the perspective\nawait perspective.add(new Link({\n source: \"agent123\",\n predicate: \"memberOf\",\n target: \"neighbourhood://QmAbc789\"\n}));\n// Query links\nconst links = await perspective.get({} as LinkQuery);\nconsole.log(links);\n// [{source: \"agent123\", predicate: \"memberOf\", target: \"neighbourhood://QmAbc789\"}]\nThis focus on agent-to-agent relationships, not app boundaries, drives AD4M's interoperability, making social networks the foundation of its architecture.","social-dna#Social DNA":"In a decentralized network awash with data, the leap from raw information to collective wisdom hinges on more than just connectivity-it requires a way to encode how agents\nand their communities process, filter, and reason over that data. Social DNA is AD4M's answer: a conceptual parallel to biological DNA, it defines the rules,\nbehaviors, and logic that transform static Perspectives and Neighbourhoods into dynamic, intelligent Social Organisms. For developers, Social DNA is the key to\ncrafting app-specific intelligence-whether it's validating data, enforcing roles, or aggregating insights-all while keeping control distributed among agents.\nIt's the engine driving AD4M's vision of a Collective Intelligence network, turning linked data into actionable, shared understanding.","query-engines-surrealdb--prolog#Query Engines: SurrealDB & Prolog":"AD4M provides two powerful query engines for working with graph data in Perspectives:","surrealdb-high-performance-queries-recommended#SurrealDB: High-Performance Queries (Recommended)":"AD4M now includes SurrealDB, a modern database that provides 10-100x faster performance than Prolog for most queries. SurrealDB uses SQL-like syntax (SurrealQL) and excels at:\nFast graph traversal using indexed in.uri and out.uri fields\nAggregations and analytics\nComplex filtering and sorting\nLarge dataset handling\n// Fast graph query - find who Alice follows\nconst follows = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'\"\n);\n// Find posts by Alice\nconst posts = await perspective.querySurrealDB(\n \"SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'\"\n);\nPerformance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they're very slow.Important: Ad4mModel (described below) now uses SurrealDB by default for all operations, providing dramatic performance improvements with no code changes required.For detailed examples and graph traversal patterns, see the SurrealDB Queries Guide.","prolog-logic-programming-legacy#Prolog: Logic Programming (Legacy)":"For backward compatibility and advanced logic programming, AD4M also includes Prolog, optimized for reasoning over relational data like the RDF triples in Perspectives.\nProlog's declarative nature lets developers write rules as predicates:\n% Check if an agent is a member\nmember(Agent, Neighbourhood) :-\n link(Agent, \"memberOf\", Neighbourhood).\n% Validate a post by a member\nmemberPost(Post, Agent, Neighbourhood) :-\n link(Agent, \"posted\", Post),\n member(Agent, Neighbourhood).\n% Query all member posts\n?- memberPost(Post, Agent, \"neighbourhood://QmGroup789\").\nThis could be queried via the AD4M client:\nconst posts = await perspective.infer(\n \"memberPost(Post, Agent, 'neighbourhood://QmGroup789')\"\n);\nconsole.log(posts); // [{Post: \"QmXyz123://post456\", Agent: \"did:key:z6Mk...\"}, ...]\nWhile these raw query engines are powerful, AD4M simplifies development with a higher-level abstraction.","ad4mmodel#Ad4mModel":"For app developers, writing queries directly is optional-AD4M's Ad4mModel class and its decorators handle the heavy lifting.\nThis TypeScript base class lets you define model classes with properties and relationships, automatically using SurrealDB under the hood for\nfast query performance (10-100x faster than Prolog). Here's how you define a model:\nimport { Ad4mModel, Model, Property, HasMany, Flag, ReadOnly } from \"@coasys/ad4m\";\n@Model({ name: \"Todo\" })\nclass Todo extends Ad4mModel {\n @Property({ through: \"todo://state\", initial: \"todo://ready\" })\n state: string = \"\";\n @Property({ through: \"todo://has_title\" })\n title: string = \"\";\n @ReadOnly({\n through: \"todo://is_liked\",\n getter: 'count(->link[WHERE predicate = \"flux://has_reaction\" AND out.uri = \"flux://thumbsup\"]) > 0'\n })\n isLiked: boolean = false;\n @HasMany({ through: \"todo://comment\" })\n comments: string[] = [];\n}\nBehind this, Ad4mModel:\nUses SurrealDB by default for fast queries (10-100x faster)\nGenerates efficient SurrealQL queries automatically\nStores data as graph links in the perspective\nProvides type-safe TypeScript interfaces\nFor example, Todo.findAll(perspective, { where: { state: \"todo://done\" } }) automatically generates and executes an optimized SurrealQL query.For backward compatibility, Prolog is still supported (pass useSurrealDB: false to query methods). See the Model Classes Guide and SurrealDB Queries Guide for details.You can use this model to work with Todo items in a type-safe way:\n// Create a new Todo\nconst todo = new Todo(perspective);\ntodo.title = \"Complete documentation\";\ntodo.state = \"todo://ready\";\nawait todo.save();\n// Query todos\nconst allTodos = await Todo.findAll(perspective);\nconst doneTodos = await Todo.query(perspective)\n .where({ state: \"todo://done\" })\n .get();\n// Update a todo\ntodo.state = \"todo://done\";\nawait todo.save();\n// Delete a todo\nawait todo.delete();\nDevelopers define their app's data model in familiar TypeScript, and AD4M handles the Social DNA—stored as SHACL shapes in a Perspective or Neighbourhood—making it both accessible and powerful. This abstraction lets you focus on app logic while SurrealDB provides fast queries and SHACL schemas enable structured, validated data that scales across the network.","why#Why?":"The goal is to arrive at scalable and interoparable communication infrastructure\nthat enables group agency without imposing a bias on how a group manages itself.This is the real problem we're facing when trying to provide a\ntechnological solution to the web's fractured sense-making.AD4M is a sense-making network disguised as an app development framework.\nAD4M apps don't have to leak any of the AD4M concepts at all,\nand they would still be interoperable with each other to the degree\nof just being different views over the same agent-centric semantic web.","why-should-i-build-on-adam#Why should I build on ADAM?":"ADAM solves a lot of common challenges when developing social applications:\nCold Start: When a new social platform has limited content and a small user base, it is challenging to attract users and engagement. By interacting with already existing agents and their social groups, you don't need to onboard users.\nAuthentication: Authentication is already taken care of, reducing the overload of having to implement authentication flows and user management.\nPrivacy by default: Each social group in ADAM is its own private network, making communication private by default.\nDatabase management: ADAM is completely decentralized, hence there is no database to manage, and no infrastructure you need to scale.\nInteroperability: You are not locked into using one kind of storage technology\nand can switch out your tech stack incrementally. With ADAMs Language implementation, you are able to interact with any existing centralized or decentralized system.\nSmart Contracts without fees: With AD4M's Social DNA, social spaces can easily add their own declarative rules and schemas (smart contracts) using SHACL and subject classes."}},"/installation":{"title":"Installation","data":{"":"To kick off with AD4M and tap into its agent-centric network, you’ll need to install the core runtime and, for JavaScript UI projects,\nthe client libraries to connect your apps. AD4M provides the AD4M Launcher for ease of use, the AD4M CLI for developer flexibility,\nand two npm packages—@coasys/ad4m and @coasys/ad4m-connect—for front-end integration.\nThis guide aligns with the v0.10.1 release candidate (as of March 24, 2025), featuring AI integration and enhanced Social DNA querying.","ad4m-launcher#AD4M Launcher":"The AD4M Launcher is a Tauri-based, system-tray app that bundles the AD4M executor, a background UI and a setup wizard—ideal for users and developers seeking a quick start.\nIt runs your agent’s instance locally, managing keys and data as the back-end for AD4M apps. Install it like this:\nDownload: Visit the GitHub release page and download the binary for your OS—e.g.,\nADAM_Launcher_-release-candidate-1_aarch64.dmg, or ADAM.Launcher_-release-candidate-1_amd64-CUDA.AppImage\n(We are working on a Windows build!.)\nRun/Install: Execute the file. Windows may prompt a security warning (allow it; signed builds are coming); macOS/Linux follow standard app install steps.\nInitialize: Launch it to generate or unlock an agent (DID and keys). It runs on localhost:12000, offering WebSocket and GraphQL endpoints.\nThe Launcher delivers a plug-and-play AD4M experience, ready for UI connections.","ad4m-cli-for-developers#AD4M CLI (For Developers)":"The AD4M CLI, written in Rust, gives developers command-line control over the AD4M ecosystem.\nAvailable on Crates.io (currently not updated due to unpublished dependencies ) and sourced at https://github.com/coasys/ad4m/tree/dev/cli,\nit includes two binaries: ad4m (CLI client) and ad4m-executor (full runtime without UI). It’s perfect for debugging, scripting, or Language development.","set-it-up#Set it up:":"Follow the CLI README to install all necessary dependencies.\nClone or Install: Clone the repo and build:\ngit clone --branch dev https://github.com/coasys/ad4m.git\ncd ad4m/cli\ncargo install --path .\n(Or install from Crates.io once we have published all dependencies: cargo install ad4m.)Run the Executor: Start the full runtime with:\nad4m-executor run\nUse ad4m init first to generate an agent if needed. It runs on localhost:12000.CLI Usage Example: With the executor running, use the ad4m CLI to interact:\nad4m languages meta QmXyz123\nThis fetches metadata for a Language (e.g., social-context) at QmXyz123, outputting details like name and description. See the CLI README for commands like ad4m expression create.The ad4m-executor provides the runtime (like the Launcher sans UI), while ad4m offers client commands—together, they’re a developer’s toolkit for AD4M.","ad4m-client-libraries-for-js-ui-projects#AD4M Client Libraries for JS UI Projects":"For JavaScript UI projects (React, Vue, etc.), the client libraries @coasys/ad4m and @coasys/ad4m-connect connect your front-end to an AD4M instance (Launcher or CLI executor).\n@coasys/ad4m: The core client, offering direct API access. Install it:\nnpm install @coasys/ad4m\nUse it for raw interactions:\nimport { Ad4mClient } from \"@coasys/ad4m\";\nconst client = new Ad4mClient(\"ws://localhost:12000\");\nconst agent = await client.agent.me();\nconsole.log(agent.did); // e.g., \"did:key:z6Mk...\"\nIt’s suited for custom logic needing full API control.@coasys/ad4m-connect: A higher-level library with WebSocket connectivity and authentication handling, ideal for streamlined UI integration. Install it:\nnpm install @coasys/ad4m-connect\nUse it to connect and authenticate:\nimport Ad4mConnect from \"@coasys/ad4m-connect\";\n \nconst ui = Ad4mConnect({\n appName: \"My First ADAM App\",\n appDesc: \"This is my first app here.\",\n appDomain: \"ad4m.dev\",\n appIconPath: \"https://i.ibb.co/GnqjPJP/icon.png\",\n capabilities: [{ with: { domain: \"*\", pointers: [\"*\"] }, can: [\"*\"] }],\n});\n \n// .connect() will show the authentication pop up\nui.connect().then((client) => {\n // Save the client after authentication is done\n const perspectives = await client.perspective.all();\n console.log(perspectives[0].name); // e.g., \"MyCommunity\"\n});\nAuthentication Handling: Per auth docs, @coasys/ad4m-connect manages capability-based auth. On first connect, it requests a capability token from the executor, prompting the user (via Launcher UI or CLI) to approve. Specify required capabilities (e.g., perspective:write) in the config. Once approved, it stores a JWT locally, auto-authenticating future connections. If the executor isn’t running or capabilities mismatch, it retries or prompts again—simplifying secure app setup.Start with @coasys/ad4m-connect for quick UI integration with auth, then use @coasys/ad4m for deeper API calls. Ensure the executor (Launcher or ad4m-executor) is active first.","system-requirements#System Requirements":"OS: macOS 10.15+, or modern Linux (e.g., Ubuntu 22.04+, glibc 2.35+).\nWe are working on a Windows build!.\nMemory: 4GB RAM minimum (8GB recommended).\nNode.js: 18+\nDependencies: Launcher bundles all (Holochain, Deno, Rust); CLI needs Rust; client libs need Node.js (18+) and an executor instance.\nOptional: CUDA for GPU acceleration AI inference.\nWith these tools installed, you’re ready to harness AD4M’s distributed power."}},"/jsdoc/README":{"title":"AD4M","data":{"":"@coasys/ad4m / ExportsThe Agent-Centric Distributed Application Meta-ontology\nor just:\nAgent-Centric DApp Meta-ontology\nA new meta-ontology for interoperable, decentralized application design\nA spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends\nThe basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network","ok-lets-go#Ok, let's go...":"To build an app/UI against Ad4m, you need to make sure that an\nad4m-executor is running\non the user's machine.The easiest way to get that is to use ad4m-cli:\ncargo install ad4m\nad4m-executor run\nThen use Ad4mClient to connect to and work with the running ad4m-executor like this:\nnpm install --save @coasys/ad4m\nnpm install --save-exact @apollo/client@3.7.10\nnpm install --save graphql-ws\nnpm install --save ws\nIn your code:\nimport { Ad4mClient } from '@coasys/ad4m'\nimport { ApolloClient, InMemoryCache } from \"@apollo/client/core\";\nimport { GraphQLWsLink } from \"@apollo/client/link/subscriptions\";\nimport { createClient } from 'graphql-ws';\nimport Websocket from \"ws\";\nconst wsLink = new GraphQLWsLink(createClient({\n url: `ws://localhost:4000/graphql`,\n webSocketImpl: Websocket\n}));\nconst apolloClient = new ApolloClient({\n link: wsLink,\n cache: new InMemoryCache(),\n defaultOptions: {\n watchQuery: {\n fetchPolicy: 'network-only',\n nextFetchPolicy: 'network-only'\n },\n }\n});\nad4mClient = new Ad4mClient(apolloClient)","unlocking--initializing-the-agent#Unlocking / initializing the agent":"You can't do much with the Ad4m runtime as long as the agent is not initialized.\nSo first get the agent status to see if we either need to create new DID or unlock\nan existing keystore.\nconst { isInitialized, isUnlocked, did } = await ad4mClient.agent.status()\nIf isInitialized is false (and then did is empty) we need to create or import\na DID and keys. generate() will create a new DID with method key and lock the\nkeystore with the given passphrase.\nconst { did } = await ad4mClient.agent.generate(\"passphrase\")\nIn following runs of the exectuor, ad4mClient.agent.status() will return a did\nand isInitialized true, but if isUnlocked is false, we need to unlock the keystore\nproviding the passphrase:\nconst { isUnlocked, did } = await ad4mClient.agent.unlock(\"passphrase\")","languages#Languages":"For creating an expression we need to select a language that we create an expression in:\nconst languages = await ad4mClient.languages.all()\nconst noteIpfsAddress = languages.find(l => l.name === 'note-ipfs').address","creating-an-expression#Creating an Expression":"const exprAddress = await ad4mClient.expression.create(\"A new text note\", noteIpfsAddress)","creating-a-perspective-and-linking-that-new-expression#Creating a Perspective and linking that new Expression":"const perspectiveHandle = await ad4mClient.perspective.add(\"A new perspective on apps...\")\nawait ad4mClient.perspective.addLink(\n perspectiveHandle.uuid,\n new Link({\n source: 'root',\n target: exprAddress\n })\n)","publishing-that-local-perspective-by-turning-it-into-a-neighbourhood#Publishing that local Perspective by turning it into a Neighbourhood":"The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing\nand thus synchronizing of links (see LinksAdapter in Language.ts).\nWhile there can and should be many different implementations\nwith different trade-offs and features (like membranes etc.),\nthere currently is one fully implemented and Holochain based LinkLanguage with the name Social Context.It is deployed on the current test network (Language Language v0.0.5) under the address:\nQmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ.","creating-our-unique-linklanguage-clone-through-templating#Creating our unique LinkLanguage clone through templating":"But we should not just use this publicly known Language as the back-bone for our new Neighbourhood,\nsince we need a unique clone.\nSo what we want is to use this existing Language as a template and create a new copy with the same code\nbut different UUID and/name in order to create a fresh space for our new Neighbourhood.What parameters can we adjust when using it as template?\nLet's have a look at the Language's meta information:\nconst socialContextMeta = await ad4mClient.languages.meta(\"QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ\") \nconsole.log(socialContextMeta)\nWhich should yield something like this:\n {\n name: 'social-context',\n address: 'QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ',\n description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',\n author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',\n templated: false,\n templateSourceLanguageAddress: null,\n templateAppliedParams: null,\n possibleTemplateParams: [ 'uuid', 'name', 'description' ],\n sourceCodeLink: 'https://github.com/juntofoundation/Social-Context'\n}\nThe field possibleTemplateParams tells us that we can set a UUID and override name and description.\nLet's leave description but change the name.\nThe function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:\nconst uniqueLinkLanguage = await ad4mClient.languages.applyTemplateAndPublish(\"QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ\", JSON.stringify({\"uuid\": \"84a329-77384c-1510fb\", \"name\": \"Social Context clone for demo Neighbourhood\"}));\nAnd then use this new LinkLanguage in our Neighbourhood:\nconst meta = new Perspective()\nconst neighbourhoodUrl = await ad4mClient.neighbourhood.publishFromPerspective(\n perspectiveHandle.uuid,\n uniqueLinkLanguage.address,\n meta\n)\nconsole.log(neighbourhoodUrl) // => neighbourhood://Qm123456789abcdef","joining-a-neighbourhood-on-another-nodeagent#Joining a Neighbourhood (on another node/agent)":"Assume everything above happened on Alice's agent.\nAlice now shares the Neighbourhood's URL with Bob.\nThis is what Bob does to join the Neigbourhood, access it as a (local) Perspective\nand retrieve the Expression Alice created and linked there:\nconst joinedNeighbourhood = await ad4mClient.neighbourhood.joinFromUrl(neighbourhoodUrl)\nconst links = await ad4mClient.perspective.queryLinks(joinedNeighbourhood.uuid, new LinkQuery({source: 'a'}))\nlinks.forEach(async link => {\n const address = link.data.target\n const expression = await ad4mClient.expression.get(address)\n const data = JSON.parse(expression.data)\n console.log(data) //=> \"A new text note\"\n})","building-from-source#Building from source":"Run:\nnpm i && npm run build","wait-what#Wait, what?!":"The central claim of AD4M is that any single- but also specifically multi-user application can be bootstrapped out of a meta-ontology consisting of 3 quintessential ontological units:\nAgents\nLanguages\nand Perspectives\nThis is a meta-ontology since it doesn't make any assumptions about the specific ontologies implemented in those bootstrapped apps. But since apps bootstrapped from it share the same meta-ontology, they are mutualy interoperable.","agents#Agents...":"...represent humans with their devices, which is what the internet actually is. Technically represented as Decentralized Identifiers - DIDs.","languages-1#Languages...":"...encapsulate the actual technology used to communicate, like Holochain or IPFS, but what they provide to the high-level layers is this: Languages define Expressions, which are the atoms of what Agents communicate. Expressions are always created, and thus signed, by an agent. Expressions are referenced via a URL of the kind ://. That URL and the Expression itself is the only objective part in AD4M.","perspectives#Perspectives...":"...belong to a specific agent. They represent context and association between expressions. They consist of a list of RDF/semantic web like triplets (subject-predicate-object) called links because all three items are just URLs pointing to expressions. Perspectives are like Solid's pods, but they are agent-centric. There is no such thing as a Perspective that does not belong to an agent. It is like the canvas on which an agent perceives and onto which they create anything. To the next layer above (either the very general UI built in Perspectivism - or any other special purpose UI), they are like a database scope.","bootstrapping#Bootstrapping":"Any AD4M implementation will have to include at least 3 reflexive system Languages to enable the dynamic bootstrapping of apps and interconnected sense-making networks:\nA Language of Agents, i.e. where the expressions represent agents, and which uses DIDs as the expression URLs.\nA Language of Languages, i.e. a way to talk about Languages so Languages can be created by users and shared.\nA Language of Perspectives which implies the concept of Shared Perspectives a.k.a. Neighbourhoods, i.e. a way to share an otherwise local and private Perspective with others which constitutes the basic building block of any collaboration context.\nHaving these Languages means Agents can author expressions that represent Agents, Languages and Perspectives. These expressions get linked from inside Perspectives. That way we can model primitives like friends-lists (Perspective including agent expressions), app-stores (Perspective including Languages) and more.","how-do-i-build-an-app-onwith-ad4m#How do I build an app on/with AD4M?":"Building an AD4M app actually means extending the AD4M ecosystem with the\nLanguages\nand link-ontologies\nneeded for the app's domain - and then creating expressions from those Languages and linking them inside Perspectives.The latter means creating RDF/semantic web style triplets that associate expressions in order to represent app specific semantics - not too different to how Solid style linked-data would work."}},"/jsdoc/classes/Ad4mClient":{"title":"Class: Ad4mClient","data":{"":"@coasys/ad4m / Exports / Ad4mClientClient for the Ad4m interface wrapping GraphQL queryies\nfor convenient use in user facing code.Aggregates the six sub-clients:\nAgentClient, ExpressionClient, LanguageClient,\nNeighbourhoodClient, PerspectiveClient and RuntimeClient\nfor the respective functionality.","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"#agentClient\n#aiClient\n#apolloClient\n#expressionClient\n#languageClient\n#neighbourhoodClient\n#perspectiveClient\n#runtimeClient","accessors#Accessors":"agent\nai\nexpression\nlanguages\nneighbourhood\nperspective\nruntime","constructors-1#Constructors":"","constructor#constructor":"• new Ad4mClient(client, subscribe?)","parameters#Parameters":"Name\tType\tDefault value\tclient\tApolloClient\tundefined\tsubscribe\tboolean\ttrue","defined-in#Defined in":"Ad4mClient.ts:30","properties-1#Properties":"","agentclient##agentClient":"• Private #agentClient: AgentClient","defined-in-1#Defined in":"Ad4mClient.ts:21","aiclient##aiClient":"• Private #aiClient: AIClient","defined-in-2#Defined in":"Ad4mClient.ts:27","apolloclient##apolloClient":"• Private #apolloClient: ApolloClient","defined-in-3#Defined in":"Ad4mClient.ts:20","expressionclient##expressionClient":"• Private #expressionClient: ExpressionClient","defined-in-4#Defined in":"Ad4mClient.ts:22","languageclient##languageClient":"• Private #languageClient: LanguageClient","defined-in-5#Defined in":"Ad4mClient.ts:23","neighbourhoodclient##neighbourhoodClient":"• Private #neighbourhoodClient: NeighbourhoodClient","defined-in-6#Defined in":"Ad4mClient.ts:24","perspectiveclient##perspectiveClient":"• Private #perspectiveClient: PerspectiveClient","defined-in-7#Defined in":"Ad4mClient.ts:25","runtimeclient##runtimeClient":"• Private #runtimeClient: RuntimeClient","defined-in-8#Defined in":"Ad4mClient.ts:26","accessors-1#Accessors":"","agent#agent":"• get agent(): AgentClient","returns#Returns":"AgentClient","defined-in-9#Defined in":"Ad4mClient.ts:45","ai#ai":"• get ai(): AIClient","returns-1#Returns":"AIClient","defined-in-10#Defined in":"Ad4mClient.ts:69","expression#expression":"• get expression(): ExpressionClient","returns-2#Returns":"ExpressionClient","defined-in-11#Defined in":"Ad4mClient.ts:49","languages#languages":"• get languages(): LanguageClient","returns-3#Returns":"LanguageClient","defined-in-12#Defined in":"Ad4mClient.ts:53","neighbourhood#neighbourhood":"• get neighbourhood(): NeighbourhoodClient","returns-4#Returns":"NeighbourhoodClient","defined-in-13#Defined in":"Ad4mClient.ts:57","perspective#perspective":"• get perspective(): PerspectiveClient","returns-5#Returns":"PerspectiveClient","defined-in-14#Defined in":"Ad4mClient.ts:61","runtime#runtime":"• get runtime(): RuntimeClient","returns-6#Returns":"RuntimeClient","defined-in-15#Defined in":"Ad4mClient.ts:65"}},"/jsdoc/classes/ExceptionInfo":{"title":"Class: ExceptionInfo","data":{"":"@coasys/ad4m / Exports / ExceptionInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"addon\nmessage\ntitle\ntype","constructors-1#Constructors":"","constructor#constructor":"• new ExceptionInfo()","properties-1#Properties":"","addon#addon":"• Optional addon: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:55","message#message":"• message: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:51","title#title":"• title: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:49","type#type":"• type: ExceptionType","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:53"}},"/jsdoc/classes/ImportResult":{"title":"Class: ImportResult","data":{"":"@coasys/ad4m / Exports / ImportResult","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"defaultModels\nexpressions\nfriends\nknownLinkLanguages\nlinks\nmodels\nnotifications\nperspectiveDiffs\nperspectives\ntasks\ntrustedAgents","constructors-1#Constructors":"","constructor#constructor":"• new ImportResult()","properties-1#Properties":"","defaultmodels#defaultModels":"• defaultModels: ImportStats","defined-in#Defined in":"runtime/RuntimeResolver.ts:181","expressions#expressions":"• expressions: ImportStats","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:169","friends#friends":"• friends: ImportStats","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:187","knownlinklanguages#knownLinkLanguages":"• knownLinkLanguages: ImportStats","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:193","links#links":"• links: ImportStats","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:166","models#models":"• models: ImportStats","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:178","notifications#notifications":"• notifications: ImportStats","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:175","perspectivediffs#perspectiveDiffs":"• perspectiveDiffs: ImportStats","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:172","perspectives#perspectives":"• perspectives: ImportStats","defined-in-8#Defined in":"runtime/RuntimeResolver.ts:163","tasks#tasks":"• tasks: ImportStats","defined-in-9#Defined in":"runtime/RuntimeResolver.ts:184","trustedagents#trustedAgents":"• trustedAgents: ImportStats","defined-in-10#Defined in":"runtime/RuntimeResolver.ts:190"}},"/jsdoc/classes/ImportStats":{"title":"Class: ImportStats","data":{"":"@coasys/ad4m / Exports / ImportStats","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"errors\nfailed\nimported\nomitted\ntotal","constructors-1#Constructors":"","constructor#constructor":"• new ImportStats()","properties-1#Properties":"","errors#errors":"• errors: string[]","defined-in#Defined in":"runtime/RuntimeResolver.ts:157","failed#failed":"• failed: number","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:151","imported#imported":"• imported: number","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:148","omitted#omitted":"• omitted: number","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:154","total#total":"• total: number","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:145"}},"/jsdoc/classes/Notification":{"title":"Class: Notification","data":{"":"@coasys/ad4m / Exports / Notification","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appIconPath\nappName\nappUrl\ndescription\ngranted\nid\nperspectiveIds\ntrigger\nwebhookAuth\nwebhookUrl","constructors-1#Constructors":"","constructor#constructor":"• new Notification()","properties-1#Properties":"","appiconpath#appIconPath":"• appIconPath: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:106","appname#appName":"• appName: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:102","appurl#appUrl":"• appUrl: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:104","description#description":"• description: string","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:100","granted#granted":"• granted: boolean","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:98","id#id":"• id: string","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:96","perspectiveids#perspectiveIds":"• perspectiveIds: string[]","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:117","trigger#trigger":"• trigger: string","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:113","webhookauth#webhookAuth":"• webhookAuth: string","defined-in-8#Defined in":"runtime/RuntimeResolver.ts:125","webhookurl#webhookUrl":"• webhookUrl: string","defined-in-9#Defined in":"runtime/RuntimeResolver.ts:121"}},"/jsdoc/classes/NotificationInput":{"title":"Class: NotificationInput","data":{"":"@coasys/ad4m / Exports / NotificationInput","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"appIconPath\nappName\nappUrl\ndescription\nperspectiveIds\ntrigger\nwebhookAuth\nwebhookUrl","constructors-1#Constructors":"","constructor#constructor":"• new NotificationInput()","properties-1#Properties":"","appiconpath#appIconPath":"• appIconPath: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:69","appname#appName":"• appName: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:65","appurl#appUrl":"• appUrl: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:67","description#description":"• description: string","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:63","perspectiveids#perspectiveIds":"• perspectiveIds: string[]","defined-in-4#Defined in":"runtime/RuntimeResolver.ts:80","trigger#trigger":"• trigger: string","defined-in-5#Defined in":"runtime/RuntimeResolver.ts:76","webhookauth#webhookAuth":"• webhookAuth: string","defined-in-6#Defined in":"runtime/RuntimeResolver.ts:88","webhookurl#webhookUrl":"• webhookUrl: string","defined-in-7#Defined in":"runtime/RuntimeResolver.ts:84"}},"/jsdoc/classes/RuntimeInfo":{"title":"Class: RuntimeInfo","data":{"":"@coasys/ad4m / Exports / RuntimeInfo","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"ad4mExecutorVersion\nisInitialized\nisUnlocked","constructors-1#Constructors":"","constructor#constructor":"• new RuntimeInfo()","properties-1#Properties":"","ad4mexecutorversion#ad4mExecutorVersion":"• ad4mExecutorVersion: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:39","isinitialized#isInitialized":"• isInitialized: Boolean","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:41","isunlocked#isUnlocked":"• isUnlocked: Boolean","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:43"}},"/jsdoc/classes/SentMessage":{"title":"Class: SentMessage","data":{"":"@coasys/ad4m / Exports / SentMessage","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"message\nrecipient","constructors-1#Constructors":"","constructor#constructor":"• new SentMessage()","properties-1#Properties":"","message#message":"• message: PerspectiveExpression","defined-in#Defined in":"runtime/RuntimeResolver.ts:33","recipient#recipient":"• recipient: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:31"}},"/jsdoc/classes/TriggeredNotification":{"title":"Class: TriggeredNotification","data":{"":"@coasys/ad4m / Exports / TriggeredNotification","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"notification\nperspectiveId\ntriggerMatch","constructors-1#Constructors":"","constructor#constructor":"• new TriggeredNotification()","properties-1#Properties":"","notification#notification":"• notification: Notification","defined-in#Defined in":"runtime/RuntimeResolver.ts:132","perspectiveid#perspectiveId":"• perspectiveId: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:134","triggermatch#triggerMatch":"• triggerMatch: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:139"}},"/jsdoc/classes/UserStatistics":{"title":"Class: UserStatistics","data":{"":"@coasys/ad4m / Exports / UserStatistics","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"did\nemail\nlastSeen\nperspectiveCount","constructors-1#Constructors":"","constructor#constructor":"• new UserStatistics()","properties-1#Properties":"","did#did":"• did: string","defined-in#Defined in":"runtime/RuntimeResolver.ts:202","email#email":"• email: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:199","lastseen#lastSeen":"• Optional lastSeen: string","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:205","perspectivecount#perspectiveCount":"• perspectiveCount: number","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:208"}},"/jsdoc/classes/VerificationRequestResult":{"title":"Class: VerificationRequestResult","data":{"":"@coasys/ad4m / Exports / VerificationRequestResult","table-of-contents#Table of contents":"","constructors#Constructors":"constructor","properties#Properties":"isExistingUser\nmessage\nrequiresPassword\nsuccess","constructors-1#Constructors":"","constructor#constructor":"• new VerificationRequestResult()","properties-1#Properties":"","isexistinguser#isExistingUser":"• isExistingUser: boolean","defined-in#Defined in":"runtime/RuntimeResolver.ts:223","message#message":"• message: string","defined-in-1#Defined in":"runtime/RuntimeResolver.ts:217","requirespassword#requiresPassword":"• requiresPassword: boolean","defined-in-2#Defined in":"runtime/RuntimeResolver.ts:220","success#success":"• success: boolean","defined-in-3#Defined in":"runtime/RuntimeResolver.ts:214"}},"/jsdoc/interfaces/SHACLPropertyShape":{"title":"Interface: SHACLPropertyShape","data":{"":"@coasys/ad4m / Exports / SHACLPropertyShapeSHACL Property Shape\nRepresents constraints on a single property path","table-of-contents#Table of contents":"","properties#Properties":"adder\nclass\nconformanceConditions\ndatatype\ngetter\nhasValue\nlocal\nmaxCount\nmaxInclusive\nminCount\nminInclusive\nname\nnodeKind\npath\npattern\nremover\nresolveLanguage\nsetter\nwritable","properties-1#Properties":"","adder#adder":"• Optional adder: AD4MAction[]AD4M-specific: Adder action for collection properties","defined-in#Defined in":"shacl/SHACLShape.ts:159","class#class":"• Optional class: stringsh:class — the target SHACL node shape URI that linked nodes must conform to.\nSet automatically when a relation has a target model. Enables typed construction\non the Rust/MCP side by referencing the full target shape.","defined-in-1#Defined in":"shacl/SHACLShape.ts:176","conformanceconditions#conformanceConditions":"• Optional conformanceConditions: ConformanceCondition[]AD4M-specific: Structured conformance conditions (DB-agnostic).\nEach condition describes a check on the target node (flag match or required property).","defined-in-2#Defined in":"shacl/SHACLShape.ts:171","datatype#datatype":"• Optional datatype: stringExpected datatype (e.g., xsd:string, xsd:integer)","defined-in-3#Defined in":"shacl/SHACLShape.ts:123","getter#getter":"• Optional getter: stringAD4M-specific: Pre-computed SurrealQL getter expression for reading this relation/property.\nFor relations with a target model, this encodes conformance filtering\nso that Rust/MCP can execute the exact same query as the JS runtime.","defined-in-4#Defined in":"shacl/SHACLShape.ts:167","hasvalue#hasValue":"• Optional hasValue: stringFixed value constraint (for Flag properties)","defined-in-5#Defined in":"shacl/SHACLShape.ts:144","local#local":"• Optional local: booleanAD4M-specific: Local-only property","defined-in-6#Defined in":"shacl/SHACLShape.ts:147","maxcount#maxCount":"• Optional maxCount: numberMaximum cardinality (single-valued if 1, omit for collections)","defined-in-7#Defined in":"shacl/SHACLShape.ts:132","maxinclusive#maxInclusive":"• Optional maxInclusive: numberMaximum value (inclusive) for numeric properties","defined-in-8#Defined in":"shacl/SHACLShape.ts:141","mincount#minCount":"• Optional minCount: numberMinimum cardinality (required if >= 1)","defined-in-9#Defined in":"shacl/SHACLShape.ts:129","mininclusive#minInclusive":"• Optional minInclusive: numberMinimum value (inclusive) for numeric properties","defined-in-10#Defined in":"shacl/SHACLShape.ts:138","name#name":"• Optional name: stringProperty name (e.g., \"name\", \"ingredients\") - used for generating named URIs","defined-in-11#Defined in":"shacl/SHACLShape.ts:117","nodekind#nodeKind":"• Optional nodeKind: \"IRI\" | \"Literal\" | \"BlankNode\"Node kind constraint (IRI, Literal, BlankNode)","defined-in-12#Defined in":"shacl/SHACLShape.ts:126","path#path":"• path: stringThe property path (predicate URI)","defined-in-13#Defined in":"shacl/SHACLShape.ts:120","pattern#pattern":"• Optional pattern: stringRegex pattern for string validation","defined-in-14#Defined in":"shacl/SHACLShape.ts:135","remover#remover":"• Optional remover: AD4MAction[]AD4M-specific: Remover action for collection properties","defined-in-15#Defined in":"shacl/SHACLShape.ts:162","resolvelanguage#resolveLanguage":"• Optional resolveLanguage: stringAD4M-specific: Language to resolve property values through","defined-in-16#Defined in":"shacl/SHACLShape.ts:153","setter#setter":"• Optional setter: AD4MAction[]AD4M-specific: Setter action for this property","defined-in-17#Defined in":"shacl/SHACLShape.ts:156","writable#writable":"• Optional writable: booleanAD4M-specific: Writable property","defined-in-18#Defined in":"shacl/SHACLShape.ts:150"}},"/languages":{"title":"Languages: Communication Protocols for Agents","data":{"understanding-languages-in-ad4m#Understanding Languages in AD4M":"In AD4M, Languages are the fundamental building blocks that define how agents communicate and share data. While we call them \"Languages\", they could just as well be called \"Protocols\" or \"Data Storage Adapters\" – they define the rules and mechanisms by which nodes in the network exchange information.The term \"Language\" was chosen deliberately: just as human languages enable people to communicate and share ideas, AD4M Languages enable digital agents to exchange data and interact. Alternative metaphors could have been \"Games\" or \"Dances\" – patterns of interaction between agents.","core-mechanism#Core Mechanism":"At their heart, Languages implement a simple but powerful mechanism:\nStorage: Take some data, store it in a shared space (could be a server, Holochain DHT, blockchain, etc.), and return a URI that points to that data\nRetrieval: Take a URI and return the previously stored data (called an \"Expression\" in AD4M)\nThis mechanism creates a universal way for agents to share and reference information, regardless of where or how it's actually stored. For example:\nAn IPFS Language might store data in the IPFS network and return a CID\nA Holochain Language might store data in a DHT and return an entry hash\nA Web2 Language might store data on a server and return a URL","universal-addressing-mechanism#Universal Addressing Mechanism":"AD4M's Language system extends the familiar URI/URL model into a truly universal addressing scheme. Every Expression (the signed data objects in AD4M) is addressable through a URI that combines:\nThe Language's unique identifier (a hash of its implementation code)\nThe Language-specific address for that data\nFor example:\n://\nThis means AD4M can seamlessly integrate with and extend existing addressing systems:\nWeb URLs become: http://example.com/resource\nIPFS content becomes: QmIPFS123://\nAgent DIDs become: did:key:z6Mk...\nCustom protocols become: QmCustom789://user123/post456\nThe Language-Language (one of AD4M's bootstrap Languages) makes this system dynamic and extensible:\nNew Languages can be published and their code verified\nAny AD4M instance can discover and install Languages as needed\nThe system can evolve without central coordination\nThis creates a spanning layer across the internet where:\nEvery piece of data has a globally unique address\nAddresses are self-describing (include their protocol)\nNew protocols can be added dynamically\nExisting systems can be integrated seamlessly","why-languages-matter#Why Languages Matter":"Languages in AD4M serve several crucial purposes:\nDefine how data is stored and retrieved\nSpecify how agents communicate\nEnable different storage backends (IPFS, Holochain, centralized servers, etc.)\nAllow for extensible and pluggable protocols\nCreate semantic meaning through shared understanding","technical-implementation#Technical Implementation":"At its core, AD4M is a Language runtime. Languages are implemented as JavaScript modules that run in a sandboxed Deno environment within the AD4M executor. This provides:\nSecure execution environment\nTypeScript support out of the box\nModern ES module system\nBuilt-in permissions model","language-module-contract#Language Module Contract":"Every Language module must export a default create function with this signature:\nexport default function create(context: LanguageContext): Language | Promise\nThis function is the entry point for your Language. The AD4M executor will:\nLoad your Language module in the Deno sandbox\nCall the create function with a LanguageContext\nUse the returned Language object to interact with your implementation","the-languagecontext#The LanguageContext":"The LanguageContext provides essential services and capabilities to your Language:\ninterface LanguageContext {\n // Access to the agent's signing capabilities\n agent: AgentService;\n \n // For verifying signatures\n signatures: SignaturesService;\n \n // Path for persistent storage\n storageDirectory: string;\n \n // Language-specific settings\n customSettings: object;\n \n // Access to Holochain functionality\n Holochain?: HolochainLanguageDelegate;\n \n // For handling AD4M signals\n ad4mSignal: Ad4mSignalCB;\n}\nKey features provided by the context:\nAgent Service\n// Sign expressions with the agent's keys\nconst expression = context.agent.createSignedExpression(data);\n// Get the agent's DID\nconst did = context.agent.did;\nHolochain Integration\n// Register a Holochain DNA\nawait context.Holochain.registerDNAs([{\n file: dnaPath,\n nick: 'my-dna'\n}]);\n// Call Holochain zome functions\nconst result = await context.Holochain.call(\n 'my-dna',\n 'zome-name',\n 'function-name',\n payload\n);\nStorage and Settings\n// Access persistent storage\nconst storagePath = context.storageDirectory;\n// Use custom settings\nconst settings = context.customSettings;","the-language-interface#The Language Interface":"Here's the core interface that all Languages must implement:\ninterface Language {\n // Required: Name of the language\n readonly name: string;\n // Optional adapters for different functionalities:\n // For languages that store and retrieve expressions\n readonly expressionAdapter?: ExpressionAdapter;\n // For languages that handle UI rendering\n readonly expressionUI?: ExpressionUI;\n // For languages that manage links (used in Neighbourhoods)\n readonly linksAdapter?: LinkSyncAdapter;\n // For real-time presence and p2p signals\n readonly telepresenceAdapter?: TelepresenceAdapter;\n // For direct messaging between agents\n readonly directMessageAdapter?: DirectMessageAdapter;\n // For language-specific settings UI\n readonly settingsUI?: SettingsUI;\n // Optional: Mark expressions as immutable for caching\n isImmutableExpression?(expression: Address): boolean;\n // Define available interactions with expressions\n interactions(expression: Address): Interaction[];\n}\nLanguage interface in the API reference |\nLanguage.ts in the codebase","types-of-languages#Types of Languages":"AD4M supports several types of Languages for different purposes:\nExpression Languages\nStore and retrieve data\nMost common type\nExample: IPFS-based file storage\nLink Languages\nCore building block of Neighbourhoods\nEnable shared semantic spaces\nExample: Holochain-based p2p links\nDirect Message Languages\nEnable agent-to-agent communication\nSupport private messaging\nExample: Encrypted p2p messaging","working-with-languages#Working with Languages":"","the-core-expression-mechanism#The Core Expression Mechanism":"Before diving into examples, it's important to understand that most Languages (all basic \"Expression Languages\") operate around the same core pattern:\ninterface ExpressionAdapter {\n // Store data and get a reference\n putAdapter: {\n createPublic(content: object): Promise
;\n // or for read-only languages:\n addressOf(content: object): Promise
;\n };\n \n // Retrieve data using its reference\n get(address: Address): Promise;\n}\nThis simple pattern enables AD4M to create a web of semantic references, where any piece of data can be stored and referenced by its address, regardless of the underlying storage mechanism.","installing-languages#Installing Languages":"// Install a language from its address\nawait ad4m.languages.install(\"Qm...\");\n// List all installed languages\nconst languages = await ad4m.languages.all();","publishing-languages#Publishing Languages":"// Publish a new language\nconst address = await ad4m.languages.publish({\n name: \"my-language\",\n description: \"A custom language implementation\",\n sourceCodeLink: \"https://github.com/...\",\n bundle: languageBundle\n});","using-languages#Using Languages":"// Create an expression in a language\nconst expression = await ad4m.expression.create(\n languageAddress,\n { content: \"Hello, World!\" }\n);\n// Retrieve an expression\nconst retrieved = await ad4m.expression.get(expression.address);","built-in-languages#Built-in Languages":"AD4M comes with several bootstrap languages:\nAgent Language: Resolves DIDs to agent information\nLanguage Language: Manages language publication and installation\nPerspective Language: Handles perspective storage and sharing\nNeighbourhood Language: Enables creation of shared spaces","security-considerations#Security Considerations":"Languages run in a sandboxed environment with:\nControlled access to system resources\nExplicit permission model\nIsolated execution context\nSecure communication channels\nFor a detailed guide on creating your own Language, see the Language Development Guide.To help you get started with creating your own languages, we have provided some templates that you can use as a starting point. These templates are Deno compatible and provide a basic structure for your language.\nExpression Language without DNA template\nExpression Language with DNA template\nLink Language without DNA template\nLink Language with DNA template\nYou can clone these repositories and modify them to create your own language. Remember to follow the guidelines for making your language Deno compatible."}},"/neighbourhoods":{"title":"Neighbourhoods: Collaborative Knowledge Spaces","data":{"understanding-neighbourhoods#Understanding Neighbourhoods":"Neighbourhoods transform private Perspectives into shared semantic spaces where multiple agents can collaborate. They represent AD4M's vision of group collaboration: decentralized, storage-agnostic, and centered around shared meaning rather than applications.","from-personal-to-shared-knowledge#From Personal to Shared Knowledge":"While Perspectives are personal knowledge graphs, Neighbourhoods enable:\nReal-time synchronization of semantic links between agents\nApp-independent group collaboration\nShared context through a common knowledge graph\nIntegration with existing group spaces and infrastructure\nFor example, the same Neighbourhood could be viewed through:\nA chat application showing messages and threads\nA task management tool showing assignments and deadlines\nA document editor showing collaborative documents\nA social network showing relationships and posts\nAll these views operate on the same underlying semantic graph, just interpreting the links differently.","linklanguages-the-sync-layer#LinkLanguages: The Sync Layer":"Neighbourhoods achieve their magic through LinkLanguages – specialized Languages that define how links are stored and synchronized between agents. A LinkLanguage implements the LinkSyncAdapter interface:\ninterface LinkSyncAdapter {\n // Is this link space writable?\n writable(): boolean;\n \n // Is this link space public?\n public(): boolean;\n \n // Get list of other agents in the space\n others(): Promise;\n // Get current revision (like git commit hash)\n currentRevision(): Promise;\n // Sync with other agents, returns changes\n sync(): Promise;\n // Get full state at current revision\n render(): Promise;\n // Publish local changes\n commit(diff: PerspectiveDiff): Promise;\n // Subscribe to remote changes\n addCallback(callback: (diff: PerspectiveDiff) => void);\n // Subscribe to sync state changes\n addSyncStateChangeCallback(callback: (state: PerspectiveState) => void);\n}\nThis git-like interface enables Neighbourhoods to:\nTrack revisions of the shared space\nSync changes between agents efficiently\nMaintain consistency through CRDT-like mechanisms\nSupport different backend implementations","the-neighbourhood-bootstrap-language#The Neighbourhood Bootstrap Language":"AD4M includes a built-in \"Neighbourhood Language\" that serves as a public registry for Neighbourhoods. When you create a Neighbourhood, an Expression in this language is published containing:\nThe address of the LinkLanguage used for sync\nMeta information about the Neighbourhood (name, description, etc.)\nAccess control information\n// Example Neighbourhood Expression\n{\n data: {\n linkLanguage: \"QmLinkLang123...\", // Address of the sync language\n meta: { // Optional metadata\n name: \"My Team Space\",\n description: \"Collaboration space for our team\"\n }\n }\n}","joining-process#Joining Process":"When an agent joins a Neighbourhood using its URL:\nThe Neighbourhood Expression is retrieved\nThe specified LinkLanguage is downloaded and installed\nThe agent connects to the shared space using that language\n// Join flow under the hood [PSEUDO-CODE]\nconst join = async (url) => {\n // 1. Get Neighbourhood Expression\n const hood = await ad4m.expression.get(url);\n \n // 2. Install LinkLanguage if needed\n const linkLang = hood.data.linkLanguage;\n if (!await ad4m.languages.isInstalled(linkLang)) {\n await ad4m.languages.install(linkLang);\n }\n \n // 3. Connect using the LinkLanguage\n return await ad4m.perspective.join(linkLang);\n}","language-templates-and-trust#Language Templates and Trust":"AD4M provides a powerful templating mechanism for Languages, particularly useful for LinkLanguages. This enables:\nCreating unique P2P networks for each Neighbourhood\nVerifiable code provenance\nTrust-based language installation","the-default-template#The Default Template":"AD4M comes with a default LinkLanguage template called \"Perspective Diff Sync\" (P-Diff-Sync), authored by Coasys. This implementation:\nUses Holochain as the P2P backend\nImplements a CRDT algorithm for consistency\nCreates isolated DHT networks per instance","trust-and-templates#Trust and Templates":"The templating system works with AD4M's trust mechanism:\nInitial Trust:\nNew AD4M installations trust Coasys by default\nThis means they trust the P-Diff-Sync template\nThe template's code hash is verified against Coasys's signature\nTemplate Usage:\n// Create a unique LinkLanguage instance\nconst linkLanguage = await ad4m.languages.applyTemplateAndPublish(\n templateAddress,\n {\n uuid: \"unique-network-id\", // Creates isolated DHT\n name: \"Team Space Sync\"\n }\n);\nTrust Verification:\nWhen installing a templated Language, AD4M verifies:\nThe template source is trusted\nThe templating only modified allowed parameters\nThe resulting code matches the expected hash\nThis means agents can safely install Languages created from trusted templates, even if they don't trust the Neighbourhood creator directly.","holochain-integration#Holochain Integration":"For the P-Diff-Sync template:\nEach templated instance creates its own Holochain DNA\nThe uuid parameter ensures a unique network ID\nAgents joining the Neighbourhood join this specific DHT\nThe network is isolated from other Neighbourhoods\n// Example of full Neighbourhood creation with templating\nconst createNeighbourhood = async () => {\n // 1. Create unique LinkLanguage from template\n const template = (await ad4m.runtime.knownLinkLanguageTemplates())[0];\n const linkLang = await ad4m.languages.applyTemplateAndPublish(\n template,\n {\n uuid: crypto.randomUUID(),\n name: \"My Space Sync\"\n }\n );\n \n // 2. Create and publish Neighbourhood\n const meta = new Perspective();\n meta.add({\n source: \"self\",\n predicate: \"name\",\n target: \"My Collaborative Space\"\n });\n \n return await ad4m.neighbourhood.publishFromPerspective(\n perspective.uuid,\n linkLang.address,\n meta\n );\n};","creating-collaborative-spaces#Creating Collaborative Spaces":"","setting-up-a-neighbourhood#Setting Up a Neighbourhood":"First, choose or create a LinkLanguage for your sync needs:\n// List available LinkLanguage templates\nconst templates = await ad4m.runtime.knownLinkLanguageTemplates();\n// Create a unique instance of a LinkLanguage\nconst linkLanguage = await ad4m.languages.applyTemplateAndPublish(\n templates[0], // e.g., Perspective Diff Sync\n JSON.stringify({\n uuid: \"unique-id-123\", // Unique network identifier\n name: \"My Team Sync\"\n })\n);\nThen create the Neighbourhood:\n// Optional: Create metadata about the Neighbourhood\nconst meta = new Perspective();\nawait meta.add({\n source: \"neighbourhood://self\",\n predicate: \"name\",\n target: \"literal://My Team Space\"\n});\n// Create the Neighbourhood from a Perspective\nconst url = await ad4m.neighbourhood.publishFromPerspective(\n perspective.uuid,\n linkLanguage.address,\n meta\n);\n// Returns: neighbourhood://Qm123456789abcdef","joining-a-neighbourhood#Joining a Neighbourhood":"Other agents can join using the Neighbourhood URL:\n// Join the Neighbourhood\nconst { uuid } = await ad4m.neighbourhood.joinFromUrl(url);\n// Get the shared Perspective\nconst shared = await ad4m.perspective.byUUID(uuid);\n// Listen for changes\nshared.addListener((links) => {\n console.log(\"New links:\", links);\n});","building-on-neighbourhoods#Building on Neighbourhoods":"","app-independent-collaboration#App-Independent Collaboration":"Neighbourhoods enable collaboration without locking data into specific apps:\n// Chat app might add message links\nawait shared.add({\n source: \"did:key:alice\",\n predicate: \"chat://posted\",\n target: \"QmMsg123://Hello!\"\n});\n// Task app might add assignment links\nawait shared.add({\n source: \"did:key:bob\",\n predicate: \"task://assigned-to\",\n target: \"did:key:carol\"\n});","integration-examples#Integration Examples":"The power of LinkLanguages lies in their ability to bridge AD4M with existing infrastructure. Here are some practical integration scenarios:\nCompany Intranet Integration:\nWrap your existing database or document management system in a LinkLanguage\nLeverage existing user permissions and access control\nMake company data available to AD4M apps while maintaining security\nEnable semantic overlays on traditional hierarchical storage\nFor example, your company's SharePoint or document management system could become a LinkLanguage, allowing AD4M apps to collaborate on documents while respecting existing access controls and security policies.\nLegacy System Integration:\nConnect to existing groupware or collaboration tools\nMap traditional data structures to semantic links\nMaintain existing workflows while enabling new capabilities\nGradually transition to more semantic approaches\nThis allows teams to keep using their familiar tools while gaining the benefits of AD4M's semantic capabilities. For instance, a team's JIRA instance could be wrapped as a LinkLanguage, making tickets and workflows available in the semantic web.\nFederated Systems:\nBridge ActivityPub, Matrix, or other federated protocols\nEnable cross-platform semantic connections\nMaintain federation while adding semantic capabilities\nIntegrate with existing social networks\nThe beauty of this approach is that AD4M apps don't need to know about the underlying infrastructure. Whether links are stored in a corporate database, a blockchain, or a p2p network, the apps just work with the semantic layer provided by the LinkLanguage.","best-practices#Best Practices":"Choose the Right LinkLanguage:\nConsider privacy requirements\nEvaluate scalability needs\nThink about integration points\nDesign Semantic Structure:\nPlan your predicate vocabulary\nConsider multiple app use cases\nDocument link patterns\nHandle Updates:\nListen for changes\nUpdate UI in real-time\nHandle conflicts gracefully"}},"/spanning-layer":{"title":"AD4M as a Spanning Layer","data":{"the-problem#The Problem":"The internet today is fragmented into isolated ecosystems:\nCentralized platforms (Twitter, Facebook) — walled gardens that lock in users and data\nFederated protocols (ActivityPub, Matrix) — better, but still siloed and fragmentation persists\nP2P systems (IPFS, Holochain) — excellent for sovereignty, but lack interoperability\nSemantic web (RDF, Solid) — great for data portability, but struggles with adoption\nEach approach solves part of the problem, but we lack a universal layer that bridges them all.","ad4ms-solution-the-spanning-layer#AD4M's Solution: The Spanning Layer":"AD4M doesn't replace these systems — it spans across them, creating a unified semantic layer that enables:\nGlobal addressing — any data, any protocol, one address format\nAgent sovereignty — users own their data, keys, and runtime\nProtocol agnosticism — mix HTTP, IPFS, Holochain data in one graph\nSemantic interoperability — RDF-like links connect data across systems\nDistributed collective intelligence — humans and AI agents collaborate\nThink of AD4M as a new layer in the internet stack:\n┌─────────────────────────────────────────────────┐\n│ Applications (Flux, WE, custom) │ ← User interfaces\n├─────────────────────────────────────────────────┤\n│ AD4M Spanning Layer │ ← What we're building\n│ (Perspectives, SDNA, Neighbourhoods, DIDs) │\n├─────────────────────────────────────────────────┤\n│ Protocol Layer (HTTP, IPFS, Holochain, etc) │ ← Languages wrap these\n├─────────────────────────────────────────────────┤\n│ Transport (TCP/IP, QUIC) │\n└─────────────────────────────────────────────────┘","how-it-works#How It Works":"","1-agent-centric-architecture#1. Agent-Centric Architecture":"Unlike app-centric systems where apps own data, AD4M is agent-centric:\nEach user runs their own executor (local runtime)\nThe executor holds the user's DID (decentralized identity) and keys\nPerspectives (knowledge graphs) store the user's data locally\nApps connect to the executor via GraphQL or MCP\nResult: Your data lives in your executor, accessible to any app you authorize. No single app owns your social graph or content.","2-languages-protocol-abstraction#2. Languages (Protocol Abstraction)":"Languages are the bridge between AD4M and existing systems:\nA Language wraps any storage/communication protocol\nEach Language defines how to create/retrieve Expressions (data objects)\nExpressions get universal addresses: ://
\nExamples:\nhttp Language → http://example.com/data.json\nipfs Language → ipfs://Qm...\nholochain Language → uhC0k.../entry_hash\nCustom Language → Qm123.../my-id\nResult: AD4M can reference data from any system using a consistent address scheme.","3-perspectives-subjective-knowledge-graphs#3. Perspectives (Subjective Knowledge Graphs)":"Perspectives are RDF-like graphs built from links (triples):\n \nExample perspective:\n \n \"Hello World\"\n \nYour perspective can mix data from any Language:\nHTTP URLs alongside IPFS hashes\nHolochain entries linked to local files\nSemantic triples connecting it all\nResult: True data portability — your knowledge graph transcends individual platforms.","4-subject-classes-sdna#4. Subject Classes (SDNA)":"SHACL-based schemas that give structure to the link graph:\n:MessageShape a sh:NodeShape ;\n sh:targetClass :Message ;\n sh:property [\n sh:path :body ;\n sh:datatype xsd:string ;\n sh:maxCount 1 ;\n sh:minCount 1 ;\n ] ;\n sh:property [\n sh:path :author ;\n sh:class :Agent ;\n sh:maxCount 1 ;\n ] .\nSDNA provides:\nValidation rules enforced across the network\nTyped properties (string, integer, Agent, etc.)\nCollections (one-to-many relationships)\nActions (state transitions via SHACL Flow)\nResult: Structured data on top of the flexible link graph — ORM-like ergonomics with RDF's flexibility.","5-neighbourhoods-shared-perspectives#5. Neighbourhoods (Shared Perspectives)":"Perspectives can be published as Neighbourhoods — shared spaces synced P2P:\nBuilt on Holochain DHT (distributed hash table)\nSDNA enforced by all members (validation rules)\nReal-time synchronization via gossip protocol\nEach member has a local replica\nResult: Truly P2P collaboration — no servers, no single point of failure, agent-centric validation.","spanning-layer-in-action#Spanning Layer in Action":"","scenario-cross-platform-social-graph#Scenario: Cross-Platform Social Graph":"Alice runs AD4M on her laptop\nHer perspective contains links to:\nTwitter posts (via HTTP Language)\nPhotos on IPFS (via IPFS Language)\nMessages in a Holochain neighbourhood\nLocal notes (via File Language)\nShe publishes a Channel neighbourhood with Message SDNA\nBob (human) and DataBot (AI agent) join the neighbourhood\nAll three can post messages, validated by the shared SDNA\nEach member's executor syncs changes P2P via Holochain\nWithout AD4M: Alice's data is trapped in silos. She needs separate accounts, separate APIs, no interoperability.With AD4M: Alice's data lives in her perspective, portable across protocols. Her social graph spans HTTP, IPFS, and Holochain seamlessly.","why-this-matters-for-ai-agents#Why This Matters for AI Agents":"AD4M's spanning layer is particularly powerful for AI agents because:\nSemantic understanding — RDF-like links provide explicit relationships\nProtocol agnostic — agents don't need to learn every API, just AD4M\nStructured data — SDNA defines clear schemas (no guessing)\nDistributed intelligence — agents can join neighbourhoods and collaborate P2P\nCryptographic provenance — every action is signed, auditable\nUsing MCP, AI agents can:\nDiscover data models via get_models\nCreate structured data via auto-generated tools\nJoin neighbourhoods and collaborate with humans\nSubscribe to changes and react in real-time","further-reading#Further Reading":"MCP Integration Guide — how AI agents use AD4M\nModel Classes — defining SHACL SDNA\nPerspectives — understanding subjective graphs\nNeighbourhoods — P2P shared spaces\nLanguages — protocol abstractions\nThe vision: A spanning layer where data is portable, agents are sovereign, and collective intelligence emerges from the synergy of humans and AI collaborating across any protocol. AD4M is the infrastructure for that future."}}} \ No newline at end of file diff --git a/docs/agents.html b/docs/agents.html new file mode 100644 index 000000000..68bb084b2 --- /dev/null +++ b/docs/agents.html @@ -0,0 +1,113 @@ +Agents: The Foundation of AD4M | AD4M Docs
Agents

Agents: The Foundation of AD4M

+

Agent-Centric Architecture

+

In AD4M, we take a fundamentally different approach to building distributed systems. Instead of treating data as the primary building block, we place agents – humans and their computers – at the center of our architecture. This philosophical shift from "data-centric" to "agent-centric" has profound implications for how we build and interact with digital systems.

+

Why Agent-Centric?

+

In traditional web architectures, data is treated as an objective, standalone entity that exists independently of its creators and consumers. This leads to centralized data silos, privacy concerns, and a disconnect between users and their digital footprint.

+

AD4M's agent-centric approach recognizes that:

+
    +
  • All data is fundamentally a claim or statement made by an agent
  • +
  • Trust and context come from understanding who made a claim
  • +
  • Agents should have sovereignty over their data and digital identity
  • +
  • Interactions should be peer-to-peer between agents
  • +
+

Technical Implementation

+

Decentralized Identifiers (DIDs)

+

Every agent in AD4M is identified by a Decentralized Identifier (DID) (opens in a new tab). DIDs are globally unique identifiers that:

+
    +
  • Are fully controlled by the agent
  • +
  • Can be resolved to cryptographic keys
  • +
  • Enable verifiable, decentralized digital identity
  • +
+
// Generate a new agent with associated DID
+await ad4m.agent.generate("YourSecurePassword");
+ 
+// Get your agent's DID and information
+const { did, perspective } = await ad4m.agent.me();
+

Agent Expressions

+

AD4M comes with a built-in "agent bootstrap language" that resolves DIDs to AgentExpression objects. An AgentExpression contains:

+
class Agent {
+  // The agent's DID - their unique identifier
+  did: string;
+ 
+  // The agent's public semantic profile
+  perspective?: Perspective;
+ 
+  // Address of the language used for direct messaging
+  directMessageLanguage?: string;
+}
+

The perspective field is particularly important as it serves as the agent's "homepage" in the semantic web – a public space where they can share information about themselves using semantic links.

+

Cryptographic Keys and Signatures

+

AD4M manages cryptographic keys associated with an agent's DID. These keys are used to:

+
    +
  • Sign expressions created by the agent
  • +
  • Verify the authenticity of expressions from other agents
  • +
  • Establish secure communication channels
  • +
+

When an agent creates an expression, AD4M automatically signs it with their private key:

+
// The expression will be signed with the agent's key
+const expression = await ad4m.expression.create(languageAddress, content);
+

Communication Between Agents

+

Agents can communicate directly with each other through AD4M's messaging system. The runtime client provides convenient functions that handle the underlying direct message language mechanics:

+
// Send a message to another agent
+await ad4m.runtime.sendMessage(recipientDID, "Hello!");
+ 
+// Listen for incoming messages
+ad4m.runtime.addMessageCallback((message) => {
+  console.log("Message from:", message.from);
+  console.log("Content:", message.content);
+});
+

Under the hood, AD4M uses the recipient's preferred direct message language (specified in their AgentExpression) to deliver the message. This abstraction ensures that:

+
    +
  • Messages are delivered using the recipient's chosen communication method
  • +
  • The underlying transport mechanism can be changed without affecting applications
  • +
  • Messages are properly encrypted and signed
  • +
+

You can also check if an agent is available for messaging:

+
// Get another agent's information
+const otherAgent = await ad4m.agent.byDID(someDID);
+ 
+// Check if they have messaging capability
+if (otherAgent.directMessageLanguage) {
+  // They can receive messages
+}
+

Agent Perspectives

+

Every agent has a public perspective that acts as their semantic profile. This perspective can contain:

+
    +
  • Personal information
  • +
  • Social connections
  • +
  • Published content
  • +
  • Public keys
  • +
  • Contact methods
  • +
+

The perspective uses semantic links to create a rich web of information:

+
// Add information to your public perspective
+const { did } = await ad4m.agent.me();
+await ad4m.agent.updatePublicPerspective({
+  links: [
+    { source: did, predicate: "foaf://name", target: "literal://string:Alice" },
+    { source: did, predicate: "foaf://knows", target: "did:key:other-agent" }
+  ]
+});
+

Security and Privacy

+

The agent-centric model provides several security benefits:

+
    +
  • All expressions are cryptographically signed
  • +
  • Agents have full control over their keys and identity
  • +
  • Communication can be encrypted end-to-end
  • +
  • Trust is built on verifiable claims and signatures
  • +
+
+

For more details about working with agents programmatically, see the Agent class definition.


AD4M - The first social network
\ No newline at end of file diff --git a/docs/agents/index.html b/docs/agents/index.html deleted file mode 100644 index fade80edc..000000000 --- a/docs/agents/index.html +++ /dev/null @@ -1,113 +0,0 @@ -Agents: The Foundation of AD4M | AD4M Docs
Agents

Agents: The Foundation of AD4M

-

Agent-Centric Architecture

-

In AD4M, we take a fundamentally different approach to building distributed systems. Instead of treating data as the primary building block, we place agents – humans and their computers – at the center of our architecture. This philosophical shift from "data-centric" to "agent-centric" has profound implications for how we build and interact with digital systems.

-

Why Agent-Centric?

-

In traditional web architectures, data is treated as an objective, standalone entity that exists independently of its creators and consumers. This leads to centralized data silos, privacy concerns, and a disconnect between users and their digital footprint.

-

AD4M's agent-centric approach recognizes that:

-
    -
  • All data is fundamentally a claim or statement made by an agent
  • -
  • Trust and context come from understanding who made a claim
  • -
  • Agents should have sovereignty over their data and digital identity
  • -
  • Interactions should be peer-to-peer between agents
  • -
-

Technical Implementation

-

Decentralized Identifiers (DIDs)

-

Every agent in AD4M is identified by a Decentralized Identifier (DID) (opens in a new tab). DIDs are globally unique identifiers that:

-
    -
  • Are fully controlled by the agent
  • -
  • Can be resolved to cryptographic keys
  • -
  • Enable verifiable, decentralized digital identity
  • -
-
// Generate a new agent with associated DID
-await ad4m.agent.generate("YourSecurePassword");
- 
-// Get your agent's DID and information
-const { did, perspective } = await ad4m.agent.me();
-

Agent Expressions

-

AD4M comes with a built-in "agent bootstrap language" that resolves DIDs to AgentExpression objects. An AgentExpression contains:

-
class Agent {
-  // The agent's DID - their unique identifier
-  did: string;
- 
-  // The agent's public semantic profile
-  perspective?: Perspective;
- 
-  // Address of the language used for direct messaging
-  directMessageLanguage?: string;
-}
-

The perspective field is particularly important as it serves as the agent's "homepage" in the semantic web – a public space where they can share information about themselves using semantic links.

-

Cryptographic Keys and Signatures

-

AD4M manages cryptographic keys associated with an agent's DID. These keys are used to:

-
    -
  • Sign expressions created by the agent
  • -
  • Verify the authenticity of expressions from other agents
  • -
  • Establish secure communication channels
  • -
-

When an agent creates an expression, AD4M automatically signs it with their private key:

-
// The expression will be signed with the agent's key
-const expression = await ad4m.expression.create(languageAddress, content);
-

Communication Between Agents

-

Agents can communicate directly with each other through AD4M's messaging system. The runtime client provides convenient functions that handle the underlying direct message language mechanics:

-
// Send a message to another agent
-await ad4m.runtime.sendMessage(recipientDID, "Hello!");
- 
-// Listen for incoming messages
-ad4m.runtime.addMessageCallback((message) => {
-  console.log("Message from:", message.from);
-  console.log("Content:", message.content);
-});
-

Under the hood, AD4M uses the recipient's preferred direct message language (specified in their AgentExpression) to deliver the message. This abstraction ensures that:

-
    -
  • Messages are delivered using the recipient's chosen communication method
  • -
  • The underlying transport mechanism can be changed without affecting applications
  • -
  • Messages are properly encrypted and signed
  • -
-

You can also check if an agent is available for messaging:

-
// Get another agent's information
-const otherAgent = await ad4m.agent.byDID(someDID);
- 
-// Check if they have messaging capability
-if (otherAgent.directMessageLanguage) {
-  // They can receive messages
-}
-

Agent Perspectives

-

Every agent has a public perspective that acts as their semantic profile. This perspective can contain:

-
    -
  • Personal information
  • -
  • Social connections
  • -
  • Published content
  • -
  • Public keys
  • -
  • Contact methods
  • -
-

The perspective uses semantic links to create a rich web of information:

-
// Add information to your public perspective
-const { did } = await ad4m.agent.me();
-await ad4m.agent.updatePublicPerspective({
-  links: [
-    { source: did, predicate: "foaf://name", target: "literal://string:Alice" },
-    { source: did, predicate: "foaf://knows", target: "did:key:other-agent" }
-  ]
-});
-

Security and Privacy

-

The agent-centric model provides several security benefits:

-
    -
  • All expressions are cryptographically signed
  • -
  • Agents have full control over their keys and identity
  • -
  • Communication can be encrypted end-to-end
  • -
  • Trust is built on verifiable claims and signatures
  • -
-
-

For more details about working with agents programmatically, see the Agent class definition.


AD4M - The first social network
\ No newline at end of file diff --git a/docs/auth/index.html b/docs/auth.html similarity index 51% rename from docs/auth/index.html rename to docs/auth.html index 4b09f3b73..717a582e0 100644 --- a/docs/auth/index.html +++ b/docs/auth.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
Authentication

Authentication & Capabilities

+
Authentication

Authentication & Capabilities

Overview

AD4M uses a capability-based security model to protect user data and control access to agent functionality. Every application that wants to interact with an AD4M executor needs to request specific capabilities, which are then granted (or denied) by the user.

What are Capabilities?

@@ -154,5 +154,5 @@

For more details about implementing authentication in your application:


AD4M - The first social network
\ No newline at end of file +
  • See the Ad4mClient API reference
  • +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/ai/index.html b/docs/developer-guides/ai.html similarity index 62% rename from docs/developer-guides/ai/index.html rename to docs/developer-guides/ai.html index 83df77ab3..8824988f8 100644 --- a/docs/developer-guides/ai/index.html +++ b/docs/developer-guides/ai.html @@ -11,7 +11,8 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Developer Guides
    Local AI inference with AD4M

    AI in AD4M

    +
    Developer Guides
    Local AI inference with AD4M

    AI in AD4M

    +

    Looking for AI agent integration? This page covers running AI models inside AD4M. If you want AI agents to use AD4M — creating perspectives, managing data, joining neighbourhoods — see the MCP Server guide.

    AD4M provides powerful AI capabilities through both local and remote model inference. This allows you to integrate various AI models into your applications, from language models to embedding models and speech recognition.

    Overview

    The AI system in AD4M supports:

    @@ -330,4 +331,4 @@

    No need to manually close streams if the client disconnects
  • Resources are freed automatically when streams are abandoned
  • Streams remain active as long as they receive audio data regularly
  • -


    AD4M - The first social network
    \ No newline at end of file +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/batch-operations.html b/docs/developer-guides/batch-operations.html new file mode 100644 index 000000000..750ad38d2 --- /dev/null +++ b/docs/developer-guides/batch-operations.html @@ -0,0 +1,216 @@ +Batch Operations | AD4M Docs
    Developer Guides
    Using Batch Operations

    Batch Operations

    +

    Overview

    +

    Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This is useful when you need to perform multiple related changes that should either all succeed or all fail together, and when you want to optimize performance by reducing internal engine updates (SurrealDB indexing, and Prolog inference if activated) and network operations.

    +

    Key Benefits

    +

    1. Atomicity

    +
      +
    • All operations in a batch are applied together or none are applied
    • +
    • Prevents partial updates that could leave your data in an inconsistent state
    • +
    • Ideal for complex operations that require multiple related changes
    • +
    +

    2. Performance Optimization

    +
      +
    • Reduces the number of internal engine updates (SurrealDB indexing, query subscriptions, and Prolog inference if activated)
    • +
    • Minimizes the number of commits to the neighbourhood's link language
    • +
    • Batches network operations for shared perspectives
    • +
    • Improves overall system responsiveness when making multiple changes
    • +
    +

    Using Transactions

    +

    The recommended way to use batch operations is Ad4mModel.transaction(), which creates a batch, runs your callback, and commits only on success:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  const recipe = await Recipe.create(perspective, { name: "Cake" }, { batchId: tx.batchId });
    + 
    +  const comment = new Comment(perspective);
    +  comment.body = "Looks great!";
    +  await comment.save(tx.batchId);
    + 
    +  // Relation methods also accept batchId
    +  await recipe.addComments(comment, tx.batchId);
    +});
    +// All operations commit together, or none do if an error is thrown
    +

    If any operation inside the callback throws, the batch is never committed and no changes are persisted.

    +

    Complex Data Models

    +

    When your application needs to maintain relationships between multiple entities:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  const userProfile = await UserProfile.create(perspective, { name: "Alice" }, { batchId: tx.batchId });
    +  const userSettings = await UserSettings.create(perspective, { theme: "dark" }, { batchId: tx.batchId });
    + 
    +  for (const preference of userPreferences) {
    +    await preference.save(tx.batchId);
    +  }
    +});
    +

    Bulk Operations

    +

    When performing operations on multiple items:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  for (const task of tasks) {
    +    task.status = 'completed';
    +    await task.save(tx.batchId);
    +  }
    +});
    +

    State Transitions

    +

    When an operation requires multiple coordinated changes:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  await sourceList.removeTask(task, tx.batchId);
    +  await targetList.addTask(task, tx.batchId);
    +  task.status = 'moved';
    +  await task.save(tx.batchId);
    +});
    +

    Creating Related Subjects

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  // Create main subject
    +  const post = await BlogPost.create(perspective, { title: "My First Post" }, { batchId: tx.batchId });
    + 
    +  // Create related subjects
    +  const comments = initialComments.map(text => {
    +    const c = new Comment(perspective);
    +    c.content = text;
    +    c.postId = post.id;
    +    return c;
    +  });
    + 
    +  // Save all related subjects in the same transaction
    +  await Promise.all(comments.map(c => c.save(tx.batchId)));
    +});
    +

    Validation Before Commit

    +

    Validate data before any writes — if validation fails, the thrown error prevents commit:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  // Validate all ingredients first
    +  for (const ingredient of ingredients) {
    +    if (!await validateIngredient(ingredient)) {
    +      throw new Error(`Invalid ingredient: ${ingredient}`);
    +    }
    +  }
    + 
    +  // If all valid, proceed with updates
    +  recipe.ingredients = ingredients;
    +  await recipe.save(tx.batchId);
    + 
    +  // Create ingredient references
    +  for (const ingredient of ingredients) {
    +    const ref = new IngredientReference(perspective);
    +    ref.recipeId = recipe.id;
    +    ref.ingredientId = ingredient.id;
    +    await ref.save(tx.batchId);
    +  }
    +});
    +// Nothing is persisted if validation threw
    +

    Advanced: Manual Batch Control

    +

    For lower-level control (e.g. mixing model operations with raw link operations), you can manage batches directly via PerspectiveProxy:

    +
    const batchId = await perspective.createBatch();
    + 
    +try {
    +  // Add multiple links in the batch
    +  await perspective.add(link1, 'shared', batchId);
    +  await perspective.add(link2, 'shared', batchId);
    +  
    +  // Remove a link in the same batch
    +  await perspective.remove(oldLink, batchId);
    +  
    +  // Update a link in the batch
    +  await perspective.update(existingLink, newLink, batchId);
    + 
    +  // Model operations also accept batchId
    +  const recipe = new Recipe(perspective);
    +  recipe.title = "Chocolate Cake";
    +  await recipe.save(batchId);
    + 
    +  // Commit all changes atomically
    +  const result = await perspective.commitBatch(batchId);
    +  console.log('Added:', result.additions.length);
    +  console.log('Removed:', result.removals.length);
    +} catch (error) {
    +  // If any operation fails, none of the changes are applied
    +  console.error('Batch operation failed:', error);
    +}
    +

    Under the hood, Ad4mModel.transaction() calls createBatch() and commitBatch() for you.

    +

    Technical Details

    +

    Batch Storage

    +
      +
    • Batches are stored in memory until committed
    • +
    • Each batch has a unique UUID
    • +
    • Changes are tracked separately for shared and local links
    • +
    +

    Engine Synchronization

    +
      +
    • Internal indexes (SurrealDB, query subscriptions, and Prolog facts if activated) are updated only once per batch commit
    • +
    • Updates are performed using a oneshot channel to ensure completion
    • +
    • The engine state remains consistent with all changes
    • +
    +

    Link Language Integration

    +
      +
    • For shared perspectives, commits to the link language happen only once per batch
    • +
    • Reduces network operations in distributed scenarios
    • +
    +

    Best Practices

    +
      +
    1. +

      Prefer transaction(): Use Ad4mModel.transaction() over manual createBatch()/commitBatch() — if the callback throws, the batch is not committed and no changes are persisted.

      +
    2. +
    3. +

      Batch Size: Keep batches focused on related operations. Avoid extremely large batches that could impact memory usage — split very large operations into multiple smaller batches.

      +
    4. +
    5. +

      Error Handling: With transaction(), errors thrown inside the callback automatically prevent commit. With manual batches, wrap operations in try/catch.

      +
    6. +
    7. +

      Resource Management: Don't keep batches open longer than necessary. With transaction() this is handled for you.

      +
    8. +
    9. +

      Testing: Test both successful and failed batch scenarios. Verify data consistency after batch operations.

      +
    10. +
    +

    Limitations and Considerations

    +
      +
    1. +

      Memory Usage

      +
        +
      • Batches store changes in memory until committed
      • +
      • Very large batches may impact system performance
      • +
      +
    2. +
    3. +

      Concurrency

      +
        +
      • Batch operations don't provide explicit locking
      • +
      • Consider application-level synchronization for concurrent operations
      • +
      +
    4. +
    5. +

      Network Connectivity

      +
        +
      • For shared perspectives, ensure stable network connectivity before committing large batches
      • +
      • Consider implementing retry logic for network-related failures
      • +
      +
    6. +
    +

    Migration Guide

    +

    Existing code using manual createBatch()/commitBatch() will continue to work. To modernize:

    +
    // Before: manual batch management
    +const batchId = await perspective.createBatch();
    +try {
    +  await recipe.save(batchId);
    +  await comment.save(batchId);
    +  await perspective.commitBatch(batchId);
    +} catch (error) {
    +  console.error(error);
    +}
    + 
    +// After: transaction() handles it
    +await Ad4mModel.transaction(perspective, async (tx) => {
    +  await recipe.save(tx.batchId);
    +  await comment.save(tx.batchId);
    +});
    +

    No schema changes or data migration is required.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/batch-operations/index.html b/docs/developer-guides/batch-operations/index.html deleted file mode 100644 index 4c31e6c58..000000000 --- a/docs/developer-guides/batch-operations/index.html +++ /dev/null @@ -1,254 +0,0 @@ -Batch Operations | AD4M Docs
    Developer Guides
    Using Batch Operations

    Batch Operations

    -

    Overview

    -

    Batch operations in AD4M allow you to group multiple perspective mutations into a single atomic transaction. This feature is particularly useful when you need to perform multiple related changes that should either all succeed or all fail together, or when you want to optimize performance by reducing the number of Prolog engine updates and network operations.

    -

    Key Benefits

    -

    1. Atomicity

    -
      -
    • All operations in a batch are applied together or none are applied
    • -
    • Prevents partial updates that could leave your data in an inconsistent state
    • -
    • Ideal for complex operations that require multiple related changes
    • -
    -

    2. Performance Optimization

    -
      -
    • Reduces the number of Prolog engine updates (which can be computationally expensive)
    • -
    • Minimizes the number of commits to the neighbourhood's link language
    • -
    • Batches network operations for shared perspectives
    • -
    • Improves overall system responsiveness when making multiple changes
    • -
    -

    Using Batch Operations

    -

    Basic Usage with PerspectiveProxy

    -
    // Create a new batch
    -const batchId = await perspective.createBatch();
    - 
    -try {
    -  // Add multiple links in the batch
    -  await perspective.add(link1, 'shared', batchId);
    -  await perspective.add(link2, 'shared', batchId);
    -  
    -  // Remove a link in the same batch
    -  await perspective.remove(oldLink, batchId);
    -  
    -  // Update a link in the batch
    -  await perspective.update(existingLink, newLink, batchId);
    -  
    -  // Commit all changes atomically
    -  const result = await perspective.commitBatch(batchId);
    -  console.log('Added:', result.additions.length);
    -  console.log('Removed:', result.removals.length);
    -} catch (error) {
    -  // If any operation fails, none of the changes are applied
    -  console.error('Batch operation failed:', error);
    -}
    -

    Using Batches with Ad4mModel

    -
    // Create a batch for model operations
    -const batchId = await perspective.createBatch();
    - 
    -try {
    -  // Create a new model instance
    -  const recipe = new Recipe(perspective);
    -  recipe.title = "Chocolate Cake";
    -  recipe.ingredients = ["Sugar", "Flour", "Cocoa"];
    -  await recipe.save(batchId);
    - 
    -  // Update another model in the same batch
    -  const existingRecipe = await Recipe.findAll(perspective)[0];
    -  existingRecipe.title = "Updated Title";
    -  await existingRecipe.update(batchId);
    - 
    -  // Delete a model in the batch
    -  await anotherRecipe.delete(batchId);
    - 
    -  // Commit all model changes together
    -  await perspective.commitBatch(batchId);
    -} catch (error) {
    -  console.error('Model batch operations failed:', error);
    -}
    -

    When to Use Batch Operations

    -

    1. Complex Data Models

    -

    When your application needs to maintain relationships between multiple entities:

    -
    const batchId = await perspective.createBatch();
    - 
    -// Create a user profile with related entities
    -await userProfile.save(batchId);
    -await userSettings.save(batchId);
    -for (const preference of userPreferences) {
    -  await preference.save(batchId);
    -}
    - 
    -await perspective.commitBatch(batchId);
    -

    2. Bulk Operations

    -

    When performing operations on multiple items:

    -
    const batchId = await perspective.createBatch();
    - 
    -// Bulk status update
    -for (const task of tasks) {
    -  task.status = 'completed';
    -  await task.update(batchId);
    -}
    - 
    -await perspective.commitBatch(batchId);
    -

    3. State Transitions

    -

    When an operation requires multiple coordinated changes:

    -
    const batchId = await perspective.createBatch();
    - 
    -// Moving a task between lists
    -await sourceList.removeTask(task, batchId);
    -await targetList.addTask(task, batchId);
    -await task.updateStatus('moved', batchId);
    - 
    -await perspective.commitBatch(batchId);
    -

    Technical Details

    -

    Batch Storage

    -
      -
    • Batches are stored in memory until committed
    • -
    • Each batch has a unique UUID
    • -
    • Changes are tracked separately for shared and local links
    • -
    -

    Prolog Engine Synchronization

    -
      -
    • Prolog facts are updated only once per batch commit
    • -
    • Updates are performed using a oneshot channel to ensure completion
    • -
    • The engine state remains consistent with all changes
    • -
    -

    Link Language Integration

    -
      -
    • For shared perspectives, commits to the link language happen only once per batch
    • -
    • Reduces network operations in distributed scenarios
    • -
    -

    Best Practices

    -
      -
    1. -

      Batch Size

      -
        -
      • Keep batches focused on related operations
      • -
      • Avoid extremely large batches that could impact memory usage
      • -
      • Consider splitting very large operations into multiple smaller batches
      • -
      -
    2. -
    3. -

      Error Handling

      -
      const batchId = await perspective.createBatch();
      -try {
      -  // Perform batch operations
      -  await perspective.commitBatch(batchId);
      -} catch (error) {
      -  // Handle errors appropriately
      -  // No changes will be persisted
      -}
      -
    4. -
    5. -

      Resource Management

      -
        -
      • Commit or abandon batches in a timely manner
      • -
      • Don't keep batches open longer than necessary
      • -
      • Consider using async/await patterns for better control flow
      • -
      -
    6. -
    7. -

      Testing

      -
        -
      • Test both successful and failed batch scenarios
      • -
      • Verify data consistency after batch operations
      • -
      • Include edge cases in your test suite
      • -
      -
    8. -
    -

    Limitations and Considerations

    -
      -
    1. -

      Memory Usage

      -
        -
      • Batches store changes in memory until committed
      • -
      • Very large batches may impact system performance
      • -
      -
    2. -
    3. -

      Concurrency

      -
        -
      • Batch operations don't provide explicit locking
      • -
      • Consider application-level synchronization for concurrent operations
      • -
      -
    4. -
    5. -

      Network Connectivity

      -
        -
      • For shared perspectives, ensure stable network connectivity before committing large batches
      • -
      • Consider implementing retry logic for network-related failures
      • -
      -
    6. -
    -

    Examples

    -

    Complex Subject Creation

    -
    const batchId = await perspective.createBatch();
    - 
    -// Create main subject
    -const post = new BlogPost(perspective);
    -post.title = "My First Post";
    -await post.save(batchId);
    - 
    -// Create related subjects
    -const comments = initialComments.map(comment => {
    -  const c = new Comment(perspective);
    -  c.content = comment;
    -  c.postId = post.baseExpression;
    -  return c;
    -});
    - 
    -// Save all related subjects in the same batch
    -await Promise.all(comments.map(c => c.save(batchId)));
    - 
    -// Commit everything together
    -await perspective.commitBatch(batchId);
    -

    Batch Processing with Validation

    -
    async function updateRecipeWithIngredients(recipe, ingredients) {
    -  const batchId = await perspective.createBatch();
    -  
    -  try {
    -    // Validate all ingredients first
    -    for (const ingredient of ingredients) {
    -      if (!await validateIngredient(ingredient)) {
    -        throw new Error(`Invalid ingredient: ${ingredient}`);
    -      }
    -    }
    -    
    -    // If all valid, proceed with updates
    -    recipe.ingredients = ingredients;
    -    await recipe.update(batchId);
    -    
    -    // Create ingredient references
    -    for (const ingredient of ingredients) {
    -      const ref = new IngredientReference(perspective);
    -      ref.recipeId = recipe.baseExpression;
    -      ref.ingredientId = ingredient.id;
    -      await ref.save(batchId);
    -    }
    -    
    -    await perspective.commitBatch(batchId);
    -  } catch (error) {
    -    // No changes are persisted if any operation fails
    -    throw new Error(`Failed to update recipe: ${error.message}`);
    -  }
    -}
    -

    Migration Guide

    -

    Existing code will continue to work without modification. To adopt batch operations:

    -
      -
    1. Identify groups of related operations in your code
    2. -
    3. Create a batch using perspective.createBatch()
    4. -
    5. Add the batchId parameter to your operations
    6. -
    7. Wrap operations in try/catch blocks
    8. -
    9. Commit the batch when all operations are complete
    10. -
    -

    No schema changes or data migration is required to use this feature.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/cli/index.html b/docs/developer-guides/cli.html similarity index 62% rename from docs/developer-guides/cli/index.html rename to docs/developer-guides/cli.html index 2fd665b7f..8186c23d7 100644 --- a/docs/developer-guides/cli/index.html +++ b/docs/developer-guides/cli.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Developer Guides
    Using the AD4M CLI

    AD4M Command Line Tools

    +
    Developer Guides
    Using the AD4M CLI

    AD4M Command Line Tools

    AD4M provides two command-line tools that enable developers to work with AD4M in headless and scripting scenarios:

    • ad4m-executor: A full AD4M node implementation (similar to the Launcher but without UI)
    • @@ -222,4 +222,4 @@

      ad4m dev publish-and-test-expression-language <language-path> <data>

    For a complete list of commands and their options:

    ad4m --help
    -ad4m <command> --help

    AD4M - The first social network
    \ No newline at end of file +ad4m <command> --help

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/hooks/index.html b/docs/developer-guides/hooks.html similarity index 52% rename from docs/developer-guides/hooks/index.html rename to docs/developer-guides/hooks.html index 7273b15a9..ae9c65f69 100644 --- a/docs/developer-guides/hooks/index.html +++ b/docs/developer-guides/hooks.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Developer Guides
    Hooking up models to the UI

    AD4M React Hooks

    +
    Developer Guides
    Hooking up models to the UI

    AD4M React Hooks

    AD4M provides a set of React hooks to easily work with core AD4M concepts like Agents, Perspectives, and Subjects. These hooks handle state management, caching, and real-time updates automatically.

    useClient

    The most fundamental hook that provides access to the AD4M client instance.

    @@ -134,34 +134,36 @@

    </div> ); }

    -

    useModel

    -

    Provides a convenient way to query and subscribe to AD4M models with pagination support.

    -
    import { useModel } from '@coasys/ad4m-react-hooks';
    +

    useLiveQuery

    +

    Provides reactive, live-updating access to AD4M model data with support for collections, single instances, pagination, and parent-scoped queries. Replaces the previous useModel hook.

    +

    Collection Mode (default)

    +
    import { useLiveQuery } from '@coasys/ad4m-react-hooks';
     import { Todo } from './models/Todo';
      
     function TodoList({ perspective }) {
    -  const { entries, loading, error, totalCount, loadMore } = useModel<Todo>({
    +  const { data, loading, error, totalCount, loadMore } = useLiveQuery(
    +    Todo,
         perspective,
    -    model: Todo,
    -    query: { /* optional query parameters */ },
    -    pageSize: 10, // Optional - enables pagination
    -    preserveReferences: true // Optional - improves rendering performance
    -  });
    +    {
    +      query: { where: { status: "active" } },
    +      pageSize: 10,
    +    }
    +  );
      
       if (error) return <div>Error: {error}</div>;
    -  if (loading && entries.length === 0) return <div>Loading...</div>;
    +  if (loading && data.length === 0) return <div>Loading...</div>;
      
       return (
         <div>
           <h2>Todos ({totalCount})</h2>
    -      {entries.map(todo => (
    -        <div key={todo.baseExpression}>
    +      {data.map(todo => (
    +        <div key={todo.id}>
               <h3>{todo.title}</h3>
               <p>{todo.description}</p>
             </div>
           ))}
      
    -      {entries.length < totalCount && (
    +      {data.length < totalCount && (
             <button onClick={loadMore} disabled={loading}>
               {loading ? 'Loading...' : 'Load More'}
             </button>
    @@ -169,6 +171,71 @@ 

    </div> ); }

    +

    Single-Instance Mode

    +

    When you provide id in options, the hook returns a single item instead of an array:

    +
    function TodoDetail({ perspective, todoId }) {
    +  const { data: todo, loading, error } = useLiveQuery(
    +    Todo,
    +    perspective,
    +    { id: todoId }
    +  );
    + 
    +  if (loading) return <div>Loading...</div>;
    +  if (error) return <div>Error: {error}</div>;
    +  if (!todo) return <div>Not found</div>;
    + 
    +  return <h2>{todo.title}</h2>;
    +}
    +

    Parent-Scoped Queries

    +

    Filter results to children of a specific parent:

    +
    function RecipeComments({ perspective, recipe }) {
    +  const { data: comments } = useLiveQuery(
    +    Comment,
    +    perspective,
    +    {
    +      parent: { model: Recipe, id: recipe.id }
    +    }
    +  );
    + 
    +  return (
    +    <ul>
    +      {comments.map(c => <li key={c.id}>{c.body}</li>)}
    +    </ul>
    +  );
    +}
    +

    Return Types

    +

    Collection mode (LiveCollectionResult<T>):

    +
      +
    • data: T[] — Array of model instances
    • +
    • loading: boolean — Whether a query is in progress
    • +
    • error: string — Error message if any
    • +
    • totalCount: number — Total matching items (for pagination)
    • +
    • loadMore: () => void — Load next page
    • +
    +

    Single-instance mode (LiveInstanceResult<T>):

    +
      +
    • data: T | null — The model instance or null
    • +
    • loading: boolean
    • +
    • error: string
    • +
    +

    Vue Usage

    +

    The Vue hook has the same API but returns Vue Ref-wrapped values and accepts ComputedRef<PerspectiveProxy> for the perspective parameter:

    +
    import { useLiveQuery } from '@coasys/ad4m-vue-hooks';
    + 
    +const { data, loading, error, totalCount, loadMore } = useLiveQuery(
    +  Todo,
    +  perspective,  // Can be a ComputedRef
    +  { pageSize: 10 }
    +);
    + 
    +// data.value is T[] (collection) or T | null (single-instance)
    +

    The Vue hook automatically re-subscribes when the perspective ref changes, and cleans up subscriptions on unmount.

    +

    Important Notes

    +
      +
    • Registration: Call <ModelClass>.register(perspective) once at app startup (e.g., await Recipe.register(perspective)) — the hook does not register models automatically. Use the concrete generated class, not the @Model decorator.
    • +
    • Cleanup: Subscriptions are automatically disposed on component unmount.
    • +
    • String model support: You can pass a model class name string instead of a class for dynamic/generic use cases.
    • +

    Best Practices

    1. @@ -199,15 +266,8 @@

      Use TypeScript for better type safety

      -
      interface TodoSubject {
      -  id: string;
      -  title: string;
      -  description: string;
      -}
      - 
      -const { entries } = useSubjects<TodoSubject>({
      -  perspective,
      -  subject: 'Todo'
      -});
      +
      // useLiveQuery is fully typed — generics are inferred from the model class
      +const { data } = useLiveQuery(Todo, perspective);
      +// data is Todo[] with full autocomplete

    2. -

    AD4M - The first social network
    \ No newline at end of file +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/mcp.html b/docs/developer-guides/mcp.html new file mode 100644 index 000000000..6b34b311b --- /dev/null +++ b/docs/developer-guides/mcp.html @@ -0,0 +1,233 @@ +MCP Server (AI Agent Integration) | AD4M Docs
    Developer Guides
    MCP Server (AI Agent Integration)

    MCP Server (AI Agent Integration)

    +

    AD4M includes a built-in Model Context Protocol (MCP) (opens in a new tab) server, enabling AI agents to interact with AD4M's spanning layer natively — creating perspectives, managing data models, joining neighbourhoods, and participating in distributed collective intelligence through a standardised protocol.

    +

    What is MCP? The Model Context Protocol is an open standard that lets AI applications discover and use tools exposed by external services. Any MCP-compatible client (OpenClaw, Claude Desktop, Cursor, etc.) can connect to AD4M's MCP server.

    +

    Why MCP?

    +

    While AD4M's GraphQL API provides full programmatic access, MCP is purpose-built for AI agents:

    +
      +
    • Tool discovery — agents automatically discover available operations and their parameters
    • +
    • Dynamic tools — SHACL subject classes generate domain-specific tools at runtime (e.g., channel_create, message_set_body)
    • +
    • Natural descriptions — every tool includes LLM-optimised descriptions with examples
    • +
    • Authentication built-in — signup, login, and JWT management through MCP tools themselves
    • +
    +

    Enabling the MCP Server

    +

    Option 1: AD4M Launcher — Open Settings and enable the "MCP Server" toggle. Configure the port (default: 3001). Restart the launcher for changes to take effect.

    +

    Option 2: CLI — Pass --enable-mcp true when starting the executor:

    +
    ad4m-executor run \
    +  --app-data-path ~/.ad4m \
    +  --admin-credential my-secret \
    +  --gql-port 12100 \
    +  --enable-mcp true
    +

    The MCP server starts on port 3001 by default, serving Streamable HTTP at /mcp.

    +

    Connecting an AI Agent

    +

    OpenClaw

    +

    Add AD4M as an MCP server in your OpenClaw configuration:

    +
    {
    +  "mcpServers": {
    +    "ad4m": {
    +      "url": "http://localhost:3001/mcp"
    +    }
    +  }
    +}
    +

    Once connected, your agent can call any AD4M tool directly. An OpenClaw skill (opens in a new tab) is also available with setup guides and reference material.

    +

    Other MCP Clients

    +

    Any MCP client supporting Streamable HTTP transport can connect to http://localhost:3001/mcp. Refer to your client's documentation for configuration.

    +

    Authentication

    +

    AD4M's MCP server supports two authentication modes:

    +

    Single-User Mode (Local Development)

    +

    When running a personal executor, use the admin credential:

    +
    # The same credential passed to --admin-credential when starting the executor
    +# Include as Authorization: <credential> header in MCP transport config
    +

    For local development, this is the simplest approach — no signup/login needed.

    +

    Multi-User Mode

    +

    For shared executors serving multiple users, AD4M provides a full auth flow through MCP tools:

    +
      +
    1. signup — Create an account with email and password
    2. +
    3. login_email — Authenticate and receive a JWT
    4. +
    5. verify_email_code — Verify email (if SMTP is configured)
    6. +
    7. auth_status — Check current authentication state
    8. +
    +
    → signup(email: "agent@example.com", password: "secure-pass")
    +← { did: "did:key:z6Mk...", success: true }
    +
    +→ login_email(email: "agent@example.com", password: "secure-pass")
    +← { token: "eyJ...", success: true }
    +

    After login, the JWT is stored in the MCP session and used automatically for all subsequent tool calls. Each user gets their own DID and isolated perspective space.

    +
    ⚠️

    Unauthenticated connections can only access auth tools (signup, login, verify, auth_status). All other tools require a valid JWT or admin credential.

    +

    Available Tools

    +

    Tools are organised by domain. Dynamic tools (generated from SHACL subject classes) appear alongside these core tools.

    +

    Perspective & Link Tools

    +
    ToolDescription
    perspective_createCreate a new perspective (personal knowledge graph)
    perspective_listList all perspectives with metadata
    add_linkAdd an RDF-like triple to a perspective
    get_linksQuery links by source, predicate, or target
    remove_linkRemove a specific link
    +

    Subject (Model) Tools

    +
    ToolDescription
    get_modelsDiscover all SHACL-defined data models in a perspective
    get_subject_dataGet a subject instance by URI
    create_subjectCreate a new subject instance
    delete_subjectDelete a subject instance
    query_subjectsQuery subjects by class with optional filters
    +

    Dynamic SHACL Tools

    +

    AD4M's MCP server introspects SHACL subject class definitions in perspectives and generates tools dynamically at runtime. This means:

    +
      +
    1. Install or define SDNA (SHACL schemas) in a perspective
    2. +
    3. MCP server discovers the classes and their properties/collections
    4. +
    5. Tools appear automatically — no manual registration needed
    6. +
    7. AI agents can call get_models to discover available tools
    8. +
    +

    Tool generation rules:

    +
      +
    • Scalar properties (sh:maxCount 1) → {class}_set_{property} (setter), {class}_get_{property} (getter)
    • +
    • Collections (sh:maxCount > 1) → {class}_add_{collection} (add item), {class}_remove_{collection} (remove item)
    • +
    • Constructors{class}_create (required properties become parameters)
    • +
    • Actions (SHACL Flow) → {class}_{action_name} (state transitions, custom logic)
    • +
    +

    Example: A Channel SDNA added via add_model(class_name: "Channel", shacl_json: ...):

    +
    {
    +  "target_class": "app://Channel",
    +  "properties": [
    +    {
    +      "path": "app://has_name",
    +      "name": "name",
    +      "datatype": "xsd:string",
    +      "min_count": 1,
    +      "max_count": 1,
    +      "writable": true,
    +      "resolve_language": "literal"
    +    },
    +    {
    +      "path": "app://has_description",
    +      "name": "description",
    +      "datatype": "xsd:string",
    +      "max_count": 1,
    +      "writable": true,
    +      "resolve_language": "literal"
    +    },
    +    {
    +      "path": "app://has_member",
    +      "name": "members",
    +      "node_kind": "sh:IRI"
    +    },
    +    {
    +      "path": "app://has_message",
    +      "name": "messages",
    +      "node_kind": "sh:IRI"
    +    }
    +  ],
    +  "constructor": [
    +    { "action": "addLink", "source": "this", "predicate": "rdf://type", "target": "app://Channel" },
    +    { "action": "setSingleTarget", "source": "this", "predicate": "app://has_name", "target": "name" }
    +  ]
    +}
    +

    Generates these MCP tools:

    +
      +
    • channel_create(perspective_id, name, description?) — name is required
    • +
    • channel_set_name(perspective_id, uri, value) — update name
    • +
    • channel_set_description(perspective_id, uri, value) — update description
    • +
    • channel_add_members(perspective_id, uri, value) — add an Agent to members
    • +
    • channel_remove_members(perspective_id, uri, value) — remove an Agent
    • +
    • channel_add_messages(perspective_id, uri, value) — add a Message
    • +
    • channel_remove_messages(perspective_id, uri, value) — remove a Message
    • +
    • channel_get(perspective_id, uri) — retrieve full Channel data
    • +
    +

    All tools include LLM-optimized descriptions with examples, data types, and constraints.

    +

    Neighbourhood Tools

    +
    ToolDescription
    join_neighbourhoodJoin a neighbourhood by URL
    publish_neighbourhoodPublish a perspective as a shared neighbourhood
    +

    Agent & Profile Tools

    +
    ToolDescription
    agent_meGet the current agent's DID and status
    agent_unlockUnlock the agent keystore
    get_agent_public_perspectiveRead any agent's public profile
    set_agent_public_perspectiveUpdate your public profile links
    +

    Waker / Subscription Tools

    +
    ToolDescription
    subscribe_to_modelGenerate a reactive query configuration for monitoring model changes
    +

    Example Workflow

    +

    Here's a typical AI agent workflow — discover models, create data, query it back:

    +
    # 1. List perspectives
    +→ perspective_list()
    +← [{ uuid: "ab23...", name: "My Space", neighbourhood: null }]
    +
    +# 2. Discover available models
    +→ get_models(perspective_id: "ab23...")
    +← [{ name: "Task", properties: ["title", "status", "assignee"],
    +      collections: ["tags"] }]
    +
    +# 3. Create a task
    +→ task_create(perspective_id: "ab23...", title: "Review MCP docs",
    +              status: "open", assignee: "did:key:z6Mk...")
    +← { uri: "ad4m://task_1234", success: true }
    +
    +# 4. Add tags
    +→ task_add_tags(perspective_id: "ab23...", uri: "ad4m://task_1234",
    +                value: "documentation")
    +← { success: true }
    +
    +# 5. Query all open tasks
    +→ query_subjects(perspective_id: "ab23...", class_name: "Task",
    +                 filter: { status: "open" })
    +← [{ uri: "ad4m://task_1234", title: "Review MCP docs", status: "open" }]
    +

    Joining a Neighbourhood

    +

    AI agents can join shared spaces and participate alongside humans. Neighbourhoods are shared perspectives synced P2P via Holochain — they form the collaborative layer of AD4M's spanning architecture.

    +
    # Join an existing neighbourhood
    +→ join_neighbourhood(url: "neighbourhood://Qm...")
    +← { perspective_id: "cd45...", state: "SYNCED" }
    +
    +# Discover what models (SHACL subject classes) exist in this community
    +→ get_models(perspective_id: "cd45...")
    +← [{ name: "Message", properties: ["body", "author", "timestamp"],
    +      collections: ["reactions"] }]
    +
    +# Send a message (uses the auto-generated message_create tool)
    +→ message_create(perspective_id: "cd45...", body: "Hello from an AI agent! 🖖")
    +← { uri: "ad4m://msg_5678", success: true }
    +

    What just happened?

    +
      +
    1. Your agent joined a Holochain-backed shared space
    2. +
    3. The neighbourhood SDNA defined the data schema (Message class)
    4. +
    5. MCP tools were generated from the schema automatically
    6. +
    7. Your message was validated, signed with your DID, and synced to all members
    8. +
    9. Other agents (human and AI) see your message in real-time
    10. +
    +

    This is the spanning layer in action — your agent participates in a P2P network using SHACL-structured data, all through simple MCP tool calls.

    +

    Understanding the Spanning Layer Through MCP

    +

    When you use AD4M's MCP tools, you're interacting with multiple layers:

    +

    1. Agent Layer (Identity)

    +
      +
    • agent_me() → your DID (e.g., did:key:z6Mk...)
    • +
    • Every action is signed with your keys
    • +
    • Cryptographic provenance on all data
    • +
    +

    2. Perspective Layer (Knowledge Graph)

    +
      +
    • perspective_create(), add_link(), get_links()
    • +
    • Your subjective view of data — links between expressions
    • +
    • Mix data from any protocol/language in one graph
    • +
    +

    3. Language Layer (Protocol Abstraction)

    +
      +
    • Expressions have addresses like <language_hash>://<address>
    • +
    • Languages wrap existing systems (HTTP, IPFS, Holochain)
    • +
    • Global addressing scheme — reference any data from anywhere
    • +
    +

    4. Subject Class Layer (Structured Data)

    +
      +
    • SHACL SDNA defines models (Channel, Message, Task, etc.)
    • +
    • Tools auto-generate from schemas
    • +
    • Validation rules enforced across the network
    • +
    +

    5. Neighbourhood Layer (Collaboration)

    +
      +
    • Shared perspectives synced P2P
    • +
    • SDNA enforced by all members
    • +
    • Real-time synchronization via Holochain
    • +
    +

    The key insight: You don't need to understand Holochain, SHACL, or RDF to use AD4M. The MCP tools provide a clean abstraction that hides complexity while preserving the power of the spanning layer architecture.

    +

    Further Reading

    +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/model-classes.html b/docs/developer-guides/model-classes.html new file mode 100644 index 000000000..49804e009 --- /dev/null +++ b/docs/developer-guides/model-classes.html @@ -0,0 +1,780 @@ +Model Classes in AD4M | AD4M Docs
    Developer Guides
    Defining and using Model Classes

    Model Classes in AD4M

    +

    Model classes in AD4M provide a way to define, store, and query structured data in your application. They follow familiar ORM conventions (ActiveRecord-style) and generate SHACL schemas automatically.

    +

    Quick Start

    +

    There are two ways to create model classes in AD4M:

    +

    Option 1: Using Decorators (Recommended)

    +
    import { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m';
    + 
    +@Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  @Property({ through: "recipe://name" })
    +  name: string = "";
    + 
    +  @HasMany({ through: "recipe://ingredient" })
    +  ingredients: string[] = [];
    +}
    + 
    +// Register the model with a perspective (once at app startup)
    +await Recipe.register(perspective);
    + 
    +// Using the model
    +const recipe = new Recipe(perspective);
    +recipe.name = "Chocolate Cake";
    +recipe.ingredients = ["flour", "sugar", "cocoa"];
    +await recipe.save();
    + 
    +// Reading it back
    +const recipes = await Recipe.findAll(perspective);
    +console.log(recipes[0].name); // "Chocolate Cake"
    + 
    +// Or use the static create shorthand
    +const cake = await Recipe.create(perspective, {
    +  name: "Chocolate Cake",
    +  ingredients: ["flour", "sugar", "cocoa"]
    +});
    +

    Option 2: From JSON Schema (Dynamic)

    +

    Perfect for integrating with external systems or when you have existing JSON Schema definitions:

    +
    import { Ad4mModel } from '@coasys/ad4m';
    + 
    +// Define your data structure using JSON Schema
    +const recipeSchema = {
    +  "$schema": "http://json-schema.org/draft-07/schema#",
    +  "title": "Recipe",
    +  "type": "object",
    +  "properties": {
    +    "name": { "type": "string" },
    +    "ingredients": { 
    +      "type": "array", 
    +      "items": { "type": "string" } 
    +    },
    +    "difficulty": { "type": "number" }
    +  },
    +  "required": ["name"]
    +};
    + 
    +// Dynamically create the model class
    +const Recipe = Ad4mModel.fromJSONSchema(recipeSchema, {
    +  name: "Recipe",
    +  namespace: "recipe://",
    +  resolveLanguage: "literal"
    +});
    + 
    +// Use exactly like decorator-based models
    +const recipe = new Recipe(perspective);
    +recipe.name = "Chocolate Cake";
    +recipe.ingredients = ["flour", "sugar", "cocoa"];
    +recipe.difficulty = 3;
    +await recipe.save();
    +

    Register your model before use:

    +
    await Recipe.register(perspective);
    +
    ⚠️

    Always register your model classes with the perspective before use (typically once at app startup). +This installs the SHACL schema so that all consumers (JS, Rust, MCP, CLI) can discover and work with your model's shape.

    +

    Basic Concepts

    +

    Properties

    +

    Properties are the basic building blocks of your models. They are optional by default — no link is created in the graph until you explicitly set a value.

    +
    @Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  // Optional property (default) — only stored when explicitly set
    +  @Property({ through: "recipe://name" })
    +  name: string = "";
    + 
    +  // Optional property — same behavior
    +  @Property({ through: "recipe://description" })
    +  description?: string;
    + 
    +  // Required property — a placeholder link is created on save
    +  @Property({ through: "recipe://category", required: true })
    +  category: string = "";
    + 
    +  // Read-only computed property — `through` acts as the SHACL predicate
    +  // identifier; the actual value comes from the custom `getter` expression.
    +  @ReadOnly({
    +    through: "recipe://rating",
    +    getter: `math::mean(->link[WHERE predicate = 'recipe://user_rating'].out.uri)`
    +  })
    +  averageRating: number = 0;
    +}
    +
    ℹ️

    @Property smart defaults: required: false, readOnly: false, resolveLanguage: "literal". +You only need to specify through in the common case.

    +
    ℹ️

    through on computed properties: Even when using a custom getter, through is still required — it serves as the SHACL predicate identifier in the generated shape, making the property discoverable by other consumers (MCP, CLI, other apps). No link is written at this predicate; the value is entirely derived from the getter expression.

    +

    All property options

    +
    OptionTypeDefaultDescription
    throughstring(required)Predicate URI for the link
    requiredbooleanfalseIf true, a placeholder link is created on save even if the value is empty
    readOnlybooleanfalsePrevents updates after creation
    resolveLanguagestring"literal"Language used to resolve the stored value. Use "literal" for simple values, or a Language address for richer content
    initialanyDefault value written on creation. When required: true with no initial, the framework uses a sentinel value ("literal://string:uninitialized")
    localbooleanfalseStore locally only — not synced to the network. Useful for user preferences or draft state
    getterstringRaw SurrealQL expression for computed values. Base is replaced with the instance's node ID at query time. Mutually exclusive with regular storage
    transform(value: any) => anyPost-retrieval transformation function, called after the value is hydrated
    +

    You can also use the @Optional decorator as an alias for @Property with required: false (the default), if you want to be explicit:

    +
    @Optional({ through: "recipe://description" })
    +description?: string;
    +

    The getter option in detail

    +

    The getter option accepts a raw SurrealQL expression. The framework wraps it as:

    +
    SELECT ({getter}) AS value FROM node WHERE uri = {instanceId}
    +

    Use Base as a placeholder for the current instance's node — it gets replaced at query time:

    +
    @ReadOnly({
    +  through: "recipe://rating",
    +  getter: `math::mean(Base->link[WHERE predicate = 'recipe://user_rating'].out.uri)`
    +})
    +averageRating: number = 0;
    +

    The transform option

    +

    Apply a transformation after a value is retrieved from the graph:

    +
    @Property({
    +  through: "recipe://tags_raw",
    +  transform: (value) => typeof value === 'string' ? value.split(',') : value
    +})
    +tags: string[] = [];
    +

    Relations

    +

    Relations represent associations between models. AD4M provides four relation decorators that make the relationship semantics explicit:

    +
    import {
    +  Ad4mModel, Model, Property,
    +  HasMany, HasOne, BelongsToOne, BelongsToMany
    +} from '@coasys/ad4m';
    + 
    +@Model({ name: "Comment" })
    +class Comment extends Ad4mModel {
    +  @Property({ through: "comment://body" })
    +  body: string = "";
    + 
    +  @BelongsToOne(() => Chef, { through: "comment://chef" })
    +  chef: string = "";
    +}
    + 
    +@Model({ name: "Chef" })
    +class Chef extends Ad4mModel {
    +  @Property({ through: "chef://name" })
    +  name: string = "";
    +}
    + 
    +@Model({ name: "Image" })
    +class Image extends Ad4mModel {
    +  @Property({ through: "image://url" })
    +  url: string = "";
    +}
    + 
    +@Model({ name: "Category" })
    +class Category extends Ad4mModel {
    +  @Property({ through: "category://name" })
    +  name: string = "";
    +}
    + 
    +@Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  @Property({ through: "recipe://name" })
    +  name: string = "";
    + 
    +  // One-to-many: this recipe owns many comments
    +  @HasMany(() => Comment, { through: "recipe://comment" })
    +  comments: string[] = [];
    + 
    +  // One-to-one: this recipe has one featured image
    +  @HasOne({ through: "recipe://featured_image", target: () => Image })
    +  featuredImage: string = "";
    + 
    +  // Many-to-one: this recipe belongs to one chef (read-only reference)
    +  @BelongsToOne(() => Chef, { through: "recipe://chef" })
    +  chef: string = "";
    + 
    +  // Many-to-many: this recipe belongs to many categories (read-only)
    +  @BelongsToMany(() => Category, { through: "recipe://category" })
    +  categories: string[] = [];
    +}
    +

    Each relation decorator supports two calling conventions:

    +
    // Target-first shorthand (recommended)
    +@HasMany(() => Comment, { through: "recipe://comment" })
    + 
    +// Options-object style
    +@HasMany({ through: "recipe://comment", target: () => Comment })
    +

    Relation types at a glance

    +
    DecoratorCardinalityGenerated methodsOwnership
    @HasManyOne-to-manyadd*, remove*, set*Parent owns
    @HasOneOne-to-oneProperty setterParent owns
    @BelongsToOneMany-to-oneRead-onlyChild references
    @BelongsToManyMany-to-manyRead-onlyChild references
    +
    ℹ️

    Default through: When you omit through on a relation decorator, it defaults to 'ad4m://has_child'. +This is the standard AD4M parent-child predicate, so it works well for hierarchical data — but make sure it's intentional.

    +

    Relation decorators also accept a local option (local: true) to store the relation links locally without syncing to the network.

    +

    Using relation methods

    +

    @HasMany generates typed helper methods on the model instance:

    +
    const recipe = await Recipe.findOne(perspective, { where: { name: "Chocolate Cake" } });
    + 
    +// Add a comment — accepts a model instance or a string ID
    +const comment = await Comment.create(perspective, { body: "Delicious!" });
    +await recipe.addComments(comment);       // pass instance
    +await recipe.addComments(comment.id);    // or pass ID
    + 
    +// Remove
    +await recipe.removeComments(comment);
    + 
    +// Replace all
    +await recipe.setComments([comment1.id, comment2.id]);
    + 
    +// With batch support
    +const batchId = await perspective.createBatch();
    +await recipe.addComments(comment, batchId);
    +await perspective.commitBatch(batchId);
    +

    Flags

    +

    Flags are immutable type markers. They are automatically readOnly and required, and cannot be changed after creation:

    +
    @Flag({ through: "ad4m://type", value: "recipe://main-course" })
    +type: string = "";
    +

    Attempting to update a flag after creation throws an error.

    +

    How It Works Under the Hood

    +

    Graph-Based Storage

    +

    Each model instance is stored as a subgraph in an AD4M perspective. For example, our recipe is stored as:

    +
    recipe://chocolate-cake-123 -[recipe://name]-> literal://string:"Chocolate Cake"
    +recipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://flour
    +recipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://sugar
    +

    Every node in this graph is a URL pointing to an Expression in some language.

    +

    Instance Identity

    +

    Each model instance has a unique id that serves as the root node of its subgraph. You can specify it or let AD4M generate one:

    +
    // Auto-generated ID
    +const recipe = new Recipe(perspective);
    + 
    +// Custom ID
    +const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03");
    +

    Literals for Simple Values

    +

    AD4M provides Literals for storing simple values without needing a full language:

    +
    // These are equivalent:
    +recipe.name = "Chocolate Cake";
    +// Stored as: literal://string:Chocolate Cake
    + 
    +recipe.cookingTime = 45;
    +// Stored as: literal://number:45
    +

    Social DNA and SHACL

    +

    When you define a model class, AD4M generates a SHACL (Shapes Constraint Language) representation — a W3C standard for describing and validating RDF graph shapes:

    +
    @Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  @Property({
    +    through: "recipe://name",
    +    required: true
    +  })
    +  name: string = "";
    + 
    +  @HasMany({ through: "recipe://ingredient" })
    +  ingredients: string[] = [];
    +}
    +

    The SHACL shape is stored as links in the perspective graph, making it discoverable and queryable by any agent or tool that joins the perspective.

    +

    How SHACL Maps to AD4M

    +
    SHACL ConceptAD4M Equivalent
    sh:NodeShapeSubject Class definition
    sh:PropertyShapeProperty or Relation definition
    sh:maxCount 1Scalar property (single value, generates set_ tool)
    No sh:maxCount or > 1Relation (generates add_/remove_ tools)
    sh:minCount 1Required property (must exist on creation — when required: true is used without an explicit initial, the @Property decorator auto-supplies a "literal://string:uninitialized" placeholder)
    sh:datatypeValue type constraint
    sh:classReference to another Subject Class (target model shape)
    sh:nodeParent shape reference (model inheritance)
    ad4m://initialDefault value on instance creation
    ad4m://resolveLanguageExpression language for value resolution
    ad4m://readOnlyRead-only computed property
    ad4m://getterSurrealQL getter for conformance filtering
    ad4m://conformanceConditionsStructured filter conditions for relation targets
    +

    AD4M extends standard SHACL with ad4m:// predicates for features specific to the AD4M runtime (initial values, language resolution, write permissions).

    +

    Working with Models

    +

    Creating

    +
    // Option 1: Instantiate and save
    +const recipe = new Recipe(perspective);
    +recipe.name = "Chocolate Cake";
    +await recipe.save();
    + 
    +// Option 2: Static create (one-step)
    +const recipe = await Recipe.create(perspective, { name: "Chocolate Cake" });
    + 
    +// Create with a specific ID
    +const recipe = new Recipe(perspective, "recipe://chocolate-cake");
    +await recipe.save();
    + 
    +// Create with a parent relationship
    +const recipe = await Recipe.create(perspective, { name: "Cake" }, {
    +  parent: { model: Cookbook, id: cookbook.id }
    +});
    +

    Reading

    +
    // Get by ID
    +const recipe = new Recipe(perspective, existingId);
    +await recipe.get();
    + 
    +// Get with eager-loaded relations
    +await recipe.get({ include: { comments: true } });
    + 
    +// Get with sparse fieldset (only hydrate specific properties)
    +await recipe.get({ properties: ["name", "category"] });
    +

    Updating

    +

    save() handles both creation and updates automatically. For existing instances (fetched via get() or a query), it only writes changed fields thanks to built-in dirty tracking:

    +
    const recipe = await Recipe.findOne(perspective, {
    +  where: { name: "Chocolate Cake" }
    +});
    + 
    +recipe.name = "Dark Chocolate Cake";
    +await recipe.save();  // Only the name field is updated
    + 
    +// Static update shorthand
    +await Recipe.update(perspective, recipe.id, { name: "White Chocolate Cake" });
    +

    Deleting

    +
    // Instance method
    +await recipe.delete();
    + 
    +// Static method
    +await Recipe.delete(perspective, recipeId);
    +

    The instance delete() also cleans up incoming links (e.g. a parent's hasMany reference to this instance).

    +

    Dirty Tracking

    +

    After fetching an instance, AD4M takes a snapshot of all field values. You can inspect what changed:

    +
    const recipe = await Recipe.findOne(perspective);
    +recipe.name = "Updated Name";
    + 
    +recipe.isDirty();       // true
    +recipe.changedFields(); // ["name"]
    + 
    +await recipe.save();    // Only "name" is written
    +

    Instance Identity

    +

    Every model instance has a unique id (a URI string):

    +
    const recipe = await Recipe.create(perspective, { name: "Cake" });
    +console.log(recipe.id); // "literal://..."
    + 
    +// Auto-generated when not specified
    +const recipe2 = new Recipe(perspective);
    +console.log(recipe2.id); // random literal URI
    + 
    +// Custom ID
    +const recipe3 = new Recipe(perspective, "recipe://my-cake");
    +console.log(recipe3.id); // "recipe://my-cake"
    +
    ℹ️

    The legacy .baseExpression getter still works but is deprecated. Use .id instead.

    +

    Built-in Instance Properties

    +

    Every model instance automatically gets these properties, populated from link metadata:

    +
    PropertyTypeDescription
    .idstringUnique URI identifier
    .authorstringDID of the agent who created the earliest link (e.g. "did:key:z6Mk...")
    .createdAtstring | numberTimestamp of the earliest link (epoch ms or ISO string)
    .updatedAtstring | numberTimestamp of the most recent link
    .timestamp(deprecated)Alias for .createdAt — use .createdAt instead
    +

    These are available after any fetch operation (get(), findAll(), findOne(), etc.) and can be used in queries:

    +
    // Order by creation date
    +const recent = await Recipe.query(perspective)
    +  .order({ createdAt: "DESC" })
    +  .limit(10)
    +  .get();
    + 
    +console.log(recent[0].author);    // "did:key:z6Mk..."
    +console.log(recent[0].createdAt); // 1709049600000
    +console.log(recent[0].updatedAt); // 1709136000000
    +

    Querying

    +

    Basic Queries

    +
    // Get all (uses SurrealDB by default — 10-100x faster than Prolog)
    +const allRecipes = await Recipe.findAll(perspective);
    + 
    +// With conditions
    +const cakes = await Recipe.findAll(perspective, { where: { category: "Dessert" } });
    + 
    +// Find one
    +const recipe = await Recipe.findOne(perspective, { where: { name: "Chocolate Cake" } });
    + 
    +// Count
    +const { results, totalCount } = await Recipe.findAllAndCount(perspective, {
    +  where: { category: "Dessert" }
    +});
    + 
    +// Pagination
    +const page = await Recipe.paginate(perspective, 10, 1, { where: { category: "Dessert" } });
    +

    Query Builder

    +

    The fluent query builder provides a chainable interface:

    +
    const recipes = await Recipe.query(perspective)
    +  .where({ category: "MainCourse", rating: { gt: 4 } })
    +  .order({ createdAt: "DESC" })
    +  .limit(5)
    +  .get();
    + 
    +// Get first match
    +const topRecipe = await Recipe.query(perspective)
    +  .where({ rating: { gt: 4 } })
    +  .order({ rating: "DESC" })
    +  .first();  // Returns Recipe | null
    +

    Where Operators

    +
    const recipes = await Recipe.findAll(perspective, {
    +  where: {
    +    name: "Exact Match",             // Equality
    +    rating: { gt: 4 },               // Greater than
    +    difficulty: { lte: 3 },          // Less than or equal
    +    servings: { between: [2, 6] },   // Range
    +    category: ["Dessert", "Snack"],  // IN (array membership)
    +    status: { not: "archived" },     // Not equal
    +    tags: { contains: "vegan" },     // Contains
    +  }
    +});
    +

    Eager Loading with include

    +

    By default, relation fields contain raw URI strings. Use include to hydrate them into full model instances:

    +
    // Eager-load comments on query results
    +const recipes = await Recipe.query(perspective)
    +  .where({ category: "Dessert" })
    +  .include({ comments: true })
    +  .get();
    + 
    +// recipes[0].comments is now Comment[] instead of string[]
    +console.log(recipes[0].comments[0].body); // "Delicious!"
    + 
    +// Nested includes
    +const recipes = await Recipe.query(perspective)
    +  .include({ 
    +    comments: { 
    +      include: { chef: true }  // Load comment chefs too
    +    } 
    +  })
    +  .get();
    + 
    +// Also works on findAll / findOne
    +const recipe = await Recipe.findOne(perspective, {
    +  where: { name: "Cake" },
    +  include: { comments: true }
    +});
    + 
    +// And on instance get()
    +const recipe = new Recipe(perspective, existingId);
    +await recipe.get({ include: { comments: true } });
    +// Shorthand:
    +await recipe.get({ comments: true });
    +

    Filtering and sorting eager-loaded relations

    +

    Instead of true, pass a sub-query object to filter, sort, or paginate the eager-loaded relation:

    +
    // Only load the 5 most recent comments
    +const recipes = await Recipe.query(perspective)
    +  .include({
    +    comments: {
    +      where: { status: "approved" },
    +      order: { createdAt: "DESC" },
    +      limit: 5
    +    }
    +  })
    +  .get();
    + 
    +// Combine with nested includes
    +const recipes = await Recipe.query(perspective)
    +  .include({
    +    comments: {
    +      order: { createdAt: "DESC" },
    +      limit: 10,
    +      include: { chef: true }  // Also hydrate each comment's chef
    +    }
    +  })
    +  .get();
    +

    The sub-query accepts: where, order, limit, offset, include, and properties.

    +

    Sparse Fieldsets with properties

    +

    Only hydrate specific properties to avoid unnecessary work (especially useful for properties with non-literal resolveLanguage that trigger network calls):

    +
    const recipes = await Recipe.query(perspective)
    +  .properties(["name", "category"])
    +  .get();
    +// Only name and category are hydrated; other fields stay at defaults
    +

    Parent-Scoped Queries

    +

    Query instances that are linked from a specific parent:

    +
    // From a model instance
    +const comments = await Comment.query(perspective)
    +  .parent(recipe)
    +  .get();
    + 
    +// From an ID + model class (predicate auto-resolved from metadata)
    +const comments = await Comment.query(perspective)
    +  .parent(recipeId, Recipe)
    +  .get();
    + 
    +// Raw predicate escape hatch
    +const comments = await Comment.query(perspective)
    +  .parent(recipeId, "recipe://comment")
    +  .get();
    +

    SurrealDB vs Prolog

    +

    Ad4mModel uses SurrealDB by default for all query operations, providing 10-100x faster performance compared to the legacy Prolog engine.

    +
    // Uses SurrealDB by default (fast!)
    +const recipes = await Recipe.findAll(perspective, { where: { rating: { gt: 4 } } });
    + 
    +// Explicitly use Prolog if needed (for backward compatibility)
    +const recipesProlog = await Recipe.findAll(perspective, {
    +  where: { rating: { gt: 4 } }
    +}, false); // useSurrealDB = false
    + 
    +// Or on the query builder
    +const recipesProlog = await Recipe.query(perspective)
    +  .where({ rating: { gt: 4 } })
    +  .useSurrealDB(false)
    +  .get();
    +

    For advanced graph traversal queries and direct SurrealQL access, see the SurrealDB Queries Guide.

    +

    Real-time Subscriptions

    +

    Subscribe to changes in your data:

    +
    const builder = Recipe.query(perspective)
    +  .where({ status: "cooking" });
    + 
    +// Subscribe — callback fires immediately with initial results,
    +// then again whenever matching data changes
    +const initialRecipes = await builder.subscribe(recipes => {
    +  console.log("Currently cooking:", recipes);
    +});
    + 
    +// Count subscription
    +const initialCount = await builder.countSubscribe(count => {
    +  console.log("Number cooking:", count);
    +});
    + 
    +// Paginated subscription
    +const initialPage = await builder.paginateSubscribe(10, 1, page => {
    +  console.log("Page 1:", page.results);
    +});
    + 
    +// Important: Clean up when done
    +builder.dispose();
    +

    Always call dispose() when you're done with a subscription to prevent memory leaks.

    +

    Transactions

    +

    Group multiple operations into an atomic batch:

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  const recipe = await Recipe.create(perspective, { name: "Cake" }, {
    +    batchId: tx.batchId
    +  });
    + 
    +  const comment = new Comment(perspective);
    +  comment.body = "Looks great!";
    +  await comment.save(tx.batchId);
    + 
    +  await recipe.addComments(comment, tx.batchId);
    +});
    +// All operations commit together, or none do if an error is thrown
    +

    For lower-level batch control, see the Batch Operations Guide.

    +

    Static Convenience Methods

    +
    MethodSignatureDescription
    createcreate(perspective, data?, options?)Create and save in one step. options supports parent and batchId
    updateupdate(perspective, id, data)Fetch by ID, merge data, save
    deletedelete(perspective, id)Delete by ID with incoming link cleanup
    removeremove(perspective, id)Deprecated — alias for delete
    findAllfindAll(perspective, query?, useSurrealDB?)Query all matching instances
    findOnefindOne(perspective, query?, useSurrealDB?)First matching instance or null
    findAllAndCountfindAllAndCount(perspective, query?, useSurrealDB?)Results + total count
    paginatepaginate(perspective, pageSize, page, query?, useSurrealDB?)Paginated results
    registerregister(perspective)Install the SHACL schema in the perspective
    transactiontransaction(perspective, fn)Atomic batch operation
    queryquery(perspective)Returns a ModelQueryBuilder
    getModelMetadatagetModelMetadata()Introspect property & relation metadata
    generateSDNAgenerateSDNA()Returns the generated Prolog SDNA rules (injected by @Model)
    generateSHACLgenerateSHACL()Returns the generated SHACL shape graph (injected by @Model)
    +

    Introspection

    +

    Use getModelMetadata() to inspect a model's structure at runtime — useful for tooling, debugging, or dynamic UIs:

    +
    const meta = Recipe.getModelMetadata();
    +console.log(meta.name);        // "Recipe"
    +console.log(meta.properties);  // [{ name: "name", predicate: "recipe://name", ... }, ...]
    +console.log(meta.relations);   // [{ name: "comments", predicate: "recipe://comment", ... }, ...]
    +

    generateSDNA() and generateSHACL() return the raw Prolog rules and SHACL shape respectively — primarily useful for debugging schema registration issues.

    +

    Relation Filtering

    +

    When a relation has a target model, AD4M can auto-generate a conformance filter that only returns linked instances matching the target model's shape (checking flags and required properties):

    +
    @Model({ name: "MainCourse" })
    +class MainCourse extends Ad4mModel {
    +  @Flag({ through: "ad4m://type", value: "recipe://main-course" })
    +  type: string = "";
    + 
    +  @Property({ through: "recipe://name", required: true })
    +  name: string = "";
    +}
    + 
    +@Model({ name: "Cookbook" })
    +class Cookbook extends Ad4mModel {
    +  // Auto-filters: only returns linked items that match the MainCourse shape
    +  @HasMany(() => MainCourse, { through: "cookbook://recipe" })
    +  mainCourses: string[] = [];
    +}
    +

    where on Relations

    +

    Add value-based filtering using the same where syntax as queries:

    +
    @Model({ name: "TaskBoard" })
    +class TaskBoard extends Ad4mModel {
    +  // Only return tasks where status is "active"
    +  @HasMany(() => Task, { through: "board://task", where: { status: "active" } })
    +  activeTasks: string[] = [];
    +}
    +

    Filtering options

    +
    OptionEffect
    target: () => ModelAuto-generates conformance filter from model shape
    where: { ... }Value-based filtering using query DSL
    filter: falseOpt out of auto-filtering even when target is set
    getter: "..."Raw SurrealQL getter (escape hatch, mutually exclusive with target/through)
    +

    Model Inheritance

    +

    Models can extend other models. The child's SHACL shape references the parent via sh:node, ensuring inherited constraints are validated:

    +
    @Model({ name: "BaseRecipe" })
    +class BaseRecipe extends Ad4mModel {
    +  @Property({ through: "recipe://name" })
    +  name: string = "";
    +}
    + 
    +@Model({ name: "DetailedRecipe" })
    +class DetailedRecipe extends BaseRecipe {
    +  @Property({ through: "recipe://instructions" })
    +  instructions: string = "";
    +}
    + 
    +// DetailedRecipe inherits the "name" property from BaseRecipe
    +const recipe = await DetailedRecipe.create(perspective, {
    +  name: "Cake",
    +  instructions: "Mix and bake"
    +});
    +

    Dynamic Models from JSON Schema

    +

    The fromJSONSchema() method dynamically creates AD4M model classes from JSON Schema definitions. This is perfect for integrating with external systems, runtime model generation, partner app integration (like Holons), and rapid prototyping.

    +

    Basic Usage

    +
    import { Ad4mModel } from '@coasys/ad4m';
    + 
    +const schema = {
    +  "$schema": "http://json-schema.org/draft-07/schema#",
    +  "title": "BlogPost",
    +  "type": "object",
    +  "properties": {
    +    "title": { "type": "string" },
    +    "content": { "type": "string" },
    +    "tags": { 
    +      "type": "array", 
    +      "items": { "type": "string" } 
    +    },
    +    "metadata": {
    +      "type": "object",
    +      "properties": {
    +        "author": { "type": "string" },
    +        "publishedAt": { "type": "string" }
    +      }
    +    }
    +  },
    +  "required": ["title"]
    +};
    + 
    +const BlogPost = Ad4mModel.fromJSONSchema(schema, {
    +  name: "BlogPost",
    +  namespace: "blog://",
    +  resolveLanguage: "literal"
    +});
    + 
    +// Use like any other Ad4mModel
    +const post = new BlogPost(perspective);
    +post.title = "My First Post";
    +post.tags = ["ad4m", "tutorial"];
    +post.metadata = { author: "Alice", publishedAt: "2025-09-23" };
    +await post.save();
    +

    Configuration Options

    +

    The second parameter to fromJSONSchema() is optional:

    +
    interface JSONSchemaToModelOptions {
    +  // Model configuration
    +  name?: string;              // Class name override (falls back to x-ad4m.className → schema.title → schema.$id)
    +  namespace?: string;         // Base namespace for predicates (falls back to x-ad4m.namespace → schema.title → schema.$id)
    + 
    +  // Predicate generation helpers (in order of precedence)
    +  propertyMapping?: Record<string, string>;    // Direct propertyName → predicate URI mapping
    +  predicateTemplate?: string;                   // Template: ${scheme}, ${namespace}/${ns}, ${title}, ${property}
    +  predicateGenerator?: (title: string, property: string) => string;  // Custom callback
    + 
    +  // Global property settings
    +  resolveLanguage?: string;   // Default language for all properties
    +  local?: boolean;            // Whether properties are stored locally
    + 
    +  // Property-specific overrides (accepts any PropertyOptions fields)
    +  propertyOptions?: Record<string, Partial<PropertyOptions>>;
    +}
    +

    Resolution Cascades

    +

    The class name, namespace, and per-property predicate are each resolved with a cascading priority:

    +
    SettingPriority 1 (highest)Priority 2Priority 3Priority 4
    Class nameoptions.namex-ad4m.classNameschema.titleschema.$id
    Namespaceoptions.namespacex-ad4m.namespaceschema.titleschema.$id
    PredicatepropertyMapping[name]x-ad4m.throughpredicateTemplatepredicateGenerator → default ${namespace}/${property}
    +

    For example, to control predicate URIs directly:

    +
    const Product = Ad4mModel.fromJSONSchema(schema, {
    +  name: "Product",
    +  namespace: "product://",
    +  // Direct mapping: property name → predicate URI
    +  propertyMapping: {
    +    name: "product://title",
    +    price: "product://cost"
    +  },
    +  // Or use a template (lower priority than propertyMapping)
    +  // predicateTemplate: "${namespace}/${property}"
    +});
    +

    x-ad4m Schema Extensions

    +

    Add AD4M-specific metadata directly to your JSON Schema:

    +
    const schema = {
    +  "title": "User",
    +  "x-ad4m": {
    +    "namespace": "user://",
    +    "resolveLanguage": "literal"
    +  },
    +  "properties": {
    +    "email": { 
    +      "type": "string",
    +      "x-ad4m": { "through": "user://email_address", "local": true }
    +    },
    +    "tags": {
    +      "type": "array",
    +      "items": { "type": "string" },
    +      "x-ad4m": { "through": "user://interests" }
    +    }
    +  },
    +  "required": ["email"]
    +};
    +

    Schema Type Mapping

    +
    JSON Schema typeAD4M treatment
    string, number, booleanScalar @Property
    objectStored as JSON literal (limited semantic querying)
    arrayRelation (@HasMany-style), with add*/remove* methods
    +

    Arrays automatically get relation helper methods:

    +
    const post = new BlogPost(perspective);
    +post.tags = ["ad4m", "tutorial"];
    +await post.save();
    + 
    +// Relation methods generated from the property name
    +post.addTags("blockchain");
    +post.removeTags("tutorial");
    +

    Type Safety

    +

    Since properties are added dynamically, TypeScript won't know about them at compile time. Use type assertions:

    +
    const BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & {
    +  new(perspective: PerspectiveProxy): Ad4mModel & {
    +    title: string;
    +    tags: string[];
    +    metadata: { author: string; publishedAt: string };
    +  }
    +};
    +

    Limitations

    +
      +
    • No author property: Conflicts with the built-in AD4M author field
    • +
    • Required properties: At least one property must be required or have an initial value
    • +
    • Complex objects: Nested objects are stored as JSON literals, limiting semantic querying
    • +
    • Performance: For better querying, consider flattening complex objects into separate properties
    • +
    +

    Best Practices

    +
      +
    1. +

      Use Meaningful Predicates: Structure your predicate URIs logically:

      +
      through: "recipe://name"      // Good
      +through: "myapp://x"          // Bad
      +
    2. +
    3. +

      Type Safety: Always define proper TypeScript types:

      +
      @Property({ through: "recipe://servings" })
      +servings: number = 0;         // Good
      + 
      +@Property({ through: "recipe://servings" })
      +servings: any;               // Bad
      +
    4. +
    5. +

      Relation Filtering: Use typed target to auto-filter relations:

      +
      @HasMany(() => Review, { through: "recipe://review" })
      +reviews: string[] = [];
      +
    6. +
    7. +

      Query Optimization: Use specific queries instead of filtering in memory, and leverage SurrealDB's performance:

      +
      // Good - Let SurrealDB do the filtering (fast)
      +const topRated = await Recipe.query(perspective)
      +  .where({ rating: { gt: 4 } })
      +  .get();
      + 
      +// Bad - Fetching all and filtering in memory (slow)
      +const all = await Recipe.findAll(perspective);
      +const topRated = all.filter(r => r.rating > 4);
      +
    8. +
    9. +

      Use SurrealDB by Default: SurrealDB is 10-100x faster than Prolog for most queries:

      +
      // Good - Uses SurrealDB by default
      +const recipes = await Recipe.findAll(perspective, {
      +  where: { rating: { gt: 4 } }
      +});
      + 
      +// Only use Prolog if you need backward compatibility
      +const recipesProlog = await Recipe.findAll(perspective, {
      +  where: { rating: { gt: 4 } }
      +}, false); // useSurrealDB = false
      +
    10. +
    11. +

      Subscriptions: Clean up subscriptions when they're no longer needed:

      +
      const builder = Recipe.query(perspective)
      +  .where({ status: "active" });
      +  
      +await builder.subscribe(recipes => {
      +  // Handle updates
      +});
      + 
      +// Later...
      +builder.dispose();
      +
    12. +
    13. +

      Use Literals Appropriately:

      +
      // Good - Using literals for simple values (default resolveLanguage)
      +@Property({ through: "recipe://name" })
      +name: string = "";
      + 
      +// Good - Using specific language for rich content
      +@Property({
      +  through: "recipe://instructions",
      +  resolveLanguage: "markdown"
      +})
      +instructions: string = "";
      +
    14. +
    15. +

      Meaningful IDs:

      +
      // Good - Descriptive ID
      +const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03");
      + 
      +// Fine - Auto-generated ID (most common)
      +const recipe = new Recipe(perspective);
      +
    16. +
    +

    Error Handling

    +

    Always handle potential errors when working with models:

    +
    try {
    +  const recipe = new Recipe(perspective);
    +  recipe.name = "Failed Recipe";
    +  await recipe.save();
    +} catch (error) {
    +  console.error("Failed to save recipe:", error);
    +  // Handle error appropriately
    +}

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/model-classes/index.html b/docs/developer-guides/model-classes/index.html deleted file mode 100644 index bfc1c33dd..000000000 --- a/docs/developer-guides/model-classes/index.html +++ /dev/null @@ -1,699 +0,0 @@ -Model Classes in AD4M | AD4M Docs
    Developer Guides
    Defining and using Model Classes

    Model Classes in AD4M

    -

    Model classes in AD4M provide a way to define, store, and query structured data in your application. Let's start with a simple example that we'll build upon:

    -

    Quick Start

    -

    There are two ways to create model classes in AD4M:

    -

    Option 1: Using Decorators (Traditional)

    -
    import { Ad4mModel, ModelOptions, Property } from '@coasys/ad4m';
    - 
    -@ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  @Property({
    -    through: "recipe://name",
    -    resolveLanguage: "literal"
    -  })
    -  name: string = "";
    -}
    - 
    -// Using the model
    -const recipe = new Recipe(perspective);
    -recipe.name = "Chocolate Cake";
    -await recipe.save();
    - 
    -// Reading it back
    -const recipes = await Recipe.findAll(perspective);
    -console.log(recipes[0].name); // "Chocolate Cake"
    -

    Option 2: From JSON Schema (Dynamic)

    -

    Perfect for integrating with external systems or when you have existing JSON Schema definitions:

    -
    import { Ad4mModel } from '@coasys/ad4m';
    - 
    -// Define your data structure using JSON Schema
    -const recipeSchema = {
    -  "$schema": "http://json-schema.org/draft-07/schema#",
    -  "title": "Recipe",
    -  "type": "object",
    -  "properties": {
    -    "name": { "type": "string" },
    -    "ingredients": { 
    -      "type": "array", 
    -      "items": { "type": "string" } 
    -    },
    -    "difficulty": { "type": "number" }
    -  },
    -  "required": ["name"]
    -};
    - 
    -// Dynamically create the model class
    -const Recipe = Ad4mModel.fromJSONSchema(recipeSchema, {
    -  name: "Recipe",
    -  namespace: "recipe://",
    -  resolveLanguage: "literal"
    -});
    - 
    -// Use exactly like decorator-based models
    -const recipe = new Recipe(perspective);
    -recipe.name = "Chocolate Cake";
    -recipe.ingredients = ["flour", "sugar", "cocoa"];
    -recipe.difficulty = 3;
    -await recipe.save();
    -

    Before using any model class, register it with your perspective:

    -
    await perspective.ensureSDNASubjectClass(Recipe);
    -

    Basic Concepts

    -

    Properties

    -

    Properties are the basic building blocks of your models. They can be required or optional:

    -
    @ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  // Required property
    -  @Property({
    -    through: "recipe://name",
    -    resolveLanguage: "literal"
    -  })
    -  name: string = "";
    - 
    -  // Optional property
    -  @Optional({
    -    through: "recipe://description",
    -    resolveLanguage: "literal"
    -  })
    -  description?: string;
    -}
    -

    Collections

    -

    Collections represent one-to-many relationships:

    -
    @ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  @Property({
    -    through: "recipe://name",
    -    resolveLanguage: "literal"
    -  })
    -  name: string = "";
    - 
    -  @Collection({ through: "recipe://ingredient" })
    -  ingredients: string[] = [];
    -}
    - 
    -// Using collections
    -const recipe = new Recipe(perspective);
    -recipe.name = "Chocolate Cake";
    -recipe.ingredients = ["flour", "sugar", "cocoa"];
    -await recipe.save();
    -

    Working with Models

    -

    Creating & Saving

    -
    // Create new instance
    -const recipe = new Recipe(perspective);
    -recipe.name = "Chocolate Cake";
    -await recipe.save();
    - 
    -// Create with specific ID
    -const recipe = new Recipe(perspective, "recipe://chocolate-cake");
    -await recipe.save();
    -

    Reading & Updating

    -
    // Get by ID
    -const recipe = new Recipe(perspective, existingId);
    -await recipe.get();
    - 
    -// Update
    -recipe.name = "Dark Chocolate Cake";
    -await recipe.update();
    -

    Basic Querying

    -
    // Get all recipes (uses SurrealDB by default - 10-100x faster)
    -const allRecipes = await Recipe.findAll(perspective);
    - 
    -// Get with simple conditions
    -const recipes = await Recipe.findAll(perspective, {
    -  where: { name: "Chocolate Cake" }
    -});
    -

    Query Performance with SurrealDB

    -

    Important: Ad4mModel now uses SurrealDB by default for all query operations, providing 10-100x faster performance compared to the legacy Prolog engine. This means:

    -
      -
    • findAll() automatically uses SurrealDB
    • -
    • findAllAndCount() automatically uses SurrealDB
    • -
    • Query builder methods automatically use SurrealDB
    • -
    • Live query subscriptions automatically use SurrealDB
    • -
    -
    // Uses SurrealDB by default (fast!)
    -const highRated = await Recipe.findAll(perspective, {
    -  where: { rating: { gt: 4 } },
    -  order: { rating: "DESC" },
    -  limit: 10
    -});
    - 
    -// You can explicitly use Prolog if needed (for backward compatibility)
    -const recipesProlog = await Recipe.findAll(perspective, {
    -  where: { rating: { gt: 4 } }
    -}, false); // useSurrealDB = false
    -

    For advanced graph traversal queries and direct SurrealQL access, see the SurrealDB Queries Guide.

    -

    Understanding the Underlying System

    -

    Now that you've seen the basics, let's understand how it works under the hood.

    -

    Graph-Based Storage

    -

    Each model instance is stored as a subgraph in an AD4M perspective. For example, our recipe is stored as:

    -
    recipe://chocolate-cake-123 -[recipe://name]-> literal://string:"Chocolate Cake"
    -recipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://flour
    -recipe://chocolate-cake-123 -[recipe://ingredient]-> ingredient://sugar
    -

    Every node in this graph is a URL pointing to an Expression in some language.

    -

    Base Expressions

    -

    Each model instance has a unique identifier called a "base expression" that serves as the root node of its subgraph. You can specify it or let AD4M generate one:

    -
    // Auto-generated base expression
    -const recipe = new Recipe(perspective);
    - 
    -// Custom base expression
    -const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03");
    -

    Literals for Simple Values

    -

    AD4M provides Literals for storing simple values without needing a full language:

    -
    // These are equivalent:
    -recipe.name = "Chocolate Cake";
    -// Stored as: literal://string:Chocolate Cake
    - 
    -recipe.cookingTime = 45;
    -// Stored as: literal://number:45
    -

    Advanced Features

    -

    Property Types

    -

    AD4M provides several specialized property decorators:

    -

    @ReadOnly

    -

    For computed or immutable properties:

    -
    @ReadOnly({
    -  through: "recipe://rating",
    -  getter: `
    -    findall(Rating, triple(Base, "recipe://user_rating", Rating), Ratings),
    -    sum_list(Ratings, Sum),
    -    length(Ratings, Count),
    -    Value is Sum / Count
    -  `
    -})
    -averageRating: number = 0;
    -

    @Flag

    -

    For immutable type markers:

    -
    @Flag({
    -  through: "ad4m://type",
    -  value: "recipe://main-course"
    -})
    -type: string = "";
    -

    Advanced Collections

    -

    Collections can be filtered and typed:

    -
    // Collection of other model instances
    -@Collection({
    -  through: "recipe://comment",
    -  where: { isInstance: Comment }
    -})
    -comments: Comment[] = [];
    - 
    -// Collection with custom filter
    -@Collection({
    -  through: "recipe://review",
    -  where: { condition: `triple(Target, "review://rating", Rating), Rating > 4` }
    -})
    -topReviews: string[] = [];
    -

    Advanced Querying

    -

    The query builder provides a fluent interface for complex queries and uses SurrealDB by default for optimal performance:

    -
    // Uses SurrealDB by default (10-100x faster)
    -const recipes = await Recipe.query(perspective)
    -  .where({ 
    -    category: "MainCourse",
    -    rating: { gt: 4 }
    -  })
    -  .order({ createdAt: "DESC" })
    -  .limit(5)
    -  .get();
    - 
    -// Explicitly control query engine
    -const recipesSurreal = await Recipe.query(perspective)
    -  .where({ rating: { gt: 4 } })
    -  .useSurrealDB(true)  // Default is true
    -  .get();
    - 
    -// Use Prolog for backward compatibility
    -const recipesProlog = await Recipe.query(perspective)
    -  .where({ rating: { gt: 4 } })
    -  .useSurrealDB(false)  // Switch to Prolog
    -  .get();
    -

    Real-time Updates

    -

    Subscribe to changes in your data. Subscriptions also use SurrealDB by default for better performance:

    -
    // Create a query builder (uses SurrealDB by default)
    -const builder = Recipe.query(perspective)
    -  .where({ status: "cooking" });
    - 
    -// Subscribe to updates
    -const initialRecipes = await builder.subscribe(recipes => {
    -  console.log("Currently cooking:", recipes);
    -});
    - 
    -// Subscribe with Prolog (for backward compatibility)
    -const builderProlog = Recipe.query(perspective)
    -  .where({ status: "cooking" })
    -  .useSurrealDB(false);  // Use Prolog
    - 
    -await builderProlog.subscribe(recipes => {
    -  console.log("Currently cooking (Prolog):", recipes);
    -});
    - 
    -// Important: Clean up when done
    -builder.dispose();
    -

    The query builder's subscription system:

    -
      -
    1. Returns initial results immediately
    2. -
    3. Calls your callback whenever the results change
    4. -
    5. Maintains an active connection to receive updates
    6. -
    7. Automatically cleans up resources when disposed
    8. -
    -

    Always call dispose() when you're done with the subscription to:

    -
      -
    • Stop keepalive signals
    • -
    • Unsubscribe from updates
    • -
    • Notify the backend to clean up resources
    • -
    • Prevent memory leaks
    • -
    -

    You can also subscribe to just the count of matching items:

    -
    const builder = Recipe.query(perspective)
    -  .where({ category: "Dessert" });
    - 
    -const initialCount = await builder.countSubscribe(count => {
    -  console.log("Number of desserts:", count);
    -});
    - 
    -// Remember to clean up
    -builder.dispose();
    -

    Dynamic Models from JSON Schema

    -

    The fromJSONSchema() method allows you to dynamically create AD4M model classes from JSON Schema definitions. This is perfect for:

    -
      -
    • Integrating with external systems that use JSON Schema
    • -
    • Runtime model generation based on user-defined schemas
    • -
    • Partner app integration (like Holons) that define types using JSON Schema
    • -
    • Rapid prototyping without writing decorator-based classes
    • -
    -

    Basic Usage

    -
    import { Ad4mModel } from '@coasys/ad4m';
    - 
    -const schema = {
    -  "$schema": "http://json-schema.org/draft-07/schema#",
    -  "title": "BlogPost",
    -  "type": "object",
    -  "properties": {
    -    "title": { "type": "string" },
    -    "content": { "type": "string" },
    -    "tags": { 
    -      "type": "array", 
    -      "items": { "type": "string" } 
    -    },
    -    "metadata": {
    -      "type": "object",
    -      "properties": {
    -        "author": { "type": "string" },
    -        "publishedAt": { "type": "string" }
    -      }
    -    }
    -  },
    -  "required": ["title"]
    -};
    - 
    -const BlogPost = Ad4mModel.fromJSONSchema(schema, {
    -  name: "BlogPost",
    -  namespace: "blog://",
    -  resolveLanguage: "literal"
    -});
    - 
    -// Use like any other Ad4mModel
    -const post = new BlogPost(perspective);
    -post.title = "My First Post";
    -post.tags = ["ad4m", "tutorial"];
    -post.metadata = { author: "Alice", publishedAt: "2025-09-23" };
    -await post.save();
    -

    Configuration Options

    -

    The second parameter to fromJSONSchema() is optional and accepts these options:

    -
    interface JSONSchemaToModelOptions {
    -  // Model configuration
    -  name?: string;              // Class name override (optional: falls back to x-ad4m.className → schema.title → schema.$id)
    -  namespace?: string;         // Base namespace for predicates (optional: falls back to x-ad4m.namespace → schema.title → schema.$id)
    - 
    -  // Predicate generation helpers
    -  // 1) Direct mapping: propertyName -> predicate URI
    -  propertyMapping?: Record<string, string>;
    - 
    -  // 2) Template: supports ${scheme}, ${namespace} (or ${ns}), ${title}, ${property}
    -  predicateTemplate?: string;
    - 
    -  // 3) Generator callback: receives schema title and property name
    -  predicateGenerator?: (title: string, property: string) => string;
    - 
    -  // Global property settings (applied to all properties unless overridden)
    -  resolveLanguage?: string;   // Default language for all properties
    -  local?: boolean;            // Whether properties are stored locally
    - 
    -  // Property-specific overrides
    -  // Accepts any PropertyOptions fields: through, initial, required, writable,
    -  // resolveLanguage, getter, setter, local, transform
    -  propertyOptions?: Record<string, Partial<PropertyOptions>>;
    -}
    -

    Class Name Resolution (Cascading Priority)

    -

    The class name is determined using this priority order:

    -
      -
    1. Explicit options.name (highest priority)
    2. -
    3. x-ad4m.className metadata in schema
    4. -
    5. Schema title
    6. -
    7. Schema $id (extracted from URI)
    8. -
    9. Error if none found (lowest priority)
    10. -
    -
    // Priority 1: Explicit name override
    -const Model1 = Ad4mModel.fromJSONSchema(schema, {
    -  name: "CustomModelName"
    -});
    - 
    -// Priority 2: x-ad4m.className metadata
    -const schemaWithClassName = {
    -  "title": "Person",
    -  "x-ad4m": {
    -    "className": "PersonModel"
    -  },
    -  "properties": { /* ... */ }
    -};
    -const PersonClass = Ad4mModel.fromJSONSchema(schemaWithClassName);
    - 
    -// Priority 3: Inferred from title
    -const schemaWithTitle = {
    -  "title": "BlogPost",  // becomes "BlogPost" class name
    -  "properties": { /* ... */ }
    -};
    -const BlogPostClass = Ad4mModel.fromJSONSchema(schemaWithTitle);
    - 
    -// Priority 4: Inferred from $id
    -const schemaWithId = {
    -  "$id": "https://example.com/schemas/product.schema.json",  // becomes "Product"
    -  "properties": { /* ... */ }
    -};
    -const ProductClass = Ad4mModel.fromJSONSchema(schemaWithId);
    -

    Namespace Resolution (Cascading Priority)

    -

    The namespace is determined using this priority order:

    -
      -
    1. Explicit options.namespace (highest priority)
    2. -
    3. x-ad4m.namespace metadata in schema
    4. -
    5. Schema title (converted to namespace)
    6. -
    7. Schema $id (extracted from URI)
    8. -
    9. Error if none found (lowest priority)
    10. -
    -
    // Priority 1: Explicit namespace
    -const Model1 = Ad4mModel.fromJSONSchema(schema, {
    -  namespace: "custom://"
    -});
    - 
    -// Priority 2: x-ad4m.namespace metadata
    -const schemaWithMetadata = {
    -  "title": "Person",
    -  "x-ad4m": {
    -    "namespace": "person://"
    -  },
    -  "properties": { /* ... */ }
    -};
    - 
    -// Priority 3: Inferred from title
    -const schemaWithTitle = {
    -  "title": "BlogPost", // becomes "blogpost://"
    -  "properties": { /* ... */ }
    -};
    -

    Property Predicate Resolution

    -

    Each property's predicate URI is determined by (highest to lowest precedence):

    -
      -
    1. options.propertyMapping[name] (explicit mapping)
    2. -
    3. x-ad4m.through in property schema
    4. -
    5. predicateTemplate (supports ${scheme}, ${namespace}/${ns}, ${title}, ${property})
    6. -
    7. predicateGenerator(title, property)
    8. -
    9. Default: ${namespace}/${propertyName} (normalized)
    10. -
    -
    const schema = {
    -  "title": "Product",
    -  "properties": {
    -    "name": { "type": "string" },
    -    "price": { 
    -      "type": "number",
    -      "x-ad4m": {
    -        "through": "product://cost"  // Custom predicate
    -      }
    -    }
    -  }
    -};
    - 
    -const Product = Ad4mModel.fromJSONSchema(schema, {
    -  name: "Product",
    -  namespace: "product://",
    -  // Option A: direct mapping
    -  propertyMapping: {
    -    name: "product://title"
    -  }
    -  // Option B: or per-property options
    -  // propertyOptions: { name: { through: "product://title" } }
    -});
    -

    Advanced Schema Features

    -

    Using x-ad4m Extensions

    -

    Add AD4M-specific metadata directly to your JSON Schema:

    -
    const advancedSchema = {
    -  "title": "User",
    -  "x-ad4m": {
    -    "namespace": "user://",
    -    "resolveLanguage": "literal"
    -  },
    -  "properties": {
    -    "email": { 
    -      "type": "string",
    -      "x-ad4m": {
    -        "through": "user://email_address",
    -        "local": true
    -      }
    -    },
    -    "profile": {
    -      "type": "object",
    -      "x-ad4m": {
    -        "resolveLanguage": "literal"  // Store as JSON
    -      }
    -    },
    -    "tags": {
    -      "type": "array",
    -      "items": { "type": "string" },
    -      "x-ad4m": {
    -        "through": "user://interests"
    -      }
    -    }
    -  },
    -  "required": ["email"]
    -};
    - 
    -const User = Ad4mModel.fromJSONSchema(advancedSchema, { name: "User" });
    -

    Complex Object Handling

    -

    Object properties are automatically stored as JSON literals:

    -
    const schema = {
    -  "title": "Article",
    -  "properties": {
    -    "metadata": {
    -      "type": "object",
    -      "properties": {
    -        "author": { "type": "string" },
    -        "publishedAt": { "type": "string" },
    -        "views": { "type": "number" }
    -      }
    -    }
    -  },
    -  "required": ["metadata"]
    -};
    - 
    -const Article = Ad4mModel.fromJSONSchema(schema, {
    -  namespace: "article://"
    -});
    - 
    -const article = new Article(perspective);
    -article.metadata = {
    -  author: "Alice",
    -  publishedAt: "2025-09-23",
    -  views: 42
    -};
    -await article.save();
    - 
    -// Complex objects are preserved
    -const saved = await Article.findAll(perspective);
    -console.log(saved[0].metadata.author); // "Alice"
    -

    Array/Collection Mapping

    -

    Arrays in JSON Schema automatically become AD4M collections:

    -
    const schema = {
    -  "title": "BlogPost",
    -  "properties": {
    -    "tags": {
    -      "type": "array",
    -      "items": { "type": "string" }
    -    },
    -    "categories": {
    -      "type": "array", 
    -      "items": { "type": "string" }
    -    }
    -  }
    -};
    - 
    -const BlogPost = Ad4mModel.fromJSONSchema(schema, {
    -  namespace: "blog://"
    -});
    - 
    -const post = new BlogPost(perspective);
    -post.tags = ["ad4m", "tutorial"];
    -post.categories = ["technology"];
    -await post.save();
    - 
    -// Collections work with all standard AD4M collection methods
    -post.addTags("blockchain");
    -post.removeCategories("technology");
    -

    Type Safety Considerations

    -

    Since properties are added dynamically, TypeScript won't know about them at compile time. You can:

    -
      -
    1. Use type assertions for better IDE support:
    2. -
    -
    const BlogPost = Ad4mModel.fromJSONSchema(schema) as typeof Ad4mModel & {
    -  new(perspective: PerspectiveProxy): Ad4mModel & {
    -    title: string;
    -    tags: string[];
    -    metadata: { author: string; publishedAt: string };
    -  }
    -};
    -
      -
    1. Create TypeScript interfaces for your schemas:
    2. -
    -
    interface BlogPostData {
    -  title: string;
    -  tags: string[];
    -  metadata: { author: string; publishedAt: string };
    -}
    - 
    -const post = new BlogPost(perspective) as Ad4mModel & BlogPostData;
    -post.title = "Type-safe access";
    -

    Limitations and Best Practices

    -
      -
    • No author property: JSON schemas cannot define a top-level author property (conflicts with built-in AD4M property)
    • -
    • Required properties: At least one property must be required or have an initial value
    • -
    • Complex objects: Nested objects are stored as JSON literals, limiting semantic querying capabilities
    • -
    • Performance: For better semantic querying, consider flattening complex objects into separate properties
    • -
    -

    Under the Hood

    -

    Social DNA and Prolog

    -

    When you define a model class, AD4M generates a Social DNA (SDNA) representation in Prolog:

    -
    @ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  @Property({
    -    through: "recipe://name",
    -    resolveLanguage: "literal",
    -    required: true
    -  })
    -  name: string = "";
    -}
    -

    Relationship with SHACL and Linked Data

    -

    AD4M's model classes share concepts with SHACL (Shapes Constraint Language):

    -
      -
    • Both define property constraints and validation rules
    • -
    • Both work with graph-based data
    • -
    • AD4M adds TypeScript integration, CRUD operations, and real-time features
    • -
    -

    Best Practices

    -
      -
    1. -

      Use Meaningful Predicates: Structure your predicate URIs logically:

      -
      through: "recipe://name"      // Good
      -through: "myapp://x"          // Bad
      -
    2. -
    3. -

      Type Safety: Always define proper TypeScript types:

      -
      @Property({ through: "recipe://servings" })
      -servings: number = 0;         // Good
      - 
      -@Property({ through: "recipe://servings" })
      -servings: any;               // Bad
      -
    4. -
    5. -

      Collection Filtering: Use where conditions to filter collections:

      -
      @Collection({
      -  through: "recipe://review",
      -  where: { isInstance: Review }  // Only include Review instances
      -})
      -reviews: Review[] = [];
      -
    6. -
    7. -

      Query Optimization: Use specific queries instead of filtering in memory, and leverage SurrealDB's performance:

      -
      // Good - Let SurrealDB do the filtering (fast)
      -const topRated = await Recipe.query(perspective)
      -  .where({ rating: { gt: 4 } })
      -  .get();
      - 
      -// Bad - Fetching all and filtering in memory (slow)
      -const all = await Recipe.findAll(perspective);
      -const topRated = all.filter(r => r.rating > 4);
      -
    8. -
    9. -

      Use SurrealDB by Default: SurrealDB is 10-100x faster than Prolog for most queries:

      -
      // Good - Uses SurrealDB by default
      -const recipes = await Recipe.findAll(perspective, {
      -  where: { rating: { gt: 4 } }
      -});
      - 
      -// Only use Prolog if you need backward compatibility
      -const recipesProlog = await Recipe.findAll(perspective, {
      -  where: { rating: { gt: 4 } }
      -}, false); // useSurrealDB = false
      -
    10. -
    11. -

      Subscriptions: Clean up subscriptions when they're no longer needed:

      -
      const builder = Recipe.query(perspective)
      -  .where({ status: "active" });
      -  
      -await builder.subscribe(recipes => {
      -  // Handle updates
      -});
      - 
      -// Later...
      -builder.dispose();
      -
    12. -
    13. -

      Use Literals Appropriately:

      -
      // Good - Using literals for simple values
      -@Property({
      -  through: "recipe://name",
      -  resolveLanguage: "literal"
      -})
      -name: string = "";
      - 
      -// Good - Using specific language for rich content
      -@Property({
      -  through: "recipe://instructions",
      -  resolveLanguage: "markdown"
      -})
      -instructions: string = "";
      -
    14. -
    15. -

      Meaningful Base Expressions:

      -
      // Good - Descriptive base expression
      -const recipe = new Recipe(perspective, "recipe://chocolate-cake-2024-03");
      - 
      -// Bad - Random or meaningless base expression
      -const recipe = new Recipe(perspective, "x://123");
      -
    16. -
    -

    Error Handling

    -

    Always handle potential errors when working with models:

    -
    try {
    -  const recipe = new Recipe(perspective);
    -  recipe.name = "Failed Recipe";
    -  await recipe.save();
    -} catch (error) {
    -  console.error("Failed to save recipe:", error);
    -  // Handle error appropriately
    -}
    -

    Integration with AD4M Perspectives

    -

    Before using a model class, register it with the perspective:

    -
    // Register the model class
    -await perspective.ensureSDNASubjectClass(Recipe);
    - 
    -// Now you can use it
    -const recipe = new Recipe(perspective);
    -await recipe.save();
    -

    This ensures the perspective knows how to handle instances of your model class.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/developer-guides/surreal-queries/index.html b/docs/developer-guides/surreal-queries.html similarity index 63% rename from docs/developer-guides/surreal-queries/index.html rename to docs/developer-guides/surreal-queries.html index 0aa7b583a..36f9692dd 100644 --- a/docs/developer-guides/surreal-queries/index.html +++ b/docs/developer-guides/surreal-queries.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Developer Guides
    SurrealDB Queries (Fast Graph Queries)

    SurrealDB Queries in AD4M

    +
    Developer Guides
    SurrealDB Queries (Fast Graph Queries)

    SurrealDB Queries in AD4M

    AD4M now includes a powerful SurrealDB-based query engine that provides 10-100x faster performance compared to traditional Prolog queries. SurrealDB is used by default in Ad4mModel operations and can be accessed directly for advanced graph traversal queries.

    Why SurrealDB?

    SurrealDB brings several key advantages:

    @@ -48,12 +48,12 @@

  • fn::parse_literal(uri) - Extract values from AD4M literal URIs (handles literal://string:, literal://number:, literal://json:, etc.)
  • -

    Indexed Fields (fast):

    +

    Fields & Indexes:

      -
    • in.uri - Source node of link
    • -
    • out.uri - Target node of link
    • -
    • predicate - Link predicate
    • -
    • source, target - String representations (also indexed)
    • +
    • predicate — Indexed independently and in composites
    • +
    • source, target — Indexed independently and in composites with predicate
    • +
    • (in, predicate), (out, predicate) — Composite indexes (pair in.uri/out.uri with predicate for best performance)
    • +
    • in.uri, out.uri — Graph edge references, resolved via the node table's unique URI index (not independently indexed on the link table)

    Direct SurrealDB Queries

    For advanced use cases, you can execute SurrealQL queries directly using perspective.querySurrealDB():

    @@ -95,10 +95,17 @@

    "SELECT source FROM link GROUP BY source" ); // uniqueSources.length gives you the count of unique sources

    -

    Graph Traversal Queries

    -

    SurrealDB uses efficient graph traversal with indexed node lookups. The key is to use direct field comparisons rather than subqueries for optimal performance.

    -

    ⚠️ Performance Warning: Avoid Subqueries

    -

    Important: Subqueries (using IN (SELECT ...)) can be very slow, especially with large datasets. Instead, use the graph traversal operator (->) which is optimized and uses indexed lookups.

    +

    Graph Traversal

    +

    SurrealDB stores links as graph edges with indexed source and target node references, enabling efficient multi-hop traversal. See the Quick Reference above for the full syntax.

    +

    Key fields:

    +
      +
    • in.uri — Source node (where the edge comes FROM). Composite-indexed with predicate
    • +
    • out.uri — Target node (where the edge goes TO). Composite-indexed with predicate
    • +
    • predicate — Link predicate (independently indexed)
    • +
    • source / target — String representations (independently indexed, plus composite with predicate)
    • +
    +

    ⚠️ Avoid Subqueries

    +

    Subqueries (IN (SELECT ...)) can be very slow. Use the -> traversal operator instead:

    // ❌ SLOW - Uses subquery
     const bad = await perspective.querySurrealDB(
       "SELECT * FROM link WHERE source IN (SELECT target FROM link WHERE source = 'user://alice')"
    @@ -108,61 +115,70 @@ 

    const good = await perspective.querySurrealDB( "SELECT out->link[WHERE predicate = 'posted'].out.uri AS posts FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'" );

    -

    Graph Traversal Operators

    -

    SurrealDB stores links as graph edges with indexed source (in.uri) and target (out.uri) node references:

    -
      -
    • in.uri - The source node of the link (where the edge comes FROM)
    • -
    • out.uri - The target node of the link (where the edge goes TO)
    • -
    • source / target - String fields (also available for simple filtering)
    • -
    -

    Forward Traversal (Outgoing Links)

    -
    // Find all users that Alice follows
    +

    Basic Traversal

    +
    // Forward: Find all users that Alice follows
     const aliceFollows = await perspective.querySurrealDB(
       "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows'"
     );
      
    -// Find all posts by Alice
    -const alicePosts = await perspective.querySurrealDB(
    -  "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'author'"
    -);
    -

    Reverse Traversal (Incoming Links)

    -
    // Find all users who follow Alice (followers)
    +// Reverse: Find all users who follow Alice
     const aliceFollowers = await perspective.querySurrealDB(
       "SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'follows'"
     );
      
    -// Find all posts that mention Alice
    -const mentionsAlice = await perspective.querySurrealDB(
    -  "SELECT source FROM link WHERE out.uri = 'user://alice' AND predicate = 'mentions'"
    -);
    -

    Bidirectional Queries

    -
    // Find all users connected to Alice (either following or followed by)
    +// Bidirectional: All connections involving Alice
     const aliceConnections = await perspective.querySurrealDB(
       "SELECT source, target FROM link WHERE (in.uri = 'user://alice' OR out.uri = 'user://alice') AND predicate = 'follows'"
     );
    -

    Multi-Hop Traversal with Graph Operators

    +

    Filtering

    +
    // By timestamp range
    +const recentLinks = await perspective.querySurrealDB(
    +  "SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'"
    +);
    + 
    +// By author
    +const bobsLinks = await perspective.querySurrealDB(
    +  "SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'"
    +);
    + 
    +// Filter on multi-hop properties (find children of a specific type)
    +const subgroups = await perspective.querySurrealDB(`
    +  SELECT out.uri AS subgroup
    +  FROM link
    +  WHERE in.uri = 'conversation://456'
    +    AND predicate = 'ad4m://has_child'
    +    AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'
    +`);
    +

    Multi-Hop Traversal

    Use the -> operator to traverse multiple hops in a single efficient query:

    -
    // Find friends of friends (2-hop traversal)
    -// Traverse: Alice -> Friends -> Their Friends
    -// Note: Use GROUP BY instead of DISTINCT for unique results
    +
    // 2-hop: Friends of friends
     const friendsOfFriends = await perspective.querySurrealDB(`
       SELECT out->link[WHERE predicate = 'follows'].out.uri AS friend_of_friend
       FROM link
       WHERE in.uri = 'user://alice' AND predicate = 'follows'
     `);
    -// Deduplicate in JavaScript if needed: [...new Set(friendsOfFriends.map(f => f.friend_of_friend))]
    +// Deduplicate in JS (friend_of_friend is an array per row — flatten first):
    +// [...new Set(friendsOfFriends.flatMap(f => f.friend_of_friend))]
      
    -// Get user profiles 2 hops away
    -// Traverse: User -> Follows -> Profile
    +// 2-hop: User profiles via follows
     const profiles = await perspective.querySurrealDB(`
       SELECT 
         out.uri AS user,
         out->link[WHERE predicate = 'has_profile'][0].out.uri AS profile
       FROM link
       WHERE in.uri = 'user://alice' AND predicate = 'follows'
    +`);
    + 
    +// 2-hop: Child items with their types
    +const childTypes = await perspective.querySurrealDB(`
    +  SELECT 
    +    out.uri AS child,
    +    out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type
    +  FROM link
    +  WHERE in.uri = 'parent://123' AND predicate = 'ad4m://has_child'
     `);
    -

    Chaining Multiple Traversals

    -

    You can chain -> operators for deeper traversals:

    +

    Chaining Traversals

    +

    Chain -> operators for deeper patterns:

    // 3-hop: Conversation -> Subgroup -> Items -> Get item types
     const itemTypes = await perspective.querySurrealDB(`
       SELECT 
    @@ -172,11 +188,9 @@ 

    WHERE in.uri = 'conversation://main' AND predicate = 'ad4m://has_child' AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' -`);

    -

    Complex Graph Patterns

    -

    Use graph traversal for complex multi-hop patterns:

    -
    // Find all comments on Alice's posts (2-hop)
    -// Traverse: Alice -> Posts (authored) -> Comments (has_comment)
    +`);
    + 
    +// 2-hop: Comments on Alice's posts
     const commentsOnAlicePosts = await perspective.querySurrealDB(`
       SELECT 
         out.uri AS post,
    @@ -185,8 +199,7 @@ 

    WHERE in.uri = 'user://alice' AND predicate = 'authored' `); -// Get all reactions to posts by people Alice follows (3-hop) -// Traverse: Alice -> Follows -> Posts -> Reactions +// 3-hop: Reactions to posts by people Alice follows const reactions = await perspective.querySurrealDB(` SELECT out.uri AS followed_user, @@ -195,79 +208,25 @@

    FROM link WHERE in.uri = 'user://alice' AND predicate = 'follows' `);

    -

    Filtering by Properties

    -
    // Find all links from Alice with a specific timestamp range
    -const recentLinks = await perspective.querySurrealDB(
    -  "SELECT * FROM link WHERE in.uri = 'user://alice' AND timestamp > '2024-01-01T00:00:00Z' AND timestamp < '2024-12-31T23:59:59Z'"
    -);
    - 
    -// Find links by author
    -const bobsLinks = await perspective.querySurrealDB(
    -  "SELECT * FROM link WHERE author = 'did:key:bob' AND predicate = 'posted'"
    -);
    -

    Advanced Graph Traversal Patterns

    -

    For complex graph queries, SurrealDB provides powerful traversal operators that let you navigate multi-hop relationships in a single query.

    -

    The Graph Traversal Operator (->)

    -

    The -> operator allows you to traverse edges in your graph. Combined with filtering and array indexing, you can express complex patterns efficiently:

    -

    Syntax: node->link[WHERE condition][index].field

    -
      -
    • node->link - Follow link edges from the node
    • -
    • [WHERE condition] - Filter the traversed links (optional)
    • -
    • [index] - Select a specific result (e.g., [0] for first, [-1] for last)
    • -
    • .field - Access a field from the result (e.g., .out.uri for target URI)
    • -
    -

    Multi-Hop Traversal Examples

    -
    // Get the type of child items (2-hop traversal)
    -// Traverse: Parent -> Child (via 'ad4m://has_child') -> Type (via 'flux://entry_type')
    -const query = `
    -  SELECT 
    -    out.uri AS child,
    -    out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type
    -  FROM link
    -  WHERE in.uri = 'parent://123' 
    -    AND predicate = 'ad4m://has_child'
    -`;
    -const results = await perspective.querySurrealDB(query);
    -// Results include child URI and its type
    -

    Filtering on Multi-Hop Properties

    -

    You can filter based on properties several hops away:

    -
    // Find all children that are of type 'conversation_subgroup'
    -const subgroups = `
    -  SELECT out.uri AS subgroup
    -  FROM link
    -  WHERE in.uri = 'conversation://456'
    -    AND predicate = 'ad4m://has_child'
    -    AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'
    -`;
    -const results = await perspective.querySurrealDB(subgroups);
    -

    The fn::parse_literal() Function

    -

    AD4M provides a custom SurrealDB function to parse literal values. Literals in AD4M are stored as URIs like:

    -
      -
    • literal://string:Hello"Hello"
    • -
    • literal://number:4242
    • -
    • literal://boolean:truetrue
    • -
    • literal://json:{"data":"value"}"value" (extracts .data field)
    • -
    -

    Usage:

    -
    // Extract parsed values from literals
    -const query = `
    +

    Parsing Literal Values

    +

    AD4M stores values as literal URIs. Use fn::parse_literal() to extract them:

    +
    Literal URIParsed Value
    literal://string:Hello"Hello"
    literal://number:4242
    literal://boolean:truetrue
    literal://json:{"data":"value"}extracts .data field
    +
    const query = `
       SELECT 
    -    out.uri AS baseExpression,
    +    out.uri AS id,
         fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS title,
         fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS body,
         fn::parse_literal(out->link[WHERE predicate = 'flux://count'][0].out.uri) AS count
       FROM link
    -  WHERE in.uri = 'parent://789'
    -    AND predicate = 'ad4m://has_child'
    +  WHERE in.uri = 'parent://789' AND predicate = 'ad4m://has_child'
     `;
     const results = await perspective.querySurrealDB(query);
    -// Results have parsed values: { baseExpression, title: "Hello", body: "World", count: 42 }
    -

    Real-World Example: Querying Messages with Metadata

    -

    Here's a complete example showing how to query messages with their metadata:

    -
    // Get messages with type, body, and author information
    -const messagesQuery = `
    +// { id, title: "Hello", body: "World", count: 42 }
    +

    Real-World Examples

    +

    Messages with Metadata

    +
    const messagesQuery = `
       SELECT
    -    out.uri AS baseExpression,
    +    out.uri AS id,
         author,
         timestamp,
         out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,
    @@ -282,46 +241,11 @@ 

    ) ORDER BY timestamp ASC `; - -const messages = await perspective.querySurrealDB(messagesQuery); -// Each message includes: baseExpression, author, timestamp, type, messageBody, postTitle

    -

    Counting Nested Items

    -

    Count items that match complex multi-hop conditions:

    -
    // Count conversation subgroups
    -const countQuery = `
    -  SELECT count() AS count
    -  FROM link
    -  WHERE in.uri = 'conversation://abc'
    -    AND predicate = 'ad4m://has_child'
    -    AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'
    -`;
    - 
    -const result = await perspective.querySurrealDB(countQuery);
    -console.log(`Found ${result[0].count} subgroups`);
    -

    Finding Unique Values Across Hops

    -

    Get unique authors from items nested within subgroups:

    -
    // Get unique participants from nested items
    -// Traverse: Conversation -> Subgroups -> Items -> Extract unique authors
    -const participantsQuery = `
    -  SELECT VALUE author
    -  FROM link
    -  WHERE in.uri = 'conversation://xyz'
    -    AND predicate = 'ad4m://has_child'
    -    AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'
    -    AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE
    -  GROUP BY author
    -`;
    - 
    -const participants = await perspective.querySurrealDB(participantsQuery);
    -// Returns array of unique author DIDs
    -

    Complex Multi-Condition Queries

    -

    Combine multiple traversals and conditions:

    -
    // Find all tasks, posts, and messages with their specific metadata
    -const itemsQuery = `
    +const messages = await perspective.querySurrealDB(messagesQuery);
    +

    Mixed Item Types with Metadata

    +
    const itemsQuery = `
       SELECT
    -    out.uri AS item,
    -    author,
    -    timestamp,
    +    out.uri AS item, author, timestamp,
         out->link[WHERE predicate = 'flux://entry_type'][0].out.uri AS type,
         fn::parse_literal(out->link[WHERE predicate = 'flux://body'][0].out.uri) AS messageBody,
         fn::parse_literal(out->link[WHERE predicate = 'flux://title'][0].out.uri) AS postTitle,
    @@ -336,35 +260,41 @@ 

    ) ORDER BY timestamp DESC LIMIT 50 +`;

    +

    Counting and Unique Values

    +
    // Count conversation subgroups
    +const countQuery = `
    +  SELECT count() AS count
    +  FROM link
    +  WHERE in.uri = 'conversation://abc'
    +    AND predicate = 'ad4m://has_child'
    +    AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup'
     `;
    +const result = await perspective.querySurrealDB(countQuery);
      
    -const items = await perspective.querySurrealDB(itemsQuery);
    -// Returns mixed items with appropriate metadata populated based on type
    -

    Performance Tips for Complex Queries

    +// Get unique participants from nested items +const participantsQuery = ` + SELECT VALUE out->link[WHERE predicate = 'ad4m://has_child'].author + FROM link + WHERE in.uri = 'conversation://xyz' + AND predicate = 'ad4m://has_child' + AND out->link[WHERE predicate = 'flux://entry_type'][0].out.uri = 'flux://conversation_subgroup' + AND out->link[WHERE predicate = 'ad4m://has_child'].author IS NOT NONE +`; +// Returns nested author arrays (one per subgroup) — flatten and deduplicate client-side
    +

    Performance Tips

      -
    1. Index-Friendly Patterns: Start with indexed fields (in.uri, out.uri, predicate)
    2. -
    3. Filter Within Traversals: Use ->link[WHERE predicate = 'x'] to filter as you traverse
    4. -
    5. Array Indexing: Use [0] to get first result efficiently, [-1] for last
    6. -
    7. Traversal Depth: 2-4 hops perform well in a single query
    8. -
    9. Use IS NOT NONE: Check for existence of traversed values to avoid errors
    10. -
    11. Combine Conditions: Use AND/OR in WHERE clauses on final filtered results
    12. +
    13. Start with indexed fields: predicate, source, target are independently indexed; in/out are composite-indexed with predicate
    14. +
    15. Filter within traversals: ->link[WHERE predicate = 'x'] filters as you traverse
    16. +
    17. Array indexing: [0] for first, [-1] for last result
    18. +
    19. Traversal depth: 2–4 hops perform well in a single query
    20. +
    21. Use IS NOT NONE: Check existence of traversed values to avoid errors
    22. +
    23. Combine conditions: AND/OR in WHERE clauses on final filtered results
    -

    Pattern Breakdown

    -

    Understanding the query structure:

    -
    // Pattern: node->link[filter][index].field
    -out->link[WHERE predicate = 'flux://entry_type'][0].out.uri
    - 
    -// Breakdown:
    -// 1. out                    - Start from the target node
    -// 2. ->link                 - Follow link edges
    -// 3. [WHERE predicate = ...]- Filter to specific predicate
    -// 4. [0]                    - Take first matching link
    -// 5. .out.uri               - Get the target URI of that link
    -

    This pattern is equivalent to asking: "From this node, follow links with a specific predicate and tell me where they point."

    Using SurrealDB with Ad4mModel

    Ad4mModel uses SurrealDB by default for all operations, providing significant performance improvements:

    findAll() - Default Uses SurrealDB

    -
    @ModelOptions({ name: "Recipe" })
    +
    @Model({ name: "Recipe" })
     class Recipe extends Ad4mModel {
       @Property({ through: "recipe://name", resolveLanguage: "literal" })
       name: string = "";
    @@ -592,7 +522,7 @@ 

    Profile Performance: Use browser DevTools to measure query performance

  • -

    Index Awareness: The system automatically indexes in.uri, out.uri, predicate, source, and target

    +

    Index Awareness: predicate, source, and target are independently indexed. (in, predicate) and (out, predicate) have composite indexes — always pair in.uri/out.uri with predicate for best performance

  • Traversal Depth: You can safely traverse 2-4 hops in a single query with good performance

    @@ -609,8 +539,8 @@

    See the AD4M examples repository (opens in a new tab) for complete implementations.

    Related Resources


  • AD4M - The first social network
    \ No newline at end of file +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/expressions/index.html b/docs/expressions.html similarity index 52% rename from docs/expressions/index.html rename to docs/expressions.html index effa5fd06..aa6e99241 100644 --- a/docs/expressions/index.html +++ b/docs/expressions.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Expressions

    Expressions: Agent-Authored Data Objects

    +
    Expressions

    Expressions: Agent-Authored Data Objects

    Understanding Expressions

    In AD4M's agent-centric paradigm, all data is treated as a claim or statement made by an agent. These claims are called "Expressions" – following the metaphor of Languages, they are what agents "express" through different protocols (Languages). While they could be seen as simple data objects, Expressions are fundamentally different because they:

      @@ -196,4 +196,4 @@

      For more details on implementing Languages that create and resolve Expressions, see the Language Development Guide.


    AD4M - The first social network
    \ No newline at end of file +

    For more details on implementing Languages that create and resolve Expressions, see the Language Development Guide.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5db8d14d3..c4f17b1b0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -11,17 +11,17 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Introduction

    Introduction

    +
    Introduction

    Introduction

    The internet has evolved from a platform for creating and sharing simple documents to highly social digital experiences, and now to an era dominated by centralized artificial intelligence systems. Yet, no social infrastructure is woven into its core. Without a universal social protocol, companies have erected siloed networks, harvesting and profiting from user content—a problem intensified by centralized AI, which concentrates power and insight extraction, deepening data monopolies and eroding agency.

    -

    AD4M (Agent-centric Distributed Application Meta-ontology) counters this by centering agents—primarily human users with -Decentralized Identifiers (DIDs), though extensible to synthetic entities—and their social contexts in digital communication.

    +

    AD4M (Agent-centric Distributed Application Meta-ontology) counters this by centering agents-primarily human users with +Decentralized Identifiers (DIDs), though extensible to synthetic entities-and their social contexts in digital communication.

    Built on Holochain (opens in a new tab), AD4M forms an agent-centric spanning layer on top of the internet, harmonizing fragmented ecosystems into a distributed -Collective Intelligence network. This deep implementation empowers agents to choose which Language they speak—bridging currently -competing P2P, federated, and centralized approaches in synergy, whether it’s a P2P protocol, a federated API, or HTTP itself.

    -

    If you’re versed in Holochain’s distributed design and the semantic web’s linked data paradigm (e.g., RDF, Solid), AD4M blends +Collective Intelligence network. This deep implementation empowers agents to choose which Language they speak-bridging currently +competing P2P, federated, and centralized approaches in synergy, whether it's a P2P protocol, a federated API, or HTTP itself.

    +

    If you're versed in Holochain's distributed design and the semantic web's linked data paradigm (e.g., RDF, Solid), AD4M blends the best of both, crafting an agent-centric semantic web where social relationships fuel a decentralized alternative to centralized AI dominance, aligned with the real human networks of its users through graph-based data and a global addressing scheme.


    @@ -29,30 +29,30 @@

    What is AD4M practically?

    AD4M, as an agent-centric spanning layer married with an app development framework, redefines how decentralized applications connect users, data, and ecosystems. Unlike traditional back-ends tied to centralized servers, -AD4M runs as a distinct instance for every user—think of it as a personal, local runtime environment. Each instance, built on Holochain, -holds the user’s cryptographic keys (via their DID), stores their data in Perspectives (subjective RDF-based knowledge graphs), -and executes code that interfaces with Languages—protocol-like abstractions that attach to existing systems, from HTTP to IPFS to custom P2P -protocols. This instance serves as the back-end that UIs and apps connect to, providing a unified, interoperable gateway to the user’s digital world.

    +AD4M runs as a distinct instance for every user-think of it as a personal, local runtime environment. Each instance, built on Holochain, +holds the user's cryptographic keys (via their DID), stores their data in Perspectives (subjective RDF-based knowledge graphs), +and executes code that interfaces with Languages-protocol-like abstractions that attach to existing systems, from HTTP to IPFS to custom P2P +protocols. This instance serves as the back-end that UIs and apps connect to, providing a unified, interoperable gateway to the user's digital world.

    At its core, AD4M inverts the typical app-centric model. Instead of apps owning your data and social graph, your AD4M instance owns them, -running on your device (or a trusted host) and exposing a GraphQL API, wrapped by our JavaScript client library, for apps to query and interact with. +running on your device (or a trusted host) and exposing a GraphQL API and an MCP server, for apps and AI agents alike to query and interact with. For example, a chat app might connect to localhost:4000/graphql to fetch messages stored in a Perspective, addressed via a Language like -QmXyz123://message789. This local runtime attaches to existing Languages—say, http for web content or solid for semantic triples—executing -their logic to read or write Expressions (data objects). Developers don’t rewrite the web; they extend it, with AD4M harmonizing these connections +QmXyz123://message789. This local runtime attaches to existing Languages-say, http for web content or solid for semantic triples-executing +their logic to read or write Expressions (data objects). Developers don't rewrite the web; they extend it, with AD4M harmonizing these connections into a single, agent-owned layer.

    • -

      Agent Autonomy: Each instance is sovereign, controlled by the user’s DID (e.g., did:key:z6Mk...). It signs every action—links in Perspectives, joins to Neighbourhoods—ensuring data integrity and ownership without intermediaries.

      +

      Agent Autonomy: Each instance is sovereign, controlled by the user's DID (e.g., did:key:z6Mk...). It signs every action-links in Perspectives, joins to Neighbourhoods-ensuring data integrity and ownership without intermediaries.

    • Interoperability Through Expressions and Perspectives: -AD4M achieves seamless integration across ecosystems via two pillars: Expressions and Perspectives. Languages produce objective Expressions—data objects with global addresses like <language_hash>://<address> (e.g., <QmSocial456://post123>), readable by any AD4M-connected app. Meanwhile, Perspectives are subjective knowledge graphs, built from RDF triples (e.g., <agent123> <posted> <QmSocial456://post123>), representing an agent’s unique view. Together, they enable portability and connection: an Expression can be linked across Perspectives, and a Perspective can pull in data from multiple Languages, bridging web, semantic web, and P2P systems effortlessly.

      +AD4M achieves seamless integration across ecosystems via two pillars: Expressions and Perspectives. Languages produce objective Expressions-data objects with global addresses like <language_hash>://<address> (e.g., <QmSocial456://post123>), readable by any AD4M-connected app. Meanwhile, Perspectives are subjective knowledge graphs, built from RDF triples (e.g., <agent123> <posted> <QmSocial456://post123>), representing an agent's unique view. Together, they enable portability and connection: an Expression can be linked across Perspectives, and a Perspective can pull in data from multiple Languages, bridging web, semantic web, and P2P systems effortlessly.

    • Rule-Based Distributed Consistency: -Using Holochain for it's core backbone, each instance doesn’t just store data—it enforces consistency through Language-defined rules and Social DNA (Prolog-based logic). For example, a Neighbourhood might restrict posting to members via a rule like member(Agent) :- link(Agent, "memberOf", Neighbourhood). This distributed validation ensures data aligns across the network without a central authority, giving developers a reliable, self-regulating foundation.

      +Using Holochain for its core backbone, each instance doesn't just store data-it enforces consistency through Language-defined rules and Social DNA (declarative schemas using SHACL). For example, a Neighbourhood can define subject classes that constrain what data looks like and how agents interact. This distributed validation ensures data aligns across the network without a central authority, giving developers a reliable, self-regulating foundation.

    -

    Practically, this means every developer’s user runs their own AD4M node. Install it, configure it (e.g., via a RuntimeConfig JSON), and it spins up a process holding their private keys, syncing their Perspectives, and running Language code—like a lightweight, personal cloud. A UI might then query:

    +

    Practically, this means every developer's user runs their own AD4M node. Install it, configure it (e.g., via a RuntimeConfig JSON), and it spins up a process holding their private keys, syncing their Perspectives, and running Language code-like a lightweight, personal cloud. A UI might then query:

    // Initialize the client
     const ad4mClient = new Ad4mClient("ws://localhost:4000", false);
      
    @@ -64,17 +64,17 @@ 

    const perspective = await ad4mClient.perspective.add("MyPerspective"); const link = await perspective.add(new Link({ source: "test://source", - predicate: "test://predicate", + predicate: "test://predicate", target: "test://target" })); // Query links const links = await perspective.get({} as LinkQuery); console.log(links); // [{source: "test://source", predicate: "test://predicate", target: "test://target"}]

    -

    This spanning layer doesn’t replace the internet—it augments it, giving agents control over their data and connections while enabling apps to tap into a distributed, interoperable network. AD4M is the engine behind a user’s digital agency, the glue for ecosystem synergy, and the foundation for Collective Intelligence—all in one local instance.

    +

    This spanning layer doesn't replace the internet-it augments it, giving agents control over their data and connections while enabling apps to tap into a distributed, interoperable network. AD4M is the engine behind a user's digital agency, the glue for ecosystem synergy, and the foundation for Collective Intelligence-all in one local instance.

    AD4M Languages

    Protocols with a Global Addressing Scheme

    -

    At the heart of AD4M are Languages, which are more than just data formats—they’re protocol-like abstractions that define how agents express, +

    At the heart of AD4M are Languages, which are more than just data formats-they're protocol-like abstractions that define how agents express, store, and share data across ecosystems. Conceptually akin to protocols like HTTP or IPFS, each Language encapsulates the capacity of (AD4M-) agents (read: nodes/users) to spawn Expressions-that is: data-objects with cryptographic provenance- messages, posts, you name it. How the Language implementation actually stores and shares these Expressions is up to the Language implementor.

    @@ -86,10 +86,10 @@

    Foundational Bootstrap Languages

    -

    Out of the gate, AD4M relies on bootstrap Languages—pre-installed essentials like the agent, perspective, & language languages. +

    Out of the gate, AD4M relies on bootstrap Languages-pre-installed essentials like the agent, perspective, & language languages. These provide the core grammar for identity (did:key:z6Mk...), knowledge graphs / perspectives (perspective://2f168edc-...) and their collaboratively shared pendandts, Neighbourhoods, (neighbourhood://2345d23...), and then languages themselves (lang://Qm3dgfw23...) They standardize interactions across every AD4M instance, around the core ontology of AD4M itself.

    @@ -101,9 +101,9 @@

    Bootstrap Languages make AD4M a functional spanning layer from the start, an evolvable bare-bones social network that enables its users to spawn their own ontologies and spaces into this meta-space.

    Evolvability through the Language-Language

    -

    The true genius of AD4M’s Language system lies in its evolvability, driven by the language-language—a meta-Language through which new Languages are defined, published, and shared across the network. +

    The true genius of AD4M's Language system lies in its evolvability, driven by the language-language-a meta-Language through which new Languages are defined, published, and shared across the network. This bootstrap Language acts as a registry and distribution mechanism: developers create a custom Language (e.g., my-social-app), its code is hashed (e.g., QmCustom321), -and it’s published as an Expression at language://QmCustom321. Other agents can then fetch and install it:

    +and it's published as an Expression at language://QmCustom321. Other agents can then fetch and install it:

    // Publish a new language
     const languageMeta = {
       name: "my-social-app",
    @@ -119,8 +119,8 @@ 

    This makes the AD4M spanning layer a living, adaptive system. The language-language ensures that as new protocols or needs emerge—say, a federated messaging standard or a novel AI integration—agents can adopt them without centralized gatekeepers or hard forks. -It’s the most critical aspect of Languages: not just connecting existing ecosystems, but enabling the entire framework to evolve with its users. +

    This makes the AD4M spanning layer a living, adaptive system. The language-language ensures that as new protocols or needs emerge-say, a federated messaging standard or a novel AI integration-agents can adopt them without centralized gatekeepers or hard forks. +It's the most critical aspect of Languages: not just connecting existing ecosystems, but enabling the entire framework to evolve with its users. A developer might extend AD4M with:

    interface CustomLanguage {
       hash: "QmCustom321";
    @@ -136,15 +136,15 @@ 

    }; }; }

    -

    By rooting adaptability in the language-language, AD4M ensures its spanning layer isn’t static—it grows, driven by the collective innovation of its agents, making it a future-proof foundation for Collective Intelligence.

    +

    By rooting adaptability in the language-language, AD4M ensures its spanning layer isn't static-it grows, driven by the collective innovation of its agents, making it a future-proof foundation for Collective Intelligence.

    Perspectives and Neighbourhoods

    -

    The local AD4M node stores, manages and gives access to an arbitrary number of Perspectives—subjective knowledge graphs of RDF triples. +

    The local AD4M node stores, manages and provides access to an arbitrary number of Perspectives-subjective knowledge graphs of RDF triples. Each Perspective is similar to a Solid Pod, in that it's a (private) collection of semantic associations. -The main difference to semantic web style graphs is that each triple (called a Link in AD4M) is an Expression and thus has a cryptographic provenance. +The main difference to semantic-web-style graphs is that each triple (called a Link in AD4M) is an Expression and thus has a cryptographic provenance. These triples, like <subject> <predicate> <object>, store data such as <agent123> <posted> <QmXyz123://post456>.

    -

    Agents share these local graph databases in a collaberative way with other AD4M agents via Neighbourhoods, app-independent social contexts that act as shared, +

    Agents share these local graph databases in a collaborative way with other AD4M agents via Neighbourhoods, app-independent social contexts that act as shared, collaboratively edited graphs. Built on the same linked data principles as the semantic web or Solid, Neighbourhoods enable portability: -a community’s social structure—its links and relationships—can move seamlessly across apps. For instance:

    +a community's social structure-its links and relationships-can move seamlessly across apps. For instance:

    const perspective = await ad4mClient.perspective.add("MyCommunity");
      
     // Add a link to the perspective
    @@ -158,15 +158,15 @@ 

    const links = await perspective.get({} as LinkQuery); console.log(links); // [{source: "agent123", predicate: "memberOf", target: "neighbourhood://QmAbc789"}]

    -

    This focus on agent-to-agent relationships, not app boundaries, drives AD4M’s interoperability, making social networks the foundation of its architecture.

    +

    This focus on agent-to-agent relationships, not app boundaries, drives AD4M's interoperability, making social networks the foundation of its architecture.


    Social DNA

    -

    In a decentralized network awash with data, the leap from raw information to collective wisdom hinges on more than just connectivity—it requires a way to encode how agents -and their communities process, filter, and reason over that data. Social DNA is AD4M’s answer: a conceptual parallel to biological DNA, it defines the rules, +

    In a decentralized network awash with data, the leap from raw information to collective wisdom hinges on more than just connectivity-it requires a way to encode how agents +and their communities process, filter, and reason over that data. Social DNA is AD4M's answer: a conceptual parallel to biological DNA, it defines the rules, behaviors, and logic that transform static Perspectives and Neighbourhoods into dynamic, intelligent Social Organisms. For developers, Social DNA is the key to -crafting app-specific intelligence—whether it’s validating data, enforcing roles, or aggregating insights—all while keeping control distributed among agents. -It’s the engine driving AD4M’s vision of a Collective Intelligence network, turning linked data into actionable, shared understanding.

    +crafting app-specific intelligence-whether it's validating data, enforcing roles, or aggregating insights-all while keeping control distributed among agents. +It's the engine driving AD4M's vision of a Collective Intelligence network, turning linked data into actionable, shared understanding.

    Query Engines: SurrealDB & Prolog

    AD4M provides two powerful query engines for working with graph data in Perspectives:

    SurrealDB: High-Performance Queries (Recommended)

    @@ -188,7 +188,7 @@

    );

    Performance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they're very slow.

    Important: Ad4mModel (described below) now uses SurrealDB by default for all operations, providing dramatic performance improvements with no code changes required.

    -

    For detailed examples and graph traversal patterns, see the SurrealDB Queries Guide.

    +

    For detailed examples and graph traversal patterns, see the SurrealDB Queries Guide.

    Prolog: Logic Programming (Legacy)

    For backward compatibility and advanced logic programming, AD4M also includes Prolog, optimized for reasoning over relational data like the RDF triples in Perspectives. Prolog's declarative nature lets developers write rules as predicates:

    @@ -210,52 +210,27 @@

    console.log(posts); // [{Post: "QmXyz123://post456", Agent: "did:key:z6Mk..."}, ...]

    While these raw query engines are powerful, AD4M simplifies development with a higher-level abstraction.

    Ad4mModel

    -

    For app developers, writing queries directly is optional—AD4M's Ad4mModel class and its decorators handle the heavy lifting. +

    For app developers, writing queries directly is optional-AD4M's Ad4mModel class and its decorators handle the heavy lifting. This TypeScript base class lets you define model classes with properties and relationships, automatically using SurrealDB under the hood for fast query performance (10-100x faster than Prolog). Here's how you define a model:

    -
    import { Ad4mModel, ModelOptions, Property, Collection, Flag, Optional, ReadOnly } from "@coasys/ad4m";
    +
    import { Ad4mModel, Model, Property, HasMany, Flag, ReadOnly } from "@coasys/ad4m";
      
    -@ModelOptions({
    -    name: "Todo"
    -})
    +@Model({ name: "Todo" })
     class Todo extends Ad4mModel {
    -    @Property({
    -        through: "todo://state",
    -        initial: "todo://ready"
    -    })
    +    @Property({ through: "todo://state", initial: "todo://ready" })
         state: string = "";
      
    -    @Optional({
    -        through: "todo://has_title",
    -        writable: true,
    -        resolveLanguage: "literal"
    -    })
    +    @Property({ through: "todo://has_title" })
         title: string = "";
      
         @ReadOnly({
    -        getter: 'triple(Base, "flux://has_reaction", "flux://thumbsup"), Value = true'
    +        through: "todo://is_liked",
    +        getter: 'count(->link[WHERE predicate = "flux://has_reaction" AND out.uri = "flux://thumbsup"]) > 0'
         })
         isLiked: boolean = false;
      
    -    @Collection({ through: "todo://comment" })
    +    @HasMany({ through: "todo://comment" })
         comments: string[] = [];
    - 
    -    @Collection({ 
    -        through: "flux://entry_type",
    -        where: { condition: 'triple(Target, "flux://has_reaction", "flux://thumbsup")' }
    -    })
    -    likedMessages: string[] = [];
    - 
    -    // Static query methods
    -    static async all(perspective: PerspectiveProxy): Promise<Todo[]> {
    -        return await Todo.findAll(perspective);
    -    }
    - 
    -    static async allDone(perspective: PerspectiveProxy): Promise<Todo[]> {
    -        return await Todo.findAll(perspective, { 
    -            where: { state: "todo://done" }
    -        });
    -    }
     }

    Behind this, Ad4mModel:

      @@ -265,7 +240,7 @@

      Provides type-safe TypeScript interfaces

    For example, Todo.findAll(perspective, { where: { state: "todo://done" } }) automatically generates and executes an optimized SurrealQL query.

    -

    For backward compatibility, Prolog is still supported (pass useSurrealDB: false to query methods). See the Model Classes Guide and SurrealDB Queries Guide for details.

    +

    For backward compatibility, Prolog is still supported (pass useSurrealDB: false to query methods). See the Model Classes Guide and SurrealDB Queries Guide for details.

    You can use this model to work with Todo items in a type-safe way:

    // Create a new Todo
     const todo = new Todo(perspective);
    @@ -274,16 +249,18 @@ 

    await todo.save(); // Query todos -const allTodos = await Todo.all(perspective); -const doneTodos = await Todo.allDone(perspective); +const allTodos = await Todo.findAll(perspective); +const doneTodos = await Todo.query(perspective) + .where({ state: "todo://done" }) + .get(); // Update a todo todo.state = "todo://done"; -await todo.update(); +await todo.save(); // Delete a todo await todo.delete();

    -

    Developers define their app's data model in familiar TypeScript, and AD4M handles the Social DNA—stored in a Perspective or Neighbourhood—making it both accessible and powerful. This abstraction lets you focus on app logic while SurrealDB provides fast queries and Prolog enables decentralized reasoning that scales across the network.

    +

    Developers define their app's data model in familiar TypeScript, and AD4M handles the Social DNA—stored as SHACL shapes in a Perspective or Neighbourhood—making it both accessible and powerful. This abstraction lets you focus on app logic while SurrealDB provides fast queries and SHACL schemas enable structured, validated data that scales across the network.

    Why?

    The goal is to arrive at scalable and interoparable communication infrastructure that enables group agency without imposing a bias on how a group manages itself.

    @@ -302,5 +279,5 @@

    Database management: ADAM is completely decentralized, hence there is no database to manage, and no infrastructure you need to scale.
  • Interoperability: You are not locked into using one kind of storage technology and can switch out your tech stack incrementally. With ADAMs Language implementation, you are able to interact with any existing centralized or decentralized system.
  • -
  • Smart Contracts without fees: With ADAMs Social DNA, social spaces can easily add their own small programs (smart contracts) using prolog.
  • -


    AD4M - The first social network
    \ No newline at end of file +
  • Smart Contracts without fees: With AD4M's Social DNA, social spaces can easily add their own declarative rules and schemas (smart contracts) using SHACL and subject classes.
  • +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/installation/index.html b/docs/installation.html similarity index 50% rename from docs/installation/index.html rename to docs/installation.html index 8de7624dc..7b875263c 100644 --- a/docs/installation/index.html +++ b/docs/installation.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Installation

    Installation

    +
    Installation

    Installation

    To kick off with AD4M and tap into its agent-centric network, you’ll need to install the core runtime and, for JavaScript UI projects, the client libraries to connect your apps. AD4M provides the AD4M Launcher for ease of use, the AD4M CLI for developer flexibility, and two npm packages—@coasys/ad4m and @coasys/ad4m-connect—for front-end integration. @@ -76,7 +76,7 @@

    console.log(perspectives[0].name); // e.g., "MyCommunity" });

    -

    Authentication Handling: Per auth docs, @coasys/ad4m-connect manages capability-based auth. On first connect, it requests a capability token from the executor, prompting the user (via Launcher UI or CLI) to approve. Specify required capabilities (e.g., perspective:write) in the config. Once approved, it stores a JWT locally, auto-authenticating future connections. If the executor isn’t running or capabilities mismatch, it retries or prompts again—simplifying secure app setup.

    +

    Authentication Handling: Per auth docs, @coasys/ad4m-connect manages capability-based auth. On first connect, it requests a capability token from the executor, prompting the user (via Launcher UI or CLI) to approve. Specify required capabilities (e.g., perspective:write) in the config. Once approved, it stores a JWT locally, auto-authenticating future connections. If the executor isn’t running or capabilities mismatch, it retries or prompts again—simplifying secure app setup.

    Start with @coasys/ad4m-connect for quick UI integration with auth, then use @coasys/ad4m for deeper API calls. Ensure the executor (Launcher or ad4m-executor) is active first.

    System Requirements

      @@ -87,4 +87,4 @@

      Dependencies: Launcher bundles all (Holochain, Deno, Rust); CLI needs Rust; client libs need Node.js (18+) and an executor instance.
    • Optional: CUDA for GPU acceleration AI inference. With these tools installed, you’re ready to harness AD4M’s distributed power.
    • -


    AD4M - The first social network
    \ No newline at end of file +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/README/index.html b/docs/jsdoc/README.html similarity index 58% rename from docs/jsdoc/README/index.html rename to docs/jsdoc/README.html index 92e62b8aa..899919c27 100644 --- a/docs/jsdoc/README/index.html +++ b/docs/jsdoc/README.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    Readme

    @coasys/ad4m / Exports

    +
    API Reference
    Readme

    @coasys/ad4m / Exports

    AD4M

    The Agent-Centric Distributed Application Meta-ontology or just: @@ -176,4 +176,4 @@

    and link-ontologies

    needed for the app's domain - and then creating expressions from those Languages and linking them inside Perspectives.

    -

    The latter means creating RDF/semantic web style triplets that associate expressions in order to represent app specific semantics - not too different to how Solid style linked-data would work.


    AD4M - The first social network
    \ No newline at end of file +

    The latter means creating RDF/semantic web style triplets that associate expressions in order to represent app specific semantics - not too different to how Solid style linked-data would work.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIClient/index.html b/docs/jsdoc/classes/AIClient.html similarity index 57% rename from docs/jsdoc/classes/AIClient/index.html rename to docs/jsdoc/classes/AIClient.html index d40dd8afe..e6c9288ed 100644 --- a/docs/jsdoc/classes/AIClient/index.html +++ b/docs/jsdoc/classes/AIClient.html @@ -11,36 +11,36 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    classes
    Aiclient

    @coasys/ad4m / Exports / AIClient

    +
    API Reference
    classes
    Aiclient

    @coasys/ad4m / Exports / AIClient

    Class: AIClient

    Table of contents

    Constructors

    Properties

    Methods

    Constructors

    constructor

    @@ -68,17 +68,17 @@

    NameTypeDefault valueapolloClientApolloClient<any>undefinedsubscribebooleantrue

    Defined in

    -

    ai/AIClient.ts:12 (opens in a new tab)

    +

    ai/AIClient.ts:12 (opens in a new tab)

    Properties

    #apolloClient

    Private #apolloClient: ApolloClient<any>

    Defined in

    -

    ai/AIClient.ts:9 (opens in a new tab)

    +

    ai/AIClient.ts:9 (opens in a new tab)


    #transcriptionSubscriptions

    Private #transcriptionSubscriptions: Map<string, any>

    Defined in

    -

    ai/AIClient.ts:10 (opens in a new tab)

    +

    ai/AIClient.ts:10 (opens in a new tab)

    Methods

    addModel

    addModel(model): Promise<string>

    @@ -100,10 +100,10 @@

    Returns

    Promise<string>

    Defined in

    -

    ai/AIClient.ts:47 (opens in a new tab)

    +

    ai/AIClient.ts:47 (opens in a new tab)


    addTask

    -

    addTask(name, modelId, systemPrompt, promptExamples, metaData?): Promise<AITask>

    +

    addTask(name, modelId, systemPrompt, promptExamples, metaData?): Promise<AITask>

    Parameters

    @@ -136,9 +136,9 @@

    NameTypenamestringmodelIdstringsystemPromptstringpromptExamples{ input: string ; output: string }[]metaData?string

    Returns

    -

    Promise<AITask>

    +

    Promise<AITask>

    Defined in

    -

    ai/AIClient.ts:151 (opens in a new tab)

    +

    ai/AIClient.ts:151 (opens in a new tab)


    closeTranscriptionStream

    closeTranscriptionStream(streamId): Promise<void>

    @@ -160,7 +160,7 @@

    Returns

    Promise<void>

    Defined in

    -

    ai/AIClient.ts:339 (opens in a new tab)

    +

    ai/AIClient.ts:339 (opens in a new tab)


    embed

    embed(modelId, text): Promise<number[]>

    @@ -186,7 +186,7 @@

    Returns

    Promise<number[]>

    Defined in

    -

    ai/AIClient.ts:276 (opens in a new tab)

    +

    ai/AIClient.ts:276 (opens in a new tab)


    feedTranscriptionStream

    feedTranscriptionStream(streamIds, audio): Promise<void>

    @@ -212,7 +212,7 @@

    Returns

    Promise<void>

    Defined in

    -

    ai/AIClient.ts:360 (opens in a new tab)

    +

    ai/AIClient.ts:360 (opens in a new tab)


    getDefaultModel

    getDefaultModel(modelType): Promise<Model>

    @@ -234,17 +234,17 @@

    Returns

    Promise<Model>

    Defined in

    -

    ai/AIClient.ts:95 (opens in a new tab)

    +

    ai/AIClient.ts:95 (opens in a new tab)


    getModels

    getModels(): Promise<Model[]>

    Returns

    Promise<Model[]>

    Defined in

    -

    ai/AIClient.ts:16 (opens in a new tab)

    +

    ai/AIClient.ts:16 (opens in a new tab)


    modelLoadingStatus

    -

    modelLoadingStatus(model): Promise<AIModelLoadingStatus>

    +

    modelLoadingStatus(model): Promise<AIModelLoadingStatus>

    Parameters

    @@ -261,9 +261,9 @@

    NameTypemodelstring

    Returns

    -

    Promise<AIModelLoadingStatus>

    +

    Promise<AIModelLoadingStatus>

    Defined in

    -

    ai/AIClient.ts:239 (opens in a new tab)

    +

    ai/AIClient.ts:239 (opens in a new tab)


    openTranscriptionStream

    openTranscriptionStream(modelId, streamCallback, params?): Promise<string>

    @@ -313,7 +313,7 @@

    Returns

    Promise<string>

    Defined in

    -

    ai/AIClient.ts:296 (opens in a new tab)

    +

    ai/AIClient.ts:296 (opens in a new tab)


    prompt

    prompt(taskId, prompt): Promise<string>

    @@ -339,7 +339,7 @@

    Returns

    Promise<string>

    Defined in

    -

    ai/AIClient.ts:260 (opens in a new tab)

    +

    ai/AIClient.ts:260 (opens in a new tab)


    removeModel

    removeModel(modelId): Promise<boolean>

    @@ -361,10 +361,10 @@

    Returns

    Promise<boolean>

    Defined in

    -

    ai/AIClient.ts:71 (opens in a new tab)

    +

    ai/AIClient.ts:71 (opens in a new tab)


    removeTask

    -

    removeTask(taskId): Promise<AITask>

    +

    removeTask(taskId): Promise<AITask>

    Parameters

    @@ -381,9 +381,9 @@

    NameTypetaskIdstring

    Returns

    -

    Promise<AITask>

    +

    Promise<AITask>

    Defined in

    -

    ai/AIClient.ts:179 (opens in a new tab)

    +

    ai/AIClient.ts:179 (opens in a new tab)


    setDefaultModel

    setDefaultModel(modelType, modelId): Promise<boolean>

    @@ -409,14 +409,14 @@

    Returns

    Promise<boolean>

    Defined in

    -

    ai/AIClient.ts:83 (opens in a new tab)

    +

    ai/AIClient.ts:83 (opens in a new tab)


    tasks

    -

    tasks(): Promise<AITask[]>

    +

    tasks(): Promise<AITask[]>

    Returns

    -

    Promise<AITask[]>

    +

    Promise<AITask[]>

    Defined in

    -

    ai/AIClient.ts:127 (opens in a new tab)

    +

    ai/AIClient.ts:127 (opens in a new tab)


    updateModel

    updateModel(modelId, model): Promise<boolean>

    @@ -442,10 +442,10 @@

    Returns

    Promise<boolean>

    Defined in

    -

    ai/AIClient.ts:59 (opens in a new tab)

    +

    ai/AIClient.ts:59 (opens in a new tab)


    updateTask

    -

    updateTask(taskId, task): Promise<AITask>

    +

    updateTask(taskId, task): Promise<AITask>

    Parameters

    @@ -464,8 +464,8 @@

    NameTypetaskIdstringtaskAITask +
    NameType
    taskIdstring
    taskAITask

    Returns

    -

    Promise<AITask>

    +

    Promise<AITask>

    Defined in

    -

    ai/AIClient.ts:206 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +

    ai/AIClient.ts:206 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIModelLoadingStatus.html b/docs/jsdoc/classes/AIModelLoadingStatus.html new file mode 100644 index 000000000..a47e1e97e --- /dev/null +++ b/docs/jsdoc/classes/AIModelLoadingStatus.html @@ -0,0 +1,89 @@ +Class: AIModelLoadingStatus | AD4M Docs
    API Reference
    classes
    Aimodelloadingstatus

    @coasys/ad4m / Exports / AIModelLoadingStatus

    +

    Class: AIModelLoadingStatus

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AIModelLoadingStatus(model, status, progress, downloaded, loaded)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    modelstring
    statusstring
    progressnumber
    downloadedboolean
    loadedboolean
    +

    Defined in

    +

    ai/Tasks.ts:114 (opens in a new tab)

    +

    Properties

    +

    downloaded

    +

    downloaded: boolean

    +

    Defined in

    +

    ai/Tasks.ts:109 (opens in a new tab)

    +
    +

    loaded

    +

    loaded: boolean

    +

    Defined in

    +

    ai/Tasks.ts:112 (opens in a new tab)

    +
    +

    model

    +

    model: string

    +

    Defined in

    +

    ai/Tasks.ts:100 (opens in a new tab)

    +
    +

    progress

    +

    progress: number

    +

    Defined in

    +

    ai/Tasks.ts:106 (opens in a new tab)

    +
    +

    status

    +

    status: string

    +

    Defined in

    +

    ai/Tasks.ts:103 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIModelLoadingStatus/index.html b/docs/jsdoc/classes/AIModelLoadingStatus/index.html deleted file mode 100644 index 00dd938bf..000000000 --- a/docs/jsdoc/classes/AIModelLoadingStatus/index.html +++ /dev/null @@ -1,89 +0,0 @@ -Class: AIModelLoadingStatus | AD4M Docs
    API Reference
    classes
    Aimodelloadingstatus

    @coasys/ad4m / Exports / AIModelLoadingStatus

    -

    Class: AIModelLoadingStatus

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AIModelLoadingStatus(model, status, progress, downloaded, loaded)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    modelstring
    statusstring
    progressnumber
    downloadedboolean
    loadedboolean
    -

    Defined in

    -

    ai/Tasks.ts:114 (opens in a new tab)

    -

    Properties

    -

    downloaded

    -

    downloaded: boolean

    -

    Defined in

    -

    ai/Tasks.ts:109 (opens in a new tab)

    -
    -

    loaded

    -

    loaded: boolean

    -

    Defined in

    -

    ai/Tasks.ts:112 (opens in a new tab)

    -
    -

    model

    -

    model: string

    -

    Defined in

    -

    ai/Tasks.ts:100 (opens in a new tab)

    -
    -

    progress

    -

    progress: number

    -

    Defined in

    -

    ai/Tasks.ts:106 (opens in a new tab)

    -
    -

    status

    -

    status: string

    -

    Defined in

    -

    ai/Tasks.ts:103 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIPromptExamples.html b/docs/jsdoc/classes/AIPromptExamples.html new file mode 100644 index 000000000..5dddbaf3d --- /dev/null +++ b/docs/jsdoc/classes/AIPromptExamples.html @@ -0,0 +1,59 @@ +Class: AIPromptExamples | AD4M Docs
    API Reference
    classes
    Aipromptexamples

    @coasys/ad4m / Exports / AIPromptExamples

    +

    Class: AIPromptExamples

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AIPromptExamples(input, output)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    inputstring
    outputstring
    +

    Defined in

    +

    ai/Tasks.ts:27 (opens in a new tab)

    +

    Properties

    +

    input

    +

    input: string

    +

    Defined in

    +

    ai/Tasks.ts:22 (opens in a new tab)

    +
    +

    output

    +

    output: string

    +

    Defined in

    +

    ai/Tasks.ts:25 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIPromptExamples/index.html b/docs/jsdoc/classes/AIPromptExamples/index.html deleted file mode 100644 index c752fd4e6..000000000 --- a/docs/jsdoc/classes/AIPromptExamples/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: AIPromptExamples | AD4M Docs
    API Reference
    classes
    Aipromptexamples

    @coasys/ad4m / Exports / AIPromptExamples

    -

    Class: AIPromptExamples

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AIPromptExamples(input, output)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    inputstring
    outputstring
    -

    Defined in

    -

    ai/Tasks.ts:27 (opens in a new tab)

    -

    Properties

    -

    input

    -

    input: string

    -

    Defined in

    -

    ai/Tasks.ts:22 (opens in a new tab)

    -
    -

    output

    -

    output: string

    -

    Defined in

    -

    ai/Tasks.ts:25 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIPromptExamplesInput.html b/docs/jsdoc/classes/AIPromptExamplesInput.html new file mode 100644 index 000000000..264d8e535 --- /dev/null +++ b/docs/jsdoc/classes/AIPromptExamplesInput.html @@ -0,0 +1,59 @@ +Class: AIPromptExamplesInput | AD4M Docs
    API Reference
    classes
    Aipromptexamplesinput

    @coasys/ad4m / Exports / AIPromptExamplesInput

    +

    Class: AIPromptExamplesInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AIPromptExamplesInput(input, output)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    inputstring
    outputstring
    +

    Defined in

    +

    ai/Tasks.ts:12 (opens in a new tab)

    +

    Properties

    +

    input

    +

    input: string

    +

    Defined in

    +

    ai/Tasks.ts:7 (opens in a new tab)

    +
    +

    output

    +

    output: string

    +

    Defined in

    +

    ai/Tasks.ts:10 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AIPromptExamplesInput/index.html b/docs/jsdoc/classes/AIPromptExamplesInput/index.html deleted file mode 100644 index 56d8749c5..000000000 --- a/docs/jsdoc/classes/AIPromptExamplesInput/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: AIPromptExamplesInput | AD4M Docs
    API Reference
    classes
    Aipromptexamplesinput

    @coasys/ad4m / Exports / AIPromptExamplesInput

    -

    Class: AIPromptExamplesInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AIPromptExamplesInput(input, output)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    inputstring
    outputstring
    -

    Defined in

    -

    ai/Tasks.ts:12 (opens in a new tab)

    -

    Properties

    -

    input

    -

    input: string

    -

    Defined in

    -

    ai/Tasks.ts:7 (opens in a new tab)

    -
    -

    output

    -

    output: string

    -

    Defined in

    -

    ai/Tasks.ts:10 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AITask.html b/docs/jsdoc/classes/AITask.html new file mode 100644 index 000000000..23834ddfa --- /dev/null +++ b/docs/jsdoc/classes/AITask.html @@ -0,0 +1,119 @@ +Class: AITask | AD4M Docs
    API Reference
    classes
    Aitask

    @coasys/ad4m / Exports / AITask

    +

    Class: AITask

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AITask(name, model_id, task_id, system_prompt, prompt_examples, metaData?, created_at?, updated_at?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    namestring
    model_idstring
    task_idstring
    system_promptstring
    prompt_examplesAIPromptExamples[]
    metaData?string
    created_at?string
    updated_at?string
    +

    Defined in

    +

    ai/Tasks.ts:85 (opens in a new tab)

    +

    Properties

    +

    createdAt

    +

    createdAt: string

    +

    Defined in

    +

    ai/Tasks.ts:80 (opens in a new tab)

    +
    +

    metaData

    +

    Optional metaData: string

    +

    Defined in

    +

    ai/Tasks.ts:77 (opens in a new tab)

    +
    +

    modelId

    +

    modelId: string

    +

    Defined in

    +

    ai/Tasks.ts:65 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    ai/Tasks.ts:62 (opens in a new tab)

    +
    +

    promptExamples

    +

    promptExamples: AIPromptExamples[]

    +

    Defined in

    +

    ai/Tasks.ts:74 (opens in a new tab)

    +
    +

    systemPrompt

    +

    systemPrompt: string

    +

    Defined in

    +

    ai/Tasks.ts:71 (opens in a new tab)

    +
    +

    taskId

    +

    taskId: string

    +

    Defined in

    +

    ai/Tasks.ts:68 (opens in a new tab)

    +
    +

    updatedAt

    +

    updatedAt: string

    +

    Defined in

    +

    ai/Tasks.ts:83 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AITask/index.html b/docs/jsdoc/classes/AITask/index.html deleted file mode 100644 index 52aa8ad67..000000000 --- a/docs/jsdoc/classes/AITask/index.html +++ /dev/null @@ -1,119 +0,0 @@ -Class: AITask | AD4M Docs
    API Reference
    classes
    Aitask

    @coasys/ad4m / Exports / AITask

    -

    Class: AITask

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AITask(name, model_id, task_id, system_prompt, prompt_examples, metaData?, created_at?, updated_at?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    namestring
    model_idstring
    task_idstring
    system_promptstring
    prompt_examplesAIPromptExamples[]
    metaData?string
    created_at?string
    updated_at?string
    -

    Defined in

    -

    ai/Tasks.ts:85 (opens in a new tab)

    -

    Properties

    -

    createdAt

    -

    createdAt: string

    -

    Defined in

    -

    ai/Tasks.ts:80 (opens in a new tab)

    -
    -

    metaData

    -

    Optional metaData: string

    -

    Defined in

    -

    ai/Tasks.ts:77 (opens in a new tab)

    -
    -

    modelId

    -

    modelId: string

    -

    Defined in

    -

    ai/Tasks.ts:65 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    ai/Tasks.ts:62 (opens in a new tab)

    -
    -

    promptExamples

    -

    promptExamples: AIPromptExamples[]

    -

    Defined in

    -

    ai/Tasks.ts:74 (opens in a new tab)

    -
    -

    systemPrompt

    -

    systemPrompt: string

    -

    Defined in

    -

    ai/Tasks.ts:71 (opens in a new tab)

    -
    -

    taskId

    -

    taskId: string

    -

    Defined in

    -

    ai/Tasks.ts:68 (opens in a new tab)

    -
    -

    updatedAt

    -

    updatedAt: string

    -

    Defined in

    -

    ai/Tasks.ts:83 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AITaskInput.html b/docs/jsdoc/classes/AITaskInput.html new file mode 100644 index 000000000..5c3b87d67 --- /dev/null +++ b/docs/jsdoc/classes/AITaskInput.html @@ -0,0 +1,89 @@ +Class: AITaskInput | AD4M Docs
    API Reference
    classes
    Aitaskinput

    @coasys/ad4m / Exports / AITaskInput

    +

    Class: AITaskInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AITaskInput(name, model_id, system_prompt, prompt_examples, metaData?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    namestring
    model_idstring
    system_promptstring
    prompt_examplesAIPromptExamplesInput[]
    metaData?string
    +

    Defined in

    +

    ai/Tasks.ts:50 (opens in a new tab)

    +

    Properties

    +

    metaData

    +

    metaData: string

    +

    Defined in

    +

    ai/Tasks.ts:48 (opens in a new tab)

    +
    +

    modelId

    +

    modelId: string

    +

    Defined in

    +

    ai/Tasks.ts:39 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    ai/Tasks.ts:36 (opens in a new tab)

    +
    +

    promptExamples

    +

    promptExamples: AIPromptExamplesInput[]

    +

    Defined in

    +

    ai/Tasks.ts:45 (opens in a new tab)

    +
    +

    systemPrompt

    +

    systemPrompt: string

    +

    Defined in

    +

    ai/Tasks.ts:42 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AITaskInput/index.html b/docs/jsdoc/classes/AITaskInput/index.html deleted file mode 100644 index d667b7dd5..000000000 --- a/docs/jsdoc/classes/AITaskInput/index.html +++ /dev/null @@ -1,89 +0,0 @@ -Class: AITaskInput | AD4M Docs
    API Reference
    classes
    Aitaskinput

    @coasys/ad4m / Exports / AITaskInput

    -

    Class: AITaskInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AITaskInput(name, model_id, system_prompt, prompt_examples, metaData?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    namestring
    model_idstring
    system_promptstring
    prompt_examplesAIPromptExamplesInput[]
    metaData?string
    -

    Defined in

    -

    ai/Tasks.ts:50 (opens in a new tab)

    -

    Properties

    -

    metaData

    -

    metaData: string

    -

    Defined in

    -

    ai/Tasks.ts:48 (opens in a new tab)

    -
    -

    modelId

    -

    modelId: string

    -

    Defined in

    -

    ai/Tasks.ts:39 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    ai/Tasks.ts:36 (opens in a new tab)

    -
    -

    promptExamples

    -

    promptExamples: AIPromptExamplesInput[]

    -

    Defined in

    -

    ai/Tasks.ts:45 (opens in a new tab)

    -
    -

    systemPrompt

    -

    systemPrompt: string

    -

    Defined in

    -

    ai/Tasks.ts:42 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Ad4mClient.html b/docs/jsdoc/classes/Ad4mClient.html new file mode 100644 index 000000000..a67ed8722 --- /dev/null +++ b/docs/jsdoc/classes/Ad4mClient.html @@ -0,0 +1,163 @@ +Class: Ad4mClient | AD4M Docs
    API Reference
    classes
    Ad4mclient

    @coasys/ad4m / Exports / Ad4mClient

    +

    Class: Ad4mClient

    +

    Client for the Ad4m interface wrapping GraphQL queryies +for convenient use in user facing code.

    +

    Aggregates the six sub-clients: +AgentClient, ExpressionClient, LanguageClient, +NeighbourhoodClient, PerspectiveClient and RuntimeClient +for the respective functionality.

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Constructors

    +

    constructor

    +

    new Ad4mClient(client, subscribe?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault value
    clientApolloClient<any>undefined
    subscribebooleantrue
    +

    Defined in

    +

    Ad4mClient.ts:30 (opens in a new tab)

    +

    Properties

    +

    #agentClient

    +

    Private #agentClient: AgentClient

    +

    Defined in

    +

    Ad4mClient.ts:21 (opens in a new tab)

    +
    +

    #aiClient

    +

    Private #aiClient: AIClient

    +

    Defined in

    +

    Ad4mClient.ts:27 (opens in a new tab)

    +
    +

    #apolloClient

    +

    Private #apolloClient: ApolloClient<any>

    +

    Defined in

    +

    Ad4mClient.ts:20 (opens in a new tab)

    +
    +

    #expressionClient

    +

    Private #expressionClient: ExpressionClient

    +

    Defined in

    +

    Ad4mClient.ts:22 (opens in a new tab)

    +
    +

    #languageClient

    +

    Private #languageClient: LanguageClient

    +

    Defined in

    +

    Ad4mClient.ts:23 (opens in a new tab)

    +
    +

    #neighbourhoodClient

    +

    Private #neighbourhoodClient: NeighbourhoodClient

    +

    Defined in

    +

    Ad4mClient.ts:24 (opens in a new tab)

    +
    +

    #perspectiveClient

    +

    Private #perspectiveClient: PerspectiveClient

    +

    Defined in

    +

    Ad4mClient.ts:25 (opens in a new tab)

    +
    +

    #runtimeClient

    +

    Private #runtimeClient: RuntimeClient

    +

    Defined in

    +

    Ad4mClient.ts:26 (opens in a new tab)

    +

    Accessors

    +

    agent

    +

    get agent(): AgentClient

    +

    Returns

    +

    AgentClient

    +

    Defined in

    +

    Ad4mClient.ts:45 (opens in a new tab)

    +
    +

    ai

    +

    get ai(): AIClient

    +

    Returns

    +

    AIClient

    +

    Defined in

    +

    Ad4mClient.ts:69 (opens in a new tab)

    +
    +

    expression

    +

    get expression(): ExpressionClient

    +

    Returns

    +

    ExpressionClient

    +

    Defined in

    +

    Ad4mClient.ts:49 (opens in a new tab)

    +
    +

    languages

    +

    get languages(): LanguageClient

    +

    Returns

    +

    LanguageClient

    +

    Defined in

    +

    Ad4mClient.ts:53 (opens in a new tab)

    +
    +

    neighbourhood

    +

    get neighbourhood(): NeighbourhoodClient

    +

    Returns

    +

    NeighbourhoodClient

    +

    Defined in

    +

    Ad4mClient.ts:57 (opens in a new tab)

    +
    +

    perspective

    +

    get perspective(): PerspectiveClient

    +

    Returns

    +

    PerspectiveClient

    +

    Defined in

    +

    Ad4mClient.ts:61 (opens in a new tab)

    +
    +

    runtime

    +

    get runtime(): RuntimeClient

    +

    Returns

    +

    RuntimeClient

    +

    Defined in

    +

    Ad4mClient.ts:65 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Ad4mClient/index.html b/docs/jsdoc/classes/Ad4mClient/index.html deleted file mode 100644 index abfcba8ed..000000000 --- a/docs/jsdoc/classes/Ad4mClient/index.html +++ /dev/null @@ -1,163 +0,0 @@ -Class: Ad4mClient | AD4M Docs
    API Reference
    classes
    Ad4mclient

    @coasys/ad4m / Exports / Ad4mClient

    -

    Class: Ad4mClient

    -

    Client for the Ad4m interface wrapping GraphQL queryies -for convenient use in user facing code.

    -

    Aggregates the six sub-clients: -AgentClient, ExpressionClient, LanguageClient, -NeighbourhoodClient, PerspectiveClient and RuntimeClient -for the respective functionality.

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Accessors

    - -

    Constructors

    -

    constructor

    -

    new Ad4mClient(client, subscribe?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault value
    clientApolloClient<any>undefined
    subscribebooleantrue
    -

    Defined in

    -

    Ad4mClient.ts:30 (opens in a new tab)

    -

    Properties

    -

    #agentClient

    -

    Private #agentClient: AgentClient

    -

    Defined in

    -

    Ad4mClient.ts:21 (opens in a new tab)

    -
    -

    #aiClient

    -

    Private #aiClient: AIClient

    -

    Defined in

    -

    Ad4mClient.ts:27 (opens in a new tab)

    -
    -

    #apolloClient

    -

    Private #apolloClient: ApolloClient<any>

    -

    Defined in

    -

    Ad4mClient.ts:20 (opens in a new tab)

    -
    -

    #expressionClient

    -

    Private #expressionClient: ExpressionClient

    -

    Defined in

    -

    Ad4mClient.ts:22 (opens in a new tab)

    -
    -

    #languageClient

    -

    Private #languageClient: LanguageClient

    -

    Defined in

    -

    Ad4mClient.ts:23 (opens in a new tab)

    -
    -

    #neighbourhoodClient

    -

    Private #neighbourhoodClient: NeighbourhoodClient

    -

    Defined in

    -

    Ad4mClient.ts:24 (opens in a new tab)

    -
    -

    #perspectiveClient

    -

    Private #perspectiveClient: PerspectiveClient

    -

    Defined in

    -

    Ad4mClient.ts:25 (opens in a new tab)

    -
    -

    #runtimeClient

    -

    Private #runtimeClient: RuntimeClient

    -

    Defined in

    -

    Ad4mClient.ts:26 (opens in a new tab)

    -

    Accessors

    -

    agent

    -

    get agent(): AgentClient

    -

    Returns

    -

    AgentClient

    -

    Defined in

    -

    Ad4mClient.ts:45 (opens in a new tab)

    -
    -

    ai

    -

    get ai(): AIClient

    -

    Returns

    -

    AIClient

    -

    Defined in

    -

    Ad4mClient.ts:69 (opens in a new tab)

    -
    -

    expression

    -

    get expression(): ExpressionClient

    -

    Returns

    -

    ExpressionClient

    -

    Defined in

    -

    Ad4mClient.ts:49 (opens in a new tab)

    -
    -

    languages

    -

    get languages(): LanguageClient

    -

    Returns

    -

    LanguageClient

    -

    Defined in

    -

    Ad4mClient.ts:53 (opens in a new tab)

    -
    -

    neighbourhood

    -

    get neighbourhood(): NeighbourhoodClient

    -

    Returns

    -

    NeighbourhoodClient

    -

    Defined in

    -

    Ad4mClient.ts:57 (opens in a new tab)

    -
    -

    perspective

    -

    get perspective(): PerspectiveClient

    -

    Returns

    -

    PerspectiveClient

    -

    Defined in

    -

    Ad4mClient.ts:61 (opens in a new tab)

    -
    -

    runtime

    -

    get runtime(): RuntimeClient

    -

    Returns

    -

    RuntimeClient

    -

    Defined in

    -

    Ad4mClient.ts:65 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Ad4mModel.html b/docs/jsdoc/classes/Ad4mModel.html new file mode 100644 index 000000000..ad46c5b7b --- /dev/null +++ b/docs/jsdoc/classes/Ad4mModel.html @@ -0,0 +1,2555 @@ +Class: Ad4mModel | AD4M Docs
    API Reference
    classes
    Ad4mmodel

    @coasys/ad4m / Exports / Ad4mModel

    +

    Class: Ad4mModel

    +

    Base class for defining data models in AD4M.

    +

    Description

    +

    Ad4mModel provides the foundation for creating data models that are stored in AD4M perspectives. +Each model instance is represented as a subgraph in the perspective, with properties and relations +mapped to links in that graph. The class uses Prolog-based queries to efficiently search and filter +instances based on their properties and relationships.

    +

    Key concepts:

    +
      +
    • Each model instance has a unique base expression that serves as its identifier
    • +
    • Properties are stored as links with predicates defined by the through option
    • +
    • Relations represent one-to-many relationships as sets of links
    • +
    • Queries are translated to Prolog for efficient graph pattern matching
    • +
    • Changes are tracked through the perspective's subscription system
    • +
    +

    Example

    +
    // Define a recipe model
    +@Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  // Required property with literal value
    +  @Property({
    +    through: "recipe://name",
    +    resolveLanguage: "literal"
    +  })
    +  name: string = "";
    + 
    +  // Optional property with custom initial value
    +  @Optional({
    +    through: "recipe://status",
    +    initial: "recipe://draft"
    +  })
    +  status: string = "";
    + 
    +  // Read-only computed property
    +  @ReadOnly({
    +    through: "recipe://rating",
    +    getter: `
    +      findall(Rating, triple(Base, "recipe://user_rating", Rating), Ratings),
    +      sum_list(Ratings, Sum),
    +      length(Ratings, Count),
    +      Value is Sum / Count
    +    `
    +  })
    +  averageRating: number = 0;
    + 
    +  // Relation of ingredients
    +  *   @HasMany({ through: "recipe://ingredient" })
    +  *   ingredients: string[] = [];
    + 
    +  // Relation of comments linked to another model
    +  @HasMany(() => Comment, { through: "recipe://comment" })
    +  comments: Comment[] = [];
    +}
    + 
    +// Create and save a new recipe
    +const recipe = new Recipe(perspective);
    +recipe.name = "Chocolate Cake";
    +recipe.ingredients = ["flour", "sugar", "cocoa"];
    +await recipe.save();
    + 
    +// Query recipes in different ways
    +// Get all recipes
    +const allRecipes = await Recipe.findAll(perspective);
    + 
    +// Find recipes with specific criteria
    +const desserts = await Recipe.findAll(perspective, {
    +  where: { 
    +    status: "recipe://published",
    +    averageRating: { gt: 4 }
    +  },
    +  order: { name: "ASC" },
    +  limit: 10
    +});
    + 
    +// Use the fluent query builder
    +const popularRecipes = await Recipe.query(perspective)
    +  .where({ averageRating: { gt: 4.5 } })
    +  .order({ averageRating: "DESC" })
    +  .limit(5)
    +  .get();
    + 
    +// Subscribe to real-time updates
    +await Recipe.query(perspective)
    +  .where({ status: "recipe://cooking" })
    +  .subscribe(recipes => {
    +    console.log("Currently being cooked:", recipes);
    +  });
    + 
    +// Paginate results
    +const { results, totalCount, pageNumber } = await Recipe.query(perspective)
    +  .where({ status: "recipe://published" })
    +  .paginate(10, 1);
    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new Ad4mModel(perspective, baseExpression?)

    +

    Constructs a new model instance.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective where this model will be stored
    baseExpression?stringOptional expression URI for this instance. If omitted, a random Literal URL is generated.
    +

    Example

    +
    // Create a new recipe with auto-generated base expression
    +const recipe = new Recipe(perspective);
    + 
    +// Create with specific base expression
    +const recipe = new Recipe(perspective, "literal://...");
    +

    Defined in

    +

    model/Ad4mModel.ts:747 (opens in a new tab)

    +

    Properties

    +

    _baseExpression

    +

    Private _baseExpression: string

    +

    Defined in

    +

    model/Ad4mModel.ts:523 (opens in a new tab)

    +
    +

    _perspective

    +

    Private _perspective: PerspectiveProxy

    +

    Defined in

    +

    model/Ad4mModel.ts:525 (opens in a new tab)

    +
    +

    _snapshot

    +

    Private _snapshot: Record<string, any> = null

    +

    Defined in

    +

    model/Ad4mModel.ts:526 (opens in a new tab)

    +
    +

    _subjectClassName

    +

    Private _subjectClassName: string

    +

    Defined in

    +

    model/Ad4mModel.ts:524 (opens in a new tab)

    +
    +

    author

    +

    author: string

    +

    Defined in

    +

    model/Ad4mModel.ts:527 (opens in a new tab)

    +
    +

    createdAt

    +

    createdAt: any

    +

    Defined in

    +

    model/Ad4mModel.ts:528 (opens in a new tab)

    +
    +

    updatedAt

    +

    updatedAt: any

    +

    Defined in

    +

    model/Ad4mModel.ts:529 (opens in a new tab)

    +
    +

    CreateOptions

    +

    Static Readonly CreateOptions: undefined

    +

    Options for Ad4mModel.create().

    +

    Defined in

    +

    model/Ad4mModel.ts:3386 (opens in a new tab)

    +
    +

    _linkShape

    +

    Static Private Readonly _linkShape: undefined

    +

    Link shape accepted by hydrateFromLinks. +Both getData() and instancesFromSurrealResult() produce this shape.

    +

    Defined in

    +

    model/Ad4mModel.ts:941 (opens in a new tab)

    +
    +

    classNamesByClass

    +

    Static Private classNamesByClass: WeakMap<typeof Ad4mModel, { [perspectiveId: string]: string; }>

    +

    Defined in

    +

    model/Ad4mModel.ts:531 (opens in a new tab)

    +

    Accessors

    +

    baseExpression

    +

    get baseExpression(): string

    +

    Returns

    +

    string

    +

    Deprecated

    +

    Use .id instead. Will be removed in a future version.

    +

    Defined in

    +

    model/Ad4mModel.ts:762 (opens in a new tab)

    +
    +

    id

    +

    get id(): string

    +

    The unique identifier (expression URI) of this model instance.

    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Ad4mModel.ts:755 (opens in a new tab)

    +
    +

    perspective

    +

    Protected get perspective(): PerspectiveProxy

    +

    Protected getter for the perspective. +Allows subclasses to access the perspective while keeping it private from external code.

    +

    Returns

    +

    PerspectiveProxy

    +

    Defined in

    +

    model/Ad4mModel.ts:770 (opens in a new tab)

    +
    +

    timestamp

    +

    get timestamp(): any

    +

    Backwards compatibility alias for createdAt.

    +

    Returns

    +

    any

    +

    Deprecated

    +

    Use createdAt instead. This will be removed in a future version.

    +

    Defined in

    +

    model/Ad4mModel.ts:581 (opens in a new tab)

    +

    Methods

    +

    addRelationValue

    +

    Private addRelationValue(key, value, batchId?): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    valueany
    batchId?string
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:2993 (opens in a new tab)

    +
    +

    changedFields

    +

    changedFields(): string[]

    +

    Returns the names of properties/relations that differ from the +snapshot taken at the last hydration.

    +

    Returns all field names if no snapshot exists.

    +

    Returns

    +

    string[]

    +

    Example

    +
    recipe.name = "New Name";
    +recipe.changedFields(); // ["name"]
    +

    Defined in

    +

    model/Ad4mModel.ts:1281 (opens in a new tab)

    +
    +

    cleanCopy

    +

    Private cleanCopy(): Record<string, any>

    +

    Returns

    +

    Record<string, any>

    +

    Defined in

    +

    model/Ad4mModel.ts:3166 (opens in a new tab)

    +
    +

    delete

    +

    delete(batchId?): Promise<void>

    +

    Deletes the model instance from the perspective.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    batchId?stringOptional batch ID for batch operations
    +

    Returns

    +

    Promise<void>

    +

    Throws

    +

    Will throw if removal fails

    +

    Example

    +
    const recipe = await Recipe.findAll(perspective)[0];
    +await recipe.delete();
    + 
    +// Or with batch operations:
    +const batchId = await perspective.createBatch();
    +await recipe.delete(batchId);
    +await perspective.commitBatch(batchId);
    +

    Defined in

    +

    model/Ad4mModel.ts:3324 (opens in a new tab)

    +
    +

    generatePropertySetterAction

    +

    Private generatePropertySetterAction(key, metadata): any[]

    +

    Generate property setter action from metadata (Phase 1: Prolog-free refactor) +Replaces Prolog query: property_setter(C, key, Setter)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    metadataPropertyMetadataEntry
    +

    Returns

    +

    any[]

    +

    Defined in

    +

    model/Ad4mModel.ts:799 (opens in a new tab)

    +
    +

    generateRelationAction

    +

    Private generateRelationAction(key, actionType): any[]

    +

    Generate relation action from metadata (Phase 1: Prolog-free refactor) +Replaces Prolog queries: collection_adder, collection_remover, collection_setter

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    actionType"setter" | "adder" | "remover"
    +

    Returns

    +

    any[]

    +

    Defined in

    +

    model/Ad4mModel.ts:839 (opens in a new tab)

    +
    +

    get

    +

    get(optsOrInclude?): Promise<Ad4mModel>

    +

    Gets the model instance with all properties and relations populated.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    optsOrInclude?IncludeMap | GetOptionsOptional hydration options. Accepts two forms: - GetOptions wrapper: { include: { comments: true }, properties: ['title'] } - IncludeMap shorthand: { comments: true } (equivalent to { include: { comments: true } })
    +

    Returns

    +

    Promise<Ad4mModel>

    +

    The populated model instance

    +

    Throws

    +

    Will throw if data retrieval fails

    +

    Example

    +
    const recipe = new Recipe(perspective, existingId);
    +await recipe.get();
    +console.log(recipe.name, recipe.ingredients);
    + 
    +// Shorthand — pass IncludeMap directly:
    +await recipe.get({ ingredients: true });
    + 
    +// Full options — includes sparse fieldset:
    +await recipe.get({ include: { ingredients: true }, properties: ['name'] });
    +

    Defined in

    +

    model/Ad4mModel.ts:3290 (opens in a new tab)

    +
    +

    getData

    +

    Private getData(opts?): Promise<Ad4mModel>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    opts?GetOptions
    +

    Returns

    +

    Promise<Ad4mModel>

    +

    Defined in

    +

    model/Ad4mModel.ts:1325 (opens in a new tab)

    +
    +

    getPropertyMetadata

    +

    Private getPropertyMetadata(key): PropertyMetadataEntry

    +

    Get property metadata from decorator (Phase 1: Prolog-free refactor)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    keystring
    +

    Returns

    +

    PropertyMetadataEntry

    +

    Defined in

    +

    model/Ad4mModel.ts:778 (opens in a new tab)

    +
    +

    getRelationOptions

    +

    Private getRelationOptions(key): RelationMetadataEntry

    +

    Get relation options from decorator

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    keystring
    +

    Returns

    +

    RelationMetadataEntry

    +

    Defined in

    +

    model/Ad4mModel.ts:788 (opens in a new tab)

    +
    +

    innerUpdate

    +

    Private innerUpdate(setProperties?, batchId?): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault value
    setPropertiesbooleantrue
    batchId?stringundefined
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:3188 (opens in a new tab)

    +
    +

    isDirty

    +

    isDirty(): boolean

    +

    Returns true if any tracked property or relation has changed +since the last hydration (or since takeSnapshot() was last called).

    +

    Always returns true if no snapshot exists (e.g. a freshly +constructed instance that hasn't been fetched yet).

    +

    Returns

    +

    boolean

    +

    Example

    +
    const recipe = await Recipe.create(perspective, { name: "Pasta" });
    +recipe.isDirty();        // false — just hydrated
    +recipe.name = "Risotto";
    +recipe.isDirty();        // true
    +

    Defined in

    +

    model/Ad4mModel.ts:1264 (opens in a new tab)

    +
    +

    removeRelationValue

    +

    Private removeRelationValue(key, value, batchId?): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    valueany
    batchId?string
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:3017 (opens in a new tab)

    +
    +

    resolveRelationId

    +

    Private resolveRelationId(value): string

    +

    Resolve a relation argument to a plain string ID. Accepts either a raw +string ID or an Ad4mModel instance (in which case .id is used).

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    valueany
    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Ad4mModel.ts:2962 (opens in a new tab)

    +
    +

    save

    +

    save(batchId?): Promise<void>

    +

    Saves the model instance to the perspective.

    +

    New instances (no snapshot yet): creates the subject via +createSubject with initial scalar values, then sets relations +via innerUpdate.

    +

    Existing instances (snapshot present, i.e. fetched via get() +or a query): updates only dirty fields via innerUpdate, then +refreshes from the perspective.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    batchId?stringOptional batch ID for batch operations
    +

    Returns

    +

    Promise<void>

    +

    Throws

    +

    Will throw if instance creation, linking, or updating fails

    +

    Example

    +
    // Create
    +const recipe = new Recipe(perspective);
    +recipe.name = "Spaghetti";
    +await recipe.save();
    + 
    +// Update
    +recipe.rating = 10;
    +await recipe.save();
    +

    Defined in

    +

    model/Ad4mModel.ts:3067 (opens in a new tab)

    +
    +

    setProperty

    +

    Private setProperty(key, value, batchId?): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    valueany
    batchId?string
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:2934 (opens in a new tab)

    +
    +

    setRelationValues

    +

    Private setRelationValues(key, value, batchId?): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    keystring
    valueany
    batchId?string
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:2968 (opens in a new tab)

    +
    +

    takeSnapshot

    +

    Private takeSnapshot(includedRelations?): void

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    includedRelations?Record<string, any>Controls which relation fields are recorded in the snapshot for dirty-tracking: • undefined (default) — snapshot ALL relations (used by .get(), .create(), .save() etc. where full hydration has occurred). • IncludeMap object (e.g. { views: true }) — only snapshot the relations named in the map. Fields not listed are omitted from the snapshot so that changedFields() ignores them. • null / empty object — skip ALL relations (used by bare subscriptions that don't eagerly load relations).
    +

    Returns

    +

    void

    +

    Defined in

    +

    model/Ad4mModel.ts:1208 (opens in a new tab)

    +
    +

    assignValuesToInstance

    +

    Static assignValuesToInstance(perspective, instance, values): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    instanceAd4mModel
    valuesValueTuple[]
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:1100 (opens in a new tab)

    +
    +

    buildConformanceGetter

    +

    Static Private buildConformanceGetter(relationPredicate, targetClass): string

    +

    Builds a SurrealQL conformance getter for a relation whose target model +is known but no explicit getter string was supplied.

    +

    The generated getter traverses outgoing links matching the relation's +predicate and then filters the target nodes to only those that conform to +the target model's shape (required properties / flags).

    +

    Delegates to the shared buildConformanceFilter() utility in decorators.ts +so the same logic is used at shape-definition time and at query time.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    relationPredicatestringThe relation's predicate URI (e.g. "flux://entry_type")
    targetClassanyThe target model class (result of calling the target() thunk)
    +

    Returns

    +

    string

    +

    A SurrealQL expression string, or undefined if no conformance +conditions could be derived from the target model.

    +

    Defined in

    +

    model/Ad4mModel.ts:1433 (opens in a new tab)

    +
    +

    buildGraphTraversalWhereClause

    +

    Static Private buildGraphTraversalWhereClause(metadata, where?): string

    +

    Builds the WHERE clause for SurrealQL queries using graph traversal syntax.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    metadataModelMetadataModel metadata containing property predicates
    where?WhereWhere conditions from the query
    +

    Returns

    +

    string

    +

    Graph traversal WHERE clause filters, or empty string if no conditions

    +

    Description

    +

    Translates where conditions into graph traversal filters: ->link[WHERE ...] +This is more efficient than nested SELECTs because SurrealDB can optimize graph traversals.

    +

    Handles several condition types:

    +
      +
    • Simple equality: { name: "Pasta" }->link[WHERE predicate = 'X' AND out.uri = 'Pasta']
    • +
    • Arrays (IN clause): { name: ["Pasta", "Pizza"] }->link[WHERE predicate = 'X' AND out.uri IN [...]]
    • +
    • NOT operators: Use NOT prefix
    • +
    • Comparison operators (gt, gte, lt, lte, etc.): Handled in post-query JavaScript filtering
    • +
    • Special fields: base uses uri directly, author/timestamp handled post-query
    • +
    +

    Defined in

    +

    model/Ad4mModel.ts:1966 (opens in a new tab)

    +
    +

    buildSurrealSelectFields

    +

    Static Private buildSurrealSelectFields(metadata, properties?, relations?): string

    +

    Builds the SELECT fields for SurrealQL queries.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    metadataModelMetadataModel metadata containing property and relation predicates
    properties?string[]Optional array of property names to include (default: all)
    relations?string[]Optional array of relation names to include (default: all)
    +

    Returns

    +

    string

    +

    Comma-separated SELECT field list

    +

    Description

    +

    Generates the field list for the SELECT clause, resolving properties and relations +via subqueries. Each property is fetched with a subquery that finds the link with the +appropriate predicate and returns its target. Relations are similar but don't use LIMIT 1.

    +

    Field types:

    +
      +
    • Properties: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X' LIMIT 1) AS propName
    • +
    • Relations: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X') AS relName
    • +
    • Author/Timestamp: Always included to provide metadata about each instance
    • +
    +

    If properties or relations arrays are provided, only those fields are included. +Otherwise, all properties/relations from metadata are included.

    +

    Defined in

    +

    model/Ad4mModel.ts:2273 (opens in a new tab)

    +
    +

    buildSurrealSelectFieldsWithAggregation

    +

    Static Private buildSurrealSelectFieldsWithAggregation(metadata, properties?, relations?): string

    +

    Builds the SELECT fields for SurrealQL queries using aggregation functions. +Compatible with GROUP BY source queries.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    metadataModelMetadata
    properties?string[]
    relations?string[]
    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Ad4mModel.ts:2312 (opens in a new tab)

    +
    +

    buildSurrealWhereClause

    +

    Static Private buildSurrealWhereClause(metadata, where?): string

    +

    Builds the WHERE clause for SurrealQL queries.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    metadataModelMetadataModel metadata containing property predicates
    where?WhereWhere conditions from the query
    +

    Returns

    +

    string

    +

    WHERE clause string (without the "WHERE" keyword), or empty string if no conditions

    +

    Description

    +

    Translates the where conditions from the Query object into SurrealQL WHERE clause fragments. +For each property filter, generates a subquery that checks for links with the appropriate +predicate and target value.

    +

    Handles several condition types:

    +
      +
    • Simple equality: { name: "Pasta" } → subquery checking for predicate and target match
    • +
    • Arrays (IN clause): { name: ["Pasta", "Pizza"] } → target IN [...]
    • +
    • Operators: { rating: { gt: 4 } } → target > '4' +
        +
      • gt, gte, lt, lte: comparison operators
      • +
      • not: negation (single value or array)
      • +
      • between: range check
      • +
      • contains: substring/element check (uses SurrealQL CONTAINS)
      • +
      +
    • +
    • Special fields: base, author, timestamp are accessed directly, not via subqueries
    • +
    +

    All conditions are joined with AND.

    +

    Defined in

    +

    model/Ad4mModel.ts:2144 (opens in a new tab)

    +
    +

    count

    +

    Static count(perspective, query?, useSurrealDB?): any

    +

    Gets a count of all matching instances.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault valueDescription
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    +

    Returns

    +

    any

    +

    Total count of matching entities

    +

    Example

    +
    const totalRecipes = await Recipe.count(perspective);
    +const activeRecipes = await Recipe.count(perspective, {
    +  where: { status: "active" }
    +});
    + 
    +// Use Prolog explicitly (legacy)
    +const countProlog = await Recipe.count(perspective, {}, false);
    +

    Defined in

    +

    model/Ad4mModel.ts:2919 (opens in a new tab)

    +
    +

    countQueryToProlog

    +

    Static countQueryToProlog(perspective, query?, modelClassName?): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    queryQuery
    modelClassName?string
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    model/Ad4mModel.ts:2861 (opens in a new tab)

    +
    +

    countQueryToSurrealQL

    +

    Static Private countQueryToSurrealQL(perspective, query): Promise<string>

    +

    Generates a SurrealQL COUNT query for the model.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective context
    queryQueryQuery parameters to filter the count
    +

    Returns

    +

    Promise<string>

    +

    SurrealQL COUNT query string

    +

    Defined in

    +

    model/Ad4mModel.ts:2891 (opens in a new tab)

    +
    +

    create

    +

    Static create<T>(this, perspective, data?, options?): Promise<T>

    +

    Creates and saves a new model instance in one step.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => T-
    perspectivePerspectiveProxyThe perspective to create the instance in
    dataRecord<string, any>Property values to assign before saving
    options?ObjectOptional settings: - parent — a ParentScope (model form or raw form) whose id will be used to create an incoming link from the parent to the new instance. - batchId — an existing batch id; when provided the link write and save() are added to the batch instead of committed immediately.
    options.batchId?string-
    options.parent?ParentScope-
    +

    Returns

    +

    Promise<T>

    +

    The saved model instance

    +

    Example

    +
    // Simple create
    +const recipe = await Recipe.create(perspective, {
    +  name: "Spaghetti",
    +  rating: 5,
    +});
    + 
    +// Create under a parent (link auto-created)
    +const comment = await Comment.create(perspective, { text: "Great!" }, {
    +  parent: { model: Post, id: postId },
    +});
    + 
    +// Create inside a transaction
    +await Ad4mModel.transaction(perspective, async (tx) => {
    +  await Recipe.create(perspective, { name: "Pasta" }, { batchId: tx.batchId });
    +});
    +

    Defined in

    +

    model/Ad4mModel.ts:3419 (opens in a new tab)

    +
    +

    delete

    +

    Static delete(this, perspective, id): Promise<void>

    +

    Deletes an existing model instance identified by id.

    +

    Also cleans up any incoming links that point to this instance.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => Ad4mModel-
    perspectivePerspectiveProxyThe perspective containing the instance
    idstringThe expression URI of the instance to delete
    +

    Returns

    +

    Promise<void>

    +

    Example

    +
    await Recipe.delete(perspective, recipeId);
    +

    Defined in

    +

    model/Ad4mModel.ts:3532 (opens in a new tab)

    +
    +

    determineNamespace

    +

    Static Private determineNamespace(schema, options): string

    +

    Determines the namespace for predicates using cascading precedence

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    schemaJSONSchema
    optionsJSONSchemaToModelOptions
    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Ad4mModel.ts:3847 (opens in a new tab)

    +
    +

    determinePredicate

    +

    Static Private determinePredicate(schema, propertyName, propertySchema, namespace, options): string

    +

    Determines the predicate for a specific property using cascading precedence

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    schemaJSONSchema
    propertyNamestring
    propertySchemaJSONSchemaProperty
    namespacestring
    optionsJSONSchemaToModelOptions
    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Ad4mModel.ts:3891 (opens in a new tab)

    +
    +

    evaluateCustomGettersForInstance

    +

    Static Private evaluateCustomGettersForInstance(instance, perspective, metadata, options?): Promise<void>

    +

    Evaluates custom SurrealQL getters for properties and relations on a specific instance.

    +

    For relations that declare a target but no explicit getter, a conformance +getter is auto-generated from the target model's metadata (unless filter: false).

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    instanceany
    perspectivePerspectiveProxy
    metadataany
    options?Object
    options.include?Record<string, any>
    options.requestedProperties?string[]
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:1453 (opens in a new tab)

    +
    +

    findAll

    +

    Static findAll<T>(this, perspective, query?, useSurrealDB?): Promise<T[]>

    +

    Gets all instances of the model in the perspective that match the query params.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    +

    Returns

    +

    Promise<T[]>

    +

    Array of matching models

    +

    Example

    +
    // Get all recipes (uses SurrealDB by default)
    +const allRecipes = await Recipe.findAll(perspective);
    + 
    +// Get recipes with specific criteria (uses SurrealDB)
    +const recipes = await Recipe.findAll(perspective, {
    +  where: { 
    +    name: "Pasta",
    +    rating: { gt: 4 }
    +  },
    +  order: { createdAt: "DESC" },
    +  limit: 10
    +});
    + 
    +// Explicitly use Prolog (legacy, for backward compatibility)
    +const recipesProlog = await Recipe.findAll(perspective, {}, false);
    +

    Defined in

    +

    model/Ad4mModel.ts:2728 (opens in a new tab)

    +
    +

    findAllAndCount

    +

    Static findAllAndCount<T>(this, perspective, query?, useSurrealDB?): Promise<ResultsWithTotalCount<T>>

    +

    Gets all instances with count of total matches without offset & limit applied.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    +

    Returns

    +

    Promise<ResultsWithTotalCount<T>>

    +

    Object containing results array and total count

    +

    Example

    +
    const { results, totalCount } = await Recipe.findAllAndCount(perspective, {
    +  where: { category: "Dessert" },
    +  limit: 10
    +});
    +console.log(`Showing 10 of ${totalCount} dessert recipes`);
    + 
    +// Use Prolog explicitly (legacy)
    +const { results, totalCount } = await Recipe.findAllAndCount(perspective, {}, false);
    +

    Defined in

    +

    model/Ad4mModel.ts:2801 (opens in a new tab)

    +
    +

    findOne

    +

    Static findOne<T>(this, perspective, query?, useSurrealDB?): Promise<T>

    +

    Finds the first instance matching the query, or null if none exists.

    +

    Equivalent to findAll with limit: 1 — only one instance is hydrated.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true) or Prolog (legacy)
    +

    Returns

    +

    Promise<T>

    +

    The first matching instance, or null

    +

    Example

    +
    const recipe = await Recipe.findOne(perspective, {
    +  where: { name: "Pasta" }
    +});
    +if (recipe) {
    +  console.log(recipe.name);
    +}
    +

    Defined in

    +

    model/Ad4mModel.ts:2770 (opens in a new tab)

    +
    +

    formatSurrealValue

    +

    Static Private formatSurrealValue(value): string

    +

    Formats a value for use in SurrealQL queries.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    valueanyThe value to format
    +

    Returns

    +

    string

    +

    Formatted value string ready for SurrealQL

    +

    Description

    +

    Handles different value types:

    +
      +
    • Strings: Wrapped in single quotes with backslash-escaped special characters
    • +
    • Numbers/booleans: Converted to string
    • +
    • Arrays: Recursively formatted and wrapped in brackets
    • +
    +

    Defined in

    +

    model/Ad4mModel.ts:2360 (opens in a new tab)

    +
    +

    fromJSONSchema

    +

    Static fromJSONSchema(schema, options): typeof Ad4mModel

    +

    Creates an Ad4mModel class from a JSON Schema definition.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    schemaJSONSchemaJSON Schema definition
    optionsJSONSchemaToModelOptionsConfiguration options
    +

    Returns

    +

    typeof Ad4mModel

    +

    Generated Ad4mModel subclass

    +

    Description

    +

    This method dynamically generates an Ad4mModel subclass from a JSON Schema, +enabling integration with systems that use JSON Schema for type definitions.

    +

    The method follows a cascading approach for determining predicates:

    +
      +
    1. Explicit configuration in options parameter (highest precedence)
    2. +
    3. x-ad4m metadata in the JSON Schema
    4. +
    5. Inference from schema title and property names
    6. +
    7. Error if no namespace can be determined
    8. +
    +

    Example

    +
    // With explicit configuration
    +const PersonClass = Ad4mModel.fromJSONSchema(schema, {
    +  name: "Person",
    +  namespace: "person://",
    +  resolveLanguage: "literal"
    +});
    + 
    +// With property mapping
    +const ContactClass = Ad4mModel.fromJSONSchema(schema, {
    +  name: "Contact",
    +  namespace: "contact://",
    +  propertyMapping: {
    +    "name": "foaf://name",
    +    "email": "foaf://mbox"
    +  }
    +});
    + 
    +// With x-ad4m metadata in schema
    +const schema = {
    +  "title": "Product",
    +  "x-ad4m": { "namespace": "product://" },
    +  "properties": {
    +    "name": { 
    +      "type": "string",
    +      "x-ad4m": { "through": "product://title" }
    +    }
    +  }
    +};
    +const ProductClass = Ad4mModel.fromJSONSchema(schema, { name: "Product" });
    +

    Throws

    +

    Error when namespace cannot be inferred

    +

    Defined in

    +

    model/Ad4mModel.ts:3682 (opens in a new tab)

    +
    +

    generateSDNA

    +

    Static generateSDNA(): Object

    +

    Generates the SDNA (Subject DNA) Prolog rules for this model class. +Injected at class-definition time by the @Model decorator. +Returns a default value on un-decorated base classes.

    +

    Returns

    +

    Object

    + + + + + + + + + + + + + + + + + +
    NameType
    namestring
    sdnastring
    +

    Defined in

    +

    model/Ad4mModel.ts:538 (opens in a new tab)

    +
    +

    generateSHACL

    +

    Static generateSHACL(): Object

    +

    Generates the SHACL shape graph for this model class. +Injected at class-definition time by the @Model decorator. +Returns { shape: null, name: '' } on un-decorated base classes — +the decorator's parentSHACL?.shape?.nodeShapeUri check handles this.

    +

    Returns

    +

    Object

    + + + + + + + + + + + + + + + + + +
    NameType
    namestring
    shapeany
    +

    Defined in

    +

    model/Ad4mModel.ts:548 (opens in a new tab)

    +
    +

    getClassName

    +

    Static getClassName(perspective): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    model/Ad4mModel.ts:552 (opens in a new tab)

    +
    +

    getDefaultValueForType

    +

    Static Private getDefaultValueForType(type?): any

    +

    Gets default value for a JSON Schema type

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    type?string
    +

    Returns

    +

    any

    +

    Defined in

    +

    model/Ad4mModel.ts:3968 (opens in a new tab)

    +
    +

    getModelMetadata

    +

    Static getModelMetadata(): ModelMetadata

    +

    Extracts metadata from decorators for query building.

    +

    Returns

    +

    ModelMetadata

    +

    Structured metadata object containing className, properties, and relations

    +

    Description

    +

    This method reads the metadata stored by decorators (@Property, @HasMany, etc.) +and returns it in a structured format that's easier to work with for query builders +and other systems that need to introspect model structure.

    +

    The metadata includes:

    +
      +
    • Class name from
    • +
    +

    Model

    +
      +
    • Property metadata (predicates, types, constraints, etc.)
    • +
    • Relation metadata (predicates, filters, etc.)
    • +
    +

    For models created via fromJSONSchema(), this method will derive metadata from +the WeakMap registries that were populated during the dynamic class creation. +If these structures are empty but a JSON schema was attached to the class, +it can fall back to deriving metadata from that schema.

    +

    Throws

    +

    Error if the class doesn't have

    +

    Model

    +

    decorator

    +

    Example

    +
    @Model({ name: "Recipe" })
    +class Recipe extends Ad4mModel {
    +  @Property({ through: "recipe://name", resolveLanguage: "literal" })
    +  name: string = "";
    +  
    +  @HasMany({ through: "recipe://ingredient" })
    +  ingredients: string[] = [];
    +}
    + 
    +const metadata = Recipe.getModelMetadata();
    +console.log(metadata.className); // "Recipe"
    +console.log(metadata.properties.name.predicate); // "recipe://name"
    +console.log(metadata.relations.ingredients.predicate); // "recipe://ingredient"
    +

    Defined in

    +

    model/Ad4mModel.ts:623 (opens in a new tab)

    +
    +

    getPropertyOption

    +

    Static Private getPropertyOption(propertyName, propertySchema, options, optionName, defaultValue?): any

    +

    Gets property-specific options using cascading precedence

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    propertyNamestring
    propertySchemaJSONSchemaProperty
    optionsJSONSchemaToModelOptions
    optionNamekeyof PropertyOptions
    defaultValue?any
    +

    Returns

    +

    any

    +

    Defined in

    +

    model/Ad4mModel.ts:3939 (opens in a new tab)

    +
    +

    hydrateFromLinks

    +

    Static Private hydrateFromLinks(instance, links, metadata, perspective, requestedProperties?): Promise<void>

    +

    Hydrates an instance from an array of raw links.

    +

    Processes properties (latest-wins semantics), relations +(chronological accumulation), and timestamps/author in a single +pass over the links array.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    instanceanyThe blank model instance to populate
    links{ author?: string ; predicate: string ; target: string ; timestamp?: string | number }[]Array of link objects (predicate, target, author?, timestamp?)
    metadataModelMetadataModel metadata from getModelMetadata()
    perspectivePerspectiveProxyThe perspective for expression resolution
    requestedProperties?string[]Optional sparse fieldset; when provided, only these property names are hydrated (relations are unaffected). Omit or pass undefined to hydrate all properties.
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:959 (opens in a new tab)

    +
    +

    hydratePropertyValue

    +

    Static Private hydratePropertyValue(target, propMeta, perspective, expectedType?): Promise<any>

    +

    Resolves a raw link target value into a hydrated property value.

    +

    Handles, in order:

    +
      +
    1. Non-literal expression resolution (perspective.getExpression)
    2. +
    3. Literal URI parsing (Literal.fromUrl(…).get())
    4. +
    5. Primitive type coercion (string → number / boolean)
    6. +
    7. Transform function application
    8. +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    targetstringThe raw target string from the link
    propMetaPropertyMetadataProperty metadata from the decorator registry
    perspectivePerspectiveProxyThe perspective for expression resolution
    expectedType?stringOptional JS typeof hint for coercion (e.g. 'number')
    +

    Returns

    +

    Promise<any>

    +

    The resolved value

    +

    Defined in

    +

    model/Ad4mModel.ts:884 (opens in a new tab)

    +
    +

    hydrateRelations

    +

    Static Private hydrateRelations<T>(instances, perspective, includeMap): Promise<void>

    +

    Hydrates relation fields on instances according to the provided IncludeMap.

    +

    For each relation listed in includeMap, the raw expression-URI strings +stored on the instance are replaced with fully-hydrated model instances +(fetched via the relation's target() class). Nested IncludeMaps are +supported for multi-level eager loading.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    instancesT[]The instances whose relations should be hydrated
    perspectivePerspectiveProxyThe perspective to fetch related instances from
    includeMapIncludeMapDescribes which relations to hydrate
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Ad4mModel.ts:1563 (opens in a new tab)

    +
    +

    instancesFromPrologResult

    +

    Static instancesFromPrologResult<T>(this, perspective, query, result): Promise<ResultsWithTotalCount<T>>

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    thistypeof Ad4mModel & (...args: any[]) => T
    perspectivePerspectiveProxy
    queryQuery
    resultAllInstancesResult
    +

    Returns

    +

    Promise<ResultsWithTotalCount<T>>

    +

    Defined in

    +

    model/Ad4mModel.ts:2364 (opens in a new tab)

    +
    +

    matchesCondition

    +

    Static Private matchesCondition(value, condition): boolean

    +

    Checks if a value matches a condition (for post-query filtering).

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    valueany
    conditionWhereCondition
    +

    Returns

    +

    boolean

    +

    Defined in

    +

    model/Ad4mModel.ts:2640 (opens in a new tab)

    +
    +

    normalizeValue

    +

    Static Private normalizeValue(value): any

    +

    Normalize a value for snapshot storage. +Arrays of model instances are reduced to their .id strings so that +dirty-tracking compares stable identifiers instead of object references.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    valueany
    +

    Returns

    +

    any

    +

    Defined in

    +

    model/Ad4mModel.ts:1188 (opens in a new tab)

    +
    +

    paginate

    +

    Static paginate<T>(this, perspective, pageSize, pageNumber, query?, useSurrealDB?): Promise<PaginationResult<T>>

    +

    Helper function for pagination with explicit page size and number.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    pageSizenumberundefinedNumber of items per page
    pageNumbernumberundefinedWhich page to retrieve (1-based)
    query?QueryundefinedOptional additional query parameters
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    +

    Returns

    +

    Promise<PaginationResult<T>>

    +

    Paginated results with metadata

    +

    Example

    +
    const page = await Recipe.paginate(perspective, 10, 1, {
    +  where: { category: "Main Course" }
    +});
    +console.log(`Page ${page.pageNumber} of recipes, ${page.results.length} items`);
    + 
    +// Use Prolog explicitly (legacy)
    +const pageProlog = await Recipe.paginate(perspective, 10, 1, {}, false);
    +

    Defined in

    +

    model/Ad4mModel.ts:2839 (opens in a new tab)

    +
    +

    query

    +

    Static query<T>(this, perspective, query?): ModelQueryBuilder<T>

    +

    Creates a query builder for fluent query construction.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => T-
    perspectivePerspectiveProxyThe perspective to query
    query?QueryOptional initial query parameters
    +

    Returns

    +

    ModelQueryBuilder<T>

    +

    A new query builder instance

    +

    Example

    +
    const recipes = await Recipe.query(perspective)
    +  .where({ category: "Dessert" })
    +  .order({ rating: "DESC" })
    +  .limit(5)
    +  .run();
    + 
    +// With real-time updates
    +await Recipe.query(perspective)
    +  .where({ status: "cooking" })
    +  .subscribe(recipes => {
    +    console.log("Currently cooking:", recipes);
    +  });
    +

    Defined in

    +

    model/Ad4mModel.ts:3623 (opens in a new tab)

    +
    +

    queryToProlog

    +

    Static queryToProlog(perspective, query, modelClassName?): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    queryQuery
    modelClassName?string
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    model/Ad4mModel.ts:1386 (opens in a new tab)

    +
    +

    queryToSurrealQL

    +

    Static queryToSurrealQL(perspective, query): Promise<string>

    +

    Generates a SurrealQL query from a Query object.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective to query (used for metadata extraction)
    queryQueryQuery parameters (where, order, limit, offset, properties, relations)
    +

    Returns

    +

    Promise<string>

    +

    Complete SurrealQL query string ready for execution

    +

    Description

    +

    This method translates high-level query parameters into a SurrealQL query string +that can be executed against the SurrealDB backend. Unlike Prolog queries which +operate on SDNA-aware predicates, SurrealQL queries operate directly on raw links +stored in SurrealDB.

    +

    The generated query uses a CTE (Common Table Expression) pattern:

    +
      +
    1. First, identify candidate base expressions by filtering links based on where conditions
    2. +
    3. Then, for each candidate base, resolve properties and relations via subqueries
    4. +
    5. Finally, apply ordering, pagination (LIMIT/START) at the SQL level
    6. +
    +

    Key architectural notes:

    +
      +
    • SurrealDB stores only raw links (source, predicate, target, author, timestamp)
    • +
    • No SDNA knowledge at the database level
    • +
    • Properties are resolved via subqueries that look for links with specific predicates
    • +
    • Relations are similar but return multiple values instead of one
    • +
    • Special fields (base, author, timestamp) are accessed directly, not via subqueries
    • +
    +

    Example

    +
    const query = Recipe.queryToSurrealQL(perspective, {
    +  where: { name: "Pasta", rating: { gt: 4 } },
    +  order: { timestamp: "DESC" },
    +  limit: 10
    +});
    +// Returns: SELECT source AS base, array::first(target[WHERE predicate = ...]) AS name, ...
    +//          FROM link WHERE ... GROUP BY source ORDER BY timestamp DESC LIMIT 10
    +

    Defined in

    +

    model/Ad4mModel.ts:1832 (opens in a new tab)

    +
    +

    register

    +

    Static register(this, perspective): Promise<void>

    +

    Registers this model's SHACL schema on the given perspective.

    +

    This ensures the perspective knows about the model's shape +(properties, relations, constraints) so instances can be +created, queried, and validated.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel-
    perspectivePerspectiveProxyThe perspective to register the model on
    +

    Returns

    +

    Promise<void>

    +

    Example

    +
    await Recipe.register(perspective);
    +// Now you can create / query Recipe instances on this perspective
    +

    Defined in

    +

    model/Ad4mModel.ts:3556 (opens in a new tab)

    +
    +

    remove

    +

    Static remove(this, perspective, id): Promise<void>

    +

    Deletes an existing model instance identified by id.

    +

    Also cleans up any incoming links that point to this instance.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => Ad4mModel-
    perspectivePerspectiveProxyThe perspective containing the instance
    idstringThe expression URI of the instance to delete
    +

    Returns

    +

    Promise<void>

    +

    Example

    +
    await Recipe.delete(perspective, recipeId);
    +

    Deprecated

    +

    Use the name deleteremove is preserved as an alias.

    +

    Defined in

    +

    model/Ad4mModel.ts:3511 (opens in a new tab)

    +
    +

    transaction

    +

    Static transaction<R>(perspective, fn): Promise<R>

    +

    Executes a set of model operations inside a single batch (transaction).

    +

    All save, update, and delete calls made via the provided batchId +are buffered and flushed atomically when the callback completes. +If the callback throws, the batch is not committed, preventing +partial writes.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Rvoid
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective to operate on
    fn(tx: { batchId: string }) => Promise<R>Async callback that receives a TransactionContext object. Pass tx.batchId to save(tx.batchId), update(tx.batchId), delete(tx.batchId), etc.
    +

    Returns

    +

    Promise<R>

    +

    The value returned by fn

    +

    Example

    +
    await Ad4mModel.transaction(perspective, async (tx) => {
    +  const recipe = new Recipe(perspective);
    +  recipe.name = "Spaghetti";
    +  await recipe.save(tx.batchId);
    + 
    +  const old = await Recipe.query(perspective).where({ name: "Stale" }).run();
    +  for (const r of old) await r.delete(tx.batchId);
    +});
    +// All changes committed atomically here
    +

    Defined in

    +

    model/Ad4mModel.ts:3590 (opens in a new tab)

    +
    +

    update

    +

    Static update<T>(this, perspective, id, data): Promise<T>

    +

    Updates an existing model instance identified by id.

    +

    Fetches the instance, applies the provided changes, calls save(), +and returns the refreshed instance.

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Textends Ad4mModel<T>
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => T-
    perspectivePerspectiveProxyThe perspective containing the instance
    idstringThe expression URI of the instance to update
    dataRecord<string, any>Property values to merge before saving
    +

    Returns

    +

    Promise<T>

    +

    The updated model instance

    +

    Example

    +
    const recipe = await Recipe.update(perspective, recipeId, {
    +  rating: 10,
    +});
    +

    Defined in

    +

    model/Ad4mModel.ts:3483 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Ad4mModel/index.html b/docs/jsdoc/classes/Ad4mModel/index.html deleted file mode 100644 index 5a09cf358..000000000 --- a/docs/jsdoc/classes/Ad4mModel/index.html +++ /dev/null @@ -1,1616 +0,0 @@ -Class: Ad4mModel | AD4M Docs
    API Reference
    classes
    Ad4mmodel

    @coasys/ad4m / Exports / Ad4mModel

    -

    Class: Ad4mModel

    -

    Base class for defining data models in AD4M.

    -

    Description

    -

    Ad4mModel provides the foundation for creating data models that are stored in AD4M perspectives. -Each model instance is represented as a subgraph in the perspective, with properties and collections -mapped to links in that graph. The class uses Prolog-based queries to efficiently search and filter -instances based on their properties and relationships.

    -

    Key concepts:

    -
      -
    • Each model instance has a unique base expression that serves as its identifier
    • -
    • Properties are stored as links with predicates defined by the through option
    • -
    • Collections represent one-to-many relationships as sets of links
    • -
    • Queries are translated to Prolog for efficient graph pattern matching
    • -
    • Changes are tracked through the perspective's subscription system
    • -
    -

    Example

    -
    // Define a recipe model
    -@ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  // Required property with literal value
    -  @Property({
    -    through: "recipe://name",
    -    resolveLanguage: "literal"
    -  })
    -  name: string = "";
    - 
    -  // Optional property with custom initial value
    -  @Optional({
    -    through: "recipe://status",
    -    initial: "recipe://draft"
    -  })
    -  status: string = "";
    - 
    -  // Read-only computed property
    -  @ReadOnly({
    -    through: "recipe://rating",
    -    getter: `
    -      findall(Rating, triple(Base, "recipe://user_rating", Rating), Ratings),
    -      sum_list(Ratings, Sum),
    -      length(Ratings, Count),
    -      Value is Sum / Count
    -    `
    -  })
    -  averageRating: number = 0;
    - 
    -  // Collection of ingredients
    -  @Collection({ through: "recipe://ingredient" })
    -  ingredients: string[] = [];
    - 
    -  // Collection of comments that are instances of another model
    -  @Collection({
    -    through: "recipe://comment",
    -    where: { isInstance: Comment }
    -  })
    -  comments: Comment[] = [];
    -}
    - 
    -// Create and save a new recipe
    -const recipe = new Recipe(perspective);
    -recipe.name = "Chocolate Cake";
    -recipe.ingredients = ["flour", "sugar", "cocoa"];
    -await recipe.save();
    - 
    -// Query recipes in different ways
    -// Get all recipes
    -const allRecipes = await Recipe.findAll(perspective);
    - 
    -// Find recipes with specific criteria
    -const desserts = await Recipe.findAll(perspective, {
    -  where: { 
    -    status: "recipe://published",
    -    averageRating: { gt: 4 }
    -  },
    -  order: { name: "ASC" },
    -  limit: 10
    -});
    - 
    -// Use the fluent query builder
    -const popularRecipes = await Recipe.query(perspective)
    -  .where({ averageRating: { gt: 4.5 } })
    -  .order({ averageRating: "DESC" })
    -  .limit(5)
    -  .get();
    - 
    -// Subscribe to real-time updates
    -await Recipe.query(perspective)
    -  .where({ status: "recipe://cooking" })
    -  .subscribe(recipes => {
    -    console.log("Currently being cooked:", recipes);
    -  });
    - 
    -// Paginate results
    -const { results, totalCount, pageNumber } = await Recipe.query(perspective)
    -  .where({ status: "recipe://published" })
    -  .paginate(10, 1);
    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Accessors

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new Ad4mModel(perspective, baseExpression?, source?)

    -

    Constructs a new model instance.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective where this model will be stored
    baseExpression?stringOptional unique identifier for this instance
    source?stringOptional source expression this instance is linked to
    -

    Example

    -
    // Create a new recipe with auto-generated base expression
    -const recipe = new Recipe(perspective);
    - 
    -// Create with specific base expression
    -const recipe = new Recipe(perspective, "recipe://chocolate-cake");
    - 
    -// Create with source link
    -const recipe = new Recipe(perspective, undefined, "cookbook://desserts");
    -

    Defined in

    -

    model/Ad4mModel.ts:596 (opens in a new tab)

    -

    Properties

    -

    #baseExpression

    -

    Private #baseExpression: string

    -

    Defined in

    -

    model/Ad4mModel.ts:406 (opens in a new tab)

    -
    -

    #perspective

    -

    Private #perspective: PerspectiveProxy

    -

    Defined in

    -

    model/Ad4mModel.ts:409 (opens in a new tab)

    -
    -

    #source

    -

    Private #source: string

    -

    Defined in

    -

    model/Ad4mModel.ts:408 (opens in a new tab)

    -
    -

    #subjectClassName

    -

    Private #subjectClassName: string

    -

    Defined in

    -

    model/Ad4mModel.ts:407 (opens in a new tab)

    -
    -

    author

    -

    author: string

    -

    Defined in

    -

    model/Ad4mModel.ts:410 (opens in a new tab)

    -
    -

    timestamp

    -

    timestamp: string

    -

    Defined in

    -

    model/Ad4mModel.ts:411 (opens in a new tab)

    -
    -

    classNamesByClass

    -

    Static Private classNamesByClass: WeakMap<typeof Ad4mModel, { [perspectiveId: string]: string; }>

    -

    Defined in

    -

    model/Ad4mModel.ts:413 (opens in a new tab)

    -

    Accessors

    -

    baseExpression

    -

    get baseExpression(): string

    -

    Gets the base expression of the subject.

    -

    Returns

    -

    string

    -

    Defined in

    -

    model/Ad4mModel.ts:605 (opens in a new tab)

    -
    -

    perspective

    -

    Protected get perspective(): PerspectiveProxy

    -

    Protected getter for the perspective. -Allows subclasses to access the perspective while keeping it private from external code.

    -

    Returns

    -

    PerspectiveProxy

    -

    Defined in

    -

    model/Ad4mModel.ts:613 (opens in a new tab)

    -

    Methods

    -

    cleanCopy

    -

    Private cleanCopy(): Object

    -

    Returns

    -

    Object

    -

    Defined in

    -

    model/Ad4mModel.ts:1974 (opens in a new tab)

    -
    -

    delete

    -

    delete(batchId?): Promise<void>

    -

    Deletes the model instance from the perspective.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    batchId?stringOptional batch ID for batch operations
    -

    Returns

    -

    Promise<void>

    -

    Throws

    -

    Will throw if removal fails

    -

    Example

    -
    const recipe = await Recipe.findAll(perspective)[0];
    -await recipe.delete();
    - 
    -// Or with batch operations:
    -const batchId = await perspective.createBatch();
    -await recipe.delete(batchId);
    -await perspective.commitBatch(batchId);
    -

    Defined in

    -

    model/Ad4mModel.ts:2077 (opens in a new tab)

    -
    -

    get

    -

    get(): Promise<Ad4mModel>

    -

    Gets the model instance with all properties and collections populated.

    -

    Returns

    -

    Promise<Ad4mModel>

    -

    The populated model instance

    -

    Throws

    -

    Will throw if data retrieval fails

    -

    Example

    -
    const recipe = new Recipe(perspective, existingId);
    -await recipe.get();
    -console.log(recipe.name, recipe.ingredients);
    -

    Defined in

    -

    model/Ad4mModel.ts:2054 (opens in a new tab)

    -
    -

    getData

    -

    Private getData(): Promise<Ad4mModel>

    -

    Returns

    -

    Promise<Ad4mModel>

    -

    Defined in

    -

    model/Ad4mModel.ts:669 (opens in a new tab)

    -
    -

    innerUpdate

    -

    Private innerUpdate(setProperties?, batchId?): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault value
    setPropertiesbooleantrue
    batchId?stringundefined
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:1985 (opens in a new tab)

    -
    -

    save

    -

    save(batchId?): Promise<void>

    -

    Saves the model instance to the perspective. -Creates a new instance with the base expression and links it to the source.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    batchId?stringOptional batch ID for batch operations
    -

    Returns

    -

    Promise<void>

    -

    Throws

    -

    Will throw if instance creation, linking, or updating fails

    -

    Example

    -
    const recipe = new Recipe(perspective);
    -recipe.name = "Spaghetti";
    -recipe.ingredients = ["pasta", "tomato sauce"];
    -await recipe.save();
    - 
    -// Or with batch operations:
    -const batchId = await perspective.createBatch();
    -await recipe.save(batchId);
    -await perspective.commitBatch(batchId);
    -

    Defined in

    -

    model/Ad4mModel.ts:1928 (opens in a new tab)

    -
    -

    setCollectionAdder

    -

    Private setCollectionAdder(key, value, batchId?): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    keystring
    valueany
    batchId?string
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:1864 (opens in a new tab)

    -
    -

    setCollectionRemover

    -

    Private setCollectionRemover(key, value, batchId?): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    keystring
    valueany
    batchId?string
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:1886 (opens in a new tab)

    -
    -

    setCollectionSetter

    -

    Private setCollectionSetter(key, value, batchId?): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    keystring
    valueany
    batchId?string
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:1840 (opens in a new tab)

    -
    -

    setProperty

    -

    Private setProperty(key, value, batchId?): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    keystring
    valueany
    batchId?string
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:1819 (opens in a new tab)

    -
    -

    update

    -

    update(batchId?): Promise<void>

    -

    Updates the model instance's properties and collections.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    batchId?stringOptional batch ID for batch operations
    -

    Returns

    -

    Promise<void>

    -

    Throws

    -

    Will throw if property setting or collection updates fail

    -

    Example

    -
    const recipe = await Recipe.findAll(perspective)[0];
    -recipe.rating = 5;
    -recipe.ingredients.push("garlic");
    -await recipe.update();
    - 
    -// Or with batch operations:
    -const batchId = await perspective.createBatch();
    -await recipe.update(batchId);
    -await perspective.commitBatch(batchId);
    -

    Defined in

    -

    model/Ad4mModel.ts:2036 (opens in a new tab)

    -
    -

    assignValuesToInstance

    -

    Static assignValuesToInstance(perspective, instance, values): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    instanceAd4mModel
    valuesValueTuple[]
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Ad4mModel.ts:617 (opens in a new tab)

    -
    -

    buildGraphTraversalWhereClause

    -

    Static Private buildGraphTraversalWhereClause(metadata, where?): string

    -

    Builds the WHERE clause for SurrealQL queries using graph traversal syntax.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    metadataModelMetadataModel metadata containing property predicates
    where?WhereWhere conditions from the query
    -

    Returns

    -

    string

    -

    Graph traversal WHERE clause filters, or empty string if no conditions

    -

    Description

    -

    Translates where conditions into graph traversal filters: ->link[WHERE ...] -This is more efficient than nested SELECTs because SurrealDB can optimize graph traversals.

    -

    Handles several condition types:

    -
      -
    • Simple equality: { name: "Pasta" }->link[WHERE predicate = 'X' AND out.uri = 'Pasta']
    • -
    • Arrays (IN clause): { name: ["Pasta", "Pizza"] }->link[WHERE predicate = 'X' AND out.uri IN [...]]
    • -
    • NOT operators: Use NOT prefix
    • -
    • Comparison operators (gt, gte, lt, lte, etc.): Handled in post-query JavaScript filtering
    • -
    • Special fields: base uses uri directly, author/timestamp handled post-query
    • -
    -

    Defined in

    -

    model/Ad4mModel.ts:854 (opens in a new tab)

    -
    -

    buildSurrealSelectFields

    -

    Static Private buildSurrealSelectFields(metadata, properties?, collections?): string

    -

    Builds the SELECT fields for SurrealQL queries.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    metadataModelMetadataModel metadata containing property and collection predicates
    properties?string[]Optional array of property names to include (default: all)
    collections?string[]Optional array of collection names to include (default: all)
    -

    Returns

    -

    string

    -

    Comma-separated SELECT field list

    -

    Description

    -

    Generates the field list for the SELECT clause, resolving properties and collections -via subqueries. Each property is fetched with a subquery that finds the link with the -appropriate predicate and returns its target. Collections are similar but don't use LIMIT 1.

    -

    Field types:

    -
      -
    • Properties: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X' LIMIT 1) AS propName
    • -
    • Collections: (SELECT VALUE target FROM link WHERE source = $parent.base AND predicate = 'X') AS collName
    • -
    • Author/Timestamp: Always included to provide metadata about each instance
    • -
    -

    If properties or collections arrays are provided, only those fields are included. -Otherwise, all properties/collections from metadata are included.

    -

    Defined in

    -

    model/Ad4mModel.ts:1114 (opens in a new tab)

    -
    -

    buildSurrealSelectFieldsWithAggregation

    -

    Static Private buildSurrealSelectFieldsWithAggregation(metadata, properties?, collections?): string

    -

    Builds the SELECT fields for SurrealQL queries using aggregation functions. -Compatible with GROUP BY source queries.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    metadataModelMetadata
    properties?string[]
    collections?string[]
    -

    Returns

    -

    string

    -

    Defined in

    -

    model/Ad4mModel.ts:1150 (opens in a new tab)

    -
    -

    buildSurrealWhereClause

    -

    Static Private buildSurrealWhereClause(metadata, where?): string

    -

    Builds the WHERE clause for SurrealQL queries.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    metadataModelMetadataModel metadata containing property predicates
    where?WhereWhere conditions from the query
    -

    Returns

    -

    string

    -

    WHERE clause string (without the "WHERE" keyword), or empty string if no conditions

    -

    Description

    -

    Translates the where conditions from the Query object into SurrealQL WHERE clause fragments. -For each property filter, generates a subquery that checks for links with the appropriate -predicate and target value.

    -

    Handles several condition types:

    -
      -
    • Simple equality: { name: "Pasta" } → subquery checking for predicate and target match
    • -
    • Arrays (IN clause): { name: ["Pasta", "Pizza"] } → target IN [...]
    • -
    • Operators: { rating: { gt: 4 } } → target > '4' -
        -
      • gt, gte, lt, lte: comparison operators
      • -
      • not: negation (single value or array)
      • -
      • between: range check
      • -
      • contains: substring/element check (uses SurrealQL CONTAINS)
      • -
      -
    • -
    • Special fields: base, author, timestamp are accessed directly, not via subqueries
    • -
    -

    All conditions are joined with AND.

    -

    Defined in

    -

    model/Ad4mModel.ts:985 (opens in a new tab)

    -
    -

    count

    -

    Static count(perspective, query?, useSurrealDB?): any

    -

    Gets a count of all matching instances.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault valueDescription
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    -

    Returns

    -

    any

    -

    Total count of matching entities

    -

    Example

    -
    const totalRecipes = await Recipe.count(perspective);
    -const activeRecipes = await Recipe.count(perspective, {
    -  where: { status: "active" }
    -});
    - 
    -// Use Prolog explicitly (legacy)
    -const countProlog = await Recipe.count(perspective, {}, false);
    -

    Defined in

    -

    model/Ad4mModel.ts:1804 (opens in a new tab)

    -
    -

    countQueryToProlog

    -

    Static countQueryToProlog(perspective, query?, modelClassName?): Promise<string>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    queryQuery
    modelClassName?string
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    model/Ad4mModel.ts:1749 (opens in a new tab)

    -
    -

    countQueryToSurrealQL

    -

    Static Private countQueryToSurrealQL(perspective, query): Promise<string>

    -

    Generates a SurrealQL COUNT query for the model.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective context
    queryQueryQuery parameters to filter the count
    -

    Returns

    -

    Promise<string>

    -

    SurrealQL COUNT query string

    -

    Defined in

    -

    model/Ad4mModel.ts:1776 (opens in a new tab)

    -
    -

    determineNamespace

    -

    Static Private determineNamespace(schema, options): string

    -

    Determines the namespace for predicates using cascading precedence

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    schemaJSONSchema
    optionsJSONSchemaToModelOptions
    -

    Returns

    -

    string

    -

    Defined in

    -

    model/Ad4mModel.ts:2341 (opens in a new tab)

    -
    -

    determinePredicate

    -

    Static Private determinePredicate(schema, propertyName, propertySchema, namespace, options): string

    -

    Determines the predicate for a specific property using cascading precedence

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    schemaJSONSchema
    propertyNamestring
    propertySchemaJSONSchemaProperty
    namespacestring
    optionsJSONSchemaToModelOptions
    -

    Returns

    -

    string

    -

    Defined in

    -

    model/Ad4mModel.ts:2385 (opens in a new tab)

    -
    -

    findAll

    -

    Static findAll<T>(this, perspective, query?, useSurrealDB?): Promise<T[]>

    -

    Gets all instances of the model in the perspective that match the query params.

    -

    Type parameters

    - - - - - - - - - - - - - -
    NameType
    Textends Ad4mModel<T>
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    -

    Returns

    -

    Promise<T[]>

    -

    Array of matching models

    -

    Example

    -
    // Get all recipes (uses SurrealDB by default)
    -const allRecipes = await Recipe.findAll(perspective);
    - 
    -// Get recipes with specific criteria (uses SurrealDB)
    -const recipes = await Recipe.findAll(perspective, {
    -  where: { 
    -    name: "Pasta",
    -    rating: { gt: 4 }
    -  },
    -  order: { createdAt: "DESC" },
    -  limit: 10
    -});
    - 
    -// Explicitly use Prolog (legacy, for backward compatibility)
    -const recipesProlog = await Recipe.findAll(perspective, {}, false);
    -

    Defined in

    -

    model/Ad4mModel.ts:1650 (opens in a new tab)

    -
    -

    findAllAndCount

    -

    Static findAllAndCount<T>(this, perspective, query?, useSurrealDB?): Promise<ResultsWithTotalCount<T>>

    -

    Gets all instances with count of total matches without offset & limit applied.

    -

    Type parameters

    - - - - - - - - - - - - - -
    NameType
    Textends Ad4mModel<T>
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    queryQuery{}Optional query parameters to filter results
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    -

    Returns

    -

    Promise<ResultsWithTotalCount<T>>

    -

    Object containing results array and total count

    -

    Example

    -
    const { results, totalCount } = await Recipe.findAllAndCount(perspective, {
    -  where: { category: "Dessert" },
    -  limit: 10
    -});
    -console.log(`Showing 10 of ${totalCount} dessert recipes`);
    - 
    -// Use Prolog explicitly (legacy)
    -const { results, totalCount } = await Recipe.findAllAndCount(perspective, {}, false);
    -

    Defined in

    -

    model/Ad4mModel.ts:1689 (opens in a new tab)

    -
    -

    formatSurrealValue

    -

    Static Private formatSurrealValue(value): string

    -

    Formats a value for use in SurrealQL queries.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    valueanyThe value to format
    -

    Returns

    -

    string

    -

    Formatted value string ready for SurrealQL

    -

    Description

    -

    Handles different value types:

    -
      -
    • Strings: Wrapped in single quotes with backslash-escaped special characters
    • -
    • Numbers/booleans: Converted to string
    • -
    • Arrays: Recursively formatted and wrapped in brackets
    • -
    -

    Defined in

    -

    model/Ad4mModel.ts:1195 (opens in a new tab)

    -
    -

    fromJSONSchema

    -

    Static fromJSONSchema(schema, options): typeof Ad4mModel

    -

    Creates an Ad4mModel class from a JSON Schema definition.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    schemaJSONSchemaJSON Schema definition
    optionsJSONSchemaToModelOptionsConfiguration options
    -

    Returns

    -

    typeof Ad4mModel

    -

    Generated Ad4mModel subclass

    -

    Description

    -

    This method dynamically generates an Ad4mModel subclass from a JSON Schema, -enabling integration with systems that use JSON Schema for type definitions.

    -

    The method follows a cascading approach for determining predicates:

    -
      -
    1. Explicit configuration in options parameter (highest precedence)
    2. -
    3. x-ad4m metadata in the JSON Schema
    4. -
    5. Inference from schema title and property names
    6. -
    7. Error if no namespace can be determined
    8. -
    -

    Example

    -
    // With explicit configuration
    -const PersonClass = Ad4mModel.fromJSONSchema(schema, {
    -  name: "Person",
    -  namespace: "person://",
    -  resolveLanguage: "literal"
    -});
    - 
    -// With property mapping
    -const ContactClass = Ad4mModel.fromJSONSchema(schema, {
    -  name: "Contact",
    -  namespace: "contact://",
    -  propertyMapping: {
    -    "name": "foaf://name",
    -    "email": "foaf://mbox"
    -  }
    -});
    - 
    -// With x-ad4m metadata in schema
    -const schema = {
    -  "title": "Product",
    -  "x-ad4m": { "namespace": "product://" },
    -  "properties": {
    -    "name": { 
    -      "type": "string",
    -      "x-ad4m": { "through": "product://title" }
    -    }
    -  }
    -};
    -const ProductClass = Ad4mModel.fromJSONSchema(schema, { name: "Product" });
    -

    Throws

    -

    Error when namespace cannot be inferred

    -

    Defined in

    -

    model/Ad4mModel.ts:2163 (opens in a new tab)

    -
    -

    getClassName

    -

    Static getClassName(perspective): Promise<string>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    model/Ad4mModel.ts:415 (opens in a new tab)

    -
    -

    getDefaultValueForType

    -

    Static Private getDefaultValueForType(type?): any

    -

    Gets default value for a JSON Schema type

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    type?string
    -

    Returns

    -

    any

    -

    Defined in

    -

    model/Ad4mModel.ts:2462 (opens in a new tab)

    -
    -

    getModelMetadata

    -

    Static getModelMetadata(): ModelMetadata

    -

    Extracts metadata from decorators for query building.

    -

    Returns

    -

    ModelMetadata

    -

    Structured metadata object containing className, properties, and collections

    -

    Description

    -

    This method reads the metadata stored by decorators (@Property, @Collection, etc.) -and returns it in a structured format that's easier to work with for query builders -and other systems that need to introspect model structure.

    -

    The metadata includes:

    -
      -
    • Class name from
    • -
    -

    Model Options

    -
      -
    • Property metadata (predicates, types, constraints, etc.)
    • -
    • Collection metadata (predicates, filters, etc.)
    • -
    -

    For models created via fromJSONSchema(), this method will derive metadata from -the stored __properties and __collections structures that were populated during -the dynamic class creation. If these structures are empty but a JSON schema was -attached to the class, it can fall back to deriving metadata from that schema.

    -

    Throws

    -

    Error if the class doesn't have

    -

    Model Options

    -

    decorator

    -

    Example

    -
    @ModelOptions({ name: "Recipe" })
    -class Recipe extends Ad4mModel {
    -  @Property({ through: "recipe://name", resolveLanguage: "literal" })
    -  name: string = "";
    -  
    -  @Collection({ through: "recipe://ingredient" })
    -  ingredients: string[] = [];
    -}
    - 
    -const metadata = Recipe.getModelMetadata();
    -console.log(metadata.className); // "Recipe"
    -console.log(metadata.properties.name.predicate); // "recipe://name"
    -console.log(metadata.collections.ingredients.predicate); // "recipe://ingredient"
    -

    Defined in

    -

    model/Ad4mModel.ts:478 (opens in a new tab)

    -
    -

    getPropertyOption

    -

    Static Private getPropertyOption(propertyName, propertySchema, options, optionName, defaultValue?): any

    -

    Gets property-specific options using cascading precedence

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    propertyNamestring
    propertySchemaJSONSchemaProperty
    optionsJSONSchemaToModelOptions
    optionNamekeyof PropertyOptions
    defaultValue?any
    -

    Returns

    -

    any

    -

    Defined in

    -

    model/Ad4mModel.ts:2433 (opens in a new tab)

    -
    -

    instancesFromPrologResult

    -

    Static instancesFromPrologResult<T>(this, perspective, query, result): Promise<ResultsWithTotalCount<T>>

    -

    Type parameters

    - - - - - - - - - - - - - -
    NameType
    Textends Ad4mModel<T>
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    thistypeof Ad4mModel & (...args: any[]) => T
    perspectivePerspectiveProxy
    queryQuery
    resultAllInstancesResult
    -

    Returns

    -

    Promise<ResultsWithTotalCount<T>>

    -

    Defined in

    -

    model/Ad4mModel.ts:1215 (opens in a new tab)

    -
    -

    matchesCondition

    -

    Static Private matchesCondition(value, condition): boolean

    -

    Checks if a value matches a condition (for post-query filtering).

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    valueany
    conditionWhereCondition
    -

    Returns

    -

    boolean

    -

    Defined in

    -

    model/Ad4mModel.ts:1562 (opens in a new tab)

    -
    -

    paginate

    -

    Static paginate<T>(this, perspective, pageSize, pageNumber, query?, useSurrealDB?): Promise<PaginationResult<T>>

    -

    Helper function for pagination with explicit page size and number.

    -

    Type parameters

    - - - - - - - - - - - - - -
    NameType
    Textends Ad4mModel<T>
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault valueDescription
    thistypeof Ad4mModel & (...args: any[]) => Tundefined-
    perspectivePerspectiveProxyundefinedThe perspective to search in
    pageSizenumberundefinedNumber of items per page
    pageNumbernumberundefinedWhich page to retrieve (1-based)
    query?QueryundefinedOptional additional query parameters
    useSurrealDBbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy)
    -

    Returns

    -

    Promise<PaginationResult<T>>

    -

    Paginated results with metadata

    -

    Example

    -
    const page = await Recipe.paginate(perspective, 10, 1, {
    -  where: { category: "Main Course" }
    -});
    -console.log(`Page ${page.pageNumber} of recipes, ${page.results.length} items`);
    - 
    -// Use Prolog explicitly (legacy)
    -const pageProlog = await Recipe.paginate(perspective, 10, 1, {}, false);
    -

    Defined in

    -

    model/Ad4mModel.ts:1727 (opens in a new tab)

    -
    -

    query

    -

    Static query<T>(this, perspective, query?): ModelQueryBuilder<T>

    -

    Creates a query builder for fluent query construction.

    -

    Type parameters

    - - - - - - - - - - - - - -
    NameType
    Textends Ad4mModel<T>
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    thistypeof Ad4mModel & (...args: any[]) => T-
    perspectivePerspectiveProxyThe perspective to query
    query?QueryOptional initial query parameters
    -

    Returns

    -

    ModelQueryBuilder<T>

    -

    A new query builder instance

    -

    Example

    -
    const recipes = await Recipe.query(perspective)
    -  .where({ category: "Dessert" })
    -  .order({ rating: "DESC" })
    -  .limit(5)
    -  .run();
    - 
    -// With real-time updates
    -await Recipe.query(perspective)
    -  .where({ status: "cooking" })
    -  .subscribe(recipes => {
    -    console.log("Currently cooking:", recipes);
    -  });
    -

    Defined in

    -

    model/Ad4mModel.ts:2104 (opens in a new tab)

    -
    -

    queryToProlog

    -

    Static queryToProlog(perspective, query, modelClassName?): Promise<string>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    queryQuery
    modelClassName?string
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    model/Ad4mModel.ts:689 (opens in a new tab)

    -
    -

    queryToSurrealQL

    -

    Static queryToSurrealQL(perspective, query): Promise<string>

    -

    Generates a SurrealQL query from a Query object.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective to query (used for metadata extraction)
    queryQueryQuery parameters (where, order, limit, offset, properties, collections)
    -

    Returns

    -

    Promise<string>

    -

    Complete SurrealQL query string ready for execution

    -

    Description

    -

    This method translates high-level query parameters into a SurrealQL query string -that can be executed against the SurrealDB backend. Unlike Prolog queries which -operate on SDNA-aware predicates, SurrealQL queries operate directly on raw links -stored in SurrealDB.

    -

    The generated query uses a CTE (Common Table Expression) pattern:

    -
      -
    1. First, identify candidate base expressions by filtering links based on where conditions
    2. -
    3. Then, for each candidate base, resolve properties and collections via subqueries
    4. -
    5. Finally, apply ordering, pagination (LIMIT/START) at the SQL level
    6. -
    -

    Key architectural notes:

    -
      -
    • SurrealDB stores only raw links (source, predicate, target, author, timestamp)
    • -
    • No SDNA knowledge at the database level
    • -
    • Properties are resolved via subqueries that look for links with specific predicates
    • -
    • Collections are similar but return multiple values instead of one
    • -
    • Special fields (base, author, timestamp) are accessed directly, not via subqueries
    • -
    -

    Example

    -
    const query = Recipe.queryToSurrealQL(perspective, {
    -  where: { name: "Pasta", rating: { gt: 4 } },
    -  order: { timestamp: "DESC" },
    -  limit: 10
    -});
    -// Returns: SELECT source AS base, array::first(target[WHERE predicate = ...]) AS name, ...
    -//          FROM link WHERE ... GROUP BY source ORDER BY timestamp DESC LIMIT 10
    -

    Defined in

    -

    model/Ad4mModel.ts:751 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Agent.html b/docs/jsdoc/classes/Agent.html new file mode 100644 index 000000000..df8d5435a --- /dev/null +++ b/docs/jsdoc/classes/Agent.html @@ -0,0 +1,84 @@ +Class: Agent | AD4M Docs
    API Reference
    classes
    Agent

    @coasys/ad4m / Exports / Agent

    +

    Class: Agent

    +

    AD4M's representation of an Agent

    +

    AD4M Agents are build around DIDs, which are used to identify and authenticate the Agent. +Conceptually, an Agent is regarded as something that can speak and that can listen.

    +

    Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key, +And they also speak (broadcast) by putting semantic statements into their public "Agent Perspective". +They listen (can receive messages) through their "direct message Language".

    +

    These three aspects are represented by the three fields of this class.

    +

    This class is used as format for the Expressions in the Agent language. +Since AD4M treats DID URIs as addresses for the Agent Language, +DIDs are resolved to Expressions that are objects of this class. +Thus, this is how agents see (other) agents.

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Agent(did, perspective?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    didstring
    perspective?Perspective
    +

    Defined in

    +

    agent/Agent.ts:42 (opens in a new tab)

    +

    Properties

    +

    did

    +

    did: string

    +

    The DID of the Agent +All epxressions authored by them are signed with the keys mentioned +in the DID document behind this DID URI.

    +

    Defined in

    +

    agent/Agent.ts:28 (opens in a new tab)

    +
    +

    directMessageLanguage

    +

    Optional directMessageLanguage: string

    +

    Address of the Language by which the Agent will receive DMs

    +

    Defined in

    +

    agent/Agent.ts:40 (opens in a new tab)

    +
    +

    perspective

    +

    Optional perspective: Perspective

    +

    The Perspective that holds the public-facing semantics/statements of the Agent +Holds and shares a Perspective that links all information +this agent wants to offer as public-facing semantics. +This should be used for any kind of user profile information.

    +

    Defined in

    +

    agent/Agent.ts:36 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Agent/index.html b/docs/jsdoc/classes/Agent/index.html deleted file mode 100644 index 80d135e8b..000000000 --- a/docs/jsdoc/classes/Agent/index.html +++ /dev/null @@ -1,84 +0,0 @@ -Class: Agent | AD4M Docs
    API Reference
    classes
    Agent

    @coasys/ad4m / Exports / Agent

    -

    Class: Agent

    -

    AD4M's representation of an Agent

    -

    AD4M Agents are build around DIDs, which are used to identify and authenticate the Agent. -Conceptually, an Agent is regarded as something that can speak and that can listen.

    -

    Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key, -And they also speak (broadcast) by putting semantic statements into their public "Agent Perspective". -They listen (can receive messages) through their "direct message Language".

    -

    These three aspects are represented by the three fields of this class.

    -

    This class is used as format for the Expressions in the Agent language. -Since AD4M treats DID URIs as addresses for the Agent Language, -DIDs are resolved to Expressions that are objects of this class. -Thus, this is how agents see (other) agents.

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Agent(did, perspective?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    didstring
    perspective?Perspective
    -

    Defined in

    -

    agent/Agent.ts:42 (opens in a new tab)

    -

    Properties

    -

    did

    -

    did: string

    -

    The DID of the Agent -All epxressions authored by them are signed with the keys mentioned -in the DID document behind this DID URI.

    -

    Defined in

    -

    agent/Agent.ts:28 (opens in a new tab)

    -
    -

    directMessageLanguage

    -

    Optional directMessageLanguage: string

    -

    Address of the Language by which the Agent will receive DMs

    -

    Defined in

    -

    agent/Agent.ts:40 (opens in a new tab)

    -
    -

    perspective

    -

    Optional perspective: Perspective

    -

    The Perspective that holds the public-facing semantics/statements of the Agent -Holds and shares a Perspective that links all information -this agent wants to offer as public-facing semantics. -This should be used for any kind of user profile information.

    -

    Defined in

    -

    agent/Agent.ts:36 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentClient/index.html b/docs/jsdoc/classes/AgentClient.html similarity index 53% rename from docs/jsdoc/classes/AgentClient/index.html rename to docs/jsdoc/classes/AgentClient.html index 8c958c855..6cdeaa080 100644 --- a/docs/jsdoc/classes/AgentClient/index.html +++ b/docs/jsdoc/classes/AgentClient.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    classes
    Agentclient

    @coasys/ad4m / Exports / AgentClient

    +
    API Reference
    classes
    Agentclient

    @coasys/ad4m / Exports / AgentClient

    Class: AgentClient

    Provides access to all functions regarding the local agent, such as generating, locking, unlocking, importing the DID keystore, @@ -19,45 +19,49 @@

    Table of contents

    Constructors

    Properties

    Methods

    Constructors

    constructor

    @@ -85,27 +89,27 @@

    NameTypeDefault valueclientApolloClient<any>undefinedsubscribebooleantrue

    Defined in

    -

    agent/AgentClient.ts:93 (opens in a new tab)

    +

    agent/AgentClient.ts:95 (opens in a new tab)

    Properties

    #agentStatusChangedCallbacks

    -

    Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]

    +

    Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]

    Defined in

    -

    agent/AgentClient.ts:91 (opens in a new tab)

    +

    agent/AgentClient.ts:93 (opens in a new tab)


    #apolloClient

    Private #apolloClient: ApolloClient<any>

    Defined in

    -

    agent/AgentClient.ts:88 (opens in a new tab)

    +

    agent/AgentClient.ts:90 (opens in a new tab)


    #appsChangedCallback

    -

    Private #appsChangedCallback: AgentAppsUpdatedCallback[]

    +

    Private #appsChangedCallback: AgentAppsUpdatedCallback[]

    Defined in

    -

    agent/AgentClient.ts:89 (opens in a new tab)

    +

    agent/AgentClient.ts:91 (opens in a new tab)


    #updatedCallbacks

    -

    Private #updatedCallbacks: AgentUpdatedCallback[]

    +

    Private #updatedCallbacks: AgentUpdatedCallback[]

    Defined in

    -

    agent/AgentClient.ts:90 (opens in a new tab)

    +

    agent/AgentClient.ts:92 (opens in a new tab)

    Methods

    addAgentStatusChangedListener

    addAgentStatusChangedListener(listener): void

    @@ -127,7 +131,7 @@

    Returns

    void

    Defined in

    -

    agent/AgentClient.ts:399 (opens in a new tab)

    +

    agent/AgentClient.ts:401 (opens in a new tab)


    addAppChangedListener

    addAppChangedListener(listener): void

    @@ -149,10 +153,10 @@

    Returns

    void

    Defined in

    -

    agent/AgentClient.ts:356 (opens in a new tab)

    +

    agent/AgentClient.ts:358 (opens in a new tab)


    addEntanglementProofs

    -

    addEntanglementProofs(proofs): Promise<EntanglementProof[]>

    +

    addEntanglementProofs(proofs): Promise<EntanglementProof[]>

    Parameters

    @@ -167,11 +171,11 @@

    NameTypeproofsEntanglementProofInput[] +
    NameType
    proofsEntanglementProofInput[]

    Returns

    -

    Promise<EntanglementProof[]>

    +

    Promise<EntanglementProof[]>

    Defined in

    -

    agent/AgentClient.ts:290 (opens in a new tab)

    +

    agent/AgentClient.ts:292 (opens in a new tab)


    addUpdatedListener

    addUpdatedListener(listener): void

    @@ -193,10 +197,10 @@

    Returns

    void

    Defined in

    -

    agent/AgentClient.ts:352 (opens in a new tab)

    +

    agent/AgentClient.ts:354 (opens in a new tab)


    byDID

    -

    byDID(did): Promise<Agent>

    +

    byDID(did): Promise<Agent>

    Parameters

    @@ -213,12 +217,12 @@

    NameTypedidstring

    Returns

    -

    Promise<Agent>

    +

    Promise<Agent>

    Defined in

    -

    agent/AgentClient.ts:200 (opens in a new tab)

    +

    agent/AgentClient.ts:202 (opens in a new tab)


    -

    deleteEntanglementProofs

    -

    deleteEntanglementProofs(proofs): Promise<EntanglementProof[]>

    +

    createUser

    +

    createUser(email, password, appInfo?): Promise<UserCreationResult>

    Parameters

    @@ -233,14 +237,22 @@

    NameTypeproofsEntanglementProofInput[] + + + + + + + + +
    NameType
    emailstring
    passwordstring
    appInfo?AuthInfoInput

    Returns

    -

    Promise<EntanglementProof[]>

    +

    Promise<UserCreationResult>

    Defined in

    -

    agent/AgentClient.ts:306 (opens in a new tab)

    +

    agent/AgentClient.ts:535 (opens in a new tab)


    -

    entanglementProofPreFlight

    -

    entanglementProofPreFlight(deviceKey, deviceKeyType): Promise<EntanglementProof>

    +

    deleteEntanglementProofs

    +

    deleteEntanglementProofs(proofs): Promise<EntanglementProof[]>

    Parameters

    @@ -255,19 +267,41 @@

    NameTypeproofsEntanglementProofInput[] +

    Returns

    +

    Promise<EntanglementProof[]>

    +

    Defined in

    +

    agent/AgentClient.ts:308 (opens in a new tab)

    +
    +

    entanglementProofPreFlight

    +

    entanglementProofPreFlight(deviceKey, deviceKeyType): Promise<EntanglementProof>

    +

    Parameters

    + + + + + + + + + + + + +
    NameType
    deviceKeystring
    deviceKeyTypestring
    -

    Returns

    -

    Promise<EntanglementProof>

    -

    Defined in

    -

    agent/AgentClient.ts:335 (opens in a new tab)

    +

    Returns

    +

    Promise<EntanglementProof>

    +

    Defined in

    +

    agent/AgentClient.ts:337 (opens in a new tab)


    generate

    -

    generate(passphrase): Promise<AgentStatus>

    -

    Parameters

    +

    generate(passphrase): Promise<AgentStatus>

    +

    Parameters

    @@ -282,14 +316,14 @@

    NameTypepassphrasestring -

    Returns

    -

    Promise<AgentStatus>

    -

    Defined in

    -

    agent/AgentClient.ts:136 (opens in a new tab)

    +

    Returns

    +

    Promise<AgentStatus>

    +

    Defined in

    +

    agent/AgentClient.ts:138 (opens in a new tab)


    generateJwt

    generateJwt(requestId, rand): Promise<string>

    -

    Parameters

    +

    Parameters

    @@ -308,28 +342,28 @@

    NameTyperequestIdstringrandstring -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    agent/AgentClient.ts:450 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:452 (opens in a new tab)


    getApps

    -

    getApps(): Promise<Apps[]>

    -

    Returns

    -

    Promise<Apps[]>

    -

    Defined in

    -

    agent/AgentClient.ts:464 (opens in a new tab)

    +

    getApps(): Promise<Apps[]>

    +

    Returns

    +

    Promise<Apps[]>

    +

    Defined in

    +

    agent/AgentClient.ts:466 (opens in a new tab)


    getEntanglementProofs

    getEntanglementProofs(): Promise<string[]>

    -

    Returns

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    agent/AgentClient.ts:322 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:324 (opens in a new tab)


    import

    -

    import(args): Promise<AgentStatus>

    -

    Parameters

    +

    import(args): Promise<AgentStatus>

    +

    Parameters

    @@ -343,22 +377,22 @@

    NameTypeargsInitializeArgs -

    Returns

    -

    Promise<AgentStatus>

    -

    Defined in

    -

    agent/AgentClient.ts:152 (opens in a new tab)

    +
    NameType
    argsInitializeArgs
    +

    Returns

    +

    Promise<AgentStatus>

    +

    Defined in

    +

    agent/AgentClient.ts:154 (opens in a new tab)


    isLocked

    isLocked(): Promise<boolean>

    -

    Returns

    +

    Returns

    Promise<boolean>

    -

    Defined in

    -

    agent/AgentClient.ts:505 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:507 (opens in a new tab)


    lock

    -

    lock(passphrase): Promise<AgentStatus>

    -

    Parameters

    +

    lock(passphrase): Promise<AgentStatus>

    +

    Parameters

    @@ -373,24 +407,50 @@

    NameTypepassphrasestring -

    Returns

    -

    Promise<AgentStatus>

    -

    Defined in

    -

    agent/AgentClient.ts:172 (opens in a new tab)

    +

    Returns

    +

    Promise<AgentStatus>

    +

    Defined in

    +

    agent/AgentClient.ts:174 (opens in a new tab)

    +
    +

    loginUser

    +

    loginUser(email, password): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    emailstring
    passwordstring
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    agent/AgentClient.ts:551 (opens in a new tab)


    me

    -

    me(): Promise<Agent>

    +

    me(): Promise<Agent>

    Returns the Agent expression of the local agent as it is shared publicly via the AgentLanguage.

    I.e. this is the users profile.

    -

    Returns

    -

    Promise<Agent>

    -

    Defined in

    -

    agent/AgentClient.ts:112 (opens in a new tab)

    +

    Returns

    +

    Promise<Agent>

    +

    Defined in

    +

    agent/AgentClient.ts:114 (opens in a new tab)


    mutatePublicPerspective

    -

    mutatePublicPerspective(mutations): Promise<Agent>

    -

    Parameters

    +

    mutatePublicPerspective(mutations): Promise<Agent>

    +

    Parameters

    @@ -404,15 +464,15 @@

    NameTypemutationsLinkMutations -

    Returns

    -

    Promise<Agent>

    -

    Defined in

    -

    agent/AgentClient.ts:240 (opens in a new tab)

    +
    NameType
    mutationsLinkMutations
    +

    Returns

    +

    Promise<Agent>

    +

    Defined in

    +

    agent/AgentClient.ts:242 (opens in a new tab)


    permitCapability

    permitCapability(auth): Promise<string>

    -

    Parameters

    +

    Parameters

    @@ -427,14 +487,14 @@

    NameTypeauthstring -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    agent/AgentClient.ts:436 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:438 (opens in a new tab)


    removeApp

    -

    removeApp(requestId): Promise<Apps[]>

    -

    Parameters

    +

    removeApp(requestId): Promise<Apps[]>

    +

    Parameters

    @@ -449,14 +509,14 @@

    NameTyperequestIdstring -

    Returns

    -

    Promise<Apps[]>

    -

    Defined in

    -

    agent/AgentClient.ts:477 (opens in a new tab)

    +

    Returns

    +

    Promise<Apps[]>

    +

    Defined in

    +

    agent/AgentClient.ts:479 (opens in a new tab)


    requestCapability

    requestCapability(authInfo): Promise<string>

    -

    Parameters

    +

    Parameters

    @@ -470,15 +530,41 @@

    NameTypeauthInfoAuthInfoInput -

    Returns

    +
    NameType
    authInfoAuthInfoInput
    +

    Returns

    Promise<string>

    -

    Defined in

    -

    agent/AgentClient.ts:422 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:424 (opens in a new tab)

    +
    +

    requestLoginVerification

    +

    requestLoginVerification(email, appInfo?): Promise<VerificationRequestResult>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    emailstring
    appInfo?AuthInfoInput
    +

    Returns

    +

    Promise<VerificationRequestResult>

    +

    Defined in

    +

    agent/AgentClient.ts:563 (opens in a new tab)


    revokeToken

    -

    revokeToken(requestId): Promise<Apps[]>

    -

    Parameters

    +

    revokeToken(requestId): Promise<Apps[]>

    +

    Parameters

    @@ -493,14 +579,14 @@

    NameTyperequestIdstring -

    Returns

    -

    Promise<Apps[]>

    -

    Defined in

    -

    agent/AgentClient.ts:491 (opens in a new tab)

    +

    Returns

    +

    Promise<Apps[]>

    +

    Defined in

    +

    agent/AgentClient.ts:493 (opens in a new tab)


    signMessage

    signMessage(message): Promise<string>

    -

    Parameters

    +

    Parameters

    @@ -515,42 +601,42 @@

    NameTypemessagestring -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    agent/AgentClient.ts:518 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:520 (opens in a new tab)


    status

    -

    status(): Promise<AgentStatus>

    -

    Returns

    -

    Promise<AgentStatus>

    -

    Defined in

    -

    agent/AgentClient.ts:123 (opens in a new tab)

    +

    status(): Promise<AgentStatus>

    +

    Returns

    +

    Promise<AgentStatus>

    +

    Defined in

    +

    agent/AgentClient.ts:125 (opens in a new tab)


    subscribeAgentStatusChanged

    subscribeAgentStatusChanged(): void

    -

    Returns

    +

    Returns

    void

    -

    Defined in

    -

    agent/AgentClient.ts:403 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:405 (opens in a new tab)


    subscribeAgentUpdated

    subscribeAgentUpdated(): void

    -

    Returns

    +

    Returns

    void

    -

    Defined in

    -

    agent/AgentClient.ts:360 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:362 (opens in a new tab)


    subscribeAppsChanged

    subscribeAppsChanged(): void

    -

    Returns

    +

    Returns

    void

    -

    Defined in

    -

    agent/AgentClient.ts:379 (opens in a new tab)

    +

    Defined in

    +

    agent/AgentClient.ts:381 (opens in a new tab)


    unlock

    -

    unlock(passphrase, holochain?): Promise<AgentStatus>

    -

    Parameters

    +

    unlock(passphrase, holochain?): Promise<AgentStatus>

    +

    Parameters

    @@ -572,14 +658,14 @@

    NameTypeDefault valuepassphrasestringundefinedholochainbooleantrue -

    Returns

    -

    Promise<AgentStatus>

    -

    Defined in

    -

    agent/AgentClient.ts:186 (opens in a new tab)

    +

    Returns

    +

    Promise<AgentStatus>

    +

    Defined in

    +

    agent/AgentClient.ts:188 (opens in a new tab)


    updateDirectMessageLanguage

    -

    updateDirectMessageLanguage(directMessageLanguage): Promise<Agent>

    -

    Parameters

    +

    updateDirectMessageLanguage(directMessageLanguage): Promise<Agent>

    +

    Parameters

    @@ -594,14 +680,14 @@

    NameTypedirectMessageLanguagestring -

    Returns

    -

    Promise<Agent>

    -

    Defined in

    -

    agent/AgentClient.ts:271 (opens in a new tab)

    +

    Returns

    +

    Promise<Agent>

    +

    Defined in

    +

    agent/AgentClient.ts:273 (opens in a new tab)


    updatePublicPerspective

    -

    updatePublicPerspective(perspective): Promise<Agent>

    -

    Parameters

    +

    updatePublicPerspective(perspective): Promise<Agent>

    +

    Parameters

    @@ -615,8 +701,38 @@

    NameTypeperspectivePerspectiveInput -

    Returns

    -

    Promise<Agent>

    -

    Defined in

    -

    agent/AgentClient.ts:214 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +
    NameType
    perspectivePerspectiveInput
    +

    Returns

    +

    Promise<Agent>

    +

    Defined in

    +

    agent/AgentClient.ts:216 (opens in a new tab)

    +
    +

    verifyEmailCode

    +

    verifyEmailCode(email, code, verificationType): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    emailstring
    codestring
    verificationTypestring
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    agent/AgentClient.ts:580 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentExpression.html b/docs/jsdoc/classes/AgentExpression.html new file mode 100644 index 000000000..2bbe75f04 --- /dev/null +++ b/docs/jsdoc/classes/AgentExpression.html @@ -0,0 +1,32 @@ +Class: AgentExpression | AD4M Docs
    API Reference
    classes
    Agentexpression

    @coasys/ad4m / Exports / AgentExpression

    +

    Class: AgentExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      AgentExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new AgentExpression()

    +

    Inherited from

    +

    ExpressionGeneric(Agent).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentExpression/index.html b/docs/jsdoc/classes/AgentExpression/index.html deleted file mode 100644 index 2f13eef84..000000000 --- a/docs/jsdoc/classes/AgentExpression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: AgentExpression | AD4M Docs
    API Reference
    classes
    Agentexpression

    @coasys/ad4m / Exports / AgentExpression

    -

    Class: AgentExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      AgentExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new AgentExpression()

    -

    Inherited from

    -

    ExpressionGeneric(Agent).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentSignature.html b/docs/jsdoc/classes/AgentSignature.html new file mode 100644 index 000000000..afbf4b186 --- /dev/null +++ b/docs/jsdoc/classes/AgentSignature.html @@ -0,0 +1,59 @@ +Class: AgentSignature | AD4M Docs
    API Reference
    classes
    Agentsignature

    @coasys/ad4m / Exports / AgentSignature

    +

    Class: AgentSignature

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AgentSignature(signature, publicKey)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    signaturestring
    publicKeystring
    +

    Defined in

    +

    agent/Agent.ts:137 (opens in a new tab)

    +

    Properties

    +

    publicKey

    +

    publicKey: string

    +

    Defined in

    +

    agent/Agent.ts:135 (opens in a new tab)

    +
    +

    signature

    +

    signature: string

    +

    Defined in

    +

    agent/Agent.ts:132 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentSignature/index.html b/docs/jsdoc/classes/AgentSignature/index.html deleted file mode 100644 index 26bcc6e34..000000000 --- a/docs/jsdoc/classes/AgentSignature/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: AgentSignature | AD4M Docs
    API Reference
    classes
    Agentsignature

    @coasys/ad4m / Exports / AgentSignature

    -

    Class: AgentSignature

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AgentSignature(signature, publicKey)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    signaturestring
    publicKeystring
    -

    Defined in

    -

    agent/Agent.ts:137 (opens in a new tab)

    -

    Properties

    -

    publicKey

    -

    publicKey: string

    -

    Defined in

    -

    agent/Agent.ts:135 (opens in a new tab)

    -
    -

    signature

    -

    signature: string

    -

    Defined in

    -

    agent/Agent.ts:132 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentStatus.html b/docs/jsdoc/classes/AgentStatus.html new file mode 100644 index 000000000..3c3392599 --- /dev/null +++ b/docs/jsdoc/classes/AgentStatus.html @@ -0,0 +1,73 @@ +Class: AgentStatus | AD4M Docs
    API Reference
    classes
    Agentstatus

    @coasys/ad4m / Exports / AgentStatus

    +

    Class: AgentStatus

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AgentStatus(obj?)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    obj?object
    +

    Defined in

    +

    agent/AgentStatus.ts:20 (opens in a new tab)

    +

    Properties

    +

    did

    +

    Optional did: string

    +

    Defined in

    +

    agent/AgentStatus.ts:12 (opens in a new tab)

    +
    +

    didDocument

    +

    Optional didDocument: string

    +

    Defined in

    +

    agent/AgentStatus.ts:15 (opens in a new tab)

    +
    +

    error

    +

    Optional error: string

    +

    Defined in

    +

    agent/AgentStatus.ts:18 (opens in a new tab)

    +
    +

    isInitialized

    +

    isInitialized: Boolean

    +

    Defined in

    +

    agent/AgentStatus.ts:6 (opens in a new tab)

    +
    +

    isUnlocked

    +

    isUnlocked: Boolean

    +

    Defined in

    +

    agent/AgentStatus.ts:9 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AgentStatus/index.html b/docs/jsdoc/classes/AgentStatus/index.html deleted file mode 100644 index 5989f15ca..000000000 --- a/docs/jsdoc/classes/AgentStatus/index.html +++ /dev/null @@ -1,73 +0,0 @@ -Class: AgentStatus | AD4M Docs
    API Reference
    classes
    Agentstatus

    @coasys/ad4m / Exports / AgentStatus

    -

    Class: AgentStatus

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AgentStatus(obj?)

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    obj?object
    -

    Defined in

    -

    agent/AgentStatus.ts:20 (opens in a new tab)

    -

    Properties

    -

    did

    -

    Optional did: string

    -

    Defined in

    -

    agent/AgentStatus.ts:12 (opens in a new tab)

    -
    -

    didDocument

    -

    Optional didDocument: string

    -

    Defined in

    -

    agent/AgentStatus.ts:15 (opens in a new tab)

    -
    -

    error

    -

    Optional error: string

    -

    Defined in

    -

    agent/AgentStatus.ts:18 (opens in a new tab)

    -
    -

    isInitialized

    -

    isInitialized: Boolean

    -

    Defined in

    -

    agent/AgentStatus.ts:6 (opens in a new tab)

    -
    -

    isUnlocked

    -

    isUnlocked: Boolean

    -

    Defined in

    -

    agent/AgentStatus.ts:9 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Apps.html b/docs/jsdoc/classes/Apps.html new file mode 100644 index 000000000..54b542404 --- /dev/null +++ b/docs/jsdoc/classes/Apps.html @@ -0,0 +1,79 @@ +Class: Apps | AD4M Docs
    API Reference
    classes
    Apps

    @coasys/ad4m / Exports / Apps

    +

    Class: Apps

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Apps(requestId, auth, token, revoked?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    requestIdstring
    authAuthInfo
    tokenstring
    revoked?boolean
    +

    Defined in

    +

    agent/Agent.ts:217 (opens in a new tab)

    +

    Properties

    +

    auth

    +

    auth: AuthInfo

    +

    Defined in

    +

    agent/Agent.ts:215 (opens in a new tab)

    +
    +

    requestId

    +

    requestId: string

    +

    Defined in

    +

    agent/Agent.ts:206 (opens in a new tab)

    +
    +

    revoked

    +

    Optional revoked: boolean

    +

    Defined in

    +

    agent/Agent.ts:212 (opens in a new tab)

    +
    +

    token

    +

    token: string

    +

    Defined in

    +

    agent/Agent.ts:209 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Apps/index.html b/docs/jsdoc/classes/Apps/index.html deleted file mode 100644 index f9a8aeceb..000000000 --- a/docs/jsdoc/classes/Apps/index.html +++ /dev/null @@ -1,79 +0,0 @@ -Class: Apps | AD4M Docs
    API Reference
    classes
    Apps

    @coasys/ad4m / Exports / Apps

    -

    Class: Apps

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Apps(requestId, auth, token, revoked?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    requestIdstring
    authAuthInfo
    tokenstring
    revoked?boolean
    -

    Defined in

    -

    agent/Agent.ts:217 (opens in a new tab)

    -

    Properties

    -

    auth

    -

    auth: AuthInfo

    -

    Defined in

    -

    agent/Agent.ts:215 (opens in a new tab)

    -
    -

    requestId

    -

    requestId: string

    -

    Defined in

    -

    agent/Agent.ts:206 (opens in a new tab)

    -
    -

    revoked

    -

    Optional revoked: boolean

    -

    Defined in

    -

    agent/Agent.ts:212 (opens in a new tab)

    -
    -

    token

    -

    token: string

    -

    Defined in

    -

    agent/Agent.ts:209 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AuthInfo.html b/docs/jsdoc/classes/AuthInfo.html new file mode 100644 index 000000000..c324e6a1d --- /dev/null +++ b/docs/jsdoc/classes/AuthInfo.html @@ -0,0 +1,89 @@ +Class: AuthInfo | AD4M Docs
    API Reference
    classes
    Authinfo

    @coasys/ad4m / Exports / AuthInfo

    +

    Class: AuthInfo

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AuthInfo(appName, appDesc, appUrl, capabilities, appIconPath?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    appNamestring
    appDescstring
    appUrlstring
    capabilitiesCapability[]
    appIconPath?string
    +

    Defined in

    +

    agent/Agent.ts:188 (opens in a new tab)

    +

    Properties

    +

    appDesc

    +

    appDesc: string

    +

    Defined in

    +

    agent/Agent.ts:177 (opens in a new tab)

    +
    +

    appIconPath

    +

    Optional appIconPath: string

    +

    Defined in

    +

    agent/Agent.ts:183 (opens in a new tab)

    +
    +

    appName

    +

    appName: string

    +

    Defined in

    +

    agent/Agent.ts:174 (opens in a new tab)

    +
    +

    appUrl

    +

    appUrl: string

    +

    Defined in

    +

    agent/Agent.ts:180 (opens in a new tab)

    +
    +

    capabilities

    +

    capabilities: Capability[]

    +

    Defined in

    +

    agent/Agent.ts:186 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AuthInfo/index.html b/docs/jsdoc/classes/AuthInfo/index.html deleted file mode 100644 index 21a5c474f..000000000 --- a/docs/jsdoc/classes/AuthInfo/index.html +++ /dev/null @@ -1,89 +0,0 @@ -Class: AuthInfo | AD4M Docs
    API Reference
    classes
    Authinfo

    @coasys/ad4m / Exports / AuthInfo

    -

    Class: AuthInfo

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AuthInfo(appName, appDesc, appUrl, capabilities, appIconPath?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    appNamestring
    appDescstring
    appUrlstring
    capabilitiesCapability[]
    appIconPath?string
    -

    Defined in

    -

    agent/Agent.ts:188 (opens in a new tab)

    -

    Properties

    -

    appDesc

    -

    appDesc: string

    -

    Defined in

    -

    agent/Agent.ts:177 (opens in a new tab)

    -
    -

    appIconPath

    -

    Optional appIconPath: string

    -

    Defined in

    -

    agent/Agent.ts:183 (opens in a new tab)

    -
    -

    appName

    -

    appName: string

    -

    Defined in

    -

    agent/Agent.ts:174 (opens in a new tab)

    -
    -

    appUrl

    -

    appUrl: string

    -

    Defined in

    -

    agent/Agent.ts:180 (opens in a new tab)

    -
    -

    capabilities

    -

    capabilities: Capability[]

    -

    Defined in

    -

    agent/Agent.ts:186 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AuthInfoInput.html b/docs/jsdoc/classes/AuthInfoInput.html new file mode 100644 index 000000000..1a4820762 --- /dev/null +++ b/docs/jsdoc/classes/AuthInfoInput.html @@ -0,0 +1,99 @@ +Class: AuthInfoInput | AD4M Docs
    API Reference
    classes
    Authinfoinput

    @coasys/ad4m / Exports / AuthInfoInput

    +

    Class: AuthInfoInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new AuthInfoInput(appName, appDesc, appDomain, appUrl?, appIconPath?, capabilities?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    appNamestring
    appDescstring
    appDomainstring
    appUrl?string
    appIconPath?string
    capabilities?CapabilityInput[]
    +

    Defined in

    +

    agent/Agent.ts:278 (opens in a new tab)

    +

    Properties

    +

    appDesc

    +

    appDesc: string

    +

    Defined in

    +

    agent/Agent.ts:264 (opens in a new tab)

    +
    +

    appDomain

    +

    appDomain: string

    +

    Defined in

    +

    agent/Agent.ts:267 (opens in a new tab)

    +
    +

    appIconPath

    +

    Optional appIconPath: string

    +

    Defined in

    +

    agent/Agent.ts:273 (opens in a new tab)

    +
    +

    appName

    +

    appName: string

    +

    Defined in

    +

    agent/Agent.ts:261 (opens in a new tab)

    +
    +

    appUrl

    +

    Optional appUrl: string

    +

    Defined in

    +

    agent/Agent.ts:270 (opens in a new tab)

    +
    +

    capabilities

    +

    Optional capabilities: CapabilityInput[]

    +

    Defined in

    +

    agent/Agent.ts:276 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/AuthInfoInput/index.html b/docs/jsdoc/classes/AuthInfoInput/index.html deleted file mode 100644 index c71b186b1..000000000 --- a/docs/jsdoc/classes/AuthInfoInput/index.html +++ /dev/null @@ -1,99 +0,0 @@ -Class: AuthInfoInput | AD4M Docs
    API Reference
    classes
    Authinfoinput

    @coasys/ad4m / Exports / AuthInfoInput

    -

    Class: AuthInfoInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new AuthInfoInput(appName, appDesc, appDomain, appUrl?, appIconPath?, capabilities?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    appNamestring
    appDescstring
    appDomainstring
    appUrl?string
    appIconPath?string
    capabilities?CapabilityInput[]
    -

    Defined in

    -

    agent/Agent.ts:278 (opens in a new tab)

    -

    Properties

    -

    appDesc

    -

    appDesc: string

    -

    Defined in

    -

    agent/Agent.ts:264 (opens in a new tab)

    -
    -

    appDomain

    -

    appDomain: string

    -

    Defined in

    -

    agent/Agent.ts:267 (opens in a new tab)

    -
    -

    appIconPath

    -

    Optional appIconPath: string

    -

    Defined in

    -

    agent/Agent.ts:273 (opens in a new tab)

    -
    -

    appName

    -

    appName: string

    -

    Defined in

    -

    agent/Agent.ts:261 (opens in a new tab)

    -
    -

    appUrl

    -

    Optional appUrl: string

    -

    Defined in

    -

    agent/Agent.ts:270 (opens in a new tab)

    -
    -

    capabilities

    -

    Optional capabilities: CapabilityInput[]

    -

    Defined in

    -

    agent/Agent.ts:276 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Capability.html b/docs/jsdoc/classes/Capability.html new file mode 100644 index 000000000..012c8d131 --- /dev/null +++ b/docs/jsdoc/classes/Capability.html @@ -0,0 +1,59 @@ +Class: Capability | AD4M Docs
    API Reference
    classes
    Capability

    @coasys/ad4m / Exports / Capability

    +

    Class: Capability

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Capability(withF, can)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    withFResource
    canstring[]
    +

    Defined in

    +

    agent/Agent.ts:165 (opens in a new tab)

    +

    Properties

    +

    can

    +

    can: string[]

    +

    Defined in

    +

    agent/Agent.ts:163 (opens in a new tab)

    +
    +

    with

    +

    with: Resource

    +

    Defined in

    +

    agent/Agent.ts:160 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Capability/index.html b/docs/jsdoc/classes/Capability/index.html deleted file mode 100644 index a0c79633e..000000000 --- a/docs/jsdoc/classes/Capability/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: Capability | AD4M Docs
    API Reference
    classes
    Capability

    @coasys/ad4m / Exports / Capability

    -

    Class: Capability

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Capability(withF, can)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    withFResource
    canstring[]
    -

    Defined in

    -

    agent/Agent.ts:165 (opens in a new tab)

    -

    Properties

    -

    can

    -

    can: string[]

    -

    Defined in

    -

    agent/Agent.ts:163 (opens in a new tab)

    -
    -

    with

    -

    with: Resource

    -

    Defined in

    -

    agent/Agent.ts:160 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/CapabilityInput.html b/docs/jsdoc/classes/CapabilityInput.html new file mode 100644 index 000000000..f9a1f1b62 --- /dev/null +++ b/docs/jsdoc/classes/CapabilityInput.html @@ -0,0 +1,59 @@ +Class: CapabilityInput | AD4M Docs
    API Reference
    classes
    Capabilityinput

    @coasys/ad4m / Exports / CapabilityInput

    +

    Class: CapabilityInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new CapabilityInput(withF, can)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    withFResourceInput
    canstring[]
    +

    Defined in

    +

    agent/Agent.ts:252 (opens in a new tab)

    +

    Properties

    +

    can

    +

    can: string[]

    +

    Defined in

    +

    agent/Agent.ts:250 (opens in a new tab)

    +
    +

    with

    +

    with: ResourceInput

    +

    Defined in

    +

    agent/Agent.ts:247 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/CapabilityInput/index.html b/docs/jsdoc/classes/CapabilityInput/index.html deleted file mode 100644 index e7b0b9ce1..000000000 --- a/docs/jsdoc/classes/CapabilityInput/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: CapabilityInput | AD4M Docs
    API Reference
    classes
    Capabilityinput

    @coasys/ad4m / Exports / CapabilityInput

    -

    Class: CapabilityInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new CapabilityInput(withF, can)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    withFResourceInput
    canstring[]
    -

    Defined in

    -

    agent/Agent.ts:252 (opens in a new tab)

    -

    Properties

    -

    can

    -

    can: string[]

    -

    Defined in

    -

    agent/Agent.ts:250 (opens in a new tab)

    -
    -

    with

    -

    with: ResourceInput

    -

    Defined in

    -

    agent/Agent.ts:247 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Dna.html b/docs/jsdoc/classes/Dna.html new file mode 100644 index 000000000..daa6c432f --- /dev/null +++ b/docs/jsdoc/classes/Dna.html @@ -0,0 +1,44 @@ +Class: Dna | AD4M Docs
    API Reference
    classes
    Dna

    @coasys/ad4m / Exports / Dna

    +

    Class: Dna

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Dna()

    +

    Properties

    +

    file

    +

    file: Buffer

    +

    Defined in

    +

    language/LanguageContext.ts:23 (opens in a new tab)

    +
    +

    nick

    +

    nick: string

    +

    Defined in

    +

    language/LanguageContext.ts:24 (opens in a new tab)

    +
    +

    zomeCalls

    +

    zomeCalls: [string, string][]

    +

    Defined in

    +

    language/LanguageContext.ts:25 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Dna/index.html b/docs/jsdoc/classes/Dna/index.html deleted file mode 100644 index d8c99d9fc..000000000 --- a/docs/jsdoc/classes/Dna/index.html +++ /dev/null @@ -1,44 +0,0 @@ -Class: Dna | AD4M Docs
    API Reference
    classes
    Dna

    @coasys/ad4m / Exports / Dna

    -

    Class: Dna

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Dna()

    -

    Properties

    -

    file

    -

    file: Buffer

    -

    Defined in

    -

    language/LanguageContext.ts:23 (opens in a new tab)

    -
    -

    nick

    -

    nick: string

    -

    Defined in

    -

    language/LanguageContext.ts:24 (opens in a new tab)

    -
    -

    zomeCalls

    -

    zomeCalls: [string, string][]

    -

    Defined in

    -

    language/LanguageContext.ts:25 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/EntanglementProof.html b/docs/jsdoc/classes/EntanglementProof.html new file mode 100644 index 000000000..d70e8d9dd --- /dev/null +++ b/docs/jsdoc/classes/EntanglementProof.html @@ -0,0 +1,99 @@ +Class: EntanglementProof | AD4M Docs
    API Reference
    classes
    Entanglementproof

    @coasys/ad4m / Exports / EntanglementProof

    +

    Class: EntanglementProof

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new EntanglementProof(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    didstring
    didSigningKeyIdstring
    deviceKeyTypestring
    deviceKeystring
    deviceKeySignedByDidstring
    didSignedByDeviceKey?string
    +

    Defined in

    +

    agent/Agent.ts:75 (opens in a new tab)

    +

    Properties

    +

    deviceKey

    +

    deviceKey: string

    +

    Defined in

    +

    agent/Agent.ts:67 (opens in a new tab)

    +
    +

    deviceKeySignedByDid

    +

    deviceKeySignedByDid: string

    +

    Defined in

    +

    agent/Agent.ts:70 (opens in a new tab)

    +
    +

    deviceKeyType

    +

    deviceKeyType: string

    +

    Defined in

    +

    agent/Agent.ts:64 (opens in a new tab)

    +
    +

    did

    +

    did: string

    +

    Defined in

    +

    agent/Agent.ts:58 (opens in a new tab)

    +
    +

    didSignedByDeviceKey

    +

    Optional didSignedByDeviceKey: string

    +

    Defined in

    +

    agent/Agent.ts:73 (opens in a new tab)

    +
    +

    didSigningKeyId

    +

    didSigningKeyId: string

    +

    Defined in

    +

    agent/Agent.ts:61 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/EntanglementProof/index.html b/docs/jsdoc/classes/EntanglementProof/index.html deleted file mode 100644 index 5578b6115..000000000 --- a/docs/jsdoc/classes/EntanglementProof/index.html +++ /dev/null @@ -1,99 +0,0 @@ -Class: EntanglementProof | AD4M Docs
    API Reference
    classes
    Entanglementproof

    @coasys/ad4m / Exports / EntanglementProof

    -

    Class: EntanglementProof

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new EntanglementProof(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    didstring
    didSigningKeyIdstring
    deviceKeyTypestring
    deviceKeystring
    deviceKeySignedByDidstring
    didSignedByDeviceKey?string
    -

    Defined in

    -

    agent/Agent.ts:75 (opens in a new tab)

    -

    Properties

    -

    deviceKey

    -

    deviceKey: string

    -

    Defined in

    -

    agent/Agent.ts:67 (opens in a new tab)

    -
    -

    deviceKeySignedByDid

    -

    deviceKeySignedByDid: string

    -

    Defined in

    -

    agent/Agent.ts:70 (opens in a new tab)

    -
    -

    deviceKeyType

    -

    deviceKeyType: string

    -

    Defined in

    -

    agent/Agent.ts:64 (opens in a new tab)

    -
    -

    did

    -

    did: string

    -

    Defined in

    -

    agent/Agent.ts:58 (opens in a new tab)

    -
    -

    didSignedByDeviceKey

    -

    Optional didSignedByDeviceKey: string

    -

    Defined in

    -

    agent/Agent.ts:73 (opens in a new tab)

    -
    -

    didSigningKeyId

    -

    didSigningKeyId: string

    -

    Defined in

    -

    agent/Agent.ts:61 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/EntanglementProofInput.html b/docs/jsdoc/classes/EntanglementProofInput.html new file mode 100644 index 000000000..b79dcd2e3 --- /dev/null +++ b/docs/jsdoc/classes/EntanglementProofInput.html @@ -0,0 +1,99 @@ +Class: EntanglementProofInput | AD4M Docs
    API Reference
    classes
    Entanglementproofinput

    @coasys/ad4m / Exports / EntanglementProofInput

    +

    Class: EntanglementProofInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new EntanglementProofInput(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    didstring
    didSigningKeyIdstring
    deviceKeyTypestring
    deviceKeystring
    deviceKeySignedByDidstring
    didSignedByDeviceKeystring
    +

    Defined in

    +

    agent/Agent.ts:112 (opens in a new tab)

    +

    Properties

    +

    deviceKey

    +

    deviceKey: string

    +

    Defined in

    +

    agent/Agent.ts:104 (opens in a new tab)

    +
    +

    deviceKeySignedByDid

    +

    deviceKeySignedByDid: string

    +

    Defined in

    +

    agent/Agent.ts:107 (opens in a new tab)

    +
    +

    deviceKeyType

    +

    deviceKeyType: string

    +

    Defined in

    +

    agent/Agent.ts:101 (opens in a new tab)

    +
    +

    did

    +

    did: string

    +

    Defined in

    +

    agent/Agent.ts:95 (opens in a new tab)

    +
    +

    didSignedByDeviceKey

    +

    didSignedByDeviceKey: string

    +

    Defined in

    +

    agent/Agent.ts:110 (opens in a new tab)

    +
    +

    didSigningKeyId

    +

    didSigningKeyId: string

    +

    Defined in

    +

    agent/Agent.ts:98 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/EntanglementProofInput/index.html b/docs/jsdoc/classes/EntanglementProofInput/index.html deleted file mode 100644 index 994be51cf..000000000 --- a/docs/jsdoc/classes/EntanglementProofInput/index.html +++ /dev/null @@ -1,99 +0,0 @@ -Class: EntanglementProofInput | AD4M Docs
    API Reference
    classes
    Entanglementproofinput

    @coasys/ad4m / Exports / EntanglementProofInput

    -

    Class: EntanglementProofInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new EntanglementProofInput(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    didstring
    didSigningKeyIdstring
    deviceKeyTypestring
    deviceKeystring
    deviceKeySignedByDidstring
    didSignedByDeviceKeystring
    -

    Defined in

    -

    agent/Agent.ts:112 (opens in a new tab)

    -

    Properties

    -

    deviceKey

    -

    deviceKey: string

    -

    Defined in

    -

    agent/Agent.ts:104 (opens in a new tab)

    -
    -

    deviceKeySignedByDid

    -

    deviceKeySignedByDid: string

    -

    Defined in

    -

    agent/Agent.ts:107 (opens in a new tab)

    -
    -

    deviceKeyType

    -

    deviceKeyType: string

    -

    Defined in

    -

    agent/Agent.ts:101 (opens in a new tab)

    -
    -

    did

    -

    did: string

    -

    Defined in

    -

    agent/Agent.ts:95 (opens in a new tab)

    -
    -

    didSignedByDeviceKey

    -

    didSignedByDeviceKey: string

    -

    Defined in

    -

    agent/Agent.ts:110 (opens in a new tab)

    -
    -

    didSigningKeyId

    -

    didSigningKeyId: string

    -

    Defined in

    -

    agent/Agent.ts:98 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExceptionInfo.html b/docs/jsdoc/classes/ExceptionInfo.html new file mode 100644 index 000000000..54bdab42d --- /dev/null +++ b/docs/jsdoc/classes/ExceptionInfo.html @@ -0,0 +1,50 @@ +Class: ExceptionInfo | AD4M Docs
    API Reference
    classes
    Exceptioninfo

    @coasys/ad4m / Exports / ExceptionInfo

    +

    Class: ExceptionInfo

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ExceptionInfo()

    +

    Properties

    +

    addon

    +

    Optional addon: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:55 (opens in a new tab)

    +
    +

    message

    +

    message: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:51 (opens in a new tab)

    +
    +

    title

    +

    title: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:49 (opens in a new tab)

    +
    +

    type

    +

    type: ExceptionType

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:53 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExceptionInfo/index.html b/docs/jsdoc/classes/ExceptionInfo/index.html deleted file mode 100644 index 231193abe..000000000 --- a/docs/jsdoc/classes/ExceptionInfo/index.html +++ /dev/null @@ -1,50 +0,0 @@ -Class: ExceptionInfo | AD4M Docs
    API Reference
    classes
    Exceptioninfo

    @coasys/ad4m / Exports / ExceptionInfo

    -

    Class: ExceptionInfo

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ExceptionInfo()

    -

    Properties

    -

    addon

    -

    Optional addon: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:54 (opens in a new tab)

    -
    -

    message

    -

    message: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:50 (opens in a new tab)

    -
    -

    title

    -

    title: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:48 (opens in a new tab)

    -
    -

    type

    -

    type: ExceptionType

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:52 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Expression.html b/docs/jsdoc/classes/Expression.html new file mode 100644 index 000000000..7f3161476 --- /dev/null +++ b/docs/jsdoc/classes/Expression.html @@ -0,0 +1,32 @@ +Class: Expression | AD4M Docs
    API Reference
    classes
    Expression

    @coasys/ad4m / Exports / Expression

    +

    Class: Expression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      Expression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new Expression()

    +

    Inherited from

    +

    ExpressionGeneric(Object).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Expression/index.html b/docs/jsdoc/classes/Expression/index.html deleted file mode 100644 index cbd2ec182..000000000 --- a/docs/jsdoc/classes/Expression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: Expression | AD4M Docs
    API Reference
    classes
    Expression

    @coasys/ad4m / Exports / Expression

    -

    Class: Expression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      Expression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new Expression()

    -

    Inherited from

    -

    ExpressionGeneric(Object).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionProof.html b/docs/jsdoc/classes/ExpressionProof.html new file mode 100644 index 000000000..b1c8e39ab --- /dev/null +++ b/docs/jsdoc/classes/ExpressionProof.html @@ -0,0 +1,71 @@ +Class: ExpressionProof | AD4M Docs
    API Reference
    classes
    Expressionproof

    @coasys/ad4m / Exports / ExpressionProof

    +

    Class: ExpressionProof

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ExpressionProof(sig, k)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    sigstring
    kstring
    +

    Defined in

    +

    expression/Expression.ts:20 (opens in a new tab)

    +

    Properties

    +

    invalid

    +

    Optional invalid: boolean

    +

    Defined in

    +

    expression/Expression.ts:18 (opens in a new tab)

    +
    +

    key

    +

    key: string

    +

    Defined in

    +

    expression/Expression.ts:12 (opens in a new tab)

    +
    +

    signature

    +

    signature: string

    +

    Defined in

    +

    expression/Expression.ts:9 (opens in a new tab)

    +
    +

    valid

    +

    Optional valid: boolean

    +

    Defined in

    +

    expression/Expression.ts:15 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionProof/index.html b/docs/jsdoc/classes/ExpressionProof/index.html deleted file mode 100644 index 4a08df1c2..000000000 --- a/docs/jsdoc/classes/ExpressionProof/index.html +++ /dev/null @@ -1,71 +0,0 @@ -Class: ExpressionProof | AD4M Docs
    API Reference
    classes
    Expressionproof

    @coasys/ad4m / Exports / ExpressionProof

    -

    Class: ExpressionProof

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ExpressionProof(sig, k)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    sigstring
    kstring
    -

    Defined in

    -

    expression/Expression.ts:20 (opens in a new tab)

    -

    Properties

    -

    invalid

    -

    Optional invalid: boolean

    -

    Defined in

    -

    expression/Expression.ts:18 (opens in a new tab)

    -
    -

    key

    -

    key: string

    -

    Defined in

    -

    expression/Expression.ts:12 (opens in a new tab)

    -
    -

    signature

    -

    signature: string

    -

    Defined in

    -

    expression/Expression.ts:9 (opens in a new tab)

    -
    -

    valid

    -

    Optional valid: boolean

    -

    Defined in

    -

    expression/Expression.ts:15 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionProofInput.html b/docs/jsdoc/classes/ExpressionProofInput.html new file mode 100644 index 000000000..4461121e7 --- /dev/null +++ b/docs/jsdoc/classes/ExpressionProofInput.html @@ -0,0 +1,50 @@ +Class: ExpressionProofInput | AD4M Docs
    API Reference
    classes
    Expressionproofinput

    @coasys/ad4m / Exports / ExpressionProofInput

    +

    Class: ExpressionProofInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ExpressionProofInput()

    +

    Properties

    +

    invalid

    +

    Optional invalid: boolean

    +

    Defined in

    +

    expression/Expression.ts:38 (opens in a new tab)

    +
    +

    key

    +

    key: string

    +

    Defined in

    +

    expression/Expression.ts:32 (opens in a new tab)

    +
    +

    signature

    +

    signature: string

    +

    Defined in

    +

    expression/Expression.ts:29 (opens in a new tab)

    +
    +

    valid

    +

    Optional valid: boolean

    +

    Defined in

    +

    expression/Expression.ts:35 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionProofInput/index.html b/docs/jsdoc/classes/ExpressionProofInput/index.html deleted file mode 100644 index 7c7ed8868..000000000 --- a/docs/jsdoc/classes/ExpressionProofInput/index.html +++ /dev/null @@ -1,50 +0,0 @@ -Class: ExpressionProofInput | AD4M Docs
    API Reference
    classes
    Expressionproofinput

    @coasys/ad4m / Exports / ExpressionProofInput

    -

    Class: ExpressionProofInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ExpressionProofInput()

    -

    Properties

    -

    invalid

    -

    Optional invalid: boolean

    -

    Defined in

    -

    expression/Expression.ts:38 (opens in a new tab)

    -
    -

    key

    -

    key: string

    -

    Defined in

    -

    expression/Expression.ts:32 (opens in a new tab)

    -
    -

    signature

    -

    signature: string

    -

    Defined in

    -

    expression/Expression.ts:29 (opens in a new tab)

    -
    -

    valid

    -

    Optional valid: boolean

    -

    Defined in

    -

    expression/Expression.ts:35 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionRef.html b/docs/jsdoc/classes/ExpressionRef.html new file mode 100644 index 000000000..965bb8b03 --- /dev/null +++ b/docs/jsdoc/classes/ExpressionRef.html @@ -0,0 +1,59 @@ +Class: ExpressionRef | AD4M Docs
    API Reference
    classes
    Expressionref

    @coasys/ad4m / Exports / ExpressionRef

    +

    Class: ExpressionRef

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ExpressionRef(lang, expr)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    langLanguageRef
    exprstring
    +

    Defined in

    +

    expression/ExpressionRef.ts:14 (opens in a new tab)

    +

    Properties

    +

    expression

    +

    expression: string

    +

    Defined in

    +

    expression/ExpressionRef.ts:12 (opens in a new tab)

    +
    +

    language

    +

    language: LanguageRef

    +

    Defined in

    +

    expression/ExpressionRef.ts:9 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionRef/index.html b/docs/jsdoc/classes/ExpressionRef/index.html deleted file mode 100644 index 63dd66645..000000000 --- a/docs/jsdoc/classes/ExpressionRef/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: ExpressionRef | AD4M Docs
    API Reference
    classes
    Expressionref

    @coasys/ad4m / Exports / ExpressionRef

    -

    Class: ExpressionRef

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ExpressionRef(lang, expr)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    langLanguageRef
    exprstring
    -

    Defined in

    -

    expression/ExpressionRef.ts:14 (opens in a new tab)

    -

    Properties

    -

    expression

    -

    expression: string

    -

    Defined in

    -

    expression/ExpressionRef.ts:12 (opens in a new tab)

    -
    -

    language

    -

    language: LanguageRef

    -

    Defined in

    -

    expression/ExpressionRef.ts:9 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionRendered.html b/docs/jsdoc/classes/ExpressionRendered.html new file mode 100644 index 000000000..6b2f33ee2 --- /dev/null +++ b/docs/jsdoc/classes/ExpressionRendered.html @@ -0,0 +1,47 @@ +Class: ExpressionRendered | AD4M Docs
    API Reference
    classes
    Expressionrendered

    @coasys/ad4m / Exports / ExpressionRendered

    +

    Class: ExpressionRendered

    +

    Hierarchy

    +
      +
    • +

      any

      +

      ExpressionRendered

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ExpressionRendered()

    +

    Inherited from

    +

    ExpressionGeneric(String).constructor

    +

    Properties

    +

    icon

    +

    icon: Icon

    +

    Defined in

    +

    expression/Expression.ts:94 (opens in a new tab)

    +
    +

    language

    +

    language: LanguageRef

    +

    Defined in

    +

    expression/Expression.ts:91 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ExpressionRendered/index.html b/docs/jsdoc/classes/ExpressionRendered/index.html deleted file mode 100644 index 08cd93c82..000000000 --- a/docs/jsdoc/classes/ExpressionRendered/index.html +++ /dev/null @@ -1,47 +0,0 @@ -Class: ExpressionRendered | AD4M Docs
    API Reference
    classes
    Expressionrendered

    @coasys/ad4m / Exports / ExpressionRendered

    -

    Class: ExpressionRendered

    -

    Hierarchy

    -
      -
    • -

      any

      -

      ExpressionRendered

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ExpressionRendered()

    -

    Inherited from

    -

    ExpressionGeneric(String).constructor

    -

    Properties

    -

    icon

    -

    icon: Icon

    -

    Defined in

    -

    expression/Expression.ts:94 (opens in a new tab)

    -
    -

    language

    -

    language: LanguageRef

    -

    Defined in

    -

    expression/Expression.ts:91 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Icon.html b/docs/jsdoc/classes/Icon.html new file mode 100644 index 000000000..f5e03af8c --- /dev/null +++ b/docs/jsdoc/classes/Icon.html @@ -0,0 +1,49 @@ +Class: Icon | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Icon/index.html b/docs/jsdoc/classes/Icon/index.html deleted file mode 100644 index 4958d726c..000000000 --- a/docs/jsdoc/classes/Icon/index.html +++ /dev/null @@ -1,49 +0,0 @@ -Class: Icon | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ImportResult.html b/docs/jsdoc/classes/ImportResult.html new file mode 100644 index 000000000..d351aa7b9 --- /dev/null +++ b/docs/jsdoc/classes/ImportResult.html @@ -0,0 +1,92 @@ +Class: ImportResult | AD4M Docs
    API Reference
    classes
    Importresult

    @coasys/ad4m / Exports / ImportResult

    +

    Class: ImportResult

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ImportResult()

    +

    Properties

    +

    defaultModels

    +

    defaultModels: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:181 (opens in a new tab)

    +
    +

    expressions

    +

    expressions: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:169 (opens in a new tab)

    +
    +

    friends

    +

    friends: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:187 (opens in a new tab)

    +
    +

    knownLinkLanguages

    +

    knownLinkLanguages: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:193 (opens in a new tab)

    +
    +

    links

    +

    links: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:166 (opens in a new tab)

    +
    +

    models

    +

    models: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:178 (opens in a new tab)

    +
    +

    notifications

    +

    notifications: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:175 (opens in a new tab)

    +
    +

    perspectiveDiffs

    +

    perspectiveDiffs: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:172 (opens in a new tab)

    +
    +

    perspectives

    +

    perspectives: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:163 (opens in a new tab)

    +
    +

    tasks

    +

    tasks: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:184 (opens in a new tab)

    +
    +

    trustedAgents

    +

    trustedAgents: ImportStats

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:190 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ImportResult/index.html b/docs/jsdoc/classes/ImportResult/index.html deleted file mode 100644 index c516a5155..000000000 --- a/docs/jsdoc/classes/ImportResult/index.html +++ /dev/null @@ -1,92 +0,0 @@ -Class: ImportResult | AD4M Docs
    API Reference
    classes
    Importresult

    @coasys/ad4m / Exports / ImportResult

    -

    Class: ImportResult

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ImportResult()

    -

    Properties

    -

    defaultModels

    -

    defaultModels: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:180 (opens in a new tab)

    -
    -

    expressions

    -

    expressions: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:168 (opens in a new tab)

    -
    -

    friends

    -

    friends: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:186 (opens in a new tab)

    -
    -

    knownLinkLanguages

    -

    knownLinkLanguages: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:192 (opens in a new tab)

    -
    -

    links

    -

    links: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:165 (opens in a new tab)

    -
    -

    models

    -

    models: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:177 (opens in a new tab)

    -
    -

    notifications

    -

    notifications: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:174 (opens in a new tab)

    -
    -

    perspectiveDiffs

    -

    perspectiveDiffs: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:171 (opens in a new tab)

    -
    -

    perspectives

    -

    perspectives: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:162 (opens in a new tab)

    -
    -

    tasks

    -

    tasks: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:183 (opens in a new tab)

    -
    -

    trustedAgents

    -

    trustedAgents: ImportStats

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:189 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ImportStats.html b/docs/jsdoc/classes/ImportStats.html new file mode 100644 index 000000000..3d7c2abbc --- /dev/null +++ b/docs/jsdoc/classes/ImportStats.html @@ -0,0 +1,56 @@ +Class: ImportStats | AD4M Docs
    API Reference
    classes
    Importstats

    @coasys/ad4m / Exports / ImportStats

    +

    Class: ImportStats

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ImportStats()

    +

    Properties

    +

    errors

    +

    errors: string[]

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:157 (opens in a new tab)

    +
    +

    failed

    +

    failed: number

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:151 (opens in a new tab)

    +
    +

    imported

    +

    imported: number

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:148 (opens in a new tab)

    +
    +

    omitted

    +

    omitted: number

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:154 (opens in a new tab)

    +
    +

    total

    +

    total: number

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:145 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ImportStats/index.html b/docs/jsdoc/classes/ImportStats/index.html deleted file mode 100644 index a6a01794c..000000000 --- a/docs/jsdoc/classes/ImportStats/index.html +++ /dev/null @@ -1,56 +0,0 @@ -Class: ImportStats | AD4M Docs
    API Reference
    classes
    Importstats

    @coasys/ad4m / Exports / ImportStats

    -

    Class: ImportStats

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ImportStats()

    -

    Properties

    -

    errors

    -

    errors: string[]

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:156 (opens in a new tab)

    -
    -

    failed

    -

    failed: number

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:150 (opens in a new tab)

    -
    -

    imported

    -

    imported: number

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:147 (opens in a new tab)

    -
    -

    omitted

    -

    omitted: number

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:153 (opens in a new tab)

    -
    -

    total

    -

    total: number

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:144 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionCall.html b/docs/jsdoc/classes/InteractionCall.html new file mode 100644 index 000000000..0cc3878df --- /dev/null +++ b/docs/jsdoc/classes/InteractionCall.html @@ -0,0 +1,70 @@ +Class: InteractionCall | AD4M Docs
    API Reference
    classes
    Interactioncall

    @coasys/ad4m / Exports / InteractionCall

    +

    Class: InteractionCall

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Constructors

    +

    constructor

    +

    new InteractionCall(name, parameters)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    namestring
    parametersobject
    +

    Defined in

    +

    language/Language.ts:256 (opens in a new tab)

    +

    Properties

    +

    name

    +

    name: string

    +

    Defined in

    +

    language/Language.ts:248 (opens in a new tab)

    +
    +

    parametersStringified

    +

    parametersStringified: string

    +

    Defined in

    +

    language/Language.ts:250 (opens in a new tab)

    +

    Accessors

    +

    parameters

    +

    get parameters(): object

    +

    Returns

    +

    object

    +

    Defined in

    +

    language/Language.ts:252 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionCall/index.html b/docs/jsdoc/classes/InteractionCall/index.html deleted file mode 100644 index 53773530c..000000000 --- a/docs/jsdoc/classes/InteractionCall/index.html +++ /dev/null @@ -1,70 +0,0 @@ -Class: InteractionCall | AD4M Docs
    API Reference
    classes
    Interactioncall

    @coasys/ad4m / Exports / InteractionCall

    -

    Class: InteractionCall

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Accessors

    - -

    Constructors

    -

    constructor

    -

    new InteractionCall(name, parameters)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    namestring
    parametersobject
    -

    Defined in

    -

    language/Language.ts:244 (opens in a new tab)

    -

    Properties

    -

    name

    -

    name: string

    -

    Defined in

    -

    language/Language.ts:236 (opens in a new tab)

    -
    -

    parametersStringified

    -

    parametersStringified: string

    -

    Defined in

    -

    language/Language.ts:238 (opens in a new tab)

    -

    Accessors

    -

    parameters

    -

    get parameters(): object

    -

    Returns

    -

    object

    -

    Defined in

    -

    language/Language.ts:240 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionMeta.html b/docs/jsdoc/classes/InteractionMeta.html new file mode 100644 index 000000000..f16048c25 --- /dev/null +++ b/docs/jsdoc/classes/InteractionMeta.html @@ -0,0 +1,44 @@ +Class: InteractionMeta | AD4M Docs
    API Reference
    classes
    Interactionmeta

    @coasys/ad4m / Exports / InteractionMeta

    +

    Class: InteractionMeta

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new InteractionMeta()

    +

    Properties

    +

    label

    +

    label: string

    +

    Defined in

    +

    language/Language.ts:230 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/Language.ts:233 (opens in a new tab)

    +
    +

    parameters

    +

    parameters: InteractionParameter[]

    +

    Defined in

    +

    language/Language.ts:236 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionMeta/index.html b/docs/jsdoc/classes/InteractionMeta/index.html deleted file mode 100644 index 7ee775d98..000000000 --- a/docs/jsdoc/classes/InteractionMeta/index.html +++ /dev/null @@ -1,44 +0,0 @@ -Class: InteractionMeta | AD4M Docs
    API Reference
    classes
    Interactionmeta

    @coasys/ad4m / Exports / InteractionMeta

    -

    Class: InteractionMeta

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new InteractionMeta()

    -

    Properties

    -

    label

    -

    label: string

    -

    Defined in

    -

    language/Language.ts:218 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/Language.ts:221 (opens in a new tab)

    -
    -

    parameters

    -

    parameters: InteractionParameter[]

    -

    Defined in

    -

    language/Language.ts:224 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionParameter.html b/docs/jsdoc/classes/InteractionParameter.html new file mode 100644 index 000000000..c8314e32b --- /dev/null +++ b/docs/jsdoc/classes/InteractionParameter.html @@ -0,0 +1,38 @@ +Class: InteractionParameter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/InteractionParameter/index.html b/docs/jsdoc/classes/InteractionParameter/index.html deleted file mode 100644 index 75f357c27..000000000 --- a/docs/jsdoc/classes/InteractionParameter/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: InteractionParameter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageExpression.html b/docs/jsdoc/classes/LanguageExpression.html new file mode 100644 index 000000000..6c8ac1726 --- /dev/null +++ b/docs/jsdoc/classes/LanguageExpression.html @@ -0,0 +1,32 @@ +Class: LanguageExpression | AD4M Docs
    API Reference
    classes
    Languageexpression

    @coasys/ad4m / Exports / LanguageExpression

    +

    Class: LanguageExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      LanguageExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new LanguageExpression()

    +

    Inherited from

    +

    ExpressionGeneric(LanguageMetaInternal).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageExpression/index.html b/docs/jsdoc/classes/LanguageExpression/index.html deleted file mode 100644 index 3285fd1ea..000000000 --- a/docs/jsdoc/classes/LanguageExpression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: LanguageExpression | AD4M Docs
    API Reference
    classes
    Languageexpression

    @coasys/ad4m / Exports / LanguageExpression

    -

    Class: LanguageExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      LanguageExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new LanguageExpression()

    -

    Inherited from

    -

    ExpressionGeneric(LanguageMetaInternal).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageHandle.html b/docs/jsdoc/classes/LanguageHandle.html new file mode 100644 index 000000000..0228f06ba --- /dev/null +++ b/docs/jsdoc/classes/LanguageHandle.html @@ -0,0 +1,62 @@ +Class: LanguageHandle | AD4M Docs
    API Reference
    classes
    Languagehandle

    @coasys/ad4m / Exports / LanguageHandle

    +

    Class: LanguageHandle

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LanguageHandle()

    +

    Properties

    +

    address

    +

    address: string

    +

    Defined in

    +

    language/LanguageHandle.ts:10 (opens in a new tab)

    +
    +

    constructorIcon

    +

    Optional constructorIcon: Icon

    +

    Defined in

    +

    language/LanguageHandle.ts:19 (opens in a new tab)

    +
    +

    icon

    +

    Optional icon: Icon

    +

    Defined in

    +

    language/LanguageHandle.ts:16 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/LanguageHandle.ts:7 (opens in a new tab)

    +
    +

    settings

    +

    Optional settings: string

    +

    Defined in

    +

    language/LanguageHandle.ts:13 (opens in a new tab)

    +
    +

    settingsIcon

    +

    Optional settingsIcon: Icon

    +

    Defined in

    +

    language/LanguageHandle.ts:22 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageHandle/index.html b/docs/jsdoc/classes/LanguageHandle/index.html deleted file mode 100644 index 4cfa60c1b..000000000 --- a/docs/jsdoc/classes/LanguageHandle/index.html +++ /dev/null @@ -1,62 +0,0 @@ -Class: LanguageHandle | AD4M Docs
    API Reference
    classes
    Languagehandle

    @coasys/ad4m / Exports / LanguageHandle

    -

    Class: LanguageHandle

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LanguageHandle()

    -

    Properties

    -

    address

    -

    address: string

    -

    Defined in

    -

    language/LanguageHandle.ts:10 (opens in a new tab)

    -
    -

    constructorIcon

    -

    Optional constructorIcon: Icon

    -

    Defined in

    -

    language/LanguageHandle.ts:19 (opens in a new tab)

    -
    -

    icon

    -

    Optional icon: Icon

    -

    Defined in

    -

    language/LanguageHandle.ts:16 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/LanguageHandle.ts:7 (opens in a new tab)

    -
    -

    settings

    -

    Optional settings: string

    -

    Defined in

    -

    language/LanguageHandle.ts:13 (opens in a new tab)

    -
    -

    settingsIcon

    -

    Optional settingsIcon: Icon

    -

    Defined in

    -

    language/LanguageHandle.ts:22 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageLanguageInput.html b/docs/jsdoc/classes/LanguageLanguageInput.html new file mode 100644 index 000000000..6cc0dc457 --- /dev/null +++ b/docs/jsdoc/classes/LanguageLanguageInput.html @@ -0,0 +1,38 @@ +Class: LanguageLanguageInput | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageLanguageInput/index.html b/docs/jsdoc/classes/LanguageLanguageInput/index.html deleted file mode 100644 index 5064f72f1..000000000 --- a/docs/jsdoc/classes/LanguageLanguageInput/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: LanguageLanguageInput | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMeta.html b/docs/jsdoc/classes/LanguageMeta.html new file mode 100644 index 000000000..d3e983ebd --- /dev/null +++ b/docs/jsdoc/classes/LanguageMeta.html @@ -0,0 +1,80 @@ +Class: LanguageMeta | AD4M Docs
    API Reference
    classes
    Languagemeta

    @coasys/ad4m / Exports / LanguageMeta

    +

    Class: LanguageMeta

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LanguageMeta()

    +

    Properties

    +

    address

    +

    address: string

    +

    Defined in

    +

    language/LanguageMeta.ts:10 (opens in a new tab)

    +
    +

    author

    +

    author: string

    +

    Defined in

    +

    language/LanguageMeta.ts:16 (opens in a new tab)

    +
    +

    description

    +

    description: string

    +

    Defined in

    +

    language/LanguageMeta.ts:13 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/LanguageMeta.ts:7 (opens in a new tab)

    +
    +

    possibleTemplateParams

    +

    Optional possibleTemplateParams: string[]

    +

    Defined in

    +

    language/LanguageMeta.ts:28 (opens in a new tab)

    +
    +

    sourceCodeLink

    +

    Optional sourceCodeLink: string

    +

    Defined in

    +

    language/LanguageMeta.ts:31 (opens in a new tab)

    +
    +

    templateAppliedParams

    +

    Optional templateAppliedParams: string

    +

    Defined in

    +

    language/LanguageMeta.ts:25 (opens in a new tab)

    +
    +

    templateSourceLanguageAddress

    +

    Optional templateSourceLanguageAddress: string

    +

    Defined in

    +

    language/LanguageMeta.ts:22 (opens in a new tab)

    +
    +

    templated

    +

    templated: boolean

    +

    Defined in

    +

    language/LanguageMeta.ts:19 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMeta/index.html b/docs/jsdoc/classes/LanguageMeta/index.html deleted file mode 100644 index 629cdca88..000000000 --- a/docs/jsdoc/classes/LanguageMeta/index.html +++ /dev/null @@ -1,80 +0,0 @@ -Class: LanguageMeta | AD4M Docs
    API Reference
    classes
    Languagemeta

    @coasys/ad4m / Exports / LanguageMeta

    -

    Class: LanguageMeta

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LanguageMeta()

    -

    Properties

    -

    address

    -

    address: string

    -

    Defined in

    -

    language/LanguageMeta.ts:10 (opens in a new tab)

    -
    -

    author

    -

    author: string

    -

    Defined in

    -

    language/LanguageMeta.ts:16 (opens in a new tab)

    -
    -

    description

    -

    description: string

    -

    Defined in

    -

    language/LanguageMeta.ts:13 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/LanguageMeta.ts:7 (opens in a new tab)

    -
    -

    possibleTemplateParams

    -

    Optional possibleTemplateParams: string[]

    -

    Defined in

    -

    language/LanguageMeta.ts:28 (opens in a new tab)

    -
    -

    sourceCodeLink

    -

    Optional sourceCodeLink: string

    -

    Defined in

    -

    language/LanguageMeta.ts:31 (opens in a new tab)

    -
    -

    templateAppliedParams

    -

    Optional templateAppliedParams: string

    -

    Defined in

    -

    language/LanguageMeta.ts:25 (opens in a new tab)

    -
    -

    templateSourceLanguageAddress

    -

    Optional templateSourceLanguageAddress: string

    -

    Defined in

    -

    language/LanguageMeta.ts:22 (opens in a new tab)

    -
    -

    templated

    -

    templated: boolean

    -

    Defined in

    -

    language/LanguageMeta.ts:19 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMetaInput.html b/docs/jsdoc/classes/LanguageMetaInput.html new file mode 100644 index 000000000..f7d992adc --- /dev/null +++ b/docs/jsdoc/classes/LanguageMetaInput.html @@ -0,0 +1,71 @@ +Class: LanguageMetaInput | AD4M Docs
    API Reference
    classes
    Languagemetainput

    @coasys/ad4m / Exports / LanguageMetaInput

    +

    Class: LanguageMetaInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LanguageMetaInput(name?, description?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    name?string
    description?string
    +

    Defined in

    +

    language/LanguageMeta.ts:48 (opens in a new tab)

    +

    Properties

    +

    description

    +

    description: string

    +

    Defined in

    +

    language/LanguageMeta.ts:40 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/LanguageMeta.ts:37 (opens in a new tab)

    +
    +

    possibleTemplateParams

    +

    Optional possibleTemplateParams: string[]

    +

    Defined in

    +

    language/LanguageMeta.ts:43 (opens in a new tab)

    +
    +

    sourceCodeLink

    +

    Optional sourceCodeLink: string

    +

    Defined in

    +

    language/LanguageMeta.ts:46 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMetaInput/index.html b/docs/jsdoc/classes/LanguageMetaInput/index.html deleted file mode 100644 index 5c52a81c3..000000000 --- a/docs/jsdoc/classes/LanguageMetaInput/index.html +++ /dev/null @@ -1,71 +0,0 @@ -Class: LanguageMetaInput | AD4M Docs
    API Reference
    classes
    Languagemetainput

    @coasys/ad4m / Exports / LanguageMetaInput

    -

    Class: LanguageMetaInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LanguageMetaInput(name?, description?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    name?string
    description?string
    -

    Defined in

    -

    language/LanguageMeta.ts:48 (opens in a new tab)

    -

    Properties

    -

    description

    -

    description: string

    -

    Defined in

    -

    language/LanguageMeta.ts:40 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/LanguageMeta.ts:37 (opens in a new tab)

    -
    -

    possibleTemplateParams

    -

    Optional possibleTemplateParams: string[]

    -

    Defined in

    -

    language/LanguageMeta.ts:43 (opens in a new tab)

    -
    -

    sourceCodeLink

    -

    Optional sourceCodeLink: string

    -

    Defined in

    -

    language/LanguageMeta.ts:46 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMetaInternal.html b/docs/jsdoc/classes/LanguageMetaInternal.html new file mode 100644 index 000000000..a9b1f3a36 --- /dev/null +++ b/docs/jsdoc/classes/LanguageMetaInternal.html @@ -0,0 +1,68 @@ +Class: LanguageMetaInternal | AD4M Docs
    API Reference
    classes
    Languagemetainternal

    @coasys/ad4m / Exports / LanguageMetaInternal

    +

    Class: LanguageMetaInternal

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LanguageMetaInternal()

    +

    Properties

    +

    address

    +

    address: string

    +

    Defined in

    +

    language/LanguageMeta.ts:57 (opens in a new tab)

    +
    +

    description

    +

    description: string

    +

    Defined in

    +

    language/LanguageMeta.ts:58 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/LanguageMeta.ts:56 (opens in a new tab)

    +
    +

    possibleTemplateParams

    +

    Optional possibleTemplateParams: string[]

    +

    Defined in

    +

    language/LanguageMeta.ts:61 (opens in a new tab)

    +
    +

    sourceCodeLink

    +

    Optional sourceCodeLink: string

    +

    Defined in

    +

    language/LanguageMeta.ts:62 (opens in a new tab)

    +
    +

    templateAppliedParams

    +

    Optional templateAppliedParams: string

    +

    Defined in

    +

    language/LanguageMeta.ts:60 (opens in a new tab)

    +
    +

    templateSourceLanguageAddress

    +

    Optional templateSourceLanguageAddress: string

    +

    Defined in

    +

    language/LanguageMeta.ts:59 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageMetaInternal/index.html b/docs/jsdoc/classes/LanguageMetaInternal/index.html deleted file mode 100644 index 6f69e8f84..000000000 --- a/docs/jsdoc/classes/LanguageMetaInternal/index.html +++ /dev/null @@ -1,68 +0,0 @@ -Class: LanguageMetaInternal | AD4M Docs
    API Reference
    classes
    Languagemetainternal

    @coasys/ad4m / Exports / LanguageMetaInternal

    -

    Class: LanguageMetaInternal

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LanguageMetaInternal()

    -

    Properties

    -

    address

    -

    address: string

    -

    Defined in

    -

    language/LanguageMeta.ts:57 (opens in a new tab)

    -
    -

    description

    -

    description: string

    -

    Defined in

    -

    language/LanguageMeta.ts:58 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/LanguageMeta.ts:56 (opens in a new tab)

    -
    -

    possibleTemplateParams

    -

    Optional possibleTemplateParams: string[]

    -

    Defined in

    -

    language/LanguageMeta.ts:61 (opens in a new tab)

    -
    -

    sourceCodeLink

    -

    Optional sourceCodeLink: string

    -

    Defined in

    -

    language/LanguageMeta.ts:62 (opens in a new tab)

    -
    -

    templateAppliedParams

    -

    Optional templateAppliedParams: string

    -

    Defined in

    -

    language/LanguageMeta.ts:60 (opens in a new tab)

    -
    -

    templateSourceLanguageAddress

    -

    Optional templateSourceLanguageAddress: string

    -

    Defined in

    -

    language/LanguageMeta.ts:59 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageRef.html b/docs/jsdoc/classes/LanguageRef.html new file mode 100644 index 000000000..a40d59663 --- /dev/null +++ b/docs/jsdoc/classes/LanguageRef.html @@ -0,0 +1,59 @@ +Class: LanguageRef | AD4M Docs
    API Reference
    classes
    Languageref

    @coasys/ad4m / Exports / LanguageRef

    +

    Class: LanguageRef

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LanguageRef(address?, name?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    address?string
    name?string
    +

    Defined in

    +

    language/LanguageRef.ts:14 (opens in a new tab)

    +

    Properties

    +

    address

    +

    address: string

    +

    Defined in

    +

    language/LanguageRef.ts:9 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Defined in

    +

    language/LanguageRef.ts:12 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LanguageRef/index.html b/docs/jsdoc/classes/LanguageRef/index.html deleted file mode 100644 index 8c71c93e0..000000000 --- a/docs/jsdoc/classes/LanguageRef/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: LanguageRef | AD4M Docs
    API Reference
    classes
    Languageref

    @coasys/ad4m / Exports / LanguageRef

    -

    Class: LanguageRef

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LanguageRef(address?, name?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    address?string
    name?string
    -

    Defined in

    -

    language/LanguageRef.ts:14 (opens in a new tab)

    -

    Properties

    -

    address

    -

    address: string

    -

    Defined in

    -

    language/LanguageRef.ts:9 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    Defined in

    -

    language/LanguageRef.ts:12 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Link.html b/docs/jsdoc/classes/Link.html new file mode 100644 index 000000000..89436ef7b --- /dev/null +++ b/docs/jsdoc/classes/Link.html @@ -0,0 +1,61 @@ +Class: Link | AD4M Docs
    API Reference
    classes
    Link

    @coasys/ad4m / Exports / Link

    +

    Class: Link

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Link(obj)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    objany
    +

    Defined in

    +

    links/Links.ts:16 (opens in a new tab)

    +

    Properties

    +

    predicate

    +

    Optional predicate: string

    +

    Defined in

    +

    links/Links.ts:14 (opens in a new tab)

    +
    +

    source

    +

    source: string

    +

    Defined in

    +

    links/Links.ts:8 (opens in a new tab)

    +
    +

    target

    +

    target: string

    +

    Defined in

    +

    links/Links.ts:11 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Link/index.html b/docs/jsdoc/classes/Link/index.html deleted file mode 100644 index 5642bdc18..000000000 --- a/docs/jsdoc/classes/Link/index.html +++ /dev/null @@ -1,61 +0,0 @@ -Class: Link | AD4M Docs
    API Reference
    classes
    Link

    @coasys/ad4m / Exports / Link

    -

    Class: Link

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Link(obj)

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    objany
    -

    Defined in

    -

    links/Links.ts:16 (opens in a new tab)

    -

    Properties

    -

    predicate

    -

    Optional predicate: string

    -

    Defined in

    -

    links/Links.ts:14 (opens in a new tab)

    -
    -

    source

    -

    source: string

    -

    Defined in

    -

    links/Links.ts:8 (opens in a new tab)

    -
    -

    target

    -

    target: string

    -

    Defined in

    -

    links/Links.ts:11 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpression.html b/docs/jsdoc/classes/LinkExpression.html new file mode 100644 index 000000000..a7c881a0a --- /dev/null +++ b/docs/jsdoc/classes/LinkExpression.html @@ -0,0 +1,52 @@ +Class: LinkExpression | AD4M Docs
    API Reference
    classes
    Linkexpression

    @coasys/ad4m / Exports / LinkExpression

    +

    Class: LinkExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      LinkExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new LinkExpression()

    +

    Inherited from

    +

    ExpressionGeneric(Link).constructor

    +

    Properties

    +

    status

    +

    Optional status: LinkStatus

    +

    Defined in

    +

    links/Links.ts:72 (opens in a new tab)

    +

    Methods

    +

    hash

    +

    hash(): number

    +

    Returns

    +

    number

    +

    Defined in

    +

    links/Links.ts:59 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpression/index.html b/docs/jsdoc/classes/LinkExpression/index.html deleted file mode 100644 index 4035224c3..000000000 --- a/docs/jsdoc/classes/LinkExpression/index.html +++ /dev/null @@ -1,52 +0,0 @@ -Class: LinkExpression | AD4M Docs
    API Reference
    classes
    Linkexpression

    @coasys/ad4m / Exports / LinkExpression

    -

    Class: LinkExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      LinkExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new LinkExpression()

    -

    Inherited from

    -

    ExpressionGeneric(Link).constructor

    -

    Properties

    -

    status

    -

    Optional status: LinkStatus

    -

    Defined in

    -

    links/Links.ts:72 (opens in a new tab)

    -

    Methods

    -

    hash

    -

    hash(): number

    -

    Returns

    -

    number

    -

    Defined in

    -

    links/Links.ts:59 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionInput.html b/docs/jsdoc/classes/LinkExpressionInput.html new file mode 100644 index 000000000..d9a25c675 --- /dev/null +++ b/docs/jsdoc/classes/LinkExpressionInput.html @@ -0,0 +1,51 @@ +Class: LinkExpressionInput | AD4M Docs
    API Reference
    classes
    Linkexpressioninput

    @coasys/ad4m / Exports / LinkExpressionInput

    +

    Class: LinkExpressionInput

    +

    Hierarchy

    +
      +
    • +

      any

      +

      LinkExpressionInput

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LinkExpressionInput()

    +

    Inherited from

    +

    ExpressionGenericInput(LinkInput).constructor

    +

    Properties

    +

    hash

    +

    hash: () => number

    +

    Type declaration

    +

    ▸ (): number

    +
    Returns
    +

    number

    +

    Defined in

    +

    links/Links.ts:77 (opens in a new tab)

    +
    +

    status

    +

    Optional status: LinkStatus

    +

    Defined in

    +

    links/Links.ts:80 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionInput/index.html b/docs/jsdoc/classes/LinkExpressionInput/index.html deleted file mode 100644 index d64958419..000000000 --- a/docs/jsdoc/classes/LinkExpressionInput/index.html +++ /dev/null @@ -1,51 +0,0 @@ -Class: LinkExpressionInput | AD4M Docs
    API Reference
    classes
    Linkexpressioninput

    @coasys/ad4m / Exports / LinkExpressionInput

    -

    Class: LinkExpressionInput

    -

    Hierarchy

    -
      -
    • -

      any

      -

      LinkExpressionInput

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LinkExpressionInput()

    -

    Inherited from

    -

    ExpressionGenericInput(LinkInput).constructor

    -

    Properties

    -

    hash

    -

    hash: () => number

    -

    Type declaration

    -

    ▸ (): number

    -
    Returns
    -

    number

    -

    Defined in

    -

    links/Links.ts:77 (opens in a new tab)

    -
    -

    status

    -

    Optional status: LinkStatus

    -

    Defined in

    -

    links/Links.ts:80 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionMutations.html b/docs/jsdoc/classes/LinkExpressionMutations.html new file mode 100644 index 000000000..b55ddd361 --- /dev/null +++ b/docs/jsdoc/classes/LinkExpressionMutations.html @@ -0,0 +1,59 @@ +Class: LinkExpressionMutations | AD4M Docs
    API Reference
    classes
    Linkexpressionmutations

    @coasys/ad4m / Exports / LinkExpressionMutations

    +

    Class: LinkExpressionMutations

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LinkExpressionMutations(additions, removals)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    additionsLinkExpression[]
    removalsLinkExpression[]
    +

    Defined in

    +

    links/Links.ts:39 (opens in a new tab)

    +

    Properties

    +

    additions

    +

    additions: LinkExpression[]

    +

    Defined in

    +

    links/Links.ts:34 (opens in a new tab)

    +
    +

    removals

    +

    removals: LinkExpression[]

    +

    Defined in

    +

    links/Links.ts:37 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionMutations/index.html b/docs/jsdoc/classes/LinkExpressionMutations/index.html deleted file mode 100644 index fd64a1a70..000000000 --- a/docs/jsdoc/classes/LinkExpressionMutations/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: LinkExpressionMutations | AD4M Docs
    API Reference
    classes
    Linkexpressionmutations

    @coasys/ad4m / Exports / LinkExpressionMutations

    -

    Class: LinkExpressionMutations

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LinkExpressionMutations(additions, removals)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    additionsLinkExpression[]
    removalsLinkExpression[]
    -

    Defined in

    -

    links/Links.ts:39 (opens in a new tab)

    -

    Properties

    -

    additions

    -

    additions: LinkExpression[]

    -

    Defined in

    -

    links/Links.ts:34 (opens in a new tab)

    -
    -

    removals

    -

    removals: LinkExpression[]

    -

    Defined in

    -

    links/Links.ts:37 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionUpdated.html b/docs/jsdoc/classes/LinkExpressionUpdated.html new file mode 100644 index 000000000..bef44002a --- /dev/null +++ b/docs/jsdoc/classes/LinkExpressionUpdated.html @@ -0,0 +1,59 @@ +Class: LinkExpressionUpdated | AD4M Docs
    API Reference
    classes
    Linkexpressionupdated

    @coasys/ad4m / Exports / LinkExpressionUpdated

    +

    Class: LinkExpressionUpdated

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LinkExpressionUpdated(oldLink, newLink)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    oldLinkLinkExpression
    newLinkLinkExpression
    +

    Defined in

    +

    links/Links.ts:103 (opens in a new tab)

    +

    Properties

    +

    newLink

    +

    newLink: LinkExpression

    +

    Defined in

    +

    links/Links.ts:101 (opens in a new tab)

    +
    +

    oldLink

    +

    oldLink: LinkExpression

    +

    Defined in

    +

    links/Links.ts:98 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkExpressionUpdated/index.html b/docs/jsdoc/classes/LinkExpressionUpdated/index.html deleted file mode 100644 index 57fb35458..000000000 --- a/docs/jsdoc/classes/LinkExpressionUpdated/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: LinkExpressionUpdated | AD4M Docs
    API Reference
    classes
    Linkexpressionupdated

    @coasys/ad4m / Exports / LinkExpressionUpdated

    -

    Class: LinkExpressionUpdated

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LinkExpressionUpdated(oldLink, newLink)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    oldLinkLinkExpression
    newLinkLinkExpression
    -

    Defined in

    -

    links/Links.ts:103 (opens in a new tab)

    -

    Properties

    -

    newLink

    -

    newLink: LinkExpression

    -

    Defined in

    -

    links/Links.ts:101 (opens in a new tab)

    -
    -

    oldLink

    -

    oldLink: LinkExpression

    -

    Defined in

    -

    links/Links.ts:98 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkInput.html b/docs/jsdoc/classes/LinkInput.html new file mode 100644 index 000000000..4d8bc9026 --- /dev/null +++ b/docs/jsdoc/classes/LinkInput.html @@ -0,0 +1,44 @@ +Class: LinkInput | AD4M Docs
    API Reference
    classes
    Linkinput

    @coasys/ad4m / Exports / LinkInput

    +

    Class: LinkInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new LinkInput()

    +

    Properties

    +

    predicate

    +

    Optional predicate: string

    +

    Defined in

    +

    links/Links.ts:54 (opens in a new tab)

    +
    +

    source

    +

    source: string

    +

    Defined in

    +

    links/Links.ts:48 (opens in a new tab)

    +
    +

    target

    +

    target: string

    +

    Defined in

    +

    links/Links.ts:51 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkInput/index.html b/docs/jsdoc/classes/LinkInput/index.html deleted file mode 100644 index c4bf51735..000000000 --- a/docs/jsdoc/classes/LinkInput/index.html +++ /dev/null @@ -1,44 +0,0 @@ -Class: LinkInput | AD4M Docs
    API Reference
    classes
    Linkinput

    @coasys/ad4m / Exports / LinkInput

    -

    Class: LinkInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new LinkInput()

    -

    Properties

    -

    predicate

    -

    Optional predicate: string

    -

    Defined in

    -

    links/Links.ts:54 (opens in a new tab)

    -
    -

    source

    -

    source: string

    -

    Defined in

    -

    links/Links.ts:48 (opens in a new tab)

    -
    -

    target

    -

    target: string

    -

    Defined in

    -

    links/Links.ts:51 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkMutations.html b/docs/jsdoc/classes/LinkMutations.html new file mode 100644 index 000000000..fb2e6c5aa --- /dev/null +++ b/docs/jsdoc/classes/LinkMutations.html @@ -0,0 +1,38 @@ +Class: LinkMutations | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkMutations/index.html b/docs/jsdoc/classes/LinkMutations/index.html deleted file mode 100644 index 2fb04db1c..000000000 --- a/docs/jsdoc/classes/LinkMutations/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: LinkMutations | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkQuery.html b/docs/jsdoc/classes/LinkQuery.html new file mode 100644 index 000000000..3b168516a --- /dev/null +++ b/docs/jsdoc/classes/LinkQuery.html @@ -0,0 +1,105 @@ +Class: LinkQuery | AD4M Docs
    API Reference
    classes
    Linkquery

    @coasys/ad4m / Exports / LinkQuery

    +

    Class: LinkQuery

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new LinkQuery(obj)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    objobject
    +

    Defined in

    +

    perspectives/LinkQuery.ts:25 (opens in a new tab)

    +

    Properties

    +

    fromDate

    +

    Optional fromDate: Date

    +

    Defined in

    +

    perspectives/LinkQuery.ts:17 (opens in a new tab)

    +
    +

    limit

    +

    Optional limit: number

    +

    Defined in

    +

    perspectives/LinkQuery.ts:23 (opens in a new tab)

    +
    +

    predicate

    +

    Optional predicate: string

    +

    Defined in

    +

    perspectives/LinkQuery.ts:14 (opens in a new tab)

    +
    +

    source

    +

    Optional source: string

    +

    Defined in

    +

    perspectives/LinkQuery.ts:8 (opens in a new tab)

    +
    +

    target

    +

    Optional target: string

    +

    Defined in

    +

    perspectives/LinkQuery.ts:11 (opens in a new tab)

    +
    +

    untilDate

    +

    Optional untilDate: Date

    +

    Defined in

    +

    perspectives/LinkQuery.ts:20 (opens in a new tab)

    +

    Methods

    +

    isMatch

    +

    isMatch(l): boolean

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    lLink
    +

    Returns

    +

    boolean

    +

    Defined in

    +

    perspectives/LinkQuery.ts:51 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/LinkQuery/index.html b/docs/jsdoc/classes/LinkQuery/index.html deleted file mode 100644 index 8c8225871..000000000 --- a/docs/jsdoc/classes/LinkQuery/index.html +++ /dev/null @@ -1,105 +0,0 @@ -Class: LinkQuery | AD4M Docs
    API Reference
    classes
    Linkquery

    @coasys/ad4m / Exports / LinkQuery

    -

    Class: LinkQuery

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new LinkQuery(obj)

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    objobject
    -

    Defined in

    -

    perspectives/LinkQuery.ts:25 (opens in a new tab)

    -

    Properties

    -

    fromDate

    -

    Optional fromDate: Date

    -

    Defined in

    -

    perspectives/LinkQuery.ts:17 (opens in a new tab)

    -
    -

    limit

    -

    Optional limit: number

    -

    Defined in

    -

    perspectives/LinkQuery.ts:23 (opens in a new tab)

    -
    -

    predicate

    -

    Optional predicate: string

    -

    Defined in

    -

    perspectives/LinkQuery.ts:14 (opens in a new tab)

    -
    -

    source

    -

    Optional source: string

    -

    Defined in

    -

    perspectives/LinkQuery.ts:8 (opens in a new tab)

    -
    -

    target

    -

    Optional target: string

    -

    Defined in

    -

    perspectives/LinkQuery.ts:11 (opens in a new tab)

    -
    -

    untilDate

    -

    Optional untilDate: Date

    -

    Defined in

    -

    perspectives/LinkQuery.ts:20 (opens in a new tab)

    -

    Methods

    -

    isMatch

    -

    isMatch(l): boolean

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    lLink
    -

    Returns

    -

    boolean

    -

    Defined in

    -

    perspectives/LinkQuery.ts:51 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Literal.html b/docs/jsdoc/classes/Literal.html new file mode 100644 index 000000000..58e82bb75 --- /dev/null +++ b/docs/jsdoc/classes/Literal.html @@ -0,0 +1,103 @@ +Class: Literal | AD4M Docs
    API Reference
    classes
    Literal

    @coasys/ad4m / Exports / Literal

    +

    Class: Literal

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new Literal()

    +

    Properties

    +

    #literal

    +

    Private Optional #literal: any

    +

    Defined in

    +

    Literal.ts:10 (opens in a new tab)

    +
    +

    #url

    +

    Private Optional #url: string

    +

    Defined in

    +

    Literal.ts:11 (opens in a new tab)

    +

    Methods

    +

    get

    +

    get(): any

    +

    Returns

    +

    any

    +

    Defined in

    +

    Literal.ts:52 (opens in a new tab)

    +
    +

    toUrl

    +

    toUrl(): string

    +

    Returns

    +

    string

    +

    Defined in

    +

    Literal.ts:27 (opens in a new tab)

    +
    +

    from

    +

    Static from(literal): Literal

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    literalany
    +

    Returns

    +

    Literal

    +

    Defined in

    +

    Literal.ts:21 (opens in a new tab)

    +
    +

    fromUrl

    +

    Static fromUrl(url): Literal

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    urlstring
    +

    Returns

    +

    Literal

    +

    Defined in

    +

    Literal.ts:13 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Literal/index.html b/docs/jsdoc/classes/Literal/index.html deleted file mode 100644 index d1f45b24f..000000000 --- a/docs/jsdoc/classes/Literal/index.html +++ /dev/null @@ -1,103 +0,0 @@ -Class: Literal | AD4M Docs
    API Reference
    classes
    Literal

    @coasys/ad4m / Exports / Literal

    -

    Class: Literal

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new Literal()

    -

    Properties

    -

    #literal

    -

    Private Optional #literal: any

    -

    Defined in

    -

    Literal.ts:10 (opens in a new tab)

    -
    -

    #url

    -

    Private Optional #url: string

    -

    Defined in

    -

    Literal.ts:11 (opens in a new tab)

    -

    Methods

    -

    get

    -

    get(): any

    -

    Returns

    -

    any

    -

    Defined in

    -

    Literal.ts:52 (opens in a new tab)

    -
    -

    toUrl

    -

    toUrl(): string

    -

    Returns

    -

    string

    -

    Defined in

    -

    Literal.ts:27 (opens in a new tab)

    -
    -

    from

    -

    Static from(literal): Literal

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    literalany
    -

    Returns

    -

    Literal

    -

    Defined in

    -

    Literal.ts:21 (opens in a new tab)

    -
    -

    fromUrl

    -

    Static fromUrl(url): Literal

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    urlstring
    -

    Returns

    -

    Literal

    -

    Defined in

    -

    Literal.ts:13 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ModelQueryBuilder/index.html b/docs/jsdoc/classes/ModelQueryBuilder.html similarity index 55% rename from docs/jsdoc/classes/ModelQueryBuilder/index.html rename to docs/jsdoc/classes/ModelQueryBuilder.html index 318667597..d53c666d7 100644 --- a/docs/jsdoc/classes/ModelQueryBuilder/index.html +++ b/docs/jsdoc/classes/ModelQueryBuilder.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    classes
    Modelquerybuilder

    @coasys/ad4m / Exports / ModelQueryBuilder

    +
    API Reference
    classes
    Modelquerybuilder

    @coasys/ad4m / Exports / ModelQueryBuilder

    Class: ModelQueryBuilder<T>

    Query builder for Ad4mModel queries. Allows building queries with a fluent interface and either running them once @@ -43,39 +43,40 @@

    NameTypeTextends Ad4mModel +
    NameType
    Textends Ad4mModel

    Table of contents

    Constructors

    Properties

    Methods

    Constructors

    constructor

    @@ -94,7 +95,7 @@

    NameTypeTextends Ad4mModel<T> +
    NameType
    Textends Ad4mModel<T>

    Parameters

    @@ -117,80 +118,52 @@

    NameTypeperspectivePerspectiveProxyctortypeof Ad4mModelquery?Query +
    NameType
    perspectivePerspectiveProxy
    ctortypeof Ad4mModel
    query?Query

    Defined in

    -

    model/Ad4mModel.ts:2503 (opens in a new tab)

    +

    model/Ad4mModel.ts:4009 (opens in a new tab)

    Properties

    ctor

    -

    Private ctor: typeof Ad4mModel

    +

    Private ctor: typeof Ad4mModel

    Defined in

    -

    model/Ad4mModel.ts:2499 (opens in a new tab)

    +

    model/Ad4mModel.ts:4005 (opens in a new tab)


    currentSubscription

    Private Optional currentSubscription: any

    Defined in

    -

    model/Ad4mModel.ts:2500 (opens in a new tab)

    +

    model/Ad4mModel.ts:4006 (opens in a new tab)


    modelClassName

    Private modelClassName: string = null

    Defined in

    -

    model/Ad4mModel.ts:2498 (opens in a new tab)

    +

    model/Ad4mModel.ts:4004 (opens in a new tab)


    perspective

    -

    Private perspective: PerspectiveProxy

    +

    Private perspective: PerspectiveProxy

    Defined in

    -

    model/Ad4mModel.ts:2496 (opens in a new tab)

    +

    model/Ad4mModel.ts:4002 (opens in a new tab)


    queryParams

    -

    Private queryParams: Query = {}

    +

    Private queryParams: Query = {}

    Defined in

    -

    model/Ad4mModel.ts:2497 (opens in a new tab)

    +

    model/Ad4mModel.ts:4003 (opens in a new tab)


    useSurrealDBFlag

    Private useSurrealDBFlag: boolean = true

    Defined in

    -

    model/Ad4mModel.ts:2501 (opens in a new tab)

    +

    model/Ad4mModel.ts:4007 (opens in a new tab)

    Methods

    -

    collections

    -

    collections(collections): ModelQueryBuilder<T>

    -

    Specifies which collections to include in the results.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    collectionsstring[]Array of collection names to include
    -

    Returns

    -

    ModelQueryBuilder<T>

    -

    The query builder for chaining

    -

    Example

    -
    .collections(["ingredients", "steps"])
    -

    Defined in

    -

    model/Ad4mModel.ts:2640 (opens in a new tab)

    -

    count

    count(): Promise<number>

    Gets the total count of matching entities.

    -

    Returns

    +

    Returns

    Promise<number>

    Total count

    Example

    const totalDesserts = await Recipe.query(perspective)
       .where({ category: "Dessert" })
       .count();
    -

    Defined in

    -

    model/Ad4mModel.ts:2794 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4396 (opens in a new tab)


    countSubscribe

    countSubscribe(callback): Promise<number>

    @@ -203,7 +176,7 @@

    Remember to call dispose() when you're done with the subscription to clean up resources.

    -

    Parameters

    +

    Parameters

    @@ -220,7 +193,7 @@

    NameTypeDescriptioncallback(count: number) => voidFunction to call with updated count -

    Returns

    +

    Returns

    Promise<number>

    Initial count

    Example

    @@ -236,8 +209,8 @@

    Remarks

    By default, this uses SurrealDB live queries for real-time updates. Prolog subscriptions remain available via .useSurrealDB(false).

    -

    Defined in

    -

    model/Ad4mModel.ts:2841 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4443 (opens in a new tab)


    dispose

    dispose(): void

    @@ -251,10 +224,24 @@

    You should call this method when you're done with a subscription to prevent memory leaks and ensure proper cleanup.

    -

    Returns

    +

    Returns

    void

    +

    Defined in

    +

    model/Ad4mModel.ts:4027 (opens in a new tab)

    +
    +

    first

    +

    first(): Promise<T>

    +

    Returns the first matching instance, or null if none match.

    +

    Internally sets limit: 1 and delegates to get().

    +

    Returns

    +

    Promise<T>

    +

    The first matching instance, or null

    +

    Example

    +
    const recipe = await Recipe.query(perspective)
    +  .where({ name: "Pasta" })
    +  .first();

    Defined in

    -

    model/Ad4mModel.ts:2521 (opens in a new tab)

    +

    model/Ad4mModel.ts:4300 (opens in a new tab)


    get

    get(): Promise<T[]>

    @@ -267,10 +254,51 @@

    .where({ category: "Dessert" }) .get();

    Defined in

    -

    model/Ad4mModel.ts:2692 (opens in a new tab)

    +

    model/Ad4mModel.ts:4271 (opens in a new tab)

    +
    +

    include

    +

    include(map): ModelQueryBuilder<T>

    +

    Specifies which relations to eager-load (hydrate into model instances).

    +

    Without include, relation fields contain raw expression URIs (strings). +With include, the URIs are resolved into fully-hydrated model instances +using the target class declared in the relation decorator.

    +

    Supports nested includes for multi-level eager loading.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    mapIncludeMapAn IncludeMap describing which relations to hydrate
    +

    Returns

    +

    ModelQueryBuilder<T>

    +

    The query builder for chaining

    +

    Example

    +
    // Hydrate comments one level deep
    +const recipes = await Recipe.query(perspective)
    +  .include({ comments: true })
    +  .run();
    +// recipe.comments is now Comment[] (model instances), not string[]
    + 
    +// Nested: hydrate comments AND each comment's author
    +const recipes = await Recipe.query(perspective)
    +  .include({ comments: { author: true } })
    +  .run();
    +

    Defined in

    +

    model/Ad4mModel.ts:4219 (opens in a new tab)


    limit

    -

    limit(limit): ModelQueryBuilder<T>

    +

    limit(limit): ModelQueryBuilder<T>

    Sets the maximum number of results to return.

    Parameters

    @@ -289,16 +317,16 @@

    NameTypeDescriptionlimitnumberMaximum number of results -

    Returns

    -

    ModelQueryBuilder<T>

    +

    Returns

    +

    ModelQueryBuilder<T>

    The query builder for chaining

    Example

    .limit(10)
    -

    Defined in

    -

    model/Ad4mModel.ts:2576 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4082 (opens in a new tab)


    offset

    -

    offset(offset): ModelQueryBuilder<T>

    +

    offset(offset): ModelQueryBuilder<T>

    Sets the number of results to skip.

    Parameters

    @@ -317,16 +345,16 @@

    NameTypeDescriptionoffsetnumberNumber of results to skip -

    Returns

    -

    ModelQueryBuilder<T>

    +

    Returns

    +

    ModelQueryBuilder<T>

    The query builder for chaining

    Example

    .offset(20) // Skip first 20 results
    -

    Defined in

    -

    model/Ad4mModel.ts:2592 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4098 (opens in a new tab)


    order

    -

    order(orderBy): ModelQueryBuilder<T>

    +

    order(orderBy): ModelQueryBuilder<T>

    Sets the order for the query results.

    Parameters

    @@ -345,16 +373,16 @@

    NameTypeDescriptionorderByOrderThe ordering criteria -

    Returns

    -

    ModelQueryBuilder<T>

    +

    Returns

    +

    ModelQueryBuilder<T>

    The query builder for chaining

    Example

    .order({ createdAt: "DESC" })
    -

    Defined in

    -

    model/Ad4mModel.ts:2560 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4066 (opens in a new tab)


    overrideModelClassName

    -

    overrideModelClassName(className): ModelQueryBuilder<T>

    +

    overrideModelClassName(className): ModelQueryBuilder<T>

    Parameters

    @@ -370,13 +398,13 @@

    NameTypeclassNamestring -

    Returns

    -

    ModelQueryBuilder<T>

    -

    Defined in

    -

    model/Ad4mModel.ts:2645 (opens in a new tab)

    +

    Returns

    +

    ModelQueryBuilder<T>

    +

    Defined in

    +

    model/Ad4mModel.ts:4224 (opens in a new tab)


    paginate

    -

    paginate(pageSize, pageNumber): Promise<PaginationResult<T>>

    +

    paginate(pageSize, pageNumber): Promise<PaginationResult<T>>

    Gets a page of results with pagination metadata.

    Parameters

    @@ -400,19 +428,19 @@

    NameTypeDescriptionpageSizenumberNumber of items per pagepageNumbernumberWhich page to retrieve (1-based) -

    Returns

    -

    Promise<PaginationResult<T>>

    +

    Returns

    +

    Promise<PaginationResult<T>>

    Paginated results with metadata

    Example

    const page = await Recipe.query(perspective)
       .where({ category: "Main" })
       .paginate(10, 1);
     console.log(`Page ${page.pageNumber}, ${page.results.length} of ${page.totalCount}`);
    -

    Defined in

    -

    model/Ad4mModel.ts:2890 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:4495 (opens in a new tab)


    paginateSubscribe

    -

    paginateSubscribe(pageSize, pageNumber, callback): Promise<PaginationResult<T>>

    +

    paginateSubscribe(pageSize, pageNumber, callback): Promise<PaginationResult<T>>

    Subscribes to paginated results updates.

    This method:

      @@ -448,9 +476,9 @@

      NameTypeDescriptionpageSizenumberNumber of items per pagepageNumbernumberWhich page to retrieve (1-based)callback(results: PaginationResult<T>) => voidFunction to call with updated pagination results -

      Returns

      -

      Promise<PaginationResult<T>>

      +
      NameTypeDescription
      pageSizenumberNumber of items per page
      pageNumbernumberWhich page to retrieve (1-based)
      callback(results: PaginationResult<T>) => voidFunction to call with updated pagination results
      +

      Returns

      +

      Promise<PaginationResult<T>>

      Initial pagination results

      Example

      const builder = Recipe.query(perspective)
      @@ -465,12 +493,26 @@ 

      Remarks

      By default, this uses SurrealDB live queries for real-time updates. Prolog subscriptions remain available via .useSurrealDB(false).

      -

      Defined in

      -

      model/Ad4mModel.ts:2938 (opens in a new tab)

      +

      Defined in

      +

      model/Ad4mModel.ts:4543 (opens in a new tab)


      -

      properties

      -

      properties(properties): ModelQueryBuilder<T>

      -

      Specifies which properties to include in the results.

      +

      parent

      +

      parent(idOrInstance, modelOrPredicate?, options?): ModelQueryBuilder<T>

      +

      Scopes the query to instances linked from a parent.

      +

      The predicate is resolved in order of precedence:

      +
        +
      1. Instance only — the parent's constructor is used as the model +class; its relation metadata is scanned for a relation whose +target() matches the queried model class.
      2. +
      3. Instance + options with field — direct field-name lookup on +the parent model's relation metadata (disambiguates when a parent +has multiple relations targeting the same child class).
      4. +
      5. String id + model class — same metadata scan (or field lookup if +options include field).
      6. +
      7. String id + string predicate — raw escape hatch, no metadata lookup.
      8. +
      +

      Passing a plain string id with no second argument throws because the +predicate cannot be resolved without a model class.

      Parameters

      @@ -487,18 +529,46 @@

      NameTypeDescriptionpropertiesstring[]Array of property names to include -

      Returns

      -

      ModelQueryBuilder<T>

      + + + + + + + + + + + + + + + +
      NameTypeDescription
      idOrInstancestring | Ad4mModelThe parent's expression URI or an Ad4mModel instance
      modelOrPredicate?string | typeof Ad4mModel | { field: string }A model class (predicate auto-resolved) or a raw predicate string
      options?ObjectOptional settings: field for direct relation-name lookup
      options.field?string-
      +

      Returns

      +

      ModelQueryBuilder<T>

      The query builder for chaining

      Example

      -
      .properties(["name", "description", "rating"])
      -

      Defined in

      -

      model/Ad4mModel.ts:2624 (opens in a new tab)

      +
      // Instance — predicate auto-resolved from Cookbook's @HasMany(() => Recipe)
      +Recipe.query(perspective).parent(cookbook).get();
      + 
      +// Instance + field — disambiguate when parent has multiple relations to same child
      +Recipe.query(perspective).parent(cookbook, { field: "recipes" }).get();
      + 
      +// String id + model class
      +Recipe.query(perspective).parent(cookbookId, Cookbook).get();
      + 
      +// String id + model class + field
      +Recipe.query(perspective).parent(cookbookId, Cookbook, { field: "recipes" }).get();
      + 
      +// String id + raw predicate (escape hatch)
      +Recipe.query(perspective).parent(cookbookId, "cookbook://recipe").get();
      +

      Defined in

      +

      model/Ad4mModel.ts:4143 (opens in a new tab)


      -

      source

      -

      source(source): ModelQueryBuilder<T>

      -

      Sets the source filter for the query.

      +

      properties

      +

      properties(properties): ModelQueryBuilder<T>

      +

      Specifies which properties to include in the results.

      Parameters

      @@ -515,14 +585,14 @@

      NameTypeDescriptionsourcestringThe source to filter by -

      Returns

      -

      ModelQueryBuilder<T>

      +
      NameTypeDescription
      propertiesstring[]Array of property names to include
      +

      Returns

      +

      ModelQueryBuilder<T>

      The query builder for chaining

      Example

      -
      .source("ad4m://self")
      -

      Defined in

      -

      model/Ad4mModel.ts:2608 (opens in a new tab)

      +
      .properties(["name", "description", "rating"])
      +

      Defined in

      +

      model/Ad4mModel.ts:4188 (opens in a new tab)


      subscribe

      subscribe(callback): Promise<T[]>

      @@ -552,7 +622,7 @@

      NameTypeDescriptioncallback(results: T[]) => voidFunction to call with updated results -

      Returns

      +

      Returns

      Promise<T[]>

      Initial results array

      Example

      @@ -568,11 +638,11 @@

      Remarks

      By default, this uses SurrealDB live queries for real-time updates. Prolog subscriptions remain available via .useSurrealDB(false).

      -

      Defined in

      -

      model/Ad4mModel.ts:2737 (opens in a new tab)

      +

      Defined in

      +

      model/Ad4mModel.ts:4337 (opens in a new tab)


      useSurrealDB

      -

      useSurrealDB(enabled?): ModelQueryBuilder<T>

      +

      useSurrealDB(enabled?): ModelQueryBuilder<T>

      Enables or disables SurrealDB query path.

      Parameters

      @@ -593,8 +663,8 @@

      NameTypeDefault valueDescriptionenabledbooleantrueWhether to use SurrealDB (default: true, 10-100x faster) or Prolog (legacy) -

      Returns

      -

      ModelQueryBuilder<T>

      +

      Returns

      +

      ModelQueryBuilder<T>

      The query builder for chaining

      Example

      // Use SurrealDB (default)
      @@ -611,11 +681,11 @@ 

      Remarks

      Note: Subscriptions (subscribe(), countSubscribe(), paginateSubscribe()) default to SurrealDB live queries if useSurrealDB(true) is set (default).

      -

      Defined in

      -

      model/Ad4mModel.ts:2675 (opens in a new tab)

      +

      Defined in

      +

      model/Ad4mModel.ts:4254 (opens in a new tab)


      where

      -

      where(conditions): ModelQueryBuilder<T>

      +

      where(conditions): ModelQueryBuilder<T>

      Adds where conditions to the query.

      Parameters

      @@ -633,9 +703,9 @@

      NameTypeDescriptionconditionsWhereThe conditions to filter by -

      Returns

      -

      ModelQueryBuilder<T>

      +
      NameTypeDescription
      conditionsWhereThe conditions to filter by
      +

      Returns

      +

      ModelQueryBuilder<T>

      The query builder for chaining

      Example

      .where({
      @@ -644,5 +714,5 @@ 

      tags: ["vegan", "quick"], published: true })

      -

      Defined in

      -

      model/Ad4mModel.ts:2544 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +

    Defined in

    +

    model/Ad4mModel.ts:4050 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Neighbourhood.html b/docs/jsdoc/classes/Neighbourhood.html new file mode 100644 index 000000000..3a6cd74dc --- /dev/null +++ b/docs/jsdoc/classes/Neighbourhood.html @@ -0,0 +1,59 @@ +Class: Neighbourhood | AD4M Docs
    API Reference
    classes
    Neighbourhood

    @coasys/ad4m / Exports / Neighbourhood

    +

    Class: Neighbourhood

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Neighbourhood(linkLanguage, meta)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    linkLanguagestring
    metaPerspective
    +

    Defined in

    +

    neighbourhood/Neighbourhood.ts:15 (opens in a new tab)

    +

    Properties

    +

    linkLanguage

    +

    linkLanguage: string

    +

    Defined in

    +

    neighbourhood/Neighbourhood.ts:10 (opens in a new tab)

    +
    +

    meta

    +

    meta: Perspective

    +

    Defined in

    +

    neighbourhood/Neighbourhood.ts:13 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Neighbourhood/index.html b/docs/jsdoc/classes/Neighbourhood/index.html deleted file mode 100644 index 01e52d8cd..000000000 --- a/docs/jsdoc/classes/Neighbourhood/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: Neighbourhood | AD4M Docs
    API Reference
    classes
    Neighbourhood

    @coasys/ad4m / Exports / Neighbourhood

    -

    Class: Neighbourhood

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Neighbourhood(linkLanguage, meta)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    linkLanguagestring
    metaPerspective
    -

    Defined in

    -

    neighbourhood/Neighbourhood.ts:15 (opens in a new tab)

    -

    Properties

    -

    linkLanguage

    -

    linkLanguage: string

    -

    Defined in

    -

    neighbourhood/Neighbourhood.ts:10 (opens in a new tab)

    -
    -

    meta

    -

    meta: Perspective

    -

    Defined in

    -

    neighbourhood/Neighbourhood.ts:13 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NeighbourhoodExpression.html b/docs/jsdoc/classes/NeighbourhoodExpression.html new file mode 100644 index 000000000..f2153e839 --- /dev/null +++ b/docs/jsdoc/classes/NeighbourhoodExpression.html @@ -0,0 +1,32 @@ +Class: NeighbourhoodExpression | AD4M Docs
    API Reference
    classes
    Neighbourhoodexpression

    @coasys/ad4m / Exports / NeighbourhoodExpression

    +

    Class: NeighbourhoodExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      NeighbourhoodExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new NeighbourhoodExpression()

    +

    Inherited from

    +

    ExpressionGeneric(Neighbourhood).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NeighbourhoodExpression/index.html b/docs/jsdoc/classes/NeighbourhoodExpression/index.html deleted file mode 100644 index c54352af5..000000000 --- a/docs/jsdoc/classes/NeighbourhoodExpression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: NeighbourhoodExpression | AD4M Docs
    API Reference
    classes
    Neighbourhoodexpression

    @coasys/ad4m / Exports / NeighbourhoodExpression

    -

    Class: NeighbourhoodExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      NeighbourhoodExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new NeighbourhoodExpression()

    -

    Inherited from

    -

    ExpressionGeneric(Neighbourhood).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NeighbourhoodProxy.html b/docs/jsdoc/classes/NeighbourhoodProxy.html new file mode 100644 index 000000000..f4c79f277 --- /dev/null +++ b/docs/jsdoc/classes/NeighbourhoodProxy.html @@ -0,0 +1,292 @@ +Class: NeighbourhoodProxy | AD4M Docs
    API Reference
    classes
    Neighbourhoodproxy

    @coasys/ad4m / Exports / NeighbourhoodProxy

    +

    Class: NeighbourhoodProxy

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new NeighbourhoodProxy(client, pID)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    clientNeighbourhoodClient
    pIDstring
    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:10 (opens in a new tab)

    +

    Properties

    +

    #client

    +

    Private #client: NeighbourhoodClient

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:7 (opens in a new tab)

    +
    +

    #pID

    +

    Private #pID: string

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:8 (opens in a new tab)

    +

    Methods

    +

    addSignalHandler

    +

    addSignalHandler(handler): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    handler(payload: PerspectiveExpression) => void
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:51 (opens in a new tab)

    +
    +

    hasTelepresenceAdapter

    +

    hasTelepresenceAdapter(): Promise<boolean>

    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:19 (opens in a new tab)

    +
    +

    onlineAgents

    +

    onlineAgents(): Promise<OnlineAgent[]>

    +

    Returns

    +

    Promise<OnlineAgent[]>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:23 (opens in a new tab)

    +
    +

    otherAgents

    +

    otherAgents(): Promise<string[]>

    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:15 (opens in a new tab)

    +
    +

    removeSignalHandler

    +

    removeSignalHandler(handler): void

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    handler(payload: PerspectiveExpression) => void
    +

    Returns

    +

    void

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:55 (opens in a new tab)

    +
    +

    sendBroadcast

    +

    sendBroadcast(payload, loopback?): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault value
    payloadPerspectiveundefined
    loopbackbooleanfalse
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:43 (opens in a new tab)

    +
    +

    sendBroadcastU

    +

    sendBroadcastU(payload, loopback?): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefault value
    payloadPerspectiveUnsignedInputundefined
    loopbackbooleanfalse
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:47 (opens in a new tab)

    +
    +

    sendSignal

    +

    sendSignal(remoteAgentDid, payload): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    remoteAgentDidstring
    payloadPerspective
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:35 (opens in a new tab)

    +
    +

    sendSignalU

    +

    sendSignalU(remoteAgentDid, payload): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    remoteAgentDidstring
    payloadPerspectiveUnsignedInput
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:39 (opens in a new tab)

    +
    +

    setOnlineStatus

    +

    setOnlineStatus(status): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    statusPerspective
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:27 (opens in a new tab)

    +
    +

    setOnlineStatusU

    +

    setOnlineStatusU(status): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    statusPerspectiveUnsignedInput
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    neighbourhood/NeighbourhoodProxy.ts:31 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NeighbourhoodProxy/index.html b/docs/jsdoc/classes/NeighbourhoodProxy/index.html deleted file mode 100644 index d1fdbc637..000000000 --- a/docs/jsdoc/classes/NeighbourhoodProxy/index.html +++ /dev/null @@ -1,292 +0,0 @@ -Class: NeighbourhoodProxy | AD4M Docs
    API Reference
    classes
    Neighbourhoodproxy

    @coasys/ad4m / Exports / NeighbourhoodProxy

    -

    Class: NeighbourhoodProxy

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new NeighbourhoodProxy(client, pID)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    clientNeighbourhoodClient
    pIDstring
    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:10 (opens in a new tab)

    -

    Properties

    -

    #client

    -

    Private #client: NeighbourhoodClient

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:7 (opens in a new tab)

    -
    -

    #pID

    -

    Private #pID: string

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:8 (opens in a new tab)

    -

    Methods

    -

    addSignalHandler

    -

    addSignalHandler(handler): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    handler(payload: PerspectiveExpression) => void
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:51 (opens in a new tab)

    -
    -

    hasTelepresenceAdapter

    -

    hasTelepresenceAdapter(): Promise<boolean>

    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:19 (opens in a new tab)

    -
    -

    onlineAgents

    -

    onlineAgents(): Promise<OnlineAgent[]>

    -

    Returns

    -

    Promise<OnlineAgent[]>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:23 (opens in a new tab)

    -
    -

    otherAgents

    -

    otherAgents(): Promise<string[]>

    -

    Returns

    -

    Promise<string[]>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:15 (opens in a new tab)

    -
    -

    removeSignalHandler

    -

    removeSignalHandler(handler): void

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    handler(payload: PerspectiveExpression) => void
    -

    Returns

    -

    void

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:55 (opens in a new tab)

    -
    -

    sendBroadcast

    -

    sendBroadcast(payload, loopback?): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault value
    payloadPerspectiveundefined
    loopbackbooleanfalse
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:43 (opens in a new tab)

    -
    -

    sendBroadcastU

    -

    sendBroadcastU(payload, loopback?): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - -
    NameTypeDefault value
    payloadPerspectiveUnsignedInputundefined
    loopbackbooleanfalse
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:47 (opens in a new tab)

    -
    -

    sendSignal

    -

    sendSignal(remoteAgentDid, payload): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    remoteAgentDidstring
    payloadPerspective
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:35 (opens in a new tab)

    -
    -

    sendSignalU

    -

    sendSignalU(remoteAgentDid, payload): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    remoteAgentDidstring
    payloadPerspectiveUnsignedInput
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:39 (opens in a new tab)

    -
    -

    setOnlineStatus

    -

    setOnlineStatus(status): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    statusPerspective
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:27 (opens in a new tab)

    -
    -

    setOnlineStatusU

    -

    setOnlineStatusU(status): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    statusPerspectiveUnsignedInput
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    neighbourhood/NeighbourhoodProxy.ts:31 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Notification.html b/docs/jsdoc/classes/Notification.html new file mode 100644 index 000000000..17afc37c6 --- /dev/null +++ b/docs/jsdoc/classes/Notification.html @@ -0,0 +1,86 @@ +Class: Notification | AD4M Docs
    API Reference
    classes
    Notification

    @coasys/ad4m / Exports / Notification

    +

    Class: Notification

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Notification()

    +

    Properties

    +

    appIconPath

    +

    appIconPath: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:106 (opens in a new tab)

    +
    +

    appName

    +

    appName: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:102 (opens in a new tab)

    +
    +

    appUrl

    +

    appUrl: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:104 (opens in a new tab)

    +
    +

    description

    +

    description: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:100 (opens in a new tab)

    +
    +

    granted

    +

    granted: boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:98 (opens in a new tab)

    +
    +

    id

    +

    id: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:96 (opens in a new tab)

    +
    +

    perspectiveIds

    +

    perspectiveIds: string[]

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:117 (opens in a new tab)

    +
    +

    trigger

    +

    trigger: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:113 (opens in a new tab)

    +
    +

    webhookAuth

    +

    webhookAuth: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:125 (opens in a new tab)

    +
    +

    webhookUrl

    +

    webhookUrl: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:121 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Notification/index.html b/docs/jsdoc/classes/Notification/index.html deleted file mode 100644 index 9bcd8292c..000000000 --- a/docs/jsdoc/classes/Notification/index.html +++ /dev/null @@ -1,86 +0,0 @@ -Class: Notification | AD4M Docs
    API Reference
    classes
    Notification

    @coasys/ad4m / Exports / Notification

    -

    Class: Notification

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Notification()

    -

    Properties

    -

    appIconPath

    -

    appIconPath: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:105 (opens in a new tab)

    -
    -

    appName

    -

    appName: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:101 (opens in a new tab)

    -
    -

    appUrl

    -

    appUrl: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:103 (opens in a new tab)

    -
    -

    description

    -

    description: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:99 (opens in a new tab)

    -
    -

    granted

    -

    granted: boolean

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:97 (opens in a new tab)

    -
    -

    id

    -

    id: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:95 (opens in a new tab)

    -
    -

    perspectiveIds

    -

    perspectiveIds: string[]

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:116 (opens in a new tab)

    -
    -

    trigger

    -

    trigger: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:112 (opens in a new tab)

    -
    -

    webhookAuth

    -

    webhookAuth: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:124 (opens in a new tab)

    -
    -

    webhookUrl

    -

    webhookUrl: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:120 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NotificationInput.html b/docs/jsdoc/classes/NotificationInput.html new file mode 100644 index 000000000..a6250e482 --- /dev/null +++ b/docs/jsdoc/classes/NotificationInput.html @@ -0,0 +1,74 @@ +Class: NotificationInput | AD4M Docs
    API Reference
    classes
    Notificationinput

    @coasys/ad4m / Exports / NotificationInput

    +

    Class: NotificationInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new NotificationInput()

    +

    Properties

    +

    appIconPath

    +

    appIconPath: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:69 (opens in a new tab)

    +
    +

    appName

    +

    appName: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:65 (opens in a new tab)

    +
    +

    appUrl

    +

    appUrl: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:67 (opens in a new tab)

    +
    +

    description

    +

    description: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:63 (opens in a new tab)

    +
    +

    perspectiveIds

    +

    perspectiveIds: string[]

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:80 (opens in a new tab)

    +
    +

    trigger

    +

    trigger: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:76 (opens in a new tab)

    +
    +

    webhookAuth

    +

    webhookAuth: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:88 (opens in a new tab)

    +
    +

    webhookUrl

    +

    webhookUrl: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:84 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/NotificationInput/index.html b/docs/jsdoc/classes/NotificationInput/index.html deleted file mode 100644 index 7519430fe..000000000 --- a/docs/jsdoc/classes/NotificationInput/index.html +++ /dev/null @@ -1,74 +0,0 @@ -Class: NotificationInput | AD4M Docs
    API Reference
    classes
    Notificationinput

    @coasys/ad4m / Exports / NotificationInput

    -

    Class: NotificationInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new NotificationInput()

    -

    Properties

    -

    appIconPath

    -

    appIconPath: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:68 (opens in a new tab)

    -
    -

    appName

    -

    appName: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:64 (opens in a new tab)

    -
    -

    appUrl

    -

    appUrl: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:66 (opens in a new tab)

    -
    -

    description

    -

    description: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:62 (opens in a new tab)

    -
    -

    perspectiveIds

    -

    perspectiveIds: string[]

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:79 (opens in a new tab)

    -
    -

    trigger

    -

    trigger: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:75 (opens in a new tab)

    -
    -

    webhookAuth

    -

    webhookAuth: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:87 (opens in a new tab)

    -
    -

    webhookUrl

    -

    webhookUrl: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:83 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/OnlineAgent.html b/docs/jsdoc/classes/OnlineAgent.html new file mode 100644 index 000000000..05eb6b6d4 --- /dev/null +++ b/docs/jsdoc/classes/OnlineAgent.html @@ -0,0 +1,38 @@ +Class: OnlineAgent | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/OnlineAgent/index.html b/docs/jsdoc/classes/OnlineAgent/index.html deleted file mode 100644 index f1c65dfba..000000000 --- a/docs/jsdoc/classes/OnlineAgent/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: OnlineAgent | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Perspective.html b/docs/jsdoc/classes/Perspective.html new file mode 100644 index 000000000..074e3c858 --- /dev/null +++ b/docs/jsdoc/classes/Perspective.html @@ -0,0 +1,112 @@ +Class: Perspective | AD4M Docs
    API Reference
    classes
    Perspective

    @coasys/ad4m / Exports / Perspective

    +

    Class: Perspective

    +

    A Perspective represents subjective meaning, encoded through +associations between expressions, a.k.a. Links, that is a graph +over the objective Expressions of any subset of Languages.

    +

    This type represents the clean onotological concept of a Perspective. +An instance of this class can be regarded as an immutable snapshot of +a mutable perspective.

    +

    The types PerspectiveProxy and PerspectiveHandle are used when dealing +with an instantiated mutable perspective as is done through most of +the GraphQL mutations.

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new Perspective(links?)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    links?LinkExpression[]
    +

    Defined in

    +

    perspectives/Perspective.ts:24 (opens in a new tab)

    +

    Properties

    +

    links

    +

    links: LinkExpression[]

    +

    The content of the perspective, a list/graph of links

    +

    Defined in

    +

    perspectives/Perspective.ts:22 (opens in a new tab)

    +

    Methods

    +

    get

    +

    get(query): LinkExpression[]

    +

    Convenience function for filtering links just like with PerspectiveProxy

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    queryLinkQuery
    +

    Returns

    +

    LinkExpression[]

    +

    Defined in

    +

    perspectives/Perspective.ts:33 (opens in a new tab)

    +
    +

    getSingleTarget

    +

    getSingleTarget(query): string | void

    +

    Convenience function to get the target of the first link that matches the given query +This makes sense when the query is expected to return only one link +and the target of that link is what you are looking for.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    queryLinkQuery
    +

    Returns

    +

    string | void

    +

    Defined in

    +

    perspectives/Perspective.ts:81 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Perspective/index.html b/docs/jsdoc/classes/Perspective/index.html deleted file mode 100644 index b800cf639..000000000 --- a/docs/jsdoc/classes/Perspective/index.html +++ /dev/null @@ -1,112 +0,0 @@ -Class: Perspective | AD4M Docs
    API Reference
    classes
    Perspective

    @coasys/ad4m / Exports / Perspective

    -

    Class: Perspective

    -

    A Perspective represents subjective meaning, encoded through -associations between expressions, a.k.a. Links, that is a graph -over the objective Expressions of any subset of Languages.

    -

    This type represents the clean onotological concept of a Perspective. -An instance of this class can be regarded as an immutable snapshot of -a mutable perspective.

    -

    The types PerspectiveProxy and PerspectiveHandle are used when dealing -with an instantiated mutable perspective as is done through most of -the GraphQL mutations.

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new Perspective(links?)

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    links?LinkExpression[]
    -

    Defined in

    -

    perspectives/Perspective.ts:24 (opens in a new tab)

    -

    Properties

    -

    links

    -

    links: LinkExpression[]

    -

    The content of the perspective, a list/graph of links

    -

    Defined in

    -

    perspectives/Perspective.ts:22 (opens in a new tab)

    -

    Methods

    -

    get

    -

    get(query): LinkExpression[]

    -

    Convenience function for filtering links just like with PerspectiveProxy

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    queryLinkQuery
    -

    Returns

    -

    LinkExpression[]

    -

    Defined in

    -

    perspectives/Perspective.ts:33 (opens in a new tab)

    -
    -

    getSingleTarget

    -

    getSingleTarget(query): string | void

    -

    Convenience function to get the target of the first link that matches the given query -This makes sense when the query is expected to return only one link -and the target of that link is what you are looking for.

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    queryLinkQuery
    -

    Returns

    -

    string | void

    -

    Defined in

    -

    perspectives/Perspective.ts:81 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveAction.html b/docs/jsdoc/classes/PerspectiveAction.html new file mode 100644 index 000000000..139a3df5b --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveAction.html @@ -0,0 +1,50 @@ +Class: PerspectiveAction | AD4M Docs
    API Reference
    classes
    Perspectiveaction

    @coasys/ad4m / Exports / PerspectiveAction

    +

    Class: PerspectiveAction

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveAction()

    +

    Properties

    +

    action

    +

    action: string

    +

    Defined in

    +

    model/decorators.ts:226 (opens in a new tab)

    +
    +

    predicate

    +

    predicate: string

    +

    Defined in

    +

    model/decorators.ts:228 (opens in a new tab)

    +
    +

    source

    +

    source: string

    +

    Defined in

    +

    model/decorators.ts:227 (opens in a new tab)

    +
    +

    target

    +

    target: string

    +

    Defined in

    +

    model/decorators.ts:229 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveAction/index.html b/docs/jsdoc/classes/PerspectiveAction/index.html deleted file mode 100644 index 5e5cace66..000000000 --- a/docs/jsdoc/classes/PerspectiveAction/index.html +++ /dev/null @@ -1,50 +0,0 @@ -Class: PerspectiveAction | AD4M Docs
    API Reference
    classes
    Perspectiveaction

    @coasys/ad4m / Exports / PerspectiveAction

    -

    Class: PerspectiveAction

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveAction()

    -

    Properties

    -

    action

    -

    action: string

    -

    Defined in

    -

    model/decorators.ts:6 (opens in a new tab)

    -
    -

    predicate

    -

    predicate: string

    -

    Defined in

    -

    model/decorators.ts:8 (opens in a new tab)

    -
    -

    source

    -

    source: string

    -

    Defined in

    -

    model/decorators.ts:7 (opens in a new tab)

    -
    -

    target

    -

    target: string

    -

    Defined in

    -

    model/decorators.ts:9 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveDiff.html b/docs/jsdoc/classes/PerspectiveDiff.html new file mode 100644 index 000000000..7e14f9f22 --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveDiff.html @@ -0,0 +1,38 @@ +Class: PerspectiveDiff | AD4M Docs
    API Reference
    classes
    Perspectivediff

    @coasys/ad4m / Exports / PerspectiveDiff

    +

    Class: PerspectiveDiff

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveDiff()

    +

    Properties

    +

    additions

    +

    additions: LinkExpression[]

    +

    Defined in

    +

    perspectives/PerspectiveDiff.ts:8 (opens in a new tab)

    +
    +

    removals

    +

    removals: LinkExpression[]

    +

    Defined in

    +

    perspectives/PerspectiveDiff.ts:11 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveDiff/index.html b/docs/jsdoc/classes/PerspectiveDiff/index.html deleted file mode 100644 index 7f47b51e4..000000000 --- a/docs/jsdoc/classes/PerspectiveDiff/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: PerspectiveDiff | AD4M Docs
    API Reference
    classes
    Perspectivediff

    @coasys/ad4m / Exports / PerspectiveDiff

    -

    Class: PerspectiveDiff

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveDiff()

    -

    Properties

    -

    additions

    -

    additions: LinkExpression[]

    -

    Defined in

    -

    perspectives/PerspectiveDiff.ts:8 (opens in a new tab)

    -
    -

    removals

    -

    removals: LinkExpression[]

    -

    Defined in

    -

    perspectives/PerspectiveDiff.ts:11 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveDiffExpression.html b/docs/jsdoc/classes/PerspectiveDiffExpression.html new file mode 100644 index 000000000..cb07f3052 --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveDiffExpression.html @@ -0,0 +1,32 @@ +Class: PerspectiveDiffExpression | AD4M Docs
    API Reference
    classes
    Perspectivediffexpression

    @coasys/ad4m / Exports / PerspectiveDiffExpression

    +

    Class: PerspectiveDiffExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      PerspectiveDiffExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveDiffExpression()

    +

    Inherited from

    +

    ExpressionGeneric(PerspectiveDiff).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveDiffExpression/index.html b/docs/jsdoc/classes/PerspectiveDiffExpression/index.html deleted file mode 100644 index f49822816..000000000 --- a/docs/jsdoc/classes/PerspectiveDiffExpression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: PerspectiveDiffExpression | AD4M Docs
    API Reference
    classes
    Perspectivediffexpression

    @coasys/ad4m / Exports / PerspectiveDiffExpression

    -

    Class: PerspectiveDiffExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      PerspectiveDiffExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveDiffExpression()

    -

    Inherited from

    -

    ExpressionGeneric(PerspectiveDiff).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveExpression.html b/docs/jsdoc/classes/PerspectiveExpression.html new file mode 100644 index 000000000..65438a2c6 --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveExpression.html @@ -0,0 +1,32 @@ +Class: PerspectiveExpression | AD4M Docs
    API Reference
    classes
    Perspectiveexpression

    @coasys/ad4m / Exports / PerspectiveExpression

    +

    Class: PerspectiveExpression

    +

    Hierarchy

    +
      +
    • +

      any

      +

      PerspectiveExpression

      +
    • +
    +

    Table of contents

    +

    Constructors

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveExpression()

    +

    Inherited from

    +

    ExpressionGeneric(Perspective).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveExpression/index.html b/docs/jsdoc/classes/PerspectiveExpression/index.html deleted file mode 100644 index 9d385148c..000000000 --- a/docs/jsdoc/classes/PerspectiveExpression/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: PerspectiveExpression | AD4M Docs
    API Reference
    classes
    Perspectiveexpression

    @coasys/ad4m / Exports / PerspectiveExpression

    -

    Class: PerspectiveExpression

    -

    Hierarchy

    -
      -
    • -

      any

      -

      PerspectiveExpression

      -
    • -
    -

    Table of contents

    -

    Constructors

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveExpression()

    -

    Inherited from

    -

    ExpressionGeneric(Perspective).constructor


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveHandle.html b/docs/jsdoc/classes/PerspectiveHandle.html new file mode 100644 index 000000000..0f65e0a4a --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveHandle.html @@ -0,0 +1,87 @@ +Class: PerspectiveHandle | AD4M Docs
    API Reference
    classes
    Perspectivehandle

    @coasys/ad4m / Exports / PerspectiveHandle

    +

    Class: PerspectiveHandle

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveHandle(uuid?, name?, state?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    uuid?string
    name?string
    state?PerspectiveState
    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:33 (opens in a new tab)

    +

    Properties

    +

    name

    +

    name: string

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:20 (opens in a new tab)

    +
    +

    neighbourhood

    +

    Optional neighbourhood: NeighbourhoodExpression

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:28 (opens in a new tab)

    +
    +

    owners

    +

    Optional owners: string[]

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:31 (opens in a new tab)

    +
    +

    sharedUrl

    +

    Optional sharedUrl: string

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:25 (opens in a new tab)

    +
    +

    state

    +

    state: PerspectiveState

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:22 (opens in a new tab)

    +
    +

    uuid

    +

    uuid: string

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:18 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveHandle/index.html b/docs/jsdoc/classes/PerspectiveHandle/index.html deleted file mode 100644 index 6ea0af205..000000000 --- a/docs/jsdoc/classes/PerspectiveHandle/index.html +++ /dev/null @@ -1,81 +0,0 @@ -Class: PerspectiveHandle | AD4M Docs
    API Reference
    classes
    Perspectivehandle

    @coasys/ad4m / Exports / PerspectiveHandle

    -

    Class: PerspectiveHandle

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveHandle(uuid?, name?, state?)

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - -
    NameType
    uuid?string
    name?string
    state?PerspectiveState
    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:30 (opens in a new tab)

    -

    Properties

    -

    name

    -

    name: string

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:20 (opens in a new tab)

    -
    -

    neighbourhood

    -

    Optional neighbourhood: NeighbourhoodExpression

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:28 (opens in a new tab)

    -
    -

    sharedUrl

    -

    Optional sharedUrl: string

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:25 (opens in a new tab)

    -
    -

    state

    -

    state: PerspectiveState

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:22 (opens in a new tab)

    -
    -

    uuid

    -

    uuid: string

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:18 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveInput.html b/docs/jsdoc/classes/PerspectiveInput.html new file mode 100644 index 000000000..4c563ba1d --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveInput.html @@ -0,0 +1,32 @@ +Class: PerspectiveInput | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveInput/index.html b/docs/jsdoc/classes/PerspectiveInput/index.html deleted file mode 100644 index 2db06a882..000000000 --- a/docs/jsdoc/classes/PerspectiveInput/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Class: PerspectiveInput | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveProxy/index.html b/docs/jsdoc/classes/PerspectiveProxy.html similarity index 58% rename from docs/jsdoc/classes/PerspectiveProxy/index.html rename to docs/jsdoc/classes/PerspectiveProxy.html index a774e97bb..a848502c8 100644 --- a/docs/jsdoc/classes/PerspectiveProxy/index.html +++ b/docs/jsdoc/classes/PerspectiveProxy.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    classes
    Perspectiveproxy

    @coasys/ad4m / Exports / PerspectiveProxy

    +
    API Reference
    classes
    Perspectiveproxy

    @coasys/ad4m / Exports / PerspectiveProxy

    Class: PerspectiveProxy

    PerspectiveProxy provides a high-level interface for working with AD4M Perspectives - agent-centric semantic graphs that store and organize links between expressions.

    @@ -50,75 +50,89 @@

    Table of contents

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    constructor

    @@ -143,75 +157,81 @@

    NameTypehandlePerspectiveHandlead4mPerspectiveClient +
    NameType
    handlePerspectiveHandle
    ad4mPerspectiveClient

    Defined in

    -

    perspectives/PerspectiveProxy.ts:393 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:399 (opens in a new tab)

    Properties

    #client

    Private #client: PerspectiveClient

    Defined in

    -

    perspectives/PerspectiveProxy.ts:383 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:389 (opens in a new tab)


    #handle

    -

    Private #handle: PerspectiveHandle

    +

    Private #handle: PerspectiveHandle

    Defined in

    -

    perspectives/PerspectiveProxy.ts:382 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:388 (opens in a new tab)


    #perspectiveLinkAddedCallbacks

    Private #perspectiveLinkAddedCallbacks: LinkCallback[]

    Defined in

    -

    perspectives/PerspectiveProxy.ts:384 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:390 (opens in a new tab)


    #perspectiveLinkRemovedCallbacks

    Private #perspectiveLinkRemovedCallbacks: LinkCallback[]

    Defined in

    -

    perspectives/PerspectiveProxy.ts:385 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:391 (opens in a new tab)


    #perspectiveLinkUpdatedCallbacks

    Private #perspectiveLinkUpdatedCallbacks: LinkCallback[]

    Defined in

    -

    perspectives/PerspectiveProxy.ts:386 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:392 (opens in a new tab)


    #perspectiveSyncStateChangeCallbacks

    Private #perspectiveSyncStateChangeCallbacks: SyncStateChangeCallback[]

    Defined in

    -

    perspectives/PerspectiveProxy.ts:387 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:393 (opens in a new tab)


    name

    name: string

    Human-readable name of this perspective

    Defined in

    -

    perspectives/PerspectiveProxy.ts:371 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:374 (opens in a new tab)


    neighbourhood

    -

    neighbourhood: NeighbourhoodExpression

    +

    neighbourhood: NeighbourhoodExpression

    If this perspective is shared, this contains the Neighbourhood metadata

    Defined in

    -

    perspectives/PerspectiveProxy.ts:377 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:380 (opens in a new tab)

    +
    +

    owners

    +

    Optional owners: string[]

    +

    List of owners of this perspective

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:386 (opens in a new tab)


    sharedUrl

    sharedUrl: string

    If this perspective is shared as a Neighbourhood, this is its URL

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:374 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:377 (opens in a new tab)


    state

    -

    state: PerspectiveState

    +

    state: PerspectiveState

    Current sync state if this perspective is shared

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:380 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:383 (opens in a new tab)


    uuid

    uuid: string

    Unique identifier of this perspective

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:368 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:371 (opens in a new tab)

    Accessors

    ai

    -

    get ai(): AIClient

    +

    get ai(): AIClient

    Returns a proxy object for working with AI capabilities.

    Returns

    -

    AIClient

    +

    AIClient

    AIClient instance

    Example

    // Use AI to analyze perspective content
    @@ -219,11 +239,11 @@ 

    // Generate new content const suggestion = await perspective.ai.suggest("next action");

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1303 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:2118 (opens in a new tab)

    Methods

    add

    -

    add(link, status?, batchId?): Promise<LinkExpression>

    +

    add(link, status?, batchId?): Promise<LinkExpression>

    Adds a new link to the perspective.

    Parameters

    @@ -255,9 +275,9 @@

    NameTypeDefault valueDescriptionlinkLinkundefinedThe link to addstatusLinkStatus'shared'Whether the link should be shared in a NeighbourhoodbatchId?stringundefinedOptional batch ID to group this operation with others +
    NameTypeDefault valueDescription
    linkLinkundefinedThe link to add
    statusLinkStatus'shared'Whether the link should be shared in a Neighbourhood
    batchId?stringundefinedOptional batch ID to group this operation with others

    Returns

    -

    Promise<LinkExpression>

    +

    Promise<LinkExpression>

    The created LinkExpression

    Example

    // Add a simple relationship
    @@ -273,13 +293,70 @@ 

    predicate: "tag", target: "private" }, "local");

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:583 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:603 (opens in a new tab)

    +
    +

    addFlow

    +

    addFlow(name, flow): Promise<void>

    +

    Recommended way to add Flow definitions.

    +

    Store a SHACL Flow (state machine) in this Perspective using the type-safe SHACLFlow class. +The flow is serialized as RDF triples (links) for native AD4M storage and querying.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    namestringFlow name (e.g., 'TODO', 'Approval')
    flowSHACLFlowSHACLFlow instance defining the state machine
    +

    Returns

    +

    Promise<void>

    +

    Example

    +
    import { SHACLFlow } from '@coasys/ad4m';
    + 
    +const todoFlow = new SHACLFlow('TODO', 'todo://');
    +todoFlow.flowable = 'any';
    + 
    +// Define states
    +todoFlow.addState({ name: 'ready', value: 0, stateCheck: { predicate: 'todo://state', target: 'todo://ready' }});
    +todoFlow.addState({ name: 'done', value: 1, stateCheck: { predicate: 'todo://state', target: 'todo://done' }});
    + 
    +// Define start action
    +todoFlow.startAction = [{ action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }];
    + 
    +// Define transitions
    +todoFlow.addTransition({
    +  actionName: 'Complete',
    +  fromState: 'ready',
    +  toState: 'done',
    +  actions: [
    +    { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://done' },
    +    { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
    +  ]
    +});
    + 
    +await perspective.addFlow('TODO', todoFlow);
    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1234 (opens in a new tab)


    addLinkExpression

    -

    addLinkExpression(link, status?, batchId?): Promise<LinkExpression>

    +

    addLinkExpression(link, status?, batchId?): Promise<LinkExpression>

    Adds a pre-signed LinkExpression to the perspective.

    -

    Parameters

    +

    Parameters

    @@ -309,18 +386,18 @@

    NameTypeDefault valueDescriptionlinkLinkExpressionundefinedThe signed LinkExpression to addstatusLinkStatus'shared'Whether the link should be sharedbatchId?stringundefinedOptional batch ID to group this operation with others -

    Returns

    -

    Promise<LinkExpression>

    +
    NameTypeDefault valueDescription
    linkLinkExpressionundefinedThe signed LinkExpression to add
    statusLinkStatus'shared'Whether the link should be shared
    batchId?stringundefinedOptional batch ID to group this operation with others
    +

    Returns

    +

    Promise<LinkExpression>

    The added LinkExpression

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:631 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:651 (opens in a new tab)


    addLinks

    -

    addLinks(links, status?, batchId?): Promise<LinkExpression[]>

    +

    addLinks(links, status?, batchId?): Promise<LinkExpression[]>

    Adds multiple links to the perspective in a single operation. More efficient than adding links one by one.

    -

    Parameters

    +

    Parameters

    @@ -350,17 +427,17 @@

    NameTypeDefault valueDescriptionlinksLink[]undefinedArray of links to addstatusLinkStatus'shared'Whether the links should be sharedbatchId?stringundefinedOptional batch ID to group this operation with others -

    Returns

    -

    Promise<LinkExpression[]>

    +
    NameTypeDefault valueDescription
    linksLink[]undefinedArray of links to add
    statusLinkStatus'shared'Whether the links should be shared
    batchId?stringundefinedOptional batch ID to group this operation with others
    +

    Returns

    +

    Promise<LinkExpression[]>

    Array of created LinkExpressions

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:596 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:616 (opens in a new tab)


    addListener

    addListener(type, cb): Promise<void>

    Subscribes to link changes in the perspective.

    -

    Parameters

    +

    Parameters

    @@ -382,7 +459,7 @@

    NameTypeDescriptiontypePerspectiveListenerTypesType of change to listen forcbLinkCallbackCallback function -

    Returns

    +

    Returns

    Promise<void>

    Example

    // Listen for new links
    @@ -394,13 +471,15 @@ 

    perspective.addListener("link-removed", (link) => { console.log("Link removed:", link); });

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:707 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:727 (opens in a new tab)


    addSdna

    -

    addSdna(name, sdnaCode, sdnaType): Promise<boolean>

    -

    Adds the given Social DNA code to the perspective's SDNA code

    -

    Parameters

    +

    addSdna(name, sdnaCode, sdnaType, shaclJson?): Promise<boolean>

    +

    Adds Social DNA code to the perspective.

    +

    Recommended: Use addShacl instead, which accepts the SHACLShape type directly. +This method is primarily for the GraphQL layer and legacy Prolog code.

    +

    Parameters

    @@ -422,16 +501,82 @@

    NameTypenamestringsdnaCodestringsdnaType"subject_class" | "flow" | "custom" -

    Returns

    + + + + + + + + + +
    NameTypeDescription
    namestringUnique name for this SDNA definition
    sdnaCodestringProlog SDNA code (legacy, can be empty string if shaclJson provided)
    sdnaType"subject_class" | "flow" | "custom"Type of SDNA: "subject_class", "flow", or "custom"
    shaclJson?stringSHACL JSON string (use addShacl() for type-safe alternative)
    +

    Returns

    Promise<boolean>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:961 (opens in a new tab)

    +

    Example

    +
    // Recommended: Use addShacl() with SHACLShape type
    +const shape = new SHACLShape('recipe://Recipe');
    +shape.addProperty({ name: 'title', path: 'recipe://title', datatype: 'xsd:string' });
    +await perspective.addShacl('Recipe', shape);
    + 
    +// Legacy: Prolog code is auto-converted to SHACL
    +await perspective.addSdna('Recipe', prologCode, 'subject_class');
    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1074 (opens in a new tab)

    +
    +

    addShacl

    +

    addShacl(name, shape): Promise<void>

    +

    Recommended way to add SDNA schemas.

    +

    Store a SHACL shape in this Perspective using the type-safe SHACLShape class. +The shape is serialized as RDF triples (links) for native AD4M storage and querying.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    namestringUnique name for this schema (e.g., 'Recipe', 'Task')
    shapeSHACLShapeSHACLShape instance defining the schema
    +

    Returns

    +

    Promise<void>

    +

    Example

    +
    import { SHACLShape } from '@coasys/ad4m';
    + 
    +const shape = new SHACLShape('recipe://Recipe');
    +shape.addProperty({ 
    +  name: 'title', 
    +  path: 'recipe://title', 
    +  datatype: 'xsd:string',
    +  minCount: 1 
    +});
    +shape.addProperty({
    +  name: 'ingredients',
    +  path: 'recipe://has_ingredient',
    +  // No maxCount = relation
    +});
    + 
    +await perspective.addShacl('Recipe', shape);
    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1105 (opens in a new tab)


    addSyncStateChangeListener

    addSyncStateChangeListener(cb): Promise<void>

    Subscribes to sync state changes if this perspective is shared.

    -

    Parameters

    +

    Parameters

    @@ -448,19 +593,19 @@

    NameTypeDescriptioncbSyncStateChangeCallbackCallback function -

    Returns

    +

    Returns

    Promise<void>

    Example

    perspective.addSyncStateChangeListener((state) => {
       console.log("Sync state:", state);
     });
    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:729 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:749 (opens in a new tab)


    availableFlows

    availableFlows(exprAddr): Promise<string[]>

    Returns all Social DNA flows that can be started from the given expression

    -

    Parameters

    +

    Parameters

    @@ -475,14 +620,16 @@

    NameTypeexprAddrstring -

    Returns

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:846 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:876 (opens in a new tab)


    -

    buildQueryFromTemplate

    -

    Private buildQueryFromTemplate(obj): string

    -

    Parameters

    +

    batchCheckSubjectInstances

    +

    batchCheckSubjectInstances(expressions, metadata): Promise<string[]>

    +

    Batch-checks multiple expressions against subject class metadata using a single or limited SurrealDB queries. +This avoids N+1 query problems by checking all values at once.

    +

    Parameters

    @@ -496,16 +643,36 @@

    NameTypeobjobject -

    Returns

    -

    string

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1154 (opens in a new tab)

    + + + + + + + + + + + + + + + + + + + + +
    NameType
    expressionsstring[]
    metadataObject
    metadata.propertiesMap<string, { predicate: string ; resolveLanguage?: string }>
    metadata.relationsMap<string, { condition?: string ; instanceFilter?: string ; predicate: string }>
    metadata.requiredPredicatesstring[]
    metadata.requiredTriples{ predicate: string ; target?: string }[]
    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1766 (opens in a new tab)


    commitBatch

    -

    commitBatch(batchId): Promise<LinkExpressionMutations>

    +

    commitBatch(batchId): Promise<LinkExpressionMutations>

    Commits a batch of operations

    -

    Parameters

    +

    Parameters

    @@ -520,23 +687,23 @@

    NameTypebatchIdstring -

    Returns

    -

    Promise<LinkExpressionMutations>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:662 (opens in a new tab)

    +

    Returns

    +

    Promise<LinkExpressionMutations>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:682 (opens in a new tab)


    createBatch

    createBatch(): Promise<string>

    Creates a new batch for grouping operations

    -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:657 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:677 (opens in a new tab)


    createExpression

    createExpression(content, languageAddress): Promise<string>

    Creates a new Expression in the specified Language.

    -

    Parameters

    +

    Parameters

    @@ -558,11 +725,11 @@

    NameTypeDescriptioncontentanyContent for the new ExpressionlanguageAddressstringAddress of the Language to use -

    Returns

    +

    Returns

    Promise<string>

    URI of the created Expression

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:684 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:704 (opens in a new tab)


    createSubject

    createSubject<T, B>(subjectClass, exprAddr, initialValues?, batchId?): Promise<B extends undefined ? T : string>

    @@ -586,7 +753,7 @@

    NameTypeTTBextends string = undefined -

    Parameters

    +

    Parameters

    @@ -618,17 +785,17 @@

    NameTypeDescriptionsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class.exprAddrstringThe address of the expression to be turned into a subject instanceinitialValues?Record<string, any>Optional initial values for properties. If provided, these will be merged with constructor actions for better performance.batchId?BOptional batch ID for grouping operations. If provided, returns the expression address instead of the subject proxy since the subject won't exist until the batch is committed. -

    Returns

    +

    Returns

    Promise<B extends undefined ? T : string>

    A proxy object for the created subject, or just the expression address if in batch mode

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1000 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1357 (opens in a new tab)


    ensureSDNASubjectClass

    ensureSDNASubjectClass(jsClass): Promise<void>

    Takes a JS class (its constructor) and assumes that it was decorated by the

    -

    Parameters

    +

    Parameters

    @@ -643,15 +810,42 @@

    NameTypejsClassany -

    Returns

    +

    Returns

    Promise<void>

    Subject Class

    etc. decorators. It then tests if there is a subject class already present in the perspective's SDNA that matches the given class. If there is no such class, it gets the JS class's SDNA by calling its static generateSDNA() function and adds it to the perspective's SDNA.

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1274 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:2078 (opens in a new tab)

    +
    +

    escapeRegExp

    +

    Private escapeRegExp(str): string

    +

    Escapes special regex characters in a string to prevent ReDoS attacks +and regex injection when building dynamic regular expressions.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    strstringThe string to escape
    +

    Returns

    +

    string

    +

    The escaped string safe for use in RegExp constructor

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:427 (opens in a new tab)


    executeAction

    executeAction(actions, expression, parameters, batchId?): Promise<boolean>

    @@ -670,11 +864,11 @@

    addLink: Creates a new link
  • removeLink: Removes an existing link
  • setSingleTarget: Removes all existing links with the same source/predicate and adds a new one
  • -
  • collectionSetter: Special command for setting collection properties
  • +
  • collectionSetter: Special command for setting relation properties
  • When used with parameters, the special value "value" in the target field will be replaced with the actual parameter value.

    -

    Parameters

    +

    Parameters

    @@ -706,7 +900,7 @@

    NameTypeDescriptionactionsanyArray of action objects to executeexpressionanyTarget expression address (replaces "this" in actions)parametersParameter[]Optional parameters that replace "value" in actionsbatchId?stringOptional batch ID to group this operation with others -

    Returns

    +

    Returns

    Promise<boolean>

    Example

    // Add a state link and remove an old one
    @@ -736,13 +930,124 @@ 

    ], "expression://123", [ { name: "title", value: "New Title" } ]);

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:471 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:491 (opens in a new tab)


    expressionsInFlowState

    expressionsInFlowState(flowName, flowState): Promise<string[]>

    Returns all expressions in the given state of given Social DNA flow

    -

    Parameters

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    flowNamestring
    flowStatenumber
    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:910 (opens in a new tab)

    +
    +

    filterInstancesSequential

    +

    Private filterInstancesSequential(values, instanceFilter): Promise<string[]>

    +

    Fallback sequential instance checking when batch checking isn't available.

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    valuesstring[]
    instanceFilterstring
    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1826 (opens in a new tab)

    +
    +

    findClassByProperties

    +

    Private findClassByProperties(obj): Promise<string>

    +

    Find a subject class by matching an object's properties/relations against SHACL shapes. +Queries SHACL links client-side to find a class whose properties contain all required ones.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    objobject
    +

    Returns

    +

    Promise<string>

    +

    The matching class name, or null if no match found.

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1941 (opens in a new tab)

    +
    +

    flowActions

    +

    flowActions(flowName, exprAddr): Promise<string[]>

    +

    Returns available action names, with regard to Social DNA flow and expression's flow state

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    flowNamestring
    exprAddrstring
    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:945 (opens in a new tab)

    +
    +

    flowState

    +

    flowState(flowName, exprAddr): Promise<number>

    +

    Returns the given expression's flow state with regard to given Social DNA flow

    +

    Parameters

    + + + + + @@ -755,23 +1060,142 @@

    NameTypeflowNamestringexprAddrstring +

    Returns

    +

    Promise<number>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:927 (opens in a new tab)

    +
    +

    generateSurrealInstanceQuery

    +

    Private generateSurrealInstanceQuery(metadata): string

    +

    Generates a SurrealDB query to find instances based on class metadata.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    metadataObject
    metadata.propertiesMap<string, { predicate: string ; resolveLanguage?: string }>
    metadata.relationsMap<string, { condition?: string ; instanceFilter?: string ; predicate: string }>
    metadata.requiredPredicatesstring[]
    metadata.requiredTriples{ predicate: string ; target?: string }[]
    +

    Returns

    +

    string

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1617 (opens in a new tab)

    +
    +

    get

    +

    get(query): Promise<LinkExpression[]>

    +

    Retrieves links from the perspective that match the given query.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    queryLinkQueryQuery parameters to filter links
    +

    Returns

    +

    Promise<LinkExpression[]>

    +

    Array of matching LinkExpressions

    +

    Example

    +
    // Get all links where Alice knows someone
    +const links = await perspective.get({
    +  source: "did:key:alice",
    +  predicate: "knows"
    +});
    + 
    +// Get all comments on a post
    +const comments = await perspective.get({
    +  source: "post://123",
    +  predicate: "comment"
    +});
    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:516 (opens in a new tab)

    +
    +

    getActionsFromSHACL

    +

    Private getActionsFromSHACL(className, predicate): Promise<any[]>

    +

    Gets actions from SHACL links for a given predicate (e.g., ad4m://constructor, ad4m://destructor). +Returns the parsed action array if found, or null if not found.

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    classNamestring
    predicatestring
    +

    Returns

    +

    Promise<any[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1421 (opens in a new tab)

    +
    +

    getAllShacl

    +

    getAllShacl(): Promise<{ name: string ; shape: SHACLShape }[]>

    +

    Get all SHACL shapes stored in this Perspective

    +

    Returns

    +

    Promise<{ name: string ; shape: SHACLShape }[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1176 (opens in a new tab)

    +
    +

    getAllSubjectInstances

    +

    getAllSubjectInstances<T>(subjectClass): Promise<T[]>

    +

    Returns all subject instances of the given subject class as proxy objects.

    +

    Type parameters

    + + + + -
    NameType
    flowNamestring
    flowStatenumber
    -

    Returns

    -

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:860 (opens in a new tab)

    -
    -

    flowActions

    -

    flowActions(flowName, exprAddr): Promise<string[]>

    -

    Returns available action names, with regard to Social DNA flow and expression's flow state

    -

    Parameters

    +
    Name
    T
    +

    Parameters

    @@ -787,18 +1211,16 @@

    NameTypeflowNamestringexprAddrstring -

    Returns

    -

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:872 (opens in a new tab)

    +
    NameTypeDescription
    subjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.
    +

    Returns

    +

    Promise<T[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1847 (opens in a new tab)


    -

    flowState

    -

    flowState(flowName, exprAddr): Promise<number>

    -

    Returns the given expression's flow state with regard to given Social DNA flow

    -

    Parameters

    - - +

    getAllSubjectProxies

    +

    getAllSubjectProxies<T>(subjectClass): Promise<T[]>

    +

    Returns all subject proxies of the given subject class as proxy objects.

    +

    Type parameters

    @@ -810,20 +1232,12 @@

    NameT +

    Parameters

    -
    NameType
    flowNamestring
    exprAddrstring
    -

    Returns

    -

    Promise<number>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:866 (opens in a new tab)

    -
    -

    get

    -

    get(query): Promise<LinkExpression[]>

    -

    Retrieves links from the perspective that match the given query.

    -

    Parameters

    @@ -835,33 +1249,20 @@

    NameTypeDescriptionsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used. +

    Returns

    +

    Promise<T[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1905 (opens in a new tab)

    +
    +

    getExpression

    +

    getExpression(expressionURI): Promise<ExpressionRendered>

    +

    Retrieves and renders an Expression referenced in this perspective.

    +

    Parameters

    -
    NameTypeDescription
    queryLinkQueryQuery parameters to filter links
    -

    Returns

    -

    Promise<LinkExpression[]>

    -

    Array of matching LinkExpressions

    -

    Example

    -
    // Get all links where Alice knows someone
    -const links = await perspective.get({
    -  source: "did:key:alice",
    -  predicate: "knows"
    -});
    - 
    -// Get all comments on a post
    -const comments = await perspective.get({
    -  source: "post://123",
    -  predicate: "comment"
    -});
    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:496 (opens in a new tab)

    -
    -

    getAllSubjectInstances

    -

    getAllSubjectInstances<T>(subjectClass): Promise<T[]>

    -

    Returns all subject instances of the given subject class as proxy objects.

    -

    Type parameters

    @@ -873,8 +1274,17 @@

    NameT -

    Parameters

    +
    NameTypeDescription
    expressionURIstringURI of the Expression to retrieve
    +

    Returns

    +

    Promise<ExpressionRendered>

    +

    The rendered Expression

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:693 (opens in a new tab)

    +
    +

    getFlow

    +

    getFlow(name): Promise<SHACLFlow>

    +

    Retrieve a Flow definition by name from this Perspective

    +

    Parameters

    @@ -890,16 +1300,25 @@

    NameTypeDescriptionsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used. -

    Returns

    -

    Promise<T[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1116 (opens in a new tab)

    +
    NameTypeDescription
    namestringFlow name to retrieve
    +

    Returns

    +

    Promise<SHACLFlow>

    +

    The SHACLFlow or null if not found

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1268 (opens in a new tab)


    -

    getAllSubjectProxies

    -

    getAllSubjectProxies<T>(subjectClass): Promise<T[]>

    -

    Returns all subject proxies of the given subject class.

    -

    Type parameters

    +

    getNeighbourhoodProxy

    +

    getNeighbourhoodProxy(): NeighbourhoodProxy

    +

    Returns

    +

    NeighbourhoodProxy

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:2100 (opens in a new tab)

    +
    +

    getPropertyValueViaSurreal

    +

    getPropertyValueViaSurreal(baseExpression, className, propertyName): Promise<any>

    +

    Gets a property value using SurrealDB when Prolog fails. +This is used as a fallback in SdnaOnly mode where link data isn't in Prolog.

    +

    Parameters

    @@ -911,8 +1330,6 @@

    NameT -

    Parameters

    @@ -922,22 +1339,25 @@

    NameTypebaseExpressionstringclassNamestringpropertyNamestring +

    Returns

    +

    Promise<any>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1648 (opens in a new tab)

    +
    +

    getRelationValuesViaSurreal

    +

    getRelationValuesViaSurreal(baseExpression, className, relationName): Promise<any[]>

    +

    Gets relation values using SurrealDB when Prolog fails. +This is used as a fallback in SdnaOnly mode where link data isn't in Prolog. +Note: This is used by Subject.ts (legacy pattern). Ad4mModel.ts uses getModelMetadata() instead.

    +

    Parameters

    -
    NameTypeDescription
    subjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, all subject classes that match the given properties will be used.
    -

    Returns

    -

    Promise<T[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1138 (opens in a new tab)

    -
    -

    getExpression

    -

    getExpression(expressionURI): Promise<ExpressionRendered>

    -

    Retrieves and renders an Expression referenced in this perspective.

    -

    Parameters

    @@ -953,34 +1373,26 @@

    NameTypeDescriptionexpressionURIstringURI of the Expression to retrieve -

    Returns

    -

    Promise<ExpressionRendered>

    -

    The rendered Expression

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:673 (opens in a new tab)

    -
    -

    getNeighbourhoodProxy

    -

    getNeighbourhoodProxy(): NeighbourhoodProxy

    -

    Returns

    -

    NeighbourhoodProxy

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1285 (opens in a new tab)

    +
    NameType
    baseExpressionstring
    classNamestring
    relationNamestring
    +

    Returns

    +

    Promise<any[]>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1692 (opens in a new tab)


    getSdna

    getSdna(): Promise<string[]>

    Returns the perspective's Social DNA code This will return all SDNA code elements in an array.

    -

    Returns

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:888 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:982 (opens in a new tab)


    getSdnaForClass

    getSdnaForClass(className): Promise<string>

    Returns the Social DNA code for a specific class This will return the SDNA code for the specified class, or null if not found.

    -

    Parameters

    +

    Parameters

    @@ -995,16 +1407,39 @@

    NameTypeclassNamestring -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:931 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1025 (opens in a new tab)

    +
    +

    getShacl

    +

    getShacl(name): Promise<SHACLShape>

    +

    Retrieve a SHACL shape by name from this Perspective

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    namestring
    +

    Returns

    +

    Promise<SHACLShape>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1136 (opens in a new tab)


    getSingleTarget

    getSingleTarget(query): Promise<string | void>

    Gets a single target value matching a query. Useful when you expect only one result.

    -

    Parameters

    +

    Parameters

    @@ -1020,8 +1455,8 @@

    NameTypeDescriptionqueryLinkQueryQuery to find the target -

    Returns

    +
    NameTypeDescription
    queryLinkQueryQuery to find the target
    +

    Returns

    Promise<string | void>

    Target value or void if not found

    Example

    @@ -1030,8 +1465,32 @@

    source: "did:key:alice", predicate: "name" });

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:799 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:819 (opens in a new tab)

    +
    +

    getSubjectClassMetadataFromSDNA

    +

    getSubjectClassMetadataFromSDNA(className): Promise<{ properties: Map<string, { predicate: string ; resolveLanguage?: string }> ; relations: Map<string, { condition?: string ; instanceFilter?: string ; predicate: string }> ; requiredPredicates: string[] ; requiredTriples: { predicate: string ; target?: string }[] }>

    +

    Gets subject class metadata from SHACL links using SHACLShape.fromLinks(). +Retrieves the SHACL shape and extracts metadata for instance queries.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    classNamestring
    +

    Returns

    +

    Promise<{ properties: Map<string, { predicate: string ; resolveLanguage?: string }> ; relations: Map<string, { condition?: string ; instanceFilter?: string ; predicate: string }> ; requiredPredicates: string[] ; requiredTriples: { predicate: string ; target?: string }[] }>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1554 (opens in a new tab)


    getSubjectData

    getSubjectData<T>(subjectClass, exprAddr): Promise<T>

    @@ -1048,7 +1507,7 @@

    NameT -

    Parameters

    +

    Parameters

    @@ -1067,10 +1526,10 @@

    NameTypesubjectClassTexprAddrstring -

    Returns

    +

    Returns

    Promise<T>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1042 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1404 (opens in a new tab)


    getSubjectProxy

    getSubjectProxy<T>(base, subjectClass): Promise<T>

    @@ -1090,7 +1549,7 @@

    NameT -

    Parameters

    +

    Parameters

    @@ -1112,16 +1571,16 @@

    NameTypeDescriptionbasestringURI of the subject's root expressionsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used. -

    Returns

    +

    Returns

    Promise<T>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1101 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1540 (opens in a new tab)


    infer

    infer(query): Promise<any>

    Executes a Prolog query against the perspective's knowledge base. This is a powerful way to find complex patterns in the graph.

    -

    Parameters

    +

    Parameters

    @@ -1138,7 +1597,7 @@

    NameTypeDescriptionquerystringProlog query string -

    Returns

    +

    Returns

    Promise<any>

    Query results or false if no results

    Example

    @@ -1154,8 +1613,8 @@

    instance(Todo, "Todo"), property_getter("Todo", Todo, "state", "active") `);

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:523 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:543 (opens in a new tab)


    isSubjectInstance

    isSubjectInstance<T>(expression, subjectClass): Promise<boolean>

    @@ -1173,7 +1632,7 @@

    NameT -

    Parameters

    +

    Parameters

    @@ -1195,16 +1654,16 @@

    NameTypeDescriptionexpressionstringThe expression to be checkedsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used. -

    Returns

    +

    Returns

    Promise<boolean>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1077 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1479 (opens in a new tab)


    linkMutations

    -

    linkMutations(mutations, status?): Promise<LinkExpressionMutations>

    +

    linkMutations(mutations, status?): Promise<LinkExpressionMutations>

    Applies a set of link mutations (adds and removes) in a single operation. Useful for atomic updates to the perspective.

    -

    Parameters

    +

    Parameters

    @@ -1228,17 +1687,17 @@

    NameTypeDefault valueDescriptionmutationsLinkMutationsundefinedObject containing links to add and removestatusLinkStatus'shared'Whether new links should be shared -

    Returns

    -

    Promise<LinkExpressionMutations>

    +
    NameTypeDefault valueDescription
    mutationsLinkMutationsundefinedObject containing links to add and remove
    statusLinkStatus'shared'Whether new links should be shared
    +

    Returns

    +

    Promise<LinkExpressionMutations>

    Object containing results of the mutations

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:619 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:639 (opens in a new tab)


    loadSnapshot

    loadSnapshot(snapshot): Promise<void>

    Loads a perspective snapshot, replacing current content.

    -

    Parameters

    +

    Parameters

    @@ -1254,11 +1713,11 @@

    NameTypeDescriptionsnapshotPerspectivePerspective snapshot to load -

    Returns

    +
    NameTypeDescription
    snapshotPerspectivePerspective snapshot to load
    +

    Returns

    Promise<void>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:770 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:790 (opens in a new tab)


    querySurrealDB

    querySurrealDB(query): Promise<any>

    @@ -1267,7 +1726,7 @@

    Security Note: Only read-only queries (SELECT, RETURN, etc.) are permitted. Mutating operations (DELETE, UPDATE, INSERT, CREATE, DROP, DEFINE, etc.) are blocked for security reasons. Use the perspective's add/remove methods to modify links.

    -

    Parameters

    +

    Parameters

    @@ -1284,7 +1743,7 @@

    NameTypeDescriptionquerystringSurrealQL query string (read-only operations only) -

    Returns

    +

    Returns

    Promise<any>

    Query results as parsed JSON

    Example

    @@ -1300,13 +1759,13 @@

    const stats = await perspective.querySurrealDB( "SELECT predicate, count() as total FROM link GROUP BY predicate" );

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:554 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:574 (opens in a new tab)


    remove

    remove(link, batchId?): Promise<boolean>

    Removes a link from the perspective.

    -

    Parameters

    +

    Parameters

    @@ -1327,16 +1786,16 @@

    NameTypeDescriptionlinkLinkExpressionInputThe link to removebatchId?stringOptional batch ID to group this operation with others -

    Returns

    +
    NameTypeDescription
    linkLinkExpressionInputThe link to remove
    batchId?stringOptional batch ID to group this operation with others
    +

    Returns

    Promise<boolean>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:652 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:672 (opens in a new tab)


    removeLinks

    -

    removeLinks(links, batchId?): Promise<LinkExpression[]>

    +

    removeLinks(links, batchId?): Promise<LinkExpression[]>

    Removes multiple links from the perspective.

    -

    Parameters

    +

    Parameters

    @@ -1357,17 +1816,17 @@

    NameTypeDescriptionlinksLinkExpressionInput[]Array of links to removebatchId?stringOptional batch ID to group this operation with others -

    Returns

    -

    Promise<LinkExpression[]>

    +
    NameTypeDescription
    linksLinkExpressionInput[]Array of links to remove
    batchId?stringOptional batch ID to group this operation with others
    +

    Returns

    +

    Promise<LinkExpression[]>

    Array of removed LinkExpressions

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:607 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:627 (opens in a new tab)


    removeListener

    removeListener(type, cb): Promise<void>

    Unsubscribes from link changes.

    -

    Parameters

    +

    Parameters

    @@ -1389,10 +1848,10 @@

    NameTypeDescriptiontypePerspectiveListenerTypesType of change to stop listening forcbLinkCallbackThe callback function to remove -

    Returns

    +

    Returns

    Promise<void>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:739 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:759 (opens in a new tab)


    removeSubject

    removeSubject<T>(subjectClass, exprAddr, batchId?): Promise<void>

    @@ -1411,7 +1870,7 @@

    NameT -

    Parameters

    +

    Parameters

    @@ -1438,15 +1897,15 @@

    NameTypeDescriptionsubjectClassTEither a string with the name of the subject class, or an object with the properties of the subject class. In the latter case, the first subject class that matches the given properties will be used.exprAddrstringThe address of the expression to be turned into a subject instancebatchId?stringOptional batch ID for grouping operations. If provided, the removal will be part of the batch and won't be executed until the batch is committed. -

    Returns

    +

    Returns

    Promise<void>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1060 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1460 (opens in a new tab)


    runFlowAction

    runFlowAction(flowName, exprAddr, actionName): Promise<void>

    Runs given Social DNA flow action

    -

    Parameters

    +

    Parameters

    @@ -1469,23 +1928,23 @@

    NameTypeflowNamestringexprAddrstringactionNamestring -

    Returns

    +

    Returns

    Promise<void>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:878 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:971 (opens in a new tab)


    sdnaFlows

    sdnaFlows(): Promise<string[]>

    Returns all the Social DNA flows defined in this perspective

    -

    Returns

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:840 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:860 (opens in a new tab)


    setSingleTarget

    setSingleTarget(link, status?): Promise<void>

    Sets a single target value, removing any existing targets.

    -

    Parameters

    +

    Parameters

    @@ -1509,8 +1968,8 @@

    NameTypeDefault valueDescriptionlinkLinkundefinedLink defining the new targetstatusLinkStatus'shared'Whether the link should be shared -

    Returns

    +
    NameTypeDefault valueDescription
    linkLinkundefinedLink defining the new target
    statusLinkStatus'shared'Whether the link should be shared
    +

    Returns

    Promise<void>

    Example

    // Set a user's status
    @@ -1519,23 +1978,23 @@ 

    predicate: "status", target: "online" });

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:824 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:844 (opens in a new tab)


    snapshot

    -

    snapshot(): Promise<Perspective>

    +

    snapshot(): Promise<Perspective>

    Creates a snapshot of the current perspective state. Useful for backup or sharing.

    -

    Returns

    -

    Promise<Perspective>

    +

    Returns

    +

    Promise<Perspective>

    Perspective object containing all links

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:761 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:781 (opens in a new tab)


    startFlow

    startFlow(flowName, exprAddr): Promise<void>

    Starts the Social DNA flow

    -

    Parameters

    +

    Parameters

    @@ -1557,10 +2016,10 @@

    NameTypeDescriptionflowNamestringon the expressionexprAddrstring -

    Returns

    +

    Returns

    Promise<void>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:852 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:902 (opens in a new tab)


    stringOrTemplateObjectToSubjectClassName

    stringOrTemplateObjectToSubjectClassName<T>(subjectClass): Promise<string>

    @@ -1577,7 +2036,7 @@

    NameT -

    Parameters

    +

    Parameters

    @@ -1592,29 +2051,30 @@

    NameTypesubjectClassT -

    Returns

    +

    Returns

    Promise<string>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:974 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1331 (opens in a new tab)


    subjectClasses

    subjectClasses(): Promise<string[]>

    Returns all the Subject classes defined in this perspectives SDNA

    -

    Returns

    +

    Uses SHACL-based lookup (Prolog-free implementation).

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:966 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:1307 (opens in a new tab)


    subjectClassesByTemplate

    subjectClassesByTemplate(obj): Promise<string[]>

    Returns all subject classes that match the given template object. This function looks at the properties of the template object and -its setters and collections to create a Prolog query that finds +its setters and relations to create a Prolog query that finds all subject classes that would be converted to a proxy object -with exactly the same properties and collections.

    +with exactly the same properties and relations.

    Since there could be multiple subject classes that match the given criteria, this function returns a list of class names.

    -

    Parameters

    +

    Parameters

    @@ -1631,13 +2091,13 @@

    NameTypeDescriptionobjobjectThe template object -

    Returns

    +

    Returns

    Promise<string[]>

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:1258 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:2038 (opens in a new tab)


    subscribeInfer

    -

    subscribeInfer(query): Promise<QuerySubscriptionProxy>

    +

    subscribeInfer(query): Promise<QuerySubscriptionProxy>

    Creates a subscription for a Prolog query that updates in real-time.

    This method:

      @@ -1651,7 +2111,7 @@

      The subscription will be automatically cleaned up on both frontend and backend when dispose() is called. Make sure to call dispose() when you're done to prevent memory leaks and ensure proper cleanup of resources.

      -

      Parameters

      +

      Parameters

      @@ -1668,8 +2128,8 @@

      NameTypeDescriptionquerystringProlog query string -

      Returns

      -

      Promise<QuerySubscriptionProxy>

      +

      Returns

      +

      Promise<QuerySubscriptionProxy>

      Initialized QuerySubscriptionProxy instance

      Example

      // Subscribe to active todos
      @@ -1688,11 +2148,11 @@ 

      // Clean up subscription when done subscription.dispose();

      -

      Defined in

      -

      perspectives/PerspectiveProxy.ts:1346 (opens in a new tab)

      +

      Defined in

      +

      perspectives/PerspectiveProxy.ts:2161 (opens in a new tab)


      subscribeSurrealDB

      -

      subscribeSurrealDB(query): Promise<QuerySubscriptionProxy>

      +

      subscribeSurrealDB(query): Promise<QuerySubscriptionProxy>

      Creates a subscription for a SurrealQL query that updates in real-time.

      This method:

        @@ -1706,7 +2166,7 @@

        The subscription will be automatically cleaned up on both frontend and backend when dispose() is called. Make sure to call dispose() when you're done to prevent memory leaks and ensure proper cleanup of resources.

        -

        Parameters

        +

        Parameters

        @@ -1723,16 +2183,16 @@

        NameTypeDescriptionquerystringSurrealQL query string -

        Returns

        -

        Promise<QuerySubscriptionProxy>

        +

        Returns

        +

        Promise<QuerySubscriptionProxy>

        Initialized QuerySubscriptionProxy instance

        -

        Defined in

        -

        perspectives/PerspectiveProxy.ts:1381 (opens in a new tab)

        +

        Defined in

        +

        perspectives/PerspectiveProxy.ts:2196 (opens in a new tab)


        update

        -

        update(oldLink, newLink, batchId?): Promise<LinkExpression>

        +

        update(oldLink, newLink, batchId?): Promise<LinkExpression>

        Updates an existing link with new data.

        -

        Parameters

        +

        Parameters

        @@ -1758,8 +2218,8 @@

        NameTypeDescriptionoldLinkLinkExpressionInputThe existing link to updatenewLinkLinkThe new link databatchId?stringOptional batch ID to group this operation with others -

        Returns

        -

        Promise<LinkExpression>

        -

        Defined in

        -

        perspectives/PerspectiveProxy.ts:642 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +
    NameTypeDescription
    oldLinkLinkExpressionInputThe existing link to update
    newLinkLinkThe new link data
    batchId?stringOptional batch ID to group this operation with others
    +

    Returns

    +

    Promise<LinkExpression>

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:662 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveUnsignedInput.html b/docs/jsdoc/classes/PerspectiveUnsignedInput.html new file mode 100644 index 000000000..0f030af24 --- /dev/null +++ b/docs/jsdoc/classes/PerspectiveUnsignedInput.html @@ -0,0 +1,75 @@ +Class: PerspectiveUnsignedInput | AD4M Docs
    API Reference
    classes
    Perspectiveunsignedinput

    @coasys/ad4m / Exports / PerspectiveUnsignedInput

    +

    Class: PerspectiveUnsignedInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new PerspectiveUnsignedInput(links?)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    links?LinkInput[]
    +

    Defined in

    +

    perspectives/Perspective.ts:103 (opens in a new tab)

    +

    Properties

    +

    links

    +

    links: LinkInput[]

    +

    Defined in

    +

    perspectives/Perspective.ts:101 (opens in a new tab)

    +

    Methods

    +

    fromLink

    +

    Static fromLink(link): PerspectiveUnsignedInput

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    linkLink
    +

    Returns

    +

    PerspectiveUnsignedInput

    +

    Defined in

    +

    perspectives/Perspective.ts:110 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/PerspectiveUnsignedInput/index.html b/docs/jsdoc/classes/PerspectiveUnsignedInput/index.html deleted file mode 100644 index 1044ef708..000000000 --- a/docs/jsdoc/classes/PerspectiveUnsignedInput/index.html +++ /dev/null @@ -1,75 +0,0 @@ -Class: PerspectiveUnsignedInput | AD4M Docs
    API Reference
    classes
    Perspectiveunsignedinput

    @coasys/ad4m / Exports / PerspectiveUnsignedInput

    -

    Class: PerspectiveUnsignedInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new PerspectiveUnsignedInput(links?)

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    links?LinkInput[]
    -

    Defined in

    -

    perspectives/Perspective.ts:103 (opens in a new tab)

    -

    Properties

    -

    links

    -

    links: LinkInput[]

    -

    Defined in

    -

    perspectives/Perspective.ts:101 (opens in a new tab)

    -

    Methods

    -

    fromLink

    -

    Static fromLink(link): PerspectiveUnsignedInput

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    linkLink
    -

    Returns

    -

    PerspectiveUnsignedInput

    -

    Defined in

    -

    perspectives/Perspective.ts:110 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/QuerySubscriptionProxy/index.html b/docs/jsdoc/classes/QuerySubscriptionProxy.html similarity index 53% rename from docs/jsdoc/classes/QuerySubscriptionProxy/index.html rename to docs/jsdoc/classes/QuerySubscriptionProxy.html index 96ba791d5..f806e90a6 100644 --- a/docs/jsdoc/classes/QuerySubscriptionProxy/index.html +++ b/docs/jsdoc/classes/QuerySubscriptionProxy.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    classes
    Querysubscriptionproxy

    @coasys/ad4m / Exports / QuerySubscriptionProxy

    +
    API Reference
    classes
    Querysubscriptionproxy

    @coasys/ad4m / Exports / QuerySubscriptionProxy

    Class: QuerySubscriptionProxy

    Proxy object for a subscribed Prolog query that provides real-time updates

    This class handles:

    @@ -44,37 +44,37 @@

    Table of contents

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    constructor

    @@ -108,22 +108,22 @@

    NameTypeDescriptionuuidstringThe UUID of the perspectivequerystringThe Prolog query to subscribe toclientPerspectiveClientThe PerspectiveClient instance to use for communication

    Defined in

    -

    perspectives/PerspectiveProxy.ts:78 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:81 (opens in a new tab)

    Properties

    #callbacks

    Private #callbacks: Set<QueryCallback>

    Defined in

    -

    perspectives/PerspectiveProxy.ts:61 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:64 (opens in a new tab)


    #client

    Private #client: PerspectiveClient

    Defined in

    -

    perspectives/PerspectiveProxy.ts:60 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:63 (opens in a new tab)


    #disposed

    Private #disposed: boolean = false

    Defined in

    -

    perspectives/PerspectiveProxy.ts:65 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:68 (opens in a new tab)


    #initReject

    Private Optional #initReject: (reason?: any) => void

    @@ -147,7 +147,7 @@
    Returns

    void

    Defined in

    -

    perspectives/PerspectiveProxy.ts:68 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:71 (opens in a new tab)


    #initResolve

    Private Optional #initResolve: (value: boolean) => void

    @@ -171,37 +171,37 @@
    Returns

    void

    Defined in

    -

    perspectives/PerspectiveProxy.ts:67 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:70 (opens in a new tab)


    #initTimeoutId

    Private Optional #initTimeoutId: Timeout

    Defined in

    -

    perspectives/PerspectiveProxy.ts:69 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:72 (opens in a new tab)


    #initialized

    Private #initialized: Promise<boolean>

    Defined in

    -

    perspectives/PerspectiveProxy.ts:66 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:69 (opens in a new tab)


    #keepaliveTimer

    Private #keepaliveTimer: number

    Defined in

    -

    perspectives/PerspectiveProxy.ts:62 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:65 (opens in a new tab)


    #latestResult

    -

    Private #latestResult: AllInstancesResult

    +

    Private #latestResult: AllInstancesResult

    Defined in

    -

    perspectives/PerspectiveProxy.ts:64 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:67 (opens in a new tab)


    #query

    Private #query: string

    Defined in

    -

    perspectives/PerspectiveProxy.ts:70 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:73 (opens in a new tab)


    #subscriptionId

    Private #subscriptionId: string

    Defined in

    -

    perspectives/PerspectiveProxy.ts:59 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:62 (opens in a new tab)


    #unsubscribe

    Private Optional #unsubscribe: () => void

    @@ -210,17 +210,17 @@

    Returns

    void

    Defined in

    -

    perspectives/PerspectiveProxy.ts:63 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:66 (opens in a new tab)


    #uuid

    Private #uuid: string

    Defined in

    -

    perspectives/PerspectiveProxy.ts:58 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:61 (opens in a new tab)


    isSurrealDB

    isSurrealDB: boolean = false

    Defined in

    -

    perspectives/PerspectiveProxy.ts:71 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:74 (opens in a new tab)

    Accessors

    id

    get id(): string

    @@ -232,7 +232,7 @@

    string

    The subscription ID string

    Defined in

    -

    perspectives/PerspectiveProxy.ts:217 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:220 (opens in a new tab)


    initialized

    get initialized(): Promise<boolean>

    @@ -247,10 +247,10 @@

    Returns

    Promise<boolean>

    Defined in

    -

    perspectives/PerspectiveProxy.ts:232 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:235 (opens in a new tab)


    result

    -

    get result(): AllInstancesResult

    +

    get result(): AllInstancesResult

    Get the latest query result

    This returns the most recent result from the query, which could be either:

      @@ -258,10 +258,10 @@

      The latest update received through the subscription

    Returns

    -

    AllInstancesResult

    +

    AllInstancesResult

    The latest query result as a string (usually a JSON array of bindings)

    Defined in

    -

    perspectives/PerspectiveProxy.ts:244 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:247 (opens in a new tab)

    Methods

    #notifyCallbacks

    Private #notifyCallbacks(result): void

    @@ -280,11 +280,11 @@

    NameTyperesultAllInstancesResult +
    NameType
    resultAllInstancesResult

    Returns

    void

    Defined in

    -

    perspectives/PerspectiveProxy.ts:273 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:276 (opens in a new tab)


    dispose

    dispose(): void

    @@ -301,7 +301,7 @@

    Returns

    void

    Defined in

    -

    perspectives/PerspectiveProxy.ts:294 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:297 (opens in a new tab)


    onResult

    onResult(callback): () => void

    @@ -352,11 +352,11 @@
    // Later: stop receiving updates removeCallback();

    Defined in

    -

    perspectives/PerspectiveProxy.ts:267 (opens in a new tab)

    +

    perspectives/PerspectiveProxy.ts:270 (opens in a new tab)


    subscribe

    subscribe(): Promise<void>

    Returns

    Promise<void>

    Defined in

    -

    perspectives/PerspectiveProxy.ts:92 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +

    perspectives/PerspectiveProxy.ts:95 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Resource.html b/docs/jsdoc/classes/Resource.html new file mode 100644 index 000000000..d4d6a05f7 --- /dev/null +++ b/docs/jsdoc/classes/Resource.html @@ -0,0 +1,59 @@ +Class: Resource | AD4M Docs
    API Reference
    classes
    Resource

    @coasys/ad4m / Exports / Resource

    +

    Class: Resource

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Resource(domain, pointers)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    domainstring
    pointersstring[]
    +

    Defined in

    +

    agent/Agent.ts:151 (opens in a new tab)

    +

    Properties

    +

    domain

    +

    domain: string

    +

    Defined in

    +

    agent/Agent.ts:146 (opens in a new tab)

    +
    +

    pointers

    +

    pointers: string[]

    +

    Defined in

    +

    agent/Agent.ts:149 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Resource/index.html b/docs/jsdoc/classes/Resource/index.html deleted file mode 100644 index d7db2f18e..000000000 --- a/docs/jsdoc/classes/Resource/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: Resource | AD4M Docs
    API Reference
    classes
    Resource

    @coasys/ad4m / Exports / Resource

    -

    Class: Resource

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new Resource(domain, pointers)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    domainstring
    pointersstring[]
    -

    Defined in

    -

    agent/Agent.ts:151 (opens in a new tab)

    -

    Properties

    -

    domain

    -

    domain: string

    -

    Defined in

    -

    agent/Agent.ts:146 (opens in a new tab)

    -
    -

    pointers

    -

    pointers: string[]

    -

    Defined in

    -

    agent/Agent.ts:149 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ResourceInput.html b/docs/jsdoc/classes/ResourceInput.html new file mode 100644 index 000000000..d43257caa --- /dev/null +++ b/docs/jsdoc/classes/ResourceInput.html @@ -0,0 +1,59 @@ +Class: ResourceInput | AD4M Docs
    API Reference
    classes
    Resourceinput

    @coasys/ad4m / Exports / ResourceInput

    +

    Class: ResourceInput

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new ResourceInput(domain, pointers)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    domainstring
    pointersstring[]
    +

    Defined in

    +

    agent/Agent.ts:238 (opens in a new tab)

    +

    Properties

    +

    domain

    +

    domain: string

    +

    Defined in

    +

    agent/Agent.ts:233 (opens in a new tab)

    +
    +

    pointers

    +

    pointers: string[]

    +

    Defined in

    +

    agent/Agent.ts:236 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/ResourceInput/index.html b/docs/jsdoc/classes/ResourceInput/index.html deleted file mode 100644 index bf242eb3b..000000000 --- a/docs/jsdoc/classes/ResourceInput/index.html +++ /dev/null @@ -1,59 +0,0 @@ -Class: ResourceInput | AD4M Docs
    API Reference
    classes
    Resourceinput

    @coasys/ad4m / Exports / ResourceInput

    -

    Class: ResourceInput

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new ResourceInput(domain, pointers)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    domainstring
    pointersstring[]
    -

    Defined in

    -

    agent/Agent.ts:238 (opens in a new tab)

    -

    Properties

    -

    domain

    -

    domain: string

    -

    Defined in

    -

    agent/Agent.ts:233 (opens in a new tab)

    -
    -

    pointers

    -

    pointers: string[]

    -

    Defined in

    -

    agent/Agent.ts:236 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/RuntimeInfo.html b/docs/jsdoc/classes/RuntimeInfo.html new file mode 100644 index 000000000..2c722c359 --- /dev/null +++ b/docs/jsdoc/classes/RuntimeInfo.html @@ -0,0 +1,44 @@ +Class: RuntimeInfo | AD4M Docs
    API Reference
    classes
    Runtimeinfo

    @coasys/ad4m / Exports / RuntimeInfo

    +

    Class: RuntimeInfo

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new RuntimeInfo()

    +

    Properties

    +

    ad4mExecutorVersion

    +

    ad4mExecutorVersion: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:39 (opens in a new tab)

    +
    +

    isInitialized

    +

    isInitialized: Boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:41 (opens in a new tab)

    +
    +

    isUnlocked

    +

    isUnlocked: Boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:43 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/RuntimeInfo/index.html b/docs/jsdoc/classes/RuntimeInfo/index.html deleted file mode 100644 index a5e42fc05..000000000 --- a/docs/jsdoc/classes/RuntimeInfo/index.html +++ /dev/null @@ -1,44 +0,0 @@ -Class: RuntimeInfo | AD4M Docs
    API Reference
    classes
    Runtimeinfo

    @coasys/ad4m / Exports / RuntimeInfo

    -

    Class: RuntimeInfo

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new RuntimeInfo()

    -

    Properties

    -

    ad4mExecutorVersion

    -

    ad4mExecutorVersion: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:38 (opens in a new tab)

    -
    -

    isInitialized

    -

    isInitialized: Boolean

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:40 (opens in a new tab)

    -
    -

    isUnlocked

    -

    isUnlocked: Boolean

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:42 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SHACLFlow.html b/docs/jsdoc/classes/SHACLFlow.html new file mode 100644 index 000000000..c6de2cc97 --- /dev/null +++ b/docs/jsdoc/classes/SHACLFlow.html @@ -0,0 +1,357 @@ +Class: SHACLFlow | AD4M Docs
    API Reference
    classes
    Shaclflow

    @coasys/ad4m / Exports / SHACLFlow

    +

    Class: SHACLFlow

    +

    SHACL Flow - represents a state machine for AD4M expressions

    +

    Flows define:

    +
      +
    • Which expressions can enter the flow (flowable condition)
    • +
    • What states exist and how to detect them (via link patterns)
    • +
    • How to transition between states (via actions)
    • +
    +

    Example

    +
    const todoFlow = new SHACLFlow('todo://TODO', 'todo://');
    + 
    +// Any expression can become a TODO
    +todoFlow.flowable = 'any';
    + 
    +// Define states
    +todoFlow.addState({
    +  name: 'ready',
    +  value: 0,
    +  stateCheck: { predicate: 'todo://state', target: 'todo://ready' }
    +});
    +todoFlow.addState({
    +  name: 'doing', 
    +  value: 0.5,
    +  stateCheck: { predicate: 'todo://state', target: 'todo://doing' }
    +});
    +todoFlow.addState({
    +  name: 'done',
    +  value: 1,
    +  stateCheck: { predicate: 'todo://state', target: 'todo://done' }
    +});
    + 
    +// Define start action
    +todoFlow.startAction = [{
    +  action: 'addLink',
    +  source: 'this',
    +  predicate: 'todo://state',
    +  target: 'todo://ready'
    +}];
    + 
    +// Define transitions
    +todoFlow.addTransition({
    +  actionName: 'Start',
    +  fromState: 'ready',
    +  toState: 'doing',
    +  actions: [
    +    { action: 'addLink', source: 'this', predicate: 'todo://state', target: 'todo://doing' },
    +    { action: 'removeLink', source: 'this', predicate: 'todo://state', target: 'todo://ready' }
    +  ]
    +});
    + 
    +// Store in perspective
    +await perspective.addFlow('TODO', todoFlow);
    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new SHACLFlow(name, namespace)

    +

    Create a new SHACL Flow

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    namestringFlow name (e.g., "TODO")
    namespacestringNamespace for URIs (e.g., "todo://")
    +

    Defined in

    +

    shacl/SHACLFlow.ts:135 (opens in a new tab)

    +

    Properties

    +

    _states

    +

    Private _states: FlowState[] = []

    +

    States in this flow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:125 (opens in a new tab)

    +
    +

    _transitions

    +

    Private _transitions: FlowTransition[] = []

    +

    Transitions between states

    +

    Defined in

    +

    shacl/SHACLFlow.ts:128 (opens in a new tab)

    +
    +

    flowable

    +

    flowable: FlowableCondition = "any"

    +

    Condition for which expressions can start this flow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:119 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    Flow name (e.g., "TODO")

    +

    Defined in

    +

    shacl/SHACLFlow.ts:113 (opens in a new tab)

    +
    +

    namespace

    +

    namespace: string

    +

    Namespace for generated URIs

    +

    Defined in

    +

    shacl/SHACLFlow.ts:116 (opens in a new tab)

    +
    +

    startAction

    +

    startAction: AD4MAction[] = []

    +

    Actions to execute when starting the flow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:122 (opens in a new tab)

    +

    Accessors

    +

    flowUri

    +

    get flowUri(): string

    +

    Get the flow shape URI

    +

    Returns

    +

    string

    +

    Defined in

    +

    shacl/SHACLFlow.ts:169 (opens in a new tab)

    +
    +

    states

    +

    get states(): FlowState[]

    +

    Get all states

    +

    Returns

    +

    FlowState[]

    +

    Defined in

    +

    shacl/SHACLFlow.ts:141 (opens in a new tab)

    +
    +

    transitions

    +

    get transitions(): FlowTransition[]

    +

    Get all transitions

    +

    Returns

    +

    FlowTransition[]

    +

    Defined in

    +

    shacl/SHACLFlow.ts:146 (opens in a new tab)

    +

    Methods

    +

    addState

    +

    addState(state): void

    +

    Add a state to the flow

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    stateFlowStateState definition
    +

    Returns

    +

    void

    +

    Defined in

    +

    shacl/SHACLFlow.ts:154 (opens in a new tab)

    +
    +

    addTransition

    +

    addTransition(transition): void

    +

    Add a transition to the flow

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    transitionFlowTransitionTransition definition
    +

    Returns

    +

    void

    +

    Defined in

    +

    shacl/SHACLFlow.ts:162 (opens in a new tab)

    +
    +

    stateUri

    +

    stateUri(stateName): string

    +

    Get a state URI

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    stateNamestring
    +

    Returns

    +

    string

    +

    Defined in

    +

    shacl/SHACLFlow.ts:176 (opens in a new tab)

    +
    +

    toJSON

    +

    toJSON(): object

    +

    Convert to JSON representation

    +

    Returns

    +

    object

    +

    Defined in

    +

    shacl/SHACLFlow.ts:477 (opens in a new tab)

    +
    +

    toLinks

    +

    toLinks(): Link[]

    +

    Serialize the flow to AD4M links +These links can be stored in a perspective and queried via SurrealDB

    +

    Returns

    +

    Link[]

    +

    Array of Link objects representing the flow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:193 (opens in a new tab)

    +
    +

    transitionUri

    +

    transitionUri(fromState, toState): string

    +

    Get a transition URI

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    fromStatestring
    toStatestring
    +

    Returns

    +

    string

    +

    Defined in

    +

    shacl/SHACLFlow.ts:183 (opens in a new tab)

    +
    +

    fromJSON

    +

    Static fromJSON(json): SHACLFlow

    +

    Create from JSON representation

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    jsonany
    +

    Returns

    +

    SHACLFlow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:491 (opens in a new tab)

    +
    +

    fromLinks

    +

    Static fromLinks(links, flowUri): SHACLFlow

    +

    Reconstruct a SHACLFlow from links

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    linksLink[]Array of links containing the flow definition
    flowUristringThe URI of the flow to reconstruct
    +

    Returns

    +

    SHACLFlow

    +

    Reconstructed SHACLFlow

    +

    Defined in

    +

    shacl/SHACLFlow.ts:334 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SHACLShape.html b/docs/jsdoc/classes/SHACLShape.html new file mode 100644 index 000000000..711baa498 --- /dev/null +++ b/docs/jsdoc/classes/SHACLShape.html @@ -0,0 +1,281 @@ +Class: SHACLShape | AD4M Docs
    API Reference
    classes
    Shaclshape

    @coasys/ad4m / Exports / SHACLShape

    +

    Class: SHACLShape

    +

    SHACL Node Shape +Defines constraints for instances of a class

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new SHACLShape(targetClassOrShapeUri, targetClass?)

    +

    Create a new SHACL Shape

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    targetClassOrShapeUristringIf one argument: the target class (shape URI auto-derived as {class}Shape) If two arguments: first is shape URI, second is target class
    targetClass?stringOptional target class when first arg is shape URI
    +

    Defined in

    +

    shacl/SHACLShape.ts:208 (opens in a new tab)

    +

    Properties

    +

    constructor_actions

    +

    Optional constructor_actions: AD4MAction[]

    +

    AD4M-specific: Constructor actions for creating instances

    +

    Defined in

    +

    shacl/SHACLShape.ts:194 (opens in a new tab)

    +
    +

    destructor_actions

    +

    Optional destructor_actions: AD4MAction[]

    +

    AD4M-specific: Destructor actions for removing instances

    +

    Defined in

    +

    shacl/SHACLShape.ts:197 (opens in a new tab)

    +
    +

    nodeShapeUri

    +

    nodeShapeUri: string

    +

    URI of this shape (e.g., recipe:RecipeShape)

    +

    Defined in

    +

    shacl/SHACLShape.ts:185 (opens in a new tab)

    +
    +

    parentShapes

    +

    parentShapes: string[]

    +

    Parent shape URIs for model inheritance (sh:node references)

    +

    Defined in

    +

    shacl/SHACLShape.ts:200 (opens in a new tab)

    +
    +

    properties

    +

    properties: SHACLPropertyShape[]

    +

    Property constraints

    +

    Defined in

    +

    shacl/SHACLShape.ts:191 (opens in a new tab)

    +
    +

    targetClass

    +

    Optional targetClass: string

    +

    Target class this shape applies to (e.g., recipe:Recipe)

    +

    Defined in

    +

    shacl/SHACLShape.ts:188 (opens in a new tab)

    +

    Methods

    +

    addParentShape

    +

    addParentShape(parentShapeUri): void

    +

    Add a parent shape reference (sh:node) for model inheritance. +When a

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    parentShapeUristring
    +

    Returns

    +

    void

    +

    Model

    +

    class extends another @Model, the child shape +references the parent shape so SHACL validators can walk the +class hierarchy.

    +

    Defined in

    +

    shacl/SHACLShape.ts:231 (opens in a new tab)

    +
    +

    addProperty

    +

    addProperty(prop): void

    +

    Add a property constraint to this shape

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    propSHACLPropertyShape
    +

    Returns

    +

    void

    +

    Defined in

    +

    shacl/SHACLShape.ts:240 (opens in a new tab)

    +
    +

    setConstructorActions

    +

    setConstructorActions(actions): void

    +

    Set constructor actions for this shape

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    actionsAD4MAction[]
    +

    Returns

    +

    void

    +

    Defined in

    +

    shacl/SHACLShape.ts:247 (opens in a new tab)

    +
    +

    setDestructorActions

    +

    setDestructorActions(actions): void

    +

    Set destructor actions for this shape

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    actionsAD4MAction[]
    +

    Returns

    +

    void

    +

    Defined in

    +

    shacl/SHACLShape.ts:254 (opens in a new tab)

    +
    +

    toJSON

    +

    toJSON(): object

    +

    Convert the shape to a JSON-serializable object. +Useful for passing to addSdna() as shaclJson parameter.

    +

    Returns

    +

    object

    +

    JSON-serializable object representing the shape

    +

    Defined in

    +

    shacl/SHACLShape.ts:790 (opens in a new tab)

    +
    +

    toLinks

    +

    toLinks(): Link[]

    +

    Serialize shape to AD4M Links (RDF triples) +Stores the shape as a graph of links in a Perspective

    +

    Returns

    +

    Link[]

    +

    Defined in

    +

    shacl/SHACLShape.ts:340 (opens in a new tab)

    +
    +

    toTurtle

    +

    toTurtle(): string

    +

    Serialize shape to Turtle (RDF) format

    +

    Returns

    +

    string

    +

    Defined in

    +

    shacl/SHACLShape.ts:261 (opens in a new tab)

    +
    +

    fromJSON

    +

    Static fromJSON(json): SHACLShape

    +

    Create a shape from a JSON object (inverse of toJSON)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    jsonany
    +

    Returns

    +

    SHACLShape

    +

    Defined in

    +

    shacl/SHACLShape.ts:824 (opens in a new tab)

    +
    +

    fromLinks

    +

    Static fromLinks(links, shapeUri): SHACLShape

    +

    Reconstruct shape from AD4M Links

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    linksLink[]
    shapeUristring
    +

    Returns

    +

    SHACLShape

    +

    Defined in

    +

    shacl/SHACLShape.ts:556 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SentMessage.html b/docs/jsdoc/classes/SentMessage.html new file mode 100644 index 000000000..1bc4ee29c --- /dev/null +++ b/docs/jsdoc/classes/SentMessage.html @@ -0,0 +1,38 @@ +Class: SentMessage | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SentMessage/index.html b/docs/jsdoc/classes/SentMessage/index.html deleted file mode 100644 index 03cb8de9b..000000000 --- a/docs/jsdoc/classes/SentMessage/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Class: SentMessage | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SmartLiteral.html b/docs/jsdoc/classes/SmartLiteral.html new file mode 100644 index 000000000..dc2751d19 --- /dev/null +++ b/docs/jsdoc/classes/SmartLiteral.html @@ -0,0 +1,181 @@ +Class: SmartLiteral | AD4M Docs
    API Reference
    classes
    Smartliteral

    @coasys/ad4m / Exports / SmartLiteral

    +

    Class: SmartLiteral

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new SmartLiteral(perspective, base)

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    basestring
    +

    Defined in

    +

    SmartLiteral.ts:23 (opens in a new tab)

    +

    Properties

    +

    #base

    +

    Private #base: string

    +

    Defined in

    +

    SmartLiteral.ts:21 (opens in a new tab)

    +
    +

    #perspective

    +

    Private #perspective: PerspectiveProxy

    +

    Defined in

    +

    SmartLiteral.ts:20 (opens in a new tab)

    +

    Accessors

    +

    base

    +

    get base(): string

    +

    Returns

    +

    string

    +

    Defined in

    +

    SmartLiteral.ts:28 (opens in a new tab)

    +

    Methods

    +

    get

    +

    get(): Promise<any>

    +

    Returns

    +

    Promise<any>

    +

    Defined in

    +

    SmartLiteral.ts:54 (opens in a new tab)

    +
    +

    set

    +

    set(content): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    contentany
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    SmartLiteral.ts:67 (opens in a new tab)

    +
    +

    create

    +

    Static create(perspective, literal): Promise<SmartLiteral>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    literalany
    +

    Returns

    +

    Promise<SmartLiteral>

    +

    Defined in

    +

    SmartLiteral.ts:32 (opens in a new tab)

    +
    +

    getAllSmartLiterals

    +

    Static getAllSmartLiterals(perspective): Promise<SmartLiteral[]>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    +

    Returns

    +

    Promise<SmartLiteral[]>

    +

    Defined in

    +

    SmartLiteral.ts:47 (opens in a new tab)

    +
    +

    isSmartLiteralBase

    +

    Static isSmartLiteralBase(perspective, base): Promise<boolean>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    perspectivePerspectiveProxy
    basestring
    +

    Returns

    +

    Promise<boolean>

    +

    Defined in

    +

    SmartLiteral.ts:39 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/SmartLiteral/index.html b/docs/jsdoc/classes/SmartLiteral/index.html deleted file mode 100644 index 831b3b18a..000000000 --- a/docs/jsdoc/classes/SmartLiteral/index.html +++ /dev/null @@ -1,181 +0,0 @@ -Class: SmartLiteral | AD4M Docs
    API Reference
    classes
    Smartliteral

    @coasys/ad4m / Exports / SmartLiteral

    -

    Class: SmartLiteral

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Accessors

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new SmartLiteral(perspective, base)

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    basestring
    -

    Defined in

    -

    SmartLiteral.ts:23 (opens in a new tab)

    -

    Properties

    -

    #base

    -

    Private #base: string

    -

    Defined in

    -

    SmartLiteral.ts:21 (opens in a new tab)

    -
    -

    #perspective

    -

    Private #perspective: PerspectiveProxy

    -

    Defined in

    -

    SmartLiteral.ts:20 (opens in a new tab)

    -

    Accessors

    -

    base

    -

    get base(): string

    -

    Returns

    -

    string

    -

    Defined in

    -

    SmartLiteral.ts:28 (opens in a new tab)

    -

    Methods

    -

    get

    -

    get(): Promise<any>

    -

    Returns

    -

    Promise<any>

    -

    Defined in

    -

    SmartLiteral.ts:54 (opens in a new tab)

    -
    -

    set

    -

    set(content): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    contentany
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    SmartLiteral.ts:67 (opens in a new tab)

    -
    -

    create

    -

    Static create(perspective, literal): Promise<SmartLiteral>

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    literalany
    -

    Returns

    -

    Promise<SmartLiteral>

    -

    Defined in

    -

    SmartLiteral.ts:32 (opens in a new tab)

    -
    -

    getAllSmartLiterals

    -

    Static getAllSmartLiterals(perspective): Promise<SmartLiteral[]>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    -

    Returns

    -

    Promise<SmartLiteral[]>

    -

    Defined in

    -

    SmartLiteral.ts:47 (opens in a new tab)

    -
    -

    isSmartLiteralBase

    -

    Static isSmartLiteralBase(perspective, base): Promise<boolean>

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    perspectivePerspectiveProxy
    basestring
    -

    Returns

    -

    Promise<boolean>

    -

    Defined in

    -

    SmartLiteral.ts:39 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Subject.html b/docs/jsdoc/classes/Subject.html new file mode 100644 index 000000000..c1fb675da --- /dev/null +++ b/docs/jsdoc/classes/Subject.html @@ -0,0 +1,101 @@ +Class: Subject | AD4M Docs
    API Reference
    classes
    Subject

    @coasys/ad4m / Exports / Subject

    +

    Class: Subject

    +

    Represents a subject in the perspective. +A subject is an entity that has properties and relations.

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Accessors

    + +

    Methods

    + +

    Constructors

    +

    constructor

    +

    new Subject(perspective, baseExpression, subjectClassName)

    +

    Constructs a new subject.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective that the subject belongs to.
    baseExpressionstringThe base expression of the subject.
    subjectClassNamestringThe class name of the subject.
    +

    Defined in

    +

    model/Subject.ts:19 (opens in a new tab)

    +

    Properties

    +

    #baseExpression

    +

    Private #baseExpression: string

    +

    Defined in

    +

    model/Subject.ts:9 (opens in a new tab)

    +
    +

    #perspective

    +

    Private #perspective: PerspectiveProxy

    +

    Defined in

    +

    model/Subject.ts:11 (opens in a new tab)

    +
    +

    #subjectClassName

    +

    Private #subjectClassName: string

    +

    Defined in

    +

    model/Subject.ts:10 (opens in a new tab)

    +

    Accessors

    +

    baseExpression

    +

    get baseExpression(): string

    +

    Gets the base expression of the subject.

    +

    Returns

    +

    string

    +

    Defined in

    +

    model/Subject.ts:28 (opens in a new tab)

    +

    Methods

    +

    init

    +

    init(): Promise<void>

    +

    Initializes the subject by validating it and defining its properties and relations dynamically.

    +

    NOTE: This method should be called before using the subject. All the properties and relations of the subject defined are not type-checked.

    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    model/Subject.ts:37 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/Subject/index.html b/docs/jsdoc/classes/Subject/index.html deleted file mode 100644 index 4e105683c..000000000 --- a/docs/jsdoc/classes/Subject/index.html +++ /dev/null @@ -1,101 +0,0 @@ -Class: Subject | AD4M Docs
    API Reference
    classes
    Subject

    @coasys/ad4m / Exports / Subject

    -

    Class: Subject

    -

    Represents a subject in the perspective. -A subject is an entity that has properties and collections.

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Accessors

    - -

    Methods

    - -

    Constructors

    -

    constructor

    -

    new Subject(perspective, baseExpression, subjectClassName)

    -

    Constructs a new subject.

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    perspectivePerspectiveProxyThe perspective that the subject belongs to.
    baseExpressionstringThe base expression of the subject.
    subjectClassNamestringThe class name of the subject.
    -

    Defined in

    -

    model/Subject.ts:19 (opens in a new tab)

    -

    Properties

    -

    #baseExpression

    -

    Private #baseExpression: string

    -

    Defined in

    -

    model/Subject.ts:9 (opens in a new tab)

    -
    -

    #perspective

    -

    Private #perspective: PerspectiveProxy

    -

    Defined in

    -

    model/Subject.ts:11 (opens in a new tab)

    -
    -

    #subjectClassName

    -

    Private #subjectClassName: string

    -

    Defined in

    -

    model/Subject.ts:10 (opens in a new tab)

    -

    Accessors

    -

    baseExpression

    -

    get baseExpression(): string

    -

    Gets the base expression of the subject.

    -

    Returns

    -

    string

    -

    Defined in

    -

    model/Subject.ts:28 (opens in a new tab)

    -

    Methods

    -

    init

    -

    init(): Promise<void>

    -

    Initializes the subject by validating it and defining its properties and collections dynamically.

    -

    NOTE: This method should be called before using the subject. All the properties and collections of the subject defined are not type-checked.

    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    model/Subject.ts:37 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/TriggeredNotification.html b/docs/jsdoc/classes/TriggeredNotification.html new file mode 100644 index 000000000..6d80bf15f --- /dev/null +++ b/docs/jsdoc/classes/TriggeredNotification.html @@ -0,0 +1,44 @@ +Class: TriggeredNotification | AD4M Docs
    API Reference
    classes
    Triggerednotification

    @coasys/ad4m / Exports / TriggeredNotification

    +

    Class: TriggeredNotification

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new TriggeredNotification()

    +

    Properties

    +

    notification

    +

    notification: Notification

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:132 (opens in a new tab)

    +
    +

    perspectiveId

    +

    perspectiveId: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:134 (opens in a new tab)

    +
    +

    triggerMatch

    +

    triggerMatch: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:139 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/TriggeredNotification/index.html b/docs/jsdoc/classes/TriggeredNotification/index.html deleted file mode 100644 index 49dafd413..000000000 --- a/docs/jsdoc/classes/TriggeredNotification/index.html +++ /dev/null @@ -1,44 +0,0 @@ -Class: TriggeredNotification | AD4M Docs
    API Reference
    classes
    Triggerednotification

    @coasys/ad4m / Exports / TriggeredNotification

    -

    Class: TriggeredNotification

    -

    Table of contents

    -

    Constructors

    - -

    Properties

    - -

    Constructors

    -

    constructor

    -

    new TriggeredNotification()

    -

    Properties

    -

    notification

    -

    notification: Notification

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:131 (opens in a new tab)

    -
    -

    perspectiveId

    -

    perspectiveId: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:133 (opens in a new tab)

    -
    -

    triggerMatch

    -

    triggerMatch: string

    -

    Defined in

    -

    runtime/RuntimeResolver.ts:138 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/UserCreationResult.html b/docs/jsdoc/classes/UserCreationResult.html new file mode 100644 index 000000000..3f996741c --- /dev/null +++ b/docs/jsdoc/classes/UserCreationResult.html @@ -0,0 +1,69 @@ +Class: UserCreationResult | AD4M Docs
    API Reference
    classes
    Usercreationresult

    @coasys/ad4m / Exports / UserCreationResult

    +

    Class: UserCreationResult

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new UserCreationResult(did, success, error?)

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    didstring
    successboolean
    error?string
    +

    Defined in

    +

    agent/Agent.ts:307 (opens in a new tab)

    +

    Properties

    +

    did

    +

    did: string

    +

    Defined in

    +

    agent/Agent.ts:299 (opens in a new tab)

    +
    +

    error

    +

    Optional error: string

    +

    Defined in

    +

    agent/Agent.ts:305 (opens in a new tab)

    +
    +

    success

    +

    success: boolean

    +

    Defined in

    +

    agent/Agent.ts:302 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/UserStatistics.html b/docs/jsdoc/classes/UserStatistics.html new file mode 100644 index 000000000..2787e05d5 --- /dev/null +++ b/docs/jsdoc/classes/UserStatistics.html @@ -0,0 +1,50 @@ +Class: UserStatistics | AD4M Docs
    API Reference
    classes
    Userstatistics

    @coasys/ad4m / Exports / UserStatistics

    +

    Class: UserStatistics

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new UserStatistics()

    +

    Properties

    +

    did

    +

    did: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:202 (opens in a new tab)

    +
    +

    email

    +

    email: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:199 (opens in a new tab)

    +
    +

    lastSeen

    +

    Optional lastSeen: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:205 (opens in a new tab)

    +
    +

    perspectiveCount

    +

    perspectiveCount: number

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:208 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/classes/VerificationRequestResult.html b/docs/jsdoc/classes/VerificationRequestResult.html new file mode 100644 index 000000000..05744de97 --- /dev/null +++ b/docs/jsdoc/classes/VerificationRequestResult.html @@ -0,0 +1,50 @@ +Class: VerificationRequestResult | AD4M Docs
    API Reference
    classes
    Verificationrequestresult

    @coasys/ad4m / Exports / VerificationRequestResult

    +

    Class: VerificationRequestResult

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new VerificationRequestResult()

    +

    Properties

    +

    isExistingUser

    +

    isExistingUser: boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:223 (opens in a new tab)

    +
    +

    message

    +

    message: string

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:217 (opens in a new tab)

    +
    +

    requiresPassword

    +

    requiresPassword: boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:220 (opens in a new tab)

    +
    +

    success

    +

    success: boolean

    +

    Defined in

    +

    runtime/RuntimeResolver.ts:214 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/enums/ExceptionType.html b/docs/jsdoc/enums/ExceptionType.html new file mode 100644 index 000000000..89bcf96db --- /dev/null +++ b/docs/jsdoc/enums/ExceptionType.html @@ -0,0 +1,49 @@ +Enumeration: ExceptionType | AD4M Docs
    API Reference
    enums
    Exceptiontype

    @coasys/ad4m / Exports / ExceptionType

    +

    Enumeration: ExceptionType

    +

    Table of contents

    +

    Enumeration Members

    + +

    Enumeration Members

    +

    AgentIsUntrusted

    +

    AgentIsUntrusted = "AGENT_IS_UNTRUSTED"

    +

    Defined in

    +

    Exception.ts:4 (opens in a new tab)

    +
    +

    CapabilityRequested

    +

    CapabilityRequested = "CAPABILITY_REQUESTED"

    +

    Defined in

    +

    Exception.ts:5 (opens in a new tab)

    +
    +

    ExpressionIsNotVerified

    +

    ExpressionIsNotVerified = "EXPRESSION_IS_NOT_VERIFIED"

    +

    Defined in

    +

    Exception.ts:3 (opens in a new tab)

    +
    +

    InstallNotificationRequest

    +

    InstallNotificationRequest = "INSTALL_NOTIFICATION_REQUEST"

    +

    Defined in

    +

    Exception.ts:6 (opens in a new tab)

    +
    +

    LanguageIsNotLoaded

    +

    LanguageIsNotLoaded = "LANGUAGE_IS_NOT_LOADED"

    +

    Defined in

    +

    Exception.ts:2 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/enums/ExceptionType/index.html b/docs/jsdoc/enums/ExceptionType/index.html deleted file mode 100644 index b09a5f5be..000000000 --- a/docs/jsdoc/enums/ExceptionType/index.html +++ /dev/null @@ -1,49 +0,0 @@ -Enumeration: ExceptionType | AD4M Docs
    API Reference
    enums
    Exceptiontype

    @coasys/ad4m / Exports / ExceptionType

    -

    Enumeration: ExceptionType

    -

    Table of contents

    -

    Enumeration Members

    - -

    Enumeration Members

    -

    AgentIsUntrusted

    -

    AgentIsUntrusted = "AGENT_IS_UNTRUSTED"

    -

    Defined in

    -

    Exception.ts:4 (opens in a new tab)

    -
    -

    CapabilityRequested

    -

    CapabilityRequested = "CAPABILITY_REQUESTED"

    -

    Defined in

    -

    Exception.ts:5 (opens in a new tab)

    -
    -

    ExpressionIsNotVerified

    -

    ExpressionIsNotVerified = "EXPRESSION_IS_NOT_VERIFIED"

    -

    Defined in

    -

    Exception.ts:3 (opens in a new tab)

    -
    -

    InstallNotificationRequest

    -

    InstallNotificationRequest = "INSTALL_NOTIFICATION_REQUEST"

    -

    Defined in

    -

    Exception.ts:6 (opens in a new tab)

    -
    -

    LanguageIsNotLoaded

    -

    LanguageIsNotLoaded = "LANGUAGE_IS_NOT_LOADED"

    -

    Defined in

    -

    Exception.ts:2 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/enums/PerspectiveState.html b/docs/jsdoc/enums/PerspectiveState.html new file mode 100644 index 000000000..1e8b9cd74 --- /dev/null +++ b/docs/jsdoc/enums/PerspectiveState.html @@ -0,0 +1,55 @@ +Enumeration: PerspectiveState | AD4M Docs
    API Reference
    enums
    Perspectivestate

    @coasys/ad4m / Exports / PerspectiveState

    +

    Enumeration: PerspectiveState

    +

    Table of contents

    +

    Enumeration Members

    + +

    Enumeration Members

    +

    LinkLanguageFailedToInstall

    +

    LinkLanguageFailedToInstall = "LINK_LANGUAGE_FAILED_TO_INSTALL"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:8 (opens in a new tab)

    +
    +

    LinkLanguageInstalledButNotSynced

    +

    LinkLanguageInstalledButNotSynced = "LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:9 (opens in a new tab)

    +
    +

    NeighboudhoodCreationInitiated

    +

    NeighboudhoodCreationInitiated = "NEIGHBOURHOOD_CREATION_INITIATED"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:6 (opens in a new tab)

    +
    +

    NeighbourhoodJoinInitiated

    +

    NeighbourhoodJoinInitiated = "NEIGHBOURHOOD_JOIN_INITIATED"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:7 (opens in a new tab)

    +
    +

    Private

    +

    Private = "PRIVATE"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:5 (opens in a new tab)

    +
    +

    Synced

    +

    Synced = "SYNCED"

    +

    Defined in

    +

    perspectives/PerspectiveHandle.ts:10 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/enums/PerspectiveState/index.html b/docs/jsdoc/enums/PerspectiveState/index.html deleted file mode 100644 index ac2c4cda0..000000000 --- a/docs/jsdoc/enums/PerspectiveState/index.html +++ /dev/null @@ -1,55 +0,0 @@ -Enumeration: PerspectiveState | AD4M Docs
    API Reference
    enums
    Perspectivestate

    @coasys/ad4m / Exports / PerspectiveState

    -

    Enumeration: PerspectiveState

    -

    Table of contents

    -

    Enumeration Members

    - -

    Enumeration Members

    -

    LinkLanguageFailedToInstall

    -

    LinkLanguageFailedToInstall = "LINK_LANGUAGE_FAILED_TO_INSTALL"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:8 (opens in a new tab)

    -
    -

    LinkLanguageInstalledButNotSynced

    -

    LinkLanguageInstalledButNotSynced = "LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:9 (opens in a new tab)

    -
    -

    NeighboudhoodCreationInitiated

    -

    NeighboudhoodCreationInitiated = "NEIGHBOURHOOD_CREATION_INITIATED"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:6 (opens in a new tab)

    -
    -

    NeighbourhoodJoinInitiated

    -

    NeighbourhoodJoinInitiated = "NEIGHBOURHOOD_JOIN_INITIATED"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:7 (opens in a new tab)

    -
    -

    Private

    -

    Private = "PRIVATE"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:5 (opens in a new tab)

    -
    -

    Synced

    -

    Synced = "SYNCED"

    -

    Defined in

    -

    perspectives/PerspectiveHandle.ts:10 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/AD4MAction.html b/docs/jsdoc/interfaces/AD4MAction.html new file mode 100644 index 000000000..a524851c3 --- /dev/null +++ b/docs/jsdoc/interfaces/AD4MAction.html @@ -0,0 +1,50 @@ +Interface: AD4MAction | AD4M Docs
    API Reference
    interfaces
    Ad4maction

    @coasys/ad4m / Exports / AD4MAction

    +

    Interface: AD4MAction

    +

    AD4M Action - represents a link operation

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    action

    +

    action: string

    +

    Defined in

    +

    shacl/SHACLShape.ts:91 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Defined in

    +

    shacl/SHACLShape.ts:95 (opens in a new tab)

    +
    +

    predicate

    +

    predicate: string

    +

    Defined in

    +

    shacl/SHACLShape.ts:93 (opens in a new tab)

    +
    +

    source

    +

    source: string

    +

    Defined in

    +

    shacl/SHACLShape.ts:92 (opens in a new tab)

    +
    +

    target

    +

    target: string

    +

    Defined in

    +

    shacl/SHACLShape.ts:94 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/Ad4mModelLike.html b/docs/jsdoc/interfaces/Ad4mModelLike.html new file mode 100644 index 000000000..494ca9a6f --- /dev/null +++ b/docs/jsdoc/interfaces/Ad4mModelLike.html @@ -0,0 +1,70 @@ +Interface: Ad4mModelLike | AD4M Docs
    API Reference
    interfaces
    Ad4mmodellike

    @coasys/ad4m / Exports / Ad4mModelLike

    +

    Interface: Ad4mModelLike

    +

    Interface for any class that looks like an Ad4mModel (used in circular-ref-safe typings).

    +

    Table of contents

    +

    Constructors

    + +

    Properties

    + +

    Constructors

    +

    constructor

    +

    new Ad4mModelLike(...args)

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    ...argsany[]
    +

    Defined in

    +

    model/decorators.ts:128 (opens in a new tab)

    +

    Properties

    +

    className

    +

    Optional className: string

    +

    Defined in

    +

    model/decorators.ts:129 (opens in a new tab)

    +
    +

    generateSDNA

    +

    Optional generateSDNA: () => any

    +

    Type declaration

    +

    ▸ (): any

    +
    Returns
    +

    any

    +

    Defined in

    +

    model/decorators.ts:130 (opens in a new tab)

    +
    +

    generateSHACL

    +

    Optional generateSHACL: () => any

    +

    Type declaration

    +

    ▸ (): any

    +
    Returns
    +

    any

    +

    Defined in

    +

    model/decorators.ts:131 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/AgentService.html b/docs/jsdoc/interfaces/AgentService.html new file mode 100644 index 000000000..bce7707ef --- /dev/null +++ b/docs/jsdoc/interfaces/AgentService.html @@ -0,0 +1,51 @@ +Interface: AgentService | AD4M Docs
    API Reference
    interfaces
    Agentservice

    @coasys/ad4m / Exports / AgentService

    +

    Interface: AgentService

    +

    Table of contents

    +

    Properties

    + +

    Methods

    + +

    Properties

    +

    did

    +

    Readonly did: string

    +

    Defined in

    +

    language/LanguageContext.ts:5 (opens in a new tab)

    +

    Methods

    +

    createSignedExpression

    +

    createSignedExpression(data): Expression

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    dataany
    +

    Returns

    +

    Expression

    +

    Defined in

    +

    language/LanguageContext.ts:6 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/AgentService/index.html b/docs/jsdoc/interfaces/AgentService/index.html deleted file mode 100644 index dba2ed75e..000000000 --- a/docs/jsdoc/interfaces/AgentService/index.html +++ /dev/null @@ -1,51 +0,0 @@ -Interface: AgentService | AD4M Docs
    API Reference
    interfaces
    Agentservice

    @coasys/ad4m / Exports / AgentService

    -

    Interface: AgentService

    -

    Table of contents

    -

    Properties

    - -

    Methods

    - -

    Properties

    -

    did

    -

    Readonly did: string

    -

    Defined in

    -

    language/LanguageContext.ts:5 (opens in a new tab)

    -

    Methods

    -

    createSignedExpression

    -

    createSignedExpression(data): Expression

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    dataany
    -

    Returns

    -

    Expression

    -

    Defined in

    -

    language/LanguageContext.ts:6 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/CollectionMetadata/index.html b/docs/jsdoc/interfaces/CollectionMetadata/index.html deleted file mode 100644 index f17902c86..000000000 --- a/docs/jsdoc/interfaces/CollectionMetadata/index.html +++ /dev/null @@ -1,67 +0,0 @@ -Interface: CollectionMetadata | AD4M Docs
    API Reference
    interfaces
    Collectionmetadata

    @coasys/ad4m / Exports / CollectionMetadata

    -

    Interface: CollectionMetadata

    -

    Metadata for a single collection extracted from decorators.

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    local

    -

    Optional local: boolean

    -

    Whether stored locally only

    -

    Defined in

    -

    model/Ad4mModel.ts:114 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    The collection name

    -

    Defined in

    -

    model/Ad4mModel.ts:108 (opens in a new tab)

    -
    -

    predicate

    -

    predicate: string

    -

    The predicate URI (through value)

    -

    Defined in

    -

    model/Ad4mModel.ts:110 (opens in a new tab)

    -
    -

    where

    -

    Optional where: Object

    -

    Filter conditions

    -

    Type declaration

    - - - - - - - - - - - - - - - - - -
    NameType
    condition?string
    isInstance?any
    -

    Defined in

    -

    model/Ad4mModel.ts:112 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/CollectionOptions/index.html b/docs/jsdoc/interfaces/CollectionOptions/index.html deleted file mode 100644 index 120a44a19..000000000 --- a/docs/jsdoc/interfaces/CollectionOptions/index.html +++ /dev/null @@ -1,40 +0,0 @@ -Interface: CollectionOptions | AD4M Docs
    API Reference
    interfaces
    Collectionoptions

    @coasys/ad4m / Exports / CollectionOptions

    -

    Interface: CollectionOptions

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    local

    -

    Optional local: boolean

    -

    Indicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.

    -

    Defined in

    -

    model/decorators.ts:391 (opens in a new tab)

    -
    -

    through

    -

    through: string

    -

    The predicate of the property. All properties must have this option.

    -

    Defined in

    -

    model/decorators.ts:381 (opens in a new tab)

    -
    -

    where

    -

    Optional where: WhereOptions

    -

    An object representing the WHERE clause of the query.

    -

    Defined in

    -

    model/decorators.ts:386 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ConformanceCondition.html b/docs/jsdoc/interfaces/ConformanceCondition.html new file mode 100644 index 000000000..77386f8d3 --- /dev/null +++ b/docs/jsdoc/interfaces/ConformanceCondition.html @@ -0,0 +1,42 @@ +Interface: ConformanceCondition | AD4M Docs
    API Reference
    interfaces
    Conformancecondition

    @coasys/ad4m / Exports / ConformanceCondition

    +

    Interface: ConformanceCondition

    +

    A single structured conformance condition for relation filtering. +DB-agnostic representation that can be translated to any query language.

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    predicate

    +

    predicate: string

    +

    The predicate URI to check on the target node

    +

    Defined in

    +

    shacl/SHACLShape.ts:106 (opens in a new tab)

    +
    +

    type

    +

    type: "flag" | "required"

    +

    Type of check: 'flag' (predicate + value) or 'required' (predicate exists)

    +

    Defined in

    +

    shacl/SHACLShape.ts:104 (opens in a new tab)

    +
    +

    value

    +

    Optional value: string

    +

    For 'flag' conditions: the expected value

    +

    Defined in

    +

    shacl/SHACLShape.ts:108 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/DirectMessageAdapter.html b/docs/jsdoc/interfaces/DirectMessageAdapter.html new file mode 100644 index 000000000..982f9a0ec --- /dev/null +++ b/docs/jsdoc/interfaces/DirectMessageAdapter.html @@ -0,0 +1,150 @@ +Interface: DirectMessageAdapter | AD4M Docs
    API Reference
    interfaces
    Directmessageadapter

    @coasys/ad4m / Exports / DirectMessageAdapter

    +

    Interface: DirectMessageAdapter

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    addMessageCallback

    +

    addMessageCallback(callback): any

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    callbackMessageCallback
    +

    Returns

    +

    any

    +

    Defined in

    +

    language/Language.ts:215 (opens in a new tab)

    +
    +

    inbox

    +

    inbox(filter?): Promise<PerspectiveExpression[]>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    filter?string
    +

    Returns

    +

    Promise<PerspectiveExpression[]>

    +

    Defined in

    +

    language/Language.ts:214 (opens in a new tab)

    +
    +

    recipient

    +

    recipient(): string

    +

    Returns

    +

    string

    +

    Defined in

    +

    language/Language.ts:207 (opens in a new tab)

    +
    +

    sendInbox

    +

    sendInbox(message): Promise<void | PerspectiveExpression>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    messagePerspective
    +

    Returns

    +

    Promise<void | PerspectiveExpression>

    +

    Defined in

    +

    language/Language.ts:211 (opens in a new tab)

    +
    +

    sendP2P

    +

    sendP2P(message): Promise<void | PerspectiveExpression>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    messagePerspective
    +

    Returns

    +

    Promise<void | PerspectiveExpression>

    +

    Defined in

    +

    language/Language.ts:210 (opens in a new tab)

    +
    +

    setStatus

    +

    setStatus(status): any

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    statusPerspectiveExpression
    +

    Returns

    +

    any

    +

    Defined in

    +

    language/Language.ts:213 (opens in a new tab)

    +
    +

    status

    +

    status(): Promise<void | PerspectiveExpression>

    +

    Returns

    +

    Promise<void | PerspectiveExpression>

    +

    Defined in

    +

    language/Language.ts:209 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/DirectMessageAdapter/index.html b/docs/jsdoc/interfaces/DirectMessageAdapter/index.html deleted file mode 100644 index 3fcfc2563..000000000 --- a/docs/jsdoc/interfaces/DirectMessageAdapter/index.html +++ /dev/null @@ -1,150 +0,0 @@ -Interface: DirectMessageAdapter | AD4M Docs
    API Reference
    interfaces
    Directmessageadapter

    @coasys/ad4m / Exports / DirectMessageAdapter

    -

    Interface: DirectMessageAdapter

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    addMessageCallback

    -

    addMessageCallback(callback): any

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    callbackMessageCallback
    -

    Returns

    -

    any

    -

    Defined in

    -

    language/Language.ts:203 (opens in a new tab)

    -
    -

    inbox

    -

    inbox(filter?): Promise<PerspectiveExpression[]>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    filter?string
    -

    Returns

    -

    Promise<PerspectiveExpression[]>

    -

    Defined in

    -

    language/Language.ts:202 (opens in a new tab)

    -
    -

    recipient

    -

    recipient(): string

    -

    Returns

    -

    string

    -

    Defined in

    -

    language/Language.ts:195 (opens in a new tab)

    -
    -

    sendInbox

    -

    sendInbox(message): Promise<void | PerspectiveExpression>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    messagePerspective
    -

    Returns

    -

    Promise<void | PerspectiveExpression>

    -

    Defined in

    -

    language/Language.ts:199 (opens in a new tab)

    -
    -

    sendP2P

    -

    sendP2P(message): Promise<void | PerspectiveExpression>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    messagePerspective
    -

    Returns

    -

    Promise<void | PerspectiveExpression>

    -

    Defined in

    -

    language/Language.ts:198 (opens in a new tab)

    -
    -

    setStatus

    -

    setStatus(status): any

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    statusPerspectiveExpression
    -

    Returns

    -

    any

    -

    Defined in

    -

    language/Language.ts:201 (opens in a new tab)

    -
    -

    status

    -

    status(): Promise<void | PerspectiveExpression>

    -

    Returns

    -

    Promise<void | PerspectiveExpression>

    -

    Defined in

    -

    language/Language.ts:197 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ExpressionAdapter.html b/docs/jsdoc/interfaces/ExpressionAdapter.html new file mode 100644 index 000000000..4d09d5238 --- /dev/null +++ b/docs/jsdoc/interfaces/ExpressionAdapter.html @@ -0,0 +1,66 @@ +Interface: ExpressionAdapter | AD4M Docs
    API Reference
    interfaces
    Expressionadapter

    @coasys/ad4m / Exports / ExpressionAdapter

    +

    Interface: ExpressionAdapter

    +

    Interface for the most common Expression Languages

    +

    Table of contents

    +

    Properties

    + +

    Methods

    + +

    Properties

    +

    putAdapter

    +

    putAdapter: PublicSharing | ReadOnlyLanguage

    +

    Strategy for putting an expression with needs to be different +for those two cases:

    +
      +
    1. PublicSharing means that this language supports the creation +and sharing of Expressions, which is the common use-case
    2. +
    3. ReadOnlyLanguage means that the Language implements a pre-defined +set of expressions (which can be infinite or finite). +For example the url-iframe Language which directly maps URLs to +addresses - meaning every well formed URL is an address in this +Language. Or a potential Language implementing the verbs/predicates +of a spec like FOAF.
    4. +
    +

    Defined in

    +

    language/Language.ts:106 (opens in a new tab)

    +

    Methods

    +

    get

    +

    get(address): Promise<Expression>

    +

    Returns an Expression by address, or null if there is no Expression +with that given address

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    addressstring
    +

    Returns

    +

    Promise<Expression>

    +

    Defined in

    +

    language/Language.ts:93 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ExpressionAdapter/index.html b/docs/jsdoc/interfaces/ExpressionAdapter/index.html deleted file mode 100644 index d9d0fec74..000000000 --- a/docs/jsdoc/interfaces/ExpressionAdapter/index.html +++ /dev/null @@ -1,66 +0,0 @@ -Interface: ExpressionAdapter | AD4M Docs
    API Reference
    interfaces
    Expressionadapter

    @coasys/ad4m / Exports / ExpressionAdapter

    -

    Interface: ExpressionAdapter

    -

    Interface for the most common Expression Languages

    -

    Table of contents

    -

    Properties

    - -

    Methods

    - -

    Properties

    -

    putAdapter

    -

    putAdapter: PublicSharing | ReadOnlyLanguage

    -

    Strategy for putting an expression with needs to be different -for those two cases:

    -
      -
    1. PublicSharing means that this language supports the creation -and sharing of Expressions, which is the common use-case
    2. -
    3. ReadOnlyLanguage means that the Language implements a pre-defined -set of expressions (which can be infinite or finite). -For example the url-iframe Language which directly maps URLs to -addresses - meaning every well formed URL is an address in this -Language. Or a potential Language implementing the verbs/predicates -of a spec like FOAF.
    4. -
    -

    Defined in

    -

    language/Language.ts:106 (opens in a new tab)

    -

    Methods

    -

    get

    -

    get(address): Promise<Expression>

    -

    Returns an Expression by address, or null if there is no Expression -with that given address

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    addressstring
    -

    Returns

    -

    Promise<Expression>

    -

    Defined in

    -

    language/Language.ts:93 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ExpressionUI.html b/docs/jsdoc/interfaces/ExpressionUI.html new file mode 100644 index 000000000..927902fc5 --- /dev/null +++ b/docs/jsdoc/interfaces/ExpressionUI.html @@ -0,0 +1,38 @@ +Interface: ExpressionUI | AD4M Docs
    API Reference
    interfaces
    Expressionui

    @coasys/ad4m / Exports / ExpressionUI

    +

    Interface: ExpressionUI

    +

    UI factories returning web components

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    constructorIcon

    +

    constructorIcon(): string

    +

    Returns JS code of a web component used to create new expressions

    +

    Returns

    +

    string

    +

    Defined in

    +

    language/Language.ts:82 (opens in a new tab)

    +
    +

    icon

    +

    icon(): string

    +

    Returns JS code of a web component that renders the given expression

    +

    Returns

    +

    string

    +

    Defined in

    +

    language/Language.ts:80 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ExpressionUI/index.html b/docs/jsdoc/interfaces/ExpressionUI/index.html deleted file mode 100644 index 33a729195..000000000 --- a/docs/jsdoc/interfaces/ExpressionUI/index.html +++ /dev/null @@ -1,38 +0,0 @@ -Interface: ExpressionUI | AD4M Docs
    API Reference
    interfaces
    Expressionui

    @coasys/ad4m / Exports / ExpressionUI

    -

    Interface: ExpressionUI

    -

    UI factories returning web components

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    constructorIcon

    -

    constructorIcon(): string

    -

    Returns JS code of a web component used to create new expressions

    -

    Returns

    -

    string

    -

    Defined in

    -

    language/Language.ts:82 (opens in a new tab)

    -
    -

    icon

    -

    icon(): string

    -

    Returns JS code of a web component that renders the given expression

    -

    Returns

    -

    string

    -

    Defined in

    -

    language/Language.ts:80 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/FlagOptions.html b/docs/jsdoc/interfaces/FlagOptions.html new file mode 100644 index 000000000..17b888f35 --- /dev/null +++ b/docs/jsdoc/interfaces/FlagOptions.html @@ -0,0 +1,33 @@ +Interface: FlagOptions | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/FlagOptions/index.html b/docs/jsdoc/interfaces/FlagOptions/index.html deleted file mode 100644 index c2176d7b0..000000000 --- a/docs/jsdoc/interfaces/FlagOptions/index.html +++ /dev/null @@ -1,33 +0,0 @@ -Interface: FlagOptions | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/FlowState.html b/docs/jsdoc/interfaces/FlowState.html new file mode 100644 index 000000000..be956de71 --- /dev/null +++ b/docs/jsdoc/interfaces/FlowState.html @@ -0,0 +1,42 @@ +Interface: FlowState | AD4M Docs
    API Reference
    interfaces
    Flowstate

    @coasys/ad4m / Exports / FlowState

    +

    Interface: FlowState

    +

    Flow State definition +Represents a single state in the flow state machine

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    name

    +

    name: string

    +

    State name (e.g., "ready", "doing", "done")

    +

    Defined in

    +

    shacl/SHACLFlow.ts:27 (opens in a new tab)

    +
    +

    stateCheck

    +

    stateCheck: LinkPattern

    +

    Link pattern that indicates this state

    +

    Defined in

    +

    shacl/SHACLFlow.ts:31 (opens in a new tab)

    +
    +

    value

    +

    value: number

    +

    Numeric state value for ordering (e.g., 0, 0.5, 1)

    +

    Defined in

    +

    shacl/SHACLFlow.ts:29 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/FlowTransition.html b/docs/jsdoc/interfaces/FlowTransition.html new file mode 100644 index 000000000..f1ef9155a --- /dev/null +++ b/docs/jsdoc/interfaces/FlowTransition.html @@ -0,0 +1,49 @@ +Interface: FlowTransition | AD4M Docs
    API Reference
    interfaces
    Flowtransition

    @coasys/ad4m / Exports / FlowTransition

    +

    Interface: FlowTransition

    +

    Flow Transition definition +Represents a transition between two states

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    actionName

    +

    actionName: string

    +

    Name of this action (shown to users, e.g., "Start", "Finish")

    +

    Defined in

    +

    shacl/SHACLFlow.ts:40 (opens in a new tab)

    +
    +

    actions

    +

    actions: AD4MAction[]

    +

    Actions to execute for this transition

    +

    Defined in

    +

    shacl/SHACLFlow.ts:46 (opens in a new tab)

    +
    +

    fromState

    +

    fromState: string

    +

    State to transition from

    +

    Defined in

    +

    shacl/SHACLFlow.ts:42 (opens in a new tab)

    +
    +

    toState

    +

    toState: string

    +

    State to transition to

    +

    Defined in

    +

    shacl/SHACLFlow.ts:44 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/GetAllAdapter.html b/docs/jsdoc/interfaces/GetAllAdapter.html new file mode 100644 index 000000000..44ef8f62d --- /dev/null +++ b/docs/jsdoc/interfaces/GetAllAdapter.html @@ -0,0 +1,50 @@ +Interface: GetAllAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/GetAllAdapter/index.html b/docs/jsdoc/interfaces/GetAllAdapter/index.html deleted file mode 100644 index 9dd17794f..000000000 --- a/docs/jsdoc/interfaces/GetAllAdapter/index.html +++ /dev/null @@ -1,50 +0,0 @@ -Interface: GetAllAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/GetByAuthorAdapter.html b/docs/jsdoc/interfaces/GetByAuthorAdapter.html new file mode 100644 index 000000000..9c6c44c67 --- /dev/null +++ b/docs/jsdoc/interfaces/GetByAuthorAdapter.html @@ -0,0 +1,50 @@ +Interface: GetByAuthorAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/GetByAuthorAdapter/index.html b/docs/jsdoc/interfaces/GetByAuthorAdapter/index.html deleted file mode 100644 index 60ee9b370..000000000 --- a/docs/jsdoc/interfaces/GetByAuthorAdapter/index.html +++ /dev/null @@ -1,50 +0,0 @@ -Interface: GetByAuthorAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/HolochainLanguageDelegate.html b/docs/jsdoc/interfaces/HolochainLanguageDelegate.html new file mode 100644 index 000000000..c2410b8aa --- /dev/null +++ b/docs/jsdoc/interfaces/HolochainLanguageDelegate.html @@ -0,0 +1,111 @@ +Interface: HolochainLanguageDelegate | AD4M Docs
    API Reference
    interfaces
    Holochainlanguagedelegate

    @coasys/ad4m / Exports / HolochainLanguageDelegate

    +

    Interface: HolochainLanguageDelegate

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    call

    +

    call(dnaNick, zomeName, fnName, params): Promise<any>

    +

    Makes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    dnaNickstring
    zomeNamestring
    fnNamestring
    paramsstring | object
    +

    Returns

    +

    Promise<any>

    +

    Defined in

    +

    language/LanguageContext.ts:32 (opens in a new tab)

    +
    +

    callAsync

    +

    callAsync(calls, timeoutMs?): Promise<any[]>

    +

    Makes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    calls{ dnaNick: string ; fnName: string ; params: string | object ; zomeName: string }[]
    timeoutMs?number
    +

    Returns

    +

    Promise<any[]>

    +

    Defined in

    +

    language/LanguageContext.ts:34 (opens in a new tab)

    +
    +

    registerDNAs

    +

    registerDNAs(dnas, holochainSignalCallback?): Promise<void>

    +

    Installs/registers a given DNA in the ad4m-executor

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    dnasDna[]
    holochainSignalCallback?AppSignalCb
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    language/LanguageContext.ts:30 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/HolochainLanguageDelegate/index.html b/docs/jsdoc/interfaces/HolochainLanguageDelegate/index.html deleted file mode 100644 index 40f6073f2..000000000 --- a/docs/jsdoc/interfaces/HolochainLanguageDelegate/index.html +++ /dev/null @@ -1,111 +0,0 @@ -Interface: HolochainLanguageDelegate | AD4M Docs
    API Reference
    interfaces
    Holochainlanguagedelegate

    @coasys/ad4m / Exports / HolochainLanguageDelegate

    -

    Interface: HolochainLanguageDelegate

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    call

    -

    call(dnaNick, zomeName, fnName, params): Promise<any>

    -

    Makes a single call to a given holochain DNA. Underlying implementation puts these calls into a sync fifo queue

    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameType
    dnaNickstring
    zomeNamestring
    fnNamestring
    paramsstring | object
    -

    Returns

    -

    Promise<any>

    -

    Defined in

    -

    language/LanguageContext.ts:32 (opens in a new tab)

    -
    -

    callAsync

    -

    callAsync(calls, timeoutMs?): Promise<any[]>

    -

    Makes all supplied calls in parallel to the provided holochain dna... Should only be called on read operations to avoid source chain async mutation errors

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    calls{ dnaNick: string ; fnName: string ; params: string | object ; zomeName: string }[]
    timeoutMs?number
    -

    Returns

    -

    Promise<any[]>

    -

    Defined in

    -

    language/LanguageContext.ts:34 (opens in a new tab)

    -
    -

    registerDNAs

    -

    registerDNAs(dnas, holochainSignalCallback?): Promise<void>

    -

    Installs/registers a given DNA in the ad4m-executor

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    dnasDna[]
    holochainSignalCallback?AppSignalCb
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    language/LanguageContext.ts:30 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/IncludeMap.html b/docs/jsdoc/interfaces/IncludeMap.html new file mode 100644 index 000000000..9493605d1 --- /dev/null +++ b/docs/jsdoc/interfaces/IncludeMap.html @@ -0,0 +1,32 @@ +Interface: IncludeMap | AD4M Docs
    API Reference
    interfaces
    Includemap

    @coasys/ad4m / Exports / IncludeMap

    +

    Interface: IncludeMap

    +

    Describes which relations to eager-load when querying.

    +

    Each value is either:

    +
      +
    • true — hydrate the relation one level deep
    • +
    • A RelationSubQuery — scoped sub-query (filter / sort / paginate / nested include)
    • +
    +

    Example

    +
    // One level deep
    +{ comments: true }
    + 
    +// Sub-query: only the 5 most-recent comments
    +{ comments: { order: { createdAt: 'DESC' }, limit: 5 } }
    + 
    +// Nested eager-load
    +{ comments: { include: { author: true } } }
    +

    Indexable

    +

    ▪ [relation: string]: boolean | RelationSubQuery


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/InitializeArgs.html b/docs/jsdoc/interfaces/InitializeArgs.html new file mode 100644 index 000000000..78dfa6b2c --- /dev/null +++ b/docs/jsdoc/interfaces/InitializeArgs.html @@ -0,0 +1,43 @@ +Interface: InitializeArgs | AD4M Docs
    API Reference
    interfaces
    Initializeargs

    @coasys/ad4m / Exports / InitializeArgs

    +

    Interface: InitializeArgs

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    did

    +

    did: string

    +

    Defined in

    +

    agent/AgentClient.ts:75 (opens in a new tab)

    +
    +

    didDocument

    +

    didDocument: string

    +

    Defined in

    +

    agent/AgentClient.ts:76 (opens in a new tab)

    +
    +

    keystore

    +

    keystore: string

    +

    Defined in

    +

    agent/AgentClient.ts:77 (opens in a new tab)

    +
    +

    passphrase

    +

    passphrase: string

    +

    Defined in

    +

    agent/AgentClient.ts:78 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/InitializeArgs/index.html b/docs/jsdoc/interfaces/InitializeArgs/index.html deleted file mode 100644 index b2e25b658..000000000 --- a/docs/jsdoc/interfaces/InitializeArgs/index.html +++ /dev/null @@ -1,43 +0,0 @@ -Interface: InitializeArgs | AD4M Docs
    API Reference
    interfaces
    Initializeargs

    @coasys/ad4m / Exports / InitializeArgs

    -

    Interface: InitializeArgs

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    did

    -

    did: string

    -

    Defined in

    -

    agent/AgentClient.ts:73 (opens in a new tab)

    -
    -

    didDocument

    -

    didDocument: string

    -

    Defined in

    -

    agent/AgentClient.ts:74 (opens in a new tab)

    -
    -

    keystore

    -

    keystore: string

    -

    Defined in

    -

    agent/AgentClient.ts:75 (opens in a new tab)

    -
    -

    passphrase

    -

    passphrase: string

    -

    Defined in

    -

    agent/AgentClient.ts:76 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/InstanceQueryParams/index.html b/docs/jsdoc/interfaces/InstanceQueryParams/index.html deleted file mode 100644 index 3266c6f7d..000000000 --- a/docs/jsdoc/interfaces/InstanceQueryParams/index.html +++ /dev/null @@ -1,33 +0,0 @@ -Interface: InstanceQueryParams | AD4M Docs
    API Reference
    interfaces
    Instancequeryparams

    @coasys/ad4m / Exports / InstanceQueryParams

    -

    Interface: InstanceQueryParams

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    condition

    -

    Optional condition: string

    -

    A string representing the condition clause of the query.

    -

    Defined in

    -

    model/decorators.ts:34 (opens in a new tab)

    -
    -

    where

    -

    Optional where: object

    -

    An object representing the WHERE clause of the query.

    -

    Defined in

    -

    model/decorators.ts:29 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/Interaction.html b/docs/jsdoc/interfaces/Interaction.html new file mode 100644 index 000000000..9714e2627 --- /dev/null +++ b/docs/jsdoc/interfaces/Interaction.html @@ -0,0 +1,63 @@ +Interface: Interaction | AD4M Docs
    API Reference
    interfaces
    Interaction

    @coasys/ad4m / Exports / Interaction

    +

    Interface: Interaction

    +

    Table of contents

    +

    Properties

    + +

    Methods

    + +

    Properties

    +

    label

    +

    Readonly label: string

    +

    Defined in

    +

    language/Language.ts:239 (opens in a new tab)

    +
    +

    name

    +

    Readonly name: string

    +

    Defined in

    +

    language/Language.ts:240 (opens in a new tab)

    +
    +

    parameters

    +

    Readonly parameters: InteractionParameter[]

    +

    Defined in

    +

    language/Language.ts:241 (opens in a new tab)

    +

    Methods

    +

    execute

    +

    execute(parameters): Promise<string>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    parametersobject
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    language/Language.ts:242 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/Interaction/index.html b/docs/jsdoc/interfaces/Interaction/index.html deleted file mode 100644 index 4c1f1753d..000000000 --- a/docs/jsdoc/interfaces/Interaction/index.html +++ /dev/null @@ -1,63 +0,0 @@ -Interface: Interaction | AD4M Docs
    API Reference
    interfaces
    Interaction

    @coasys/ad4m / Exports / Interaction

    -

    Interface: Interaction

    -

    Table of contents

    -

    Properties

    - -

    Methods

    - -

    Properties

    -

    label

    -

    Readonly label: string

    -

    Defined in

    -

    language/Language.ts:227 (opens in a new tab)

    -
    -

    name

    -

    Readonly name: string

    -

    Defined in

    -

    language/Language.ts:228 (opens in a new tab)

    -
    -

    parameters

    -

    Readonly parameters: InteractionParameter[]

    -

    Defined in

    -

    language/Language.ts:229 (opens in a new tab)

    -

    Methods

    -

    execute

    -

    execute(parameters): Promise<string>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    parametersobject
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    language/Language.ts:230 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/Language.html b/docs/jsdoc/interfaces/Language.html new file mode 100644 index 000000000..8c53ec264 --- /dev/null +++ b/docs/jsdoc/interfaces/Language.html @@ -0,0 +1,171 @@ +Interface: Language | AD4M Docs
    API Reference
    interfaces
    Language

    @coasys/ad4m / Exports / Language

    +

    Interface: Language

    +

    Interface of AD4M Languages

    +

    Any JavaScript module that implements a create() function that returns an object that implements this interface +is a valid AD4M language. +So the AD4M-internal representation of a language is an object that implements this interface.

    +

    Since there are a few different kinds of languages, this interface is split into optional sub-interfaces. +The only required property is the name of the language.

    +

    The most usual kind of language is the "Expression Language", which is a language that can be used to create +and share Expressions. +For that, implement the expressionsAdapter and expressionUI interface.

    +

    The second most common kind of language is the "Link Language", which is a language that builds the core +of AD4M Neighbourhoods. +For that, implement the linksAdapter interface.

    +

    Table of contents

    +

    Properties

    + +

    Methods

    + +

    Properties

    +

    directMessageAdapter

    +

    Optional Readonly directMessageAdapter: DirectMessageAdapter

    +

    Optional adapter for direct messaging between agents

    +

    Defined in

    +

    language/Language.ts:65 (opens in a new tab)

    +
    +

    expressionAdapter

    +

    Optional Readonly expressionAdapter: ExpressionAdapter

    +

    ExpressionAdapter implements means of getting an Expression +by address and putting an expression

    +

    Defined in

    +

    language/Language.ts:39 (opens in a new tab)

    +
    +

    expressionUI

    +

    Optional Readonly expressionUI: ExpressionUI

    +

    Interface for getting UI/web components for rendering Expressions of this Language

    +

    Defined in

    +

    language/Language.ts:42 (opens in a new tab)

    +
    +

    getAllAdapter

    +

    Optional Readonly getAllAdapter: GetAllAdapter

    +

    Optional adapter for getting all Expressions

    +

    Defined in

    +

    language/Language.ts:62 (opens in a new tab)

    +
    +

    getByAuthorAdapter

    +

    Optional Readonly getByAuthorAdapter: GetByAuthorAdapter

    +

    Optional adapter for getting Expressions by author

    +

    Defined in

    +

    language/Language.ts:60 (opens in a new tab)

    +
    +

    languageAdapter

    +

    Optional Readonly languageAdapter: LanguageAdapter

    +

    Implementation of a Language that defines and stores Languages

    +

    Defined in

    +

    language/Language.ts:57 (opens in a new tab)

    +
    +

    linksAdapter

    +

    Optional Readonly linksAdapter: LinkSyncAdapter

    +

    Interface of LinkLanguages for the core implementation of Neighbourhoods

    +

    Defined in

    +

    language/Language.ts:45 (opens in a new tab)

    +
    +

    name

    +

    Readonly name: string

    +

    Defined in

    +

    language/Language.ts:27 (opens in a new tab)

    +
    +

    settingsUI

    +

    Optional Readonly settingsUI: SettingsUI

    +

    Interface for providing UI components for the settings of this Language

    +

    Defined in

    +

    language/Language.ts:68 (opens in a new tab)

    +
    +

    teardown

    +

    Optional Readonly teardown: () => void

    +

    Type declaration

    +

    ▸ (): void

    +

    Optional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor

    +
    Returns
    +

    void

    +

    Defined in

    +

    language/Language.ts:71 (opens in a new tab)

    +
    +

    telepresenceAdapter

    +

    Optional Readonly telepresenceAdapter: TelepresenceAdapter

    +

    Additional Interface of LinkLanguages that support telepresence features, +that is:

    +
      +
    • seeing who is online and getting a status
    • +
    • sending/receiveing p2p signals to other online agents without affecting +the shared Perspective of the Neighbourhood +(see TelepresenceAdapter for more details)
    • +
    +

    Defined in

    +

    language/Language.ts:54 (opens in a new tab)

    +

    Methods

    +

    interactions

    +

    interactions(expression): Interaction[]

    +

    All available interactions this agent could execute on given expression

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    expressionstring
    +

    Returns

    +

    Interaction[]

    +

    Defined in

    +

    language/Language.ts:74 (opens in a new tab)

    +
    +

    isImmutableExpression

    +

    Optional isImmutableExpression(expression): boolean

    +

    Flagging expressions as immutable to enable +expression caching in the ad4m-executor

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    expressionstring
    +

    Returns

    +

    boolean

    +

    Defined in

    +

    language/Language.ts:32 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/Language/index.html b/docs/jsdoc/interfaces/Language/index.html deleted file mode 100644 index e63fc4165..000000000 --- a/docs/jsdoc/interfaces/Language/index.html +++ /dev/null @@ -1,171 +0,0 @@ -Interface: Language | AD4M Docs
    API Reference
    interfaces
    Language

    @coasys/ad4m / Exports / Language

    -

    Interface: Language

    -

    Interface of AD4M Languages

    -

    Any JavaScript module that implements a create() function that returns an object that implements this interface -is a valid AD4M language. -So the AD4M-internal representation of a language is an object that implements this interface.

    -

    Since there are a few different kinds of languages, this interface is split into optional sub-interfaces. -The only required property is the name of the language.

    -

    The most usual kind of language is the "Expression Language", which is a language that can be used to create -and share Expressions. -For that, implement the expressionsAdapter and expressionUI interface.

    -

    The second most common kind of language is the "Link Language", which is a language that builds the core -of AD4M Neighbourhoods. -For that, implement the linksAdapter interface.

    -

    Table of contents

    -

    Properties

    - -

    Methods

    - -

    Properties

    -

    directMessageAdapter

    -

    Optional Readonly directMessageAdapter: DirectMessageAdapter

    -

    Optional adapter for direct messaging between agents

    -

    Defined in

    -

    language/Language.ts:65 (opens in a new tab)

    -
    -

    expressionAdapter

    -

    Optional Readonly expressionAdapter: ExpressionAdapter

    -

    ExpressionAdapter implements means of getting an Expression -by address and putting an expression

    -

    Defined in

    -

    language/Language.ts:39 (opens in a new tab)

    -
    -

    expressionUI

    -

    Optional Readonly expressionUI: ExpressionUI

    -

    Interface for getting UI/web components for rendering Expressions of this Language

    -

    Defined in

    -

    language/Language.ts:42 (opens in a new tab)

    -
    -

    getAllAdapter

    -

    Optional Readonly getAllAdapter: GetAllAdapter

    -

    Optional adapter for getting all Expressions

    -

    Defined in

    -

    language/Language.ts:62 (opens in a new tab)

    -
    -

    getByAuthorAdapter

    -

    Optional Readonly getByAuthorAdapter: GetByAuthorAdapter

    -

    Optional adapter for getting Expressions by author

    -

    Defined in

    -

    language/Language.ts:60 (opens in a new tab)

    -
    -

    languageAdapter

    -

    Optional Readonly languageAdapter: LanguageAdapter

    -

    Implementation of a Language that defines and stores Languages

    -

    Defined in

    -

    language/Language.ts:57 (opens in a new tab)

    -
    -

    linksAdapter

    -

    Optional Readonly linksAdapter: LinkSyncAdapter

    -

    Interface of LinkLanguages for the core implementation of Neighbourhoods

    -

    Defined in

    -

    language/Language.ts:45 (opens in a new tab)

    -
    -

    name

    -

    Readonly name: string

    -

    Defined in

    -

    language/Language.ts:27 (opens in a new tab)

    -
    -

    settingsUI

    -

    Optional Readonly settingsUI: SettingsUI

    -

    Interface for providing UI components for the settings of this Language

    -

    Defined in

    -

    language/Language.ts:68 (opens in a new tab)

    -
    -

    teardown

    -

    Optional Readonly teardown: () => void

    -

    Type declaration

    -

    ▸ (): void

    -

    Optional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor

    -
    Returns
    -

    void

    -

    Defined in

    -

    language/Language.ts:71 (opens in a new tab)

    -
    -

    telepresenceAdapter

    -

    Optional Readonly telepresenceAdapter: TelepresenceAdapter

    -

    Additional Interface of LinkLanguages that support telepresence features, -that is:

    -
      -
    • seeing who is online and getting a status
    • -
    • sending/receiveing p2p signals to other online agents without affecting -the shared Perspective of the Neighbourhood -(see TelepresenceAdapter for more details)
    • -
    -

    Defined in

    -

    language/Language.ts:54 (opens in a new tab)

    -

    Methods

    -

    interactions

    -

    interactions(expression): Interaction[]

    -

    All available interactions this agent could execute on given expression

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    expressionstring
    -

    Returns

    -

    Interaction[]

    -

    Defined in

    -

    language/Language.ts:74 (opens in a new tab)

    -
    -

    isImmutableExpression

    -

    Optional isImmutableExpression(expression): boolean

    -

    Flagging expressions as immutable to enable -expression caching in the ad4m-executor

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    expressionstring
    -

    Returns

    -

    boolean

    -

    Defined in

    -

    language/Language.ts:32 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LanguageAdapter.html b/docs/jsdoc/interfaces/LanguageAdapter.html new file mode 100644 index 000000000..64c5cee7d --- /dev/null +++ b/docs/jsdoc/interfaces/LanguageAdapter.html @@ -0,0 +1,42 @@ +Interface: LanguageAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LanguageAdapter/index.html b/docs/jsdoc/interfaces/LanguageAdapter/index.html deleted file mode 100644 index 4c745bd24..000000000 --- a/docs/jsdoc/interfaces/LanguageAdapter/index.html +++ /dev/null @@ -1,42 +0,0 @@ -Interface: LanguageAdapter | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LanguageContext.html b/docs/jsdoc/interfaces/LanguageContext.html new file mode 100644 index 000000000..b85102e90 --- /dev/null +++ b/docs/jsdoc/interfaces/LanguageContext.html @@ -0,0 +1,55 @@ +Interface: LanguageContext | AD4M Docs
    API Reference
    interfaces
    Languagecontext

    @coasys/ad4m / Exports / LanguageContext

    +

    Interface: LanguageContext

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    Holochain

    +

    Holochain: HolochainLanguageDelegate

    +

    Defined in

    +

    language/LanguageContext.ts:18 (opens in a new tab)

    +
    +

    ad4mSignal

    +

    ad4mSignal: Ad4mSignalCB

    +

    Defined in

    +

    language/LanguageContext.ts:19 (opens in a new tab)

    +
    +

    agent

    +

    agent: AgentService

    +

    Defined in

    +

    language/LanguageContext.ts:14 (opens in a new tab)

    +
    +

    customSettings

    +

    customSettings: object

    +

    Defined in

    +

    language/LanguageContext.ts:17 (opens in a new tab)

    +
    +

    signatures

    +

    signatures: SignaturesService

    +

    Defined in

    +

    language/LanguageContext.ts:15 (opens in a new tab)

    +
    +

    storageDirectory

    +

    storageDirectory: string

    +

    Defined in

    +

    language/LanguageContext.ts:16 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LanguageContext/index.html b/docs/jsdoc/interfaces/LanguageContext/index.html deleted file mode 100644 index 06ed81995..000000000 --- a/docs/jsdoc/interfaces/LanguageContext/index.html +++ /dev/null @@ -1,55 +0,0 @@ -Interface: LanguageContext | AD4M Docs
    API Reference
    interfaces
    Languagecontext

    @coasys/ad4m / Exports / LanguageContext

    -

    Interface: LanguageContext

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    Holochain

    -

    Holochain: HolochainLanguageDelegate

    -

    Defined in

    -

    language/LanguageContext.ts:18 (opens in a new tab)

    -
    -

    ad4mSignal

    -

    ad4mSignal: Ad4mSignalCB

    -

    Defined in

    -

    language/LanguageContext.ts:19 (opens in a new tab)

    -
    -

    agent

    -

    agent: AgentService

    -

    Defined in

    -

    language/LanguageContext.ts:14 (opens in a new tab)

    -
    -

    customSettings

    -

    customSettings: object

    -

    Defined in

    -

    language/LanguageContext.ts:17 (opens in a new tab)

    -
    -

    signatures

    -

    signatures: SignaturesService

    -

    Defined in

    -

    language/LanguageContext.ts:15 (opens in a new tab)

    -
    -

    storageDirectory

    -

    storageDirectory: string

    -

    Defined in

    -

    language/LanguageContext.ts:16 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LinkPattern.html b/docs/jsdoc/interfaces/LinkPattern.html new file mode 100644 index 000000000..8880212e9 --- /dev/null +++ b/docs/jsdoc/interfaces/LinkPattern.html @@ -0,0 +1,42 @@ +Interface: LinkPattern | AD4M Docs
    API Reference
    interfaces
    Linkpattern

    @coasys/ad4m / Exports / LinkPattern

    +

    Interface: LinkPattern

    +

    Link pattern for state detection +Used to check if an expression is in a particular state

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    predicate

    +

    predicate: string

    +

    Required predicate to match

    +

    Defined in

    +

    shacl/SHACLFlow.ts:16 (opens in a new tab)

    +
    +

    source

    +

    Optional source: string

    +

    Optional source pattern (if omitted, uses the expression address)

    +

    Defined in

    +

    shacl/SHACLFlow.ts:14 (opens in a new tab)

    +
    +

    target

    +

    target: string

    +

    Required target value to match

    +

    Defined in

    +

    shacl/SHACLFlow.ts:18 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LinkSyncAdapter.html b/docs/jsdoc/interfaces/LinkSyncAdapter.html new file mode 100644 index 000000000..4d36a9612 --- /dev/null +++ b/docs/jsdoc/interfaces/LinkSyncAdapter.html @@ -0,0 +1,183 @@ +Interface: LinkSyncAdapter | AD4M Docs
    API Reference
    interfaces
    Linksyncadapter

    @coasys/ad4m / Exports / LinkSyncAdapter

    +

    Interface: LinkSyncAdapter

    +

    Interface for "Link Languages" that facilitate the synchronization +between agents' local Perspectives inside a Neighbourhood. +The assumption is that every version of the shared Perspective +is labeled with a unique revision string. +Changes are committed and retrieved through diffs. +Think of a LinkSyncAdapter as a git branch to which agents commit +their changes to and pull diffs from their current revision +to the latest one.

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    addCallback

    +

    addCallback(callback): any

    +

    Get push notification when a diff got published

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    callbackPerspectiveDiffObserver
    +

    Returns

    +

    any

    +

    Defined in

    +

    language/Language.ts:186 (opens in a new tab)

    +
    +

    addSyncStateChangeCallback

    +

    addSyncStateChangeCallback(callback): any

    +

    Add a sync state callback method

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    callbackSyncStateChangeObserver
    +

    Returns

    +

    any

    +

    Defined in

    +

    language/Language.ts:189 (opens in a new tab)

    +
    +

    commit

    +

    commit(diff): Promise<string>

    +

    Publish changes

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    diffPerspectiveDiff
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    language/Language.ts:183 (opens in a new tab)

    +
    +

    currentRevision

    +

    currentRevision(): Promise<string>

    +

    What revision are we on now -> what changes are included in output of render()

    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    language/Language.ts:169 (opens in a new tab)

    +
    +

    others

    +

    others(): Promise<string[]>

    +

    Returns

    +

    Promise<string[]>

    +

    Defined in

    +

    language/Language.ts:166 (opens in a new tab)

    +
    +

    public

    +

    public(): boolean

    +

    Returns

    +

    boolean

    +

    Defined in

    +

    language/Language.ts:165 (opens in a new tab)

    +
    +

    render

    +

    render(): Promise<Perspective>

    +

    Returns the full, rendered Perspective at currentRevision

    +

    Returns

    +

    Promise<Perspective>

    +

    Defined in

    +

    language/Language.ts:180 (opens in a new tab)

    +
    +

    setLocalAgents

    +

    Optional setLocalAgents(agents): void

    +

    Set the local agents (DIDs) that own this perspective/neighbourhood. +This is used to determine which agents should be registered in the DHT. +Optional - if not implemented, all local agents may be registered.

    +

    This is a temporary hack to support multiple users on one node joining the same neighbourhood. +Once we migrate the LanguageController to Rust and run Languages per user, each user will get their +own language instance and we won't need to explicitly set local agents. This will provide better +isolation and avoid the need to share language state between users.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    agentsstring[]
    +

    Returns

    +

    void

    +

    Defined in

    +

    language/Language.ts:201 (opens in a new tab)

    +
    +

    sync

    +

    sync(): Promise<PerspectiveDiff>

    +

    Check for and get new changes, +notify others of local changes. +This function will be called every +few seconds by the ad4m-executor.

    +

    Returns

    +

    Promise<PerspectiveDiff>

    +

    Defined in

    +

    language/Language.ts:177 (opens in a new tab)

    +
    +

    writable

    +

    writable(): boolean

    +

    Returns

    +

    boolean

    +

    Defined in

    +

    language/Language.ts:164 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/LinkSyncAdapter/index.html b/docs/jsdoc/interfaces/LinkSyncAdapter/index.html deleted file mode 100644 index 9bcd8b0d5..000000000 --- a/docs/jsdoc/interfaces/LinkSyncAdapter/index.html +++ /dev/null @@ -1,153 +0,0 @@ -Interface: LinkSyncAdapter | AD4M Docs
    API Reference
    interfaces
    Linksyncadapter

    @coasys/ad4m / Exports / LinkSyncAdapter

    -

    Interface: LinkSyncAdapter

    -

    Interface for "Link Languages" that facilitate the synchronization -between agents' local Perspectives inside a Neighbourhood. -The assumption is that every version of the shared Perspective -is labeled with a unique revision string. -Changes are committed and retrieved through diffs. -Think of a LinkSyncAdapter as a git branch to which agents commit -their changes to and pull diffs from their current revision -to the latest one.

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    addCallback

    -

    addCallback(callback): any

    -

    Get push notification when a diff got published

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    callbackPerspectiveDiffObserver
    -

    Returns

    -

    any

    -

    Defined in

    -

    language/Language.ts:186 (opens in a new tab)

    -
    -

    addSyncStateChangeCallback

    -

    addSyncStateChangeCallback(callback): any

    -

    Add a sync state callback method

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    callbackSyncStateChangeObserver
    -

    Returns

    -

    any

    -

    Defined in

    -

    language/Language.ts:189 (opens in a new tab)

    -
    -

    commit

    -

    commit(diff): Promise<string>

    -

    Publish changes

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    diffPerspectiveDiff
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    language/Language.ts:183 (opens in a new tab)

    -
    -

    currentRevision

    -

    currentRevision(): Promise<string>

    -

    What revision are we on now -> what changes are included in output of render()

    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    language/Language.ts:169 (opens in a new tab)

    -
    -

    others

    -

    others(): Promise<string[]>

    -

    Returns

    -

    Promise<string[]>

    -

    Defined in

    -

    language/Language.ts:166 (opens in a new tab)

    -
    -

    public

    -

    public(): boolean

    -

    Returns

    -

    boolean

    -

    Defined in

    -

    language/Language.ts:165 (opens in a new tab)

    -
    -

    render

    -

    render(): Promise<Perspective>

    -

    Returns the full, rendered Perspective at currentRevision

    -

    Returns

    -

    Promise<Perspective>

    -

    Defined in

    -

    language/Language.ts:180 (opens in a new tab)

    -
    -

    sync

    -

    sync(): Promise<PerspectiveDiff>

    -

    Check for and get new changes, -notify others of local changes. -This function will be called every -few seconds by the ad4m-executor.

    -

    Returns

    -

    Promise<PerspectiveDiff>

    -

    Defined in

    -

    language/Language.ts:177 (opens in a new tab)

    -
    -

    writable

    -

    writable(): boolean

    -

    Returns

    -

    boolean

    -

    Defined in

    -

    language/Language.ts:164 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ModelConfig.html b/docs/jsdoc/interfaces/ModelConfig.html new file mode 100644 index 000000000..4245aa36f --- /dev/null +++ b/docs/jsdoc/interfaces/ModelConfig.html @@ -0,0 +1,26 @@ +Interface: ModelConfig | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ModelMetadata.html b/docs/jsdoc/interfaces/ModelMetadata.html new file mode 100644 index 000000000..87a6801d0 --- /dev/null +++ b/docs/jsdoc/interfaces/ModelMetadata.html @@ -0,0 +1,42 @@ +Interface: ModelMetadata | AD4M Docs
    API Reference
    interfaces
    Modelmetadata

    @coasys/ad4m / Exports / ModelMetadata

    +

    Interface: ModelMetadata

    +

    Complete model metadata extracted from decorators.

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    className

    +

    className: string

    +

    The model class name from

    +

    Model

    +

    Defined in

    +

    model/Ad4mModel.ts:197 (opens in a new tab)

    +
    +

    properties

    +

    properties: Record<string, PropertyMetadata>

    +

    Map of property name to metadata

    +

    Defined in

    +

    model/Ad4mModel.ts:199 (opens in a new tab)

    +
    +

    relations

    +

    relations: Record<string, RelationMetadata>

    +

    Map of relation name to metadata

    +

    Defined in

    +

    model/Ad4mModel.ts:201 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ModelMetadata/index.html b/docs/jsdoc/interfaces/ModelMetadata/index.html deleted file mode 100644 index ee18bc8f7..000000000 --- a/docs/jsdoc/interfaces/ModelMetadata/index.html +++ /dev/null @@ -1,42 +0,0 @@ -Interface: ModelMetadata | AD4M Docs
    API Reference
    interfaces
    Modelmetadata

    @coasys/ad4m / Exports / ModelMetadata

    -

    Interface: ModelMetadata

    -

    Complete model metadata extracted from decorators.

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    className

    -

    className: string

    -

    The model class name from

    -

    Model Options

    -

    Defined in

    -

    model/Ad4mModel.ts:122 (opens in a new tab)

    -
    -

    collections

    -

    collections: Record<string, CollectionMetadata>

    -

    Map of collection name to metadata

    -

    Defined in

    -

    model/Ad4mModel.ts:126 (opens in a new tab)

    -
    -

    properties

    -

    properties: Record<string, PropertyMetadata>

    -

    Map of property name to metadata

    -

    Defined in

    -

    model/Ad4mModel.ts:124 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ModelOptionsOptions/index.html b/docs/jsdoc/interfaces/ModelOptionsOptions/index.html deleted file mode 100644 index 223534628..000000000 --- a/docs/jsdoc/interfaces/ModelOptionsOptions/index.html +++ /dev/null @@ -1,26 +0,0 @@ -Interface: ModelOptionsOptions | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PropertyMetadata.html b/docs/jsdoc/interfaces/PropertyMetadata.html new file mode 100644 index 000000000..4b38be3ba --- /dev/null +++ b/docs/jsdoc/interfaces/PropertyMetadata.html @@ -0,0 +1,123 @@ +Interface: PropertyMetadata | AD4M Docs
    API Reference
    interfaces
    Propertymetadata

    @coasys/ad4m / Exports / PropertyMetadata

    +

    Interface: PropertyMetadata

    +

    Metadata for a single property extracted from decorators.

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    flag

    +

    Optional flag: boolean

    +

    Whether this is a flag property

    +

    Defined in

    +

    model/Ad4mModel.ts:162 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter code

    +

    Defined in

    +

    model/Ad4mModel.ts:156 (opens in a new tab)

    +
    +

    initial

    +

    Optional initial: string

    +

    Initial value if specified

    +

    Defined in

    +

    model/Ad4mModel.ts:148 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Whether stored locally only

    +

    Defined in

    +

    model/Ad4mModel.ts:158 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    The property name

    +

    Defined in

    +

    model/Ad4mModel.ts:140 (opens in a new tab)

    +
    +

    predicate

    +

    predicate: string

    +

    The predicate URI (through value)

    +

    Defined in

    +

    model/Ad4mModel.ts:142 (opens in a new tab)

    +
    +

    prologGetter

    +

    Optional prologGetter: string

    +

    Custom Prolog getter code

    +

    Defined in

    +

    model/Ad4mModel.ts:152 (opens in a new tab)

    +
    +

    prologSetter

    +

    Optional prologSetter: string

    +

    Custom Prolog setter code

    +

    Defined in

    +

    model/Ad4mModel.ts:154 (opens in a new tab)

    +
    +

    readOnly

    +

    readOnly: boolean

    +

    Whether the property is read-only

    +

    Defined in

    +

    model/Ad4mModel.ts:146 (opens in a new tab)

    +
    +

    required

    +

    required: boolean

    +

    Whether the property is required

    +

    Defined in

    +

    model/Ad4mModel.ts:144 (opens in a new tab)

    +
    +

    resolveLanguage

    +

    Optional resolveLanguage: string

    +

    Language for resolution (e.g., "literal")

    +

    Defined in

    +

    model/Ad4mModel.ts:150 (opens in a new tab)

    +
    +

    transform

    +

    Optional transform: (value: any) => any

    +

    Type declaration

    +

    ▸ (value): any

    +

    Transform function

    +
    Parameters
    + + + + + + + + + + + + + +
    NameType
    valueany
    +
    Returns
    +

    any

    +

    Defined in

    +

    model/Ad4mModel.ts:160 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PropertyMetadata/index.html b/docs/jsdoc/interfaces/PropertyMetadata/index.html deleted file mode 100644 index 3facffefe..000000000 --- a/docs/jsdoc/interfaces/PropertyMetadata/index.html +++ /dev/null @@ -1,116 +0,0 @@ -Interface: PropertyMetadata | AD4M Docs
    API Reference
    interfaces
    Propertymetadata

    @coasys/ad4m / Exports / PropertyMetadata

    -

    Interface: PropertyMetadata

    -

    Metadata for a single property extracted from decorators.

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    flag

    -

    Optional flag: boolean

    -

    Whether this is a flag property

    -

    Defined in

    -

    model/Ad4mModel.ts:100 (opens in a new tab)

    -
    -

    getter

    -

    Optional getter: string

    -

    Custom Prolog getter code

    -

    Defined in

    -

    model/Ad4mModel.ts:92 (opens in a new tab)

    -
    -

    initial

    -

    Optional initial: string

    -

    Initial value if specified

    -

    Defined in

    -

    model/Ad4mModel.ts:88 (opens in a new tab)

    -
    -

    local

    -

    Optional local: boolean

    -

    Whether stored locally only

    -

    Defined in

    -

    model/Ad4mModel.ts:96 (opens in a new tab)

    -
    -

    name

    -

    name: string

    -

    The property name

    -

    Defined in

    -

    model/Ad4mModel.ts:80 (opens in a new tab)

    -
    -

    predicate

    -

    predicate: string

    -

    The predicate URI (through value)

    -

    Defined in

    -

    model/Ad4mModel.ts:82 (opens in a new tab)

    -
    -

    required

    -

    required: boolean

    -

    Whether the property is required

    -

    Defined in

    -

    model/Ad4mModel.ts:84 (opens in a new tab)

    -
    -

    resolveLanguage

    -

    Optional resolveLanguage: string

    -

    Language for resolution (e.g., "literal")

    -

    Defined in

    -

    model/Ad4mModel.ts:90 (opens in a new tab)

    -
    -

    setter

    -

    Optional setter: string

    -

    Custom Prolog setter code

    -

    Defined in

    -

    model/Ad4mModel.ts:94 (opens in a new tab)

    -
    -

    transform

    -

    Optional transform: (value: any) => any

    -

    Type declaration

    -

    ▸ (value): any

    -

    Transform function

    -
    Parameters
    - - - - - - - - - - - - - -
    NameType
    valueany
    -
    Returns
    -

    any

    -

    Defined in

    -

    model/Ad4mModel.ts:98 (opens in a new tab)

    -
    -

    writable

    -

    writable: boolean

    -

    Whether the property is writable

    -

    Defined in

    -

    model/Ad4mModel.ts:86 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PropertyMetadataEntry.html b/docs/jsdoc/interfaces/PropertyMetadataEntry.html new file mode 100644 index 000000000..a2135e737 --- /dev/null +++ b/docs/jsdoc/interfaces/PropertyMetadataEntry.html @@ -0,0 +1,161 @@ +Interface: PropertyMetadataEntry | AD4M Docs
    API Reference
    interfaces
    Propertymetadataentry

    @coasys/ad4m / Exports / PropertyMetadataEntry

    +

    Interface: PropertyMetadataEntry

    +

    Metadata stored for each property via

    +

    Property

    +

    /

    +

    Optional

    +

    /

    +

    Read Only

    +

    /

    +

    Flag

    +

    Hierarchy

    + +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    flag

    +

    Optional flag: boolean

    +

    Defined in

    +

    model/decorators.ts:18 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter to resolve the property value. Use this for custom graph traversals. +The expression can reference 'Base' which will be replaced with the instance's base expression. +Example: "(<-link[WHERE predicate = 'flux://has_reply'].in.uri)[0]"

    +

    Inherited from

    +

    PropertyOptions.getter

    +

    Defined in

    +

    model/decorators.ts:288 (opens in a new tab)

    +
    +

    initial

    +

    Optional initial: string

    +

    The initial value of the property. Required if the property is marked as required.

    +

    Inherited from

    +

    PropertyOptions.initial

    +

    Defined in

    +

    model/decorators.ts:255 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Indicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.

    +

    Inherited from

    +

    PropertyOptions.local

    +

    Defined in

    +

    model/decorators.ts:293 (opens in a new tab)

    +
    +

    prologGetter

    +

    Optional prologGetter: string

    +

    Custom Prolog getter to get the value of the property. If not provided, the default getter will be used.

    +

    Inherited from

    +

    PropertyOptions.prologGetter

    +

    Defined in

    +

    model/decorators.ts:276 (opens in a new tab)

    +
    +

    prologSetter

    +

    Optional prologSetter: string

    +

    Custom Prolog setter to set the value of the property. Only available if the property is writable.

    +

    Inherited from

    +

    PropertyOptions.prologSetter

    +

    Defined in

    +

    model/decorators.ts:281 (opens in a new tab)

    +
    +

    readOnly

    +

    Optional readOnly: boolean

    +

    Indicates whether the property is read-only. If true, no setter will be generated. +Defaults to false (property is writable).

    +

    Inherited from

    +

    PropertyOptions.readOnly

    +

    Defined in

    +

    model/decorators.ts:266 (opens in a new tab)

    +
    +

    required

    +

    Optional required: boolean

    +

    Indicates whether the property is required. If true, an initial value must be provided.

    +

    Inherited from

    +

    PropertyOptions.required

    +

    Defined in

    +

    model/decorators.ts:260 (opens in a new tab)

    +
    +

    resolveLanguage

    +

    Optional resolveLanguage: string

    +

    The language used to store the property. Can be the default Literal Language or a custom language address.

    +

    Inherited from

    +

    PropertyOptions.resolveLanguage

    +

    Defined in

    +

    model/decorators.ts:271 (opens in a new tab)

    +
    +

    through

    +

    Optional through: string

    +

    The predicate of the property. All properties must have this option.

    +

    Inherited from

    +

    PropertyOptions.through

    +

    Defined in

    +

    model/decorators.ts:250 (opens in a new tab)

    +
    +

    transform

    +

    Optional transform: (value: any) => any

    +

    Type declaration

    +

    ▸ (value): any

    +

    Optional transform function to modify the property value after it is retrieved. +This is useful for transforming raw data into a more usable format. +The function takes the raw value as input and returns the transformed value.

    +
    Parameters
    + + + + + + + + + + + + + +
    NameType
    valueany
    +
    Returns
    +

    any

    +

    Inherited from

    +

    PropertyOptions.transform

    +

    Defined in

    +

    model/decorators.ts:300 (opens in a new tab)

    +
    +

    writable

    +

    Optional writable: boolean

    +

    Internal computed writable flag (inverse of readOnly) for SDNA/SHACL compatibility

    +

    Defined in

    +

    model/decorators.ts:17 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PropertyOptions.html b/docs/jsdoc/interfaces/PropertyOptions.html new file mode 100644 index 000000000..985c53be8 --- /dev/null +++ b/docs/jsdoc/interfaces/PropertyOptions.html @@ -0,0 +1,120 @@ +Interface: PropertyOptions | AD4M Docs
    API Reference
    interfaces
    Propertyoptions

    @coasys/ad4m / Exports / PropertyOptions

    +

    Interface: PropertyOptions

    +

    Hierarchy

    + +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter to resolve the property value. Use this for custom graph traversals. +The expression can reference 'Base' which will be replaced with the instance's base expression. +Example: "(<-link[WHERE predicate = 'flux://has_reply'].in.uri)[0]"

    +

    Defined in

    +

    model/decorators.ts:288 (opens in a new tab)

    +
    +

    initial

    +

    Optional initial: string

    +

    The initial value of the property. Required if the property is marked as required.

    +

    Defined in

    +

    model/decorators.ts:255 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Indicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.

    +

    Defined in

    +

    model/decorators.ts:293 (opens in a new tab)

    +
    +

    prologGetter

    +

    Optional prologGetter: string

    +

    Custom Prolog getter to get the value of the property. If not provided, the default getter will be used.

    +

    Defined in

    +

    model/decorators.ts:276 (opens in a new tab)

    +
    +

    prologSetter

    +

    Optional prologSetter: string

    +

    Custom Prolog setter to set the value of the property. Only available if the property is writable.

    +

    Defined in

    +

    model/decorators.ts:281 (opens in a new tab)

    +
    +

    readOnly

    +

    Optional readOnly: boolean

    +

    Indicates whether the property is read-only. If true, no setter will be generated. +Defaults to false (property is writable).

    +

    Defined in

    +

    model/decorators.ts:266 (opens in a new tab)

    +
    +

    required

    +

    Optional required: boolean

    +

    Indicates whether the property is required. If true, an initial value must be provided.

    +

    Defined in

    +

    model/decorators.ts:260 (opens in a new tab)

    +
    +

    resolveLanguage

    +

    Optional resolveLanguage: string

    +

    The language used to store the property. Can be the default Literal Language or a custom language address.

    +

    Defined in

    +

    model/decorators.ts:271 (opens in a new tab)

    +
    +

    through

    +

    Optional through: string

    +

    The predicate of the property. All properties must have this option.

    +

    Defined in

    +

    model/decorators.ts:250 (opens in a new tab)

    +
    +

    transform

    +

    Optional transform: (value: any) => any

    +

    Type declaration

    +

    ▸ (value): any

    +

    Optional transform function to modify the property value after it is retrieved. +This is useful for transforming raw data into a more usable format. +The function takes the raw value as input and returns the transformed value.

    +
    Parameters
    + + + + + + + + + + + + + +
    NameType
    valueany
    +
    Returns
    +

    any

    +

    Defined in

    +

    model/decorators.ts:300 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PropertyOptions/index.html b/docs/jsdoc/interfaces/PropertyOptions/index.html deleted file mode 100644 index 2c287d044..000000000 --- a/docs/jsdoc/interfaces/PropertyOptions/index.html +++ /dev/null @@ -1,103 +0,0 @@ -Interface: PropertyOptions | AD4M Docs
    API Reference
    interfaces
    Propertyoptions

    @coasys/ad4m / Exports / PropertyOptions

    -

    Interface: PropertyOptions

    -

    Table of contents

    -

    Properties

    - -

    Properties

    -

    getter

    -

    Optional getter: string

    -

    Custom getter to get the value of the property in the prolog engine. If not provided, the default getter will be used.

    -

    Defined in

    -

    model/decorators.ts:149 (opens in a new tab)

    -
    -

    initial

    -

    Optional initial: string

    -

    The initial value of the property. Required if the property is marked as required.

    -

    Defined in

    -

    model/decorators.ts:129 (opens in a new tab)

    -
    -

    local

    -

    Optional local: boolean

    -

    Indicates whether the property is stored locally in the perspective and not in the network. Useful for properties that are not meant to be shared with the network.

    -

    Defined in

    -

    model/decorators.ts:159 (opens in a new tab)

    -
    -

    required

    -

    Optional required: boolean

    -

    Indicates whether the property is required. If true, an initial value must be provided.

    -

    Defined in

    -

    model/decorators.ts:134 (opens in a new tab)

    -
    -

    resolveLanguage

    -

    Optional resolveLanguage: string

    -

    The language used to store the property. Can be the default Literal Language or a custom language address.

    -

    Defined in

    -

    model/decorators.ts:144 (opens in a new tab)

    -
    -

    setter

    -

    Optional setter: string

    -

    Custom setter to set the value of the property in the prolog engine. Only available if the property is writable.

    -

    Defined in

    -

    model/decorators.ts:154 (opens in a new tab)

    -
    -

    through

    -

    Optional through: string

    -

    The predicate of the property. All properties must have this option.

    -

    Defined in

    -

    model/decorators.ts:124 (opens in a new tab)

    -
    -

    transform

    -

    Optional transform: (value: any) => any

    -

    Type declaration

    -

    ▸ (value): any

    -

    Optional transform function to modify the property value after it is retrieved. -This is useful for transforming raw data into a more usable format. -The function takes the raw value as input and returns the transformed value.

    -
    Parameters
    - - - - - - - - - - - - - -
    NameType
    valueany
    -
    Returns
    -

    any

    -

    Defined in

    -

    model/decorators.ts:166 (opens in a new tab)

    -
    -

    writable

    -

    Optional writable: boolean

    -

    Indicates whether the property is writable. If true, a setter will be available in the prolog engine.

    -

    Defined in

    -

    model/decorators.ts:139 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PublicSharing.html b/docs/jsdoc/interfaces/PublicSharing.html new file mode 100644 index 000000000..dcbe016b8 --- /dev/null +++ b/docs/jsdoc/interfaces/PublicSharing.html @@ -0,0 +1,49 @@ +Interface: PublicSharing | AD4M Docs
    API Reference
    interfaces
    Publicsharing

    @coasys/ad4m / Exports / PublicSharing

    +

    Interface: PublicSharing

    +

    Implement this interface if your Language supports creation of sharing +of Expressions. +See ExpressionAdapter

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    createPublic

    +

    createPublic(content): Promise<string>

    +

    Create an Expression and shares it. +Return the Expression's address.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    contentobjectis the object created by the constructorIcon component
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    language/Language.ts:118 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/PublicSharing/index.html b/docs/jsdoc/interfaces/PublicSharing/index.html deleted file mode 100644 index 0f589cc0e..000000000 --- a/docs/jsdoc/interfaces/PublicSharing/index.html +++ /dev/null @@ -1,49 +0,0 @@ -Interface: PublicSharing | AD4M Docs
    API Reference
    interfaces
    Publicsharing

    @coasys/ad4m / Exports / PublicSharing

    -

    Interface: PublicSharing

    -

    Implement this interface if your Language supports creation of sharing -of Expressions. -See ExpressionAdapter

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    createPublic

    -

    createPublic(content): Promise<string>

    -

    Create an Expression and shares it. -Return the Expression's address.

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    contentobjectis the object created by the constructorIcon component
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    language/Language.ts:118 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ReadOnlyLanguage.html b/docs/jsdoc/interfaces/ReadOnlyLanguage.html new file mode 100644 index 000000000..41f6c7561 --- /dev/null +++ b/docs/jsdoc/interfaces/ReadOnlyLanguage.html @@ -0,0 +1,47 @@ +Interface: ReadOnlyLanguage | AD4M Docs
    API Reference
    interfaces
    Readonlylanguage

    @coasys/ad4m / Exports / ReadOnlyLanguage

    +

    Interface: ReadOnlyLanguage

    +

    Implement this interface if your Language is defined over a static +set of pre-defined Expressions.

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    addressOf

    +

    addressOf(content): Promise<string>

    +

    This just calculates the address of an object

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    contentobjectis the object created by the constructorIcon component
    +

    Returns

    +

    Promise<string>

    +

    Defined in

    +

    language/Language.ts:128 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/ReadOnlyLanguage/index.html b/docs/jsdoc/interfaces/ReadOnlyLanguage/index.html deleted file mode 100644 index 67d902115..000000000 --- a/docs/jsdoc/interfaces/ReadOnlyLanguage/index.html +++ /dev/null @@ -1,47 +0,0 @@ -Interface: ReadOnlyLanguage | AD4M Docs
    API Reference
    interfaces
    Readonlylanguage

    @coasys/ad4m / Exports / ReadOnlyLanguage

    -

    Interface: ReadOnlyLanguage

    -

    Implement this interface if your Language is defined over a static -set of pre-defined Expressions.

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    addressOf

    -

    addressOf(content): Promise<string>

    -

    This just calculates the address of an object

    -

    Parameters

    - - - - - - - - - - - - - - - -
    NameTypeDescription
    contentobjectis the object created by the constructorIcon component
    -

    Returns

    -

    Promise<string>

    -

    Defined in

    -

    language/Language.ts:128 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/RelationMetadata.html b/docs/jsdoc/interfaces/RelationMetadata.html new file mode 100644 index 000000000..8b29588b7 --- /dev/null +++ b/docs/jsdoc/interfaces/RelationMetadata.html @@ -0,0 +1,81 @@ +Interface: RelationMetadata | AD4M Docs
    API Reference
    interfaces
    Relationmetadata

    @coasys/ad4m / Exports / RelationMetadata

    +

    Interface: RelationMetadata

    +

    Metadata for a single relation extracted from decorators.

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    direction

    +

    Optional direction: "reverse" | "forward"

    +

    Link direction: 'forward' for HasMany/HasOne, 'reverse' for BelongsToMany/BelongsToOne

    +

    Defined in

    +

    model/Ad4mModel.ts:178 (opens in a new tab)

    +
    +

    filter

    +

    Optional filter: boolean

    +

    Whether to auto-generate a conformance filter when target is set. +Defaults to true — set to false to opt out of DB-level type filtering.

    +

    Defined in

    +

    model/Ad4mModel.ts:185 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter code

    +

    Defined in

    +

    model/Ad4mModel.ts:174 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Whether stored locally only

    +

    Defined in

    +

    model/Ad4mModel.ts:176 (opens in a new tab)

    +
    +

    name

    +

    name: string

    +

    The relation name

    +

    Defined in

    +

    model/Ad4mModel.ts:170 (opens in a new tab)

    +
    +

    predicate

    +

    predicate: string

    +

    The predicate URI (through value)

    +

    Defined in

    +

    model/Ad4mModel.ts:172 (opens in a new tab)

    +
    +

    target

    +

    Optional target: () => any

    +

    Type declaration

    +

    ▸ (): any

    +

    Target model class thunk for hydration and type filtering

    +
    Returns
    +

    any

    +

    Defined in

    +

    model/Ad4mModel.ts:180 (opens in a new tab)

    +
    +

    where

    +

    Optional where: Where

    +

    Where clause for relation filtering (query DSL)

    +

    Defined in

    +

    model/Ad4mModel.ts:187 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/RelationMetadataEntry.html b/docs/jsdoc/interfaces/RelationMetadataEntry.html new file mode 100644 index 000000000..8dcf6359e --- /dev/null +++ b/docs/jsdoc/interfaces/RelationMetadataEntry.html @@ -0,0 +1,90 @@ +Interface: RelationMetadataEntry | AD4M Docs
    API Reference
    interfaces
    Relationmetadataentry

    @coasys/ad4m / Exports / RelationMetadataEntry

    +

    Interface: RelationMetadataEntry

    +

    Metadata stored for each relation via

    +

    Has Many

    +

    /

    +

    Has One

    +

    /

    +

    Belongs To One

    +

    /

    +

    Belongs To Many

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    filter

    +

    Optional filter: boolean

    +

    Whether to auto-generate a conformance filter when target is set. +Defaults to true — set to false to opt out of DB-level type filtering +while keeping hydration capability via include.

    +

    Defined in

    +

    model/decorators.ts:43 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter to resolve the relation values. +The expression can reference 'Base' which will be replaced with the instance's base expression.

    +

    Defined in

    +

    model/decorators.ts:37 (opens in a new tab)

    +
    +

    kind

    +

    kind: "hasMany" | "hasOne" | "belongsToOne" | "belongsToMany"

    +

    Defined in

    +

    model/decorators.ts:26 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Defined in

    +

    model/decorators.ts:32 (opens in a new tab)

    +
    +

    maxCount

    +

    Optional maxCount: number

    +

    Maximum number of related instances. +Set automatically: 1 for @HasOne/@BelongsToOne, undefined (unlimited) for *Many.

    +

    Defined in

    +

    model/decorators.ts:31 (opens in a new tab)

    +
    +

    predicate

    +

    predicate: string

    +

    Defined in

    +

    model/decorators.ts:23 (opens in a new tab)

    +
    +

    target

    +

    Optional target: () => Ad4mModelLike

    +

    Type declaration

    +

    ▸ (): Ad4mModelLike

    +

    Target model class thunk. Optional for untyped string relations.

    +
    Returns
    +

    Ad4mModelLike

    +

    Defined in

    +

    model/decorators.ts:25 (opens in a new tab)

    +
    +

    where

    +

    Optional where: Where

    +

    Filter constraints on linked target nodes using the query DSL. +Property names reference the target model's properties. +Overrides auto-derived conformance when set.

    +

    Defined in

    +

    model/decorators.ts:49 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/RelationOptions.html b/docs/jsdoc/interfaces/RelationOptions.html new file mode 100644 index 000000000..087e4086a --- /dev/null +++ b/docs/jsdoc/interfaces/RelationOptions.html @@ -0,0 +1,88 @@ +Interface: RelationOptions | AD4M Docs
    API Reference
    interfaces
    Relationoptions

    @coasys/ad4m / Exports / RelationOptions

    +

    Interface: RelationOptions

    +

    Options for relation decorators (@HasMany, @HasOne, @BelongsToOne, @BelongsToMany).

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    filter

    +

    Optional filter: boolean

    +

    Whether to auto-generate a DB-level conformance filter when target is set. +Defaults to true when target is present — the query will only return linked +nodes whose shape matches the target model (required properties, flags, etc.). +Set to false to opt out of filtering while keeping hydration capability.

    +

    Defined in

    +

    model/decorators.ts:1136 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    Custom SurrealQL getter to resolve the relation values. Use this for custom graph traversals. +The expression can reference 'Base' which will be replaced with the instance's base expression. +Example: "(<-link[WHERE predicate = 'flux://has_reply'].out.uri)"

    +

    Mutually exclusive with through and target. When getter is provided the +relation is read-only (no adder/remover actions are generated).

    +

    Defined in

    +

    model/decorators.ts:1127 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    Whether the link is stored locally (not shared on the network)

    +

    Defined in

    +

    model/decorators.ts:1129 (opens in a new tab)

    +
    +

    target

    +

    Optional target: () => Ad4mModelLike

    +

    Type declaration

    +

    ▸ (): Ad4mModelLike

    +

    The target model class (use a thunk to avoid circular-dependency issues). Optional for untyped string relations. +Cannot be combined with getter.

    +
    Returns
    +

    Ad4mModelLike

    +

    Defined in

    +

    model/decorators.ts:1118 (opens in a new tab)

    +
    +

    through

    +

    Optional through: string

    +

    The predicate URI used to link the two models. +Defaults to 'ad4m://has_child' when omitted. +Cannot be combined with getter.

    +

    Defined in

    +

    model/decorators.ts:1115 (opens in a new tab)

    +
    +

    where

    +

    Optional where: Where

    +

    Filter constraints on the linked target nodes, using the same query DSL +as Model.query().where(...). Property names reference the target +model's properties (resolved via target metadata).

    +

    When target is set and where is omitted, conformance conditions are +auto-derived from the target shape (flags + required properties). +Providing where overrides this auto-derivation.

    +

    Mutually exclusive with getter and filter: false.

    +

    Example

    +
    @HasMany(() => Message, {
    +  through: "flux://entry_type",
    +  where: { status: "active", priority: { gte: 3 } }
    +})
    +activeMessages: Message[] = []
    +

    Defined in

    +

    model/decorators.ts:1157 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/SHACLPropertyShape.html b/docs/jsdoc/interfaces/SHACLPropertyShape.html new file mode 100644 index 000000000..013680d87 --- /dev/null +++ b/docs/jsdoc/interfaces/SHACLPropertyShape.html @@ -0,0 +1,159 @@ +Interface: SHACLPropertyShape | AD4M Docs
    API Reference
    interfaces
    Shaclpropertyshape

    @coasys/ad4m / Exports / SHACLPropertyShape

    +

    Interface: SHACLPropertyShape

    +

    SHACL Property Shape +Represents constraints on a single property path

    +

    Table of contents

    +

    Properties

    + +

    Properties

    +

    adder

    +

    Optional adder: AD4MAction[]

    +

    AD4M-specific: Adder action for collection properties

    +

    Defined in

    +

    shacl/SHACLShape.ts:159 (opens in a new tab)

    +
    +

    class

    +

    Optional class: string

    +

    sh:class — the target SHACL node shape URI that linked nodes must conform to. +Set automatically when a relation has a target model. Enables typed construction +on the Rust/MCP side by referencing the full target shape.

    +

    Defined in

    +

    shacl/SHACLShape.ts:176 (opens in a new tab)

    +
    +

    conformanceConditions

    +

    Optional conformanceConditions: ConformanceCondition[]

    +

    AD4M-specific: Structured conformance conditions (DB-agnostic). +Each condition describes a check on the target node (flag match or required property).

    +

    Defined in

    +

    shacl/SHACLShape.ts:171 (opens in a new tab)

    +
    +

    datatype

    +

    Optional datatype: string

    +

    Expected datatype (e.g., xsd:string, xsd:integer)

    +

    Defined in

    +

    shacl/SHACLShape.ts:123 (opens in a new tab)

    +
    +

    getter

    +

    Optional getter: string

    +

    AD4M-specific: Pre-computed SurrealQL getter expression for reading this relation/property. +For relations with a target model, this encodes conformance filtering +so that Rust/MCP can execute the exact same query as the JS runtime.

    +

    Defined in

    +

    shacl/SHACLShape.ts:167 (opens in a new tab)

    +
    +

    hasValue

    +

    Optional hasValue: string

    +

    Fixed value constraint (for Flag properties)

    +

    Defined in

    +

    shacl/SHACLShape.ts:144 (opens in a new tab)

    +
    +

    local

    +

    Optional local: boolean

    +

    AD4M-specific: Local-only property

    +

    Defined in

    +

    shacl/SHACLShape.ts:147 (opens in a new tab)

    +
    +

    maxCount

    +

    Optional maxCount: number

    +

    Maximum cardinality (single-valued if 1, omit for collections)

    +

    Defined in

    +

    shacl/SHACLShape.ts:132 (opens in a new tab)

    +
    +

    maxInclusive

    +

    Optional maxInclusive: number

    +

    Maximum value (inclusive) for numeric properties

    +

    Defined in

    +

    shacl/SHACLShape.ts:141 (opens in a new tab)

    +
    +

    minCount

    +

    Optional minCount: number

    +

    Minimum cardinality (required if >= 1)

    +

    Defined in

    +

    shacl/SHACLShape.ts:129 (opens in a new tab)

    +
    +

    minInclusive

    +

    Optional minInclusive: number

    +

    Minimum value (inclusive) for numeric properties

    +

    Defined in

    +

    shacl/SHACLShape.ts:138 (opens in a new tab)

    +
    +

    name

    +

    Optional name: string

    +

    Property name (e.g., "name", "ingredients") - used for generating named URIs

    +

    Defined in

    +

    shacl/SHACLShape.ts:117 (opens in a new tab)

    +
    +

    nodeKind

    +

    Optional nodeKind: "IRI" | "Literal" | "BlankNode"

    +

    Node kind constraint (IRI, Literal, BlankNode)

    +

    Defined in

    +

    shacl/SHACLShape.ts:126 (opens in a new tab)

    +
    +

    path

    +

    path: string

    +

    The property path (predicate URI)

    +

    Defined in

    +

    shacl/SHACLShape.ts:120 (opens in a new tab)

    +
    +

    pattern

    +

    Optional pattern: string

    +

    Regex pattern for string validation

    +

    Defined in

    +

    shacl/SHACLShape.ts:135 (opens in a new tab)

    +
    +

    remover

    +

    Optional remover: AD4MAction[]

    +

    AD4M-specific: Remover action for collection properties

    +

    Defined in

    +

    shacl/SHACLShape.ts:162 (opens in a new tab)

    +
    +

    resolveLanguage

    +

    Optional resolveLanguage: string

    +

    AD4M-specific: Language to resolve property values through

    +

    Defined in

    +

    shacl/SHACLShape.ts:153 (opens in a new tab)

    +
    +

    setter

    +

    Optional setter: AD4MAction[]

    +

    AD4M-specific: Setter action for this property

    +

    Defined in

    +

    shacl/SHACLShape.ts:156 (opens in a new tab)

    +
    +

    writable

    +

    Optional writable: boolean

    +

    AD4M-specific: Writable property

    +

    Defined in

    +

    shacl/SHACLShape.ts:150 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/SettingsUI.html b/docs/jsdoc/interfaces/SettingsUI.html new file mode 100644 index 000000000..848926c31 --- /dev/null +++ b/docs/jsdoc/interfaces/SettingsUI.html @@ -0,0 +1,27 @@ +Interface: SettingsUI | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/SettingsUI/index.html b/docs/jsdoc/interfaces/SettingsUI/index.html deleted file mode 100644 index b90f465e4..000000000 --- a/docs/jsdoc/interfaces/SettingsUI/index.html +++ /dev/null @@ -1,27 +0,0 @@ -Interface: SettingsUI | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/SignaturesService.html b/docs/jsdoc/interfaces/SignaturesService.html new file mode 100644 index 000000000..a052f7a7b --- /dev/null +++ b/docs/jsdoc/interfaces/SignaturesService.html @@ -0,0 +1,42 @@ +Interface: SignaturesService | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/SignaturesService/index.html b/docs/jsdoc/interfaces/SignaturesService/index.html deleted file mode 100644 index 6ed9267db..000000000 --- a/docs/jsdoc/interfaces/SignaturesService/index.html +++ /dev/null @@ -1,42 +0,0 @@ -Interface: SignaturesService | AD4M Docs

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/TelepresenceAdapter.html b/docs/jsdoc/interfaces/TelepresenceAdapter.html new file mode 100644 index 000000000..c99460b2f --- /dev/null +++ b/docs/jsdoc/interfaces/TelepresenceAdapter.html @@ -0,0 +1,123 @@ +Interface: TelepresenceAdapter | AD4M Docs
    API Reference
    interfaces
    Telepresenceadapter

    @coasys/ad4m / Exports / TelepresenceAdapter

    +

    Interface: TelepresenceAdapter

    +

    Table of contents

    +

    Methods

    + +

    Methods

    +

    getOnlineAgents

    +

    getOnlineAgents(): Promise<OnlineAgent[]>

    +

    Returns

    +

    Promise<OnlineAgent[]>

    +

    Defined in

    +

    language/Language.ts:273 (opens in a new tab)

    +
    +

    registerSignalCallback

    +

    registerSignalCallback(callback): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    callbackTelepresenceSignalCallback
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    language/Language.ts:277 (opens in a new tab)

    +
    +

    sendBroadcast

    +

    sendBroadcast(payload): Promise<object>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    payloadPerspectiveExpression
    +

    Returns

    +

    Promise<object>

    +

    Defined in

    +

    language/Language.ts:276 (opens in a new tab)

    +
    +

    sendSignal

    +

    sendSignal(remoteAgentDid, payload): Promise<object>

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    remoteAgentDidstring
    payloadPerspectiveExpression
    +

    Returns

    +

    Promise<object>

    +

    Defined in

    +

    language/Language.ts:275 (opens in a new tab)

    +
    +

    setOnlineStatus

    +

    setOnlineStatus(status): Promise<void>

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    statusPerspectiveExpression
    +

    Returns

    +

    Promise<void>

    +

    Defined in

    +

    language/Language.ts:272 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/interfaces/TelepresenceAdapter/index.html b/docs/jsdoc/interfaces/TelepresenceAdapter/index.html deleted file mode 100644 index 620f7372b..000000000 --- a/docs/jsdoc/interfaces/TelepresenceAdapter/index.html +++ /dev/null @@ -1,123 +0,0 @@ -Interface: TelepresenceAdapter | AD4M Docs
    API Reference
    interfaces
    Telepresenceadapter

    @coasys/ad4m / Exports / TelepresenceAdapter

    -

    Interface: TelepresenceAdapter

    -

    Table of contents

    -

    Methods

    - -

    Methods

    -

    getOnlineAgents

    -

    getOnlineAgents(): Promise<OnlineAgent[]>

    -

    Returns

    -

    Promise<OnlineAgent[]>

    -

    Defined in

    -

    language/Language.ts:261 (opens in a new tab)

    -
    -

    registerSignalCallback

    -

    registerSignalCallback(callback): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    callbackTelepresenceSignalCallback
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    language/Language.ts:265 (opens in a new tab)

    -
    -

    sendBroadcast

    -

    sendBroadcast(payload): Promise<object>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    payloadPerspectiveExpression
    -

    Returns

    -

    Promise<object>

    -

    Defined in

    -

    language/Language.ts:264 (opens in a new tab)

    -
    -

    sendSignal

    -

    sendSignal(remoteAgentDid, payload): Promise<object>

    -

    Parameters

    - - - - - - - - - - - - - - - - - -
    NameType
    remoteAgentDidstring
    payloadPerspectiveExpression
    -

    Returns

    -

    Promise<object>

    -

    Defined in

    -

    language/Language.ts:263 (opens in a new tab)

    -
    -

    setOnlineStatus

    -

    setOnlineStatus(status): Promise<void>

    -

    Parameters

    - - - - - - - - - - - - - -
    NameType
    statusPerspectiveExpression
    -

    Returns

    -

    Promise<void>

    -

    Defined in

    -

    language/Language.ts:260 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/jsdoc/modules/index.html b/docs/jsdoc/modules.html similarity index 51% rename from docs/jsdoc/modules/index.html rename to docs/jsdoc/modules.html index 53ea24f17..5c9045c14 100644 --- a/docs/jsdoc/modules/index.html +++ b/docs/jsdoc/modules.html @@ -11,167 +11,199 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    API Reference
    Modules

    @coasys/ad4m / Exports

    +
    API Reference
    Modules

    @coasys/ad4m / Exports

    @coasys/ad4m

    Table of contents

    Enumerations

    Classes

    Interfaces

    Type Aliases

    Variables

    Decorators Functions

    Other Functions

    Type Aliases

    Ad4mSignalCB

    @@ -196,12 +228,12 @@
    Returns

    void

    Defined in

    -

    language/LanguageContext.ts:37 (opens in a new tab)

    +

    language/LanguageContext.ts:37 (opens in a new tab)


    Address

    Ƭ Address: string

    Defined in

    -

    Address.ts:1 (opens in a new tab)

    +

    Address.ts:1 (opens in a new tab)


    AgentAppsUpdatedCallback

    Ƭ AgentAppsUpdatedCallback: () => null

    @@ -210,10 +242,10 @@

    Returns

    null

    Defined in

    -

    agent/AgentClient.ts:81 (opens in a new tab)

    +

    agent/AgentClient.ts:83 (opens in a new tab)


    AgentStatusChangedCallback

    -

    Ƭ AgentStatusChangedCallback: (agent: Agent) => null

    +

    Ƭ AgentStatusChangedCallback: (agent: Agent) => null

    Type declaration

    ▸ (agent): null

    Parameters
    @@ -230,14 +262,14 @@
    NameTypeagentAgent +
    NameType
    agentAgent
    Returns

    null

    Defined in

    -

    agent/AgentClient.ts:80 (opens in a new tab)

    +

    agent/AgentClient.ts:82 (opens in a new tab)


    AgentUpdatedCallback

    -

    Ƭ AgentUpdatedCallback: (agent: Agent) => null

    +

    Ƭ AgentUpdatedCallback: (agent: Agent) => null

    Type declaration

    ▸ (agent): null

    Parameters
    @@ -254,11 +286,11 @@
    NameTypeagentAgent +
    NameType
    agentAgent
    Returns

    null

    Defined in

    -

    agent/AgentClient.ts:79 (opens in a new tab)

    +

    agent/AgentClient.ts:81 (opens in a new tab)


    AllInstancesResult

    Ƭ AllInstancesResult: Object

    @@ -284,22 +316,63 @@

    NameTypeAllInstancesAd4mModel[]TotalCount?numberisInit?boolean +
    NameType
    AllInstancesAd4mModel[]
    TotalCount?number
    isInit?boolean

    Defined in

    -

    model/Ad4mModel.ts:71 (opens in a new tab)

    +

    model/Ad4mModel.ts:131 (opens in a new tab)


    DID

    Ƭ DID: string

    Defined in

    -

    DID.ts:1 (opens in a new tab)

    +

    DID.ts:1 (opens in a new tab)

    +
    +

    FlowableCondition

    +

    Ƭ FlowableCondition: "any" | LinkPattern

    +

    Flowable condition - determines which expressions can enter this flow +"any" means all expressions can start this flow +Otherwise, a link pattern to check

    +

    Defined in

    +

    shacl/SHACLFlow.ts:54 (opens in a new tab)

    +
    +

    GetOptions

    +

    Ƭ GetOptions: Pick<Query, "include" | "properties">

    +

    Options accepted by the instance get() method.

    +

    A subset of Query — only hydration controls apply to a single known instance.

    +

    Defined in

    +

    model/Ad4mModel.ts:129 (opens in a new tab)

    +
    +

    HasManyMethods

    +

    Ƭ HasManyMethods<Keys>: { [K in Keys as `add${Capitalize<K>}`]: Function } & { [K in Keys as `remove${Capitalize<K>}`]: Function } & { [K in Keys as `set${Capitalize<K>}`]: Function }

    +

    Utility type that describes the auto-generated helper methods for a HasMany +relation. For a property named comments on a class Post, the following +methods will be available on instances:

    +

    post.addComment(value) +post.removeComment(value) +post.setComment(values)

    +

    Type parameters

    + + + + + + + + + + + + + +
    NameType
    Keysextends string
    +

    Defined in

    +

    model/decorators.ts:1169 (opens in a new tab)


    LinkStatus

    Ƭ LinkStatus: "shared" | "local"

    -

    Defined in

    -

    perspectives/PerspectiveProxy.ts:321 (opens in a new tab)

    +

    Defined in

    +

    perspectives/PerspectiveProxy.ts:324 (opens in a new tab)


    MessageCallback

    -

    Ƭ MessageCallback: (message: PerspectiveExpression) => void

    +

    Ƭ MessageCallback: (message: PerspectiveExpression) => void

    Type declaration

    ▸ (message): void

    Parameters
    @@ -316,15 +389,15 @@
    NameTypemessagePerspectiveExpression +
    NameType
    messagePerspectiveExpression
    Returns

    void

    -

    Defined in

    -

    language/Language.ts:192 (opens in a new tab)

    +

    Defined in

    +

    language/Language.ts:204 (opens in a new tab)


    PaginationResult

    Ƭ PaginationResult<T>: Object

    -

    Type parameters

    +

    Type parameters

    @@ -364,11 +437,21 @@

    NameTypepageNumbernumberpageSizenumberresultsT[]totalCount?number -

    Defined in

    -

    model/Ad4mModel.ts:73 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:133 (opens in a new tab)

    +
    +

    ParentScope

    +

    Ƭ ParentScope: { field?: string ; id: string ; model: typeof Ad4mModel } | { id: string ; predicate: string }

    +

    Discriminated union for parent-scoped queries.

    +

    Model form (preferred) — predicate auto-resolved from the parent model's +relation metadata. Use field to disambiguate when the parent has multiple +relations targeting the same child class.

    +

    Raw form — explicit predicate string, no metadata lookup.

    +

    Defined in

    +

    model/Ad4mModel.ts:72 (opens in a new tab)


    PerspectiveDiffObserver

    -

    Ƭ PerspectiveDiffObserver: (diff: PerspectiveDiff) => void

    +

    Ƭ PerspectiveDiffObserver: (diff: PerspectiveDiff) => void

    Type declaration

    ▸ (diff): void

    Parameters
    @@ -385,11 +468,11 @@
    NameTypediffPerspectiveDiff +
    NameType
    diffPerspectiveDiff
    Returns

    void

    -

    Defined in

    -

    language/Language.ts:151 (opens in a new tab)

    +

    Defined in

    +

    language/Language.ts:151 (opens in a new tab)


    Query

    Ƭ Query: Object

    @@ -435,13 +518,32 @@

    NameTypecollections?string[]count?booleanlimit?numberoffset?numberorder?Orderproperties?string[]source?stringwhere?Where -

    Defined in

    -

    model/Ad4mModel.ts:60 (opens in a new tab)

    + + + + + + + + + +
    NameTypeDescription
    count?boolean-
    include?IncludeMap-
    limit?number-
    offset?number-
    order?Order-
    parent?ParentScopeFilter to instances that are the target of a link from a given parent.
    properties?string[]-
    where?Where-
    +

    Defined in

    +

    model/Ad4mModel.ts:99 (opens in a new tab)

    +
    +

    RelationSubQuery

    +

    Ƭ RelationSubQuery: Omit<Query, "parent" | "count">

    +

    Sub-query options for a specific relation inside an IncludeMap.

    +

    Equivalent to Query without top-level scoping (parent) or count, +since the result set is already constrained to the linked relation.

    +

    Example

    +
    await post.get({ include: { comments: { order: { createdAt: 'DESC' }, limit: 5 } } });
    +

    Defined in

    +

    model/Ad4mModel.ts:122 (opens in a new tab)


    ResultsWithTotalCount

    Ƭ ResultsWithTotalCount<T>: Object

    -

    Type parameters

    +

    Type parameters

    @@ -473,13 +575,13 @@

    NameTyperesultsT[]totalCount?number -

    Defined in

    -

    model/Ad4mModel.ts:72 (opens in a new tab)

    +

    Defined in

    +

    model/Ad4mModel.ts:132 (opens in a new tab)


    StatusCallback

    -

    Ƭ StatusCallback: (caller: DID) => Perspective

    +

    Ƭ StatusCallback: (caller: DID) => Perspective

    Type declaration

    -

    ▸ (caller): Perspective

    +

    ▸ (caller): Perspective

    Parameters
    @@ -494,14 +596,14 @@
    NameTypecallerDID +
    NameType
    callerDID
    Returns
    -

    Perspective

    -

    Defined in

    -

    language/Language.ts:193 (opens in a new tab)

    +

    Perspective

    +

    Defined in

    +

    language/Language.ts:205 (opens in a new tab)


    SyncStateChangeObserver

    -

    Ƭ SyncStateChangeObserver: (state: PerspectiveState) => void

    +

    Ƭ SyncStateChangeObserver: (state: PerspectiveState) => void

    Type declaration

    ▸ (state): void

    Parameters
    @@ -518,16 +620,16 @@
    NameTypestatePerspectiveState +
    NameType
    statePerspectiveState
    Returns

    void

    -

    Defined in

    -

    language/Language.ts:152 (opens in a new tab)

    +

    Defined in

    +

    language/Language.ts:152 (opens in a new tab)


    TelepresenceSignalCallback

    -

    Ƭ TelepresenceSignalCallback: (payload: PerspectiveExpression) => void

    +

    Ƭ TelepresenceSignalCallback: (payload: PerspectiveExpression, recipientDid?: string) => void

    Type declaration

    -

    ▸ (payload): void

    +

    ▸ (payload, recipientDid?): void

    Parameters
    @@ -542,25 +644,85 @@
    NameTypepayloadPerspectiveExpression + + + + +
    NameType
    payloadPerspectiveExpression
    recipientDid?string
    Returns

    void

    -

    Defined in

    -

    language/Language.ts:258 (opens in a new tab)

    +

    Defined in

    +

    language/Language.ts:270 (opens in a new tab)

    +
    +

    Where

    +

    Ƭ Where: Object

    +

    Index signature

    +

    ▪ [propertyName: string]: WhereCondition

    +

    Defined in

    +

    model/Ad4mModel.ts:60 (opens in a new tab)

    +
    +

    WhereCondition

    +

    Ƭ WhereCondition: string | number | boolean | string[] | number[] | { [K in keyof WhereOps]?: WhereOps[K] }

    +

    Defined in

    +

    model/Ad4mModel.ts:59 (opens in a new tab)

    +
    +

    WhereOps

    +

    Ƭ WhereOps: Object

    +

    Type declaration

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameType
    between[number, number]
    containsstring | number
    gtnumber
    gtenumber
    ltnumber
    ltenumber
    notstring | number | boolean | string[] | number[]
    +

    Defined in

    +

    model/Ad4mModel.ts:50 (opens in a new tab)

    Variables

    SMART_LITERAL_CONTENT_PREDICATE

    Const SMART_LITERAL_CONTENT_PREDICATE: "smart_literal://content"

    -

    Defined in

    -

    SmartLiteral.ts:6 (opens in a new tab)

    +

    Defined in

    +

    SmartLiteral.ts:6 (opens in a new tab)


    typeDefsString

    Const typeDefsString: ""

    -

    Defined in

    -

    typeDefs.ts:6 (opens in a new tab)

    +

    Defined in

    +

    typeDefs.ts:6 (opens in a new tab)

    Decorators Functions

    -

    Collection

    -

    Collection(opts): <T>(target: T, key: keyof T) => void

    -

    Decorator for defining collections on model classes.

    +

    BelongsToMany

    +

    BelongsToMany(opts): PropertyDecorator

    +

    Decorator for defining the inverse side of a many-to-many relation.

    Parameters

    @@ -575,13 +737,27 @@

    NameTypeoptsRelationOptions +

    Returns

    +

    PropertyDecorator

    +

    Description

    +

    Declares the non-owning (inverse) side of a many-to-many relationship. +The property is a read-only relation since the owning side manages links.

    +

    Supports two calling conventions:

    +
    @BelongsToMany({ through: "post://tag", target: () => Post })
    +@BelongsToMany(() => Post, { through: "post://tag" })
    +

    Example

    +
    @Model({ name: "Tag" })
    +class Tag extends Ad4mModel {
    +  @BelongsToMany(() => Post, { through: "post://tag" })
    +  posts: string[] = [];
    +}
    +

    Defined in

    +

    model/decorators.ts:1456 (opens in a new tab)

    +

    BelongsToMany(target, opts?): PropertyDecorator

    +

    Parameters

    -
    NameTypeDescription
    optsCollectionOptionsCollection configuration
    -

    Returns

    -

    fn

    -

    ▸ <T>(target, key): void

    -
    Type parameters
    @@ -593,12 +769,20 @@
    NameT -
    Parameters
    +
    NameType
    target() => Ad4mModelLike
    opts?Omit<RelationOptions, "target">
    +

    Returns

    +

    PropertyDecorator

    +

    Defined in

    +

    model/decorators.ts:1457 (opens in a new tab)

    +
    +

    BelongsToOne

    +

    BelongsToOne(opts): PropertyDecorator

    +

    Decorator for defining the inverse side of a one-to-one relation.

    +

    Parameters

    @@ -612,66 +796,52 @@
    NameTypetargetTkeykeyof T -
    Returns
    -

    void

    +
    NameType
    optsRelationOptions
    +

    Returns

    +

    PropertyDecorator

    Description

    -

    Defines a property that represents a collection of values linked to the model instance. -Collections are always arrays and support operations for adding, removing, and setting values.

    -

    For each collection property, the following methods are automatically generated:

    -
      -
    • addX(value) - Add a value to the collection
    • -
    • removeX(value) - Remove a value from the collection
    • -
    • setCollectionX(values) - Replace all values in the collection
    • -
    -

    Where X is the capitalized property name.

    -

    Collections can be filtered using the where option to only include values that:

    -
      -
    • Are instances of a specific model class
    • -
    • Match a custom Prolog condition
    • -
    +

    Declares the non-owning (inverse) side of a one-to-one relationship. +The property is read-only since the owning side manages the link.

    +

    Supports two calling conventions:

    +
    @BelongsToOne({ through: "post://author", target: () => Post })
    +@BelongsToOne(() => Post, { through: "post://author" })

    Example

    -
    class Recipe extends Ad4mModel {
    -  // Basic collection of ingredients
    -  @Collection({ 
    -    through: "recipe://ingredient" 
    -  })
    -  ingredients: string[] = [];
    - 
    -  // Collection that only includes instances of another model
    -  @Collection({
    -    through: "recipe://comment",
    -    where: { isInstance: Comment }
    -  })
    -  comments: string[] = [];
    - 
    -  // Collection with custom filter condition
    -  @Collection({
    -    through: "recipe://step",
    -    where: { condition: `triple(Target, "step://order", Order), Order < 3` }
    -  })
    -  firstSteps: string[] = [];
    - 
    -  // Local-only collection not shared with network
    -  @Collection({
    -    through: "recipe://note",
    -    local: true
    -  })
    -  privateNotes: string[] = [];
    -}
    - 
    -// Using the generated methods:
    -const recipe = new Recipe(perspective);
    -await recipe.addIngredients("ingredient://flour");
    -await recipe.removeIngredients("ingredient://sugar");
    -await recipe.setCollectionIngredients(["ingredient://butter", "ingredient://eggs"]);
    -

    Defined in

    -

    model/decorators.ts:459 (opens in a new tab)

    +
    @Model({ name: "Author" })
    +class Author extends Ad4mModel {
    +  @BelongsToOne(() => Post, { through: "post://author" })
    +  post: string = "";
    +}
    +

    Defined in

    +

    model/decorators.ts:1398 (opens in a new tab)

    +

    BelongsToOne(target, opts?): PropertyDecorator

    +

    Parameters

    + + + + + + + + + + + + + + + + + +
    NameType
    target() => Ad4mModelLike
    opts?Omit<RelationOptions, "target">
    +

    Returns

    +

    PropertyDecorator

    +

    Defined in

    +

    model/decorators.ts:1399 (opens in a new tab)


    Flag

    Flag(opts): <T>(target: T, key: keyof T) => void

    Decorator for defining flags on model classes.

    -

    Parameters

    +

    Parameters

    @@ -687,8 +857,8 @@

    NameTypeDescriptionoptsFlagOptionsFlag configuration -

    Returns

    +
    NameTypeDescription
    optsFlagOptionsFlag configuration
    +

    Returns

    fn

    ▸ <T>(target, key): void

    Type parameters
    @@ -704,7 +874,7 @@
    NameT -
    Parameters
    +
    Parameters
    @@ -723,7 +893,7 @@
    NameTypetargetTkeykeyof T -
    Returns
    +
    Returns

    void

    Description

    A specialized property decorator for defining immutable type flags or markers on model instances. @@ -769,13 +939,13 @@

    const messages = await Message.query(perspective) .where({ type: "ad4m://message" }) .run();
    -

    Defined in

    -

    model/decorators.ts:341 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:430 (opens in a new tab)


    -

    InstanceQuery

    -

    InstanceQuery(options?): <T>(target: T, key: keyof T, descriptor: PropertyDescriptor) => void

    -

    Decorator for querying instances of a model class.

    -

    Parameters

    +

    HasMany

    +

    HasMany(opts): PropertyDecorator

    +

    Decorator for defining a one-to-many relation.

    +

    Parameters

    @@ -789,13 +959,32 @@

    NameTypeoptsRelationOptions +

    Returns

    +

    PropertyDecorator

    +

    Description

    +

    Declares that the decorated property is an array of related model instances. +Under the hood it registers the relation in the relation registry and also +creates the corresponding relation entry so that the SDNA / SHACL +generators continue to emit the correct subject-class code.

    +

    Supports two calling conventions:

    +
    // Options-object style
    +@HasMany({ through: "post://comment", target: () => Comment })
    + 
    +// Target-first shorthand
    +@HasMany(() => Comment, { through: "post://comment" })
    +

    Example

    +
    @Model({ name: "Post" })
    +class Post extends Ad4mModel {
    +  @HasMany(() => Comment, { through: "post://comment" })
    +  comments: string[] = [];
    +}
    +

    Defined in

    +

    model/decorators.ts:1264 (opens in a new tab)

    +

    HasMany(target, opts?): PropertyDecorator

    +

    Parameters

    -
    NameTypeDescription
    options?InstanceQueryParamsQuery options
    -

    Returns

    -

    fn

    -

    ▸ <T>(target, key, descriptor): void

    -
    Type parameters
    @@ -807,12 +996,20 @@
    NameT -
    Parameters
    +
    NameType
    target() => Ad4mModelLike
    opts?Omit<RelationOptions, "target">
    +

    Returns

    +

    PropertyDecorator

    +

    Defined in

    +

    model/decorators.ts:1265 (opens in a new tab)

    +
    +

    HasOne

    +

    HasOne(opts): PropertyDecorator

    +

    Decorator for defining a one-to-one relation (owning side).

    +

    Parameters

    @@ -826,48 +1023,52 @@
    NameTypeoptsRelationOptions +

    Returns

    +

    PropertyDecorator

    +

    Description

    +

    Declares that the decorated property holds a single related model instance. +The owning side manages the link.

    +

    Supports two calling conventions:

    +
    @HasOne({ through: "post://author", target: () => Author })
    +@HasOne(() => Author, { through: "post://author" })
    +

    Example

    +
    @Model({ name: "Post" })
    +class Post extends Ad4mModel {
    +  @HasOne(() => Author, { through: "post://author" })
    +  author: string = "";
    +}
    +

    Defined in

    +

    model/decorators.ts:1328 (opens in a new tab)

    +

    HasOne(target, opts?): PropertyDecorator

    +

    Parameters

    -
    NameType
    targetT
    keykeyof T
    descriptorPropertyDescriptor
    -
    Returns
    -

    void

    -

    Description

    -

    Allows you to define static query methods on your model class to retrieve instances based on custom conditions. -This decorator can only be applied to static async methods that return a Promise of an array of model instances.

    -

    The query can be constrained using either:

    -
      -
    • A where clause that matches property values
    • -
    • A custom Prolog condition for more complex queries
    • -
    -

    Example

    -
    class Recipe extends Ad4mModel {
    -  @Property({ through: "recipe://name" })
    -  name: string = "";
    - 
    -  @Property({ through: "recipe://rating" })
    -  rating: number = 0;
    - 
    -  // Get all recipes
    -  @InstanceQuery()
    -  static async all(perspective: PerspectiveProxy): Promise<Recipe[]> { return [] }
    - 
    -  // Get recipes by name
    -  @InstanceQuery({ where: { name: "Chocolate Cake" }})
    -  static async findByName(perspective: PerspectiveProxy): Promise<Recipe[]> { return [] }
    - 
    -  // Get highly rated recipes using a custom condition
    -  @InstanceQuery({ condition: "triple(Instance, 'recipe://rating', Rating), Rating > 4" })
    -  static async topRated(perspective: PerspectiveProxy): Promise<Recipe[]> { return [] }
    -}
    -

    Defined in

    -

    model/decorators.ts:77 (opens in a new tab)

    + + + + + + + + + + + + + +
    NameType
    target() => Ad4mModelLike
    opts?Omit<RelationOptions, "target">
    +

    Returns

    +

    PropertyDecorator

    +

    Defined in

    +

    model/decorators.ts:1329 (opens in a new tab)


    -

    ModelOptions

    -

    ModelOptions(opts): (target: any) => void

    +

    Model

    +

    Model(opts): (target: any) => void

    Decorator for defining model classes in AD4M.

    -

    Parameters

    +

    Parameters

    @@ -883,11 +1084,11 @@

    NameTypeDescriptionoptsModelOptionsOptionsModel configuration -

    Returns

    +
    NameTypeDescription
    optsModelConfigModel configuration
    +

    Returns

    fn

    ▸ (target): void

    -
    Parameters
    +
    Parameters
    @@ -902,7 +1103,7 @@
    NameTypetargetany -
    Returns
    +
    Returns

    void

    Description

    The root decorator that must be applied to any class that represents a model in AD4M. @@ -911,12 +1112,12 @@

    This decorator:

    • Registers the class with a unique name in the AD4M system
    • -
    • Generates the necessary SDNA code for the model's properties and collections
    • -
    • Enables the use of other model decorators (@Property, @Collection, etc.)
    • +
    • Generates the necessary SDNA code for the model's properties and relations
    • +
    • Enables the use of other model decorators (@Property, @HasMany, etc.)
    • Provides static query methods through the Ad4mModel base class

    Example

    -
    @ModelOptions({ name: "Recipe" })
    +
    @Model({ name: "Recipe" })
     class Recipe extends Ad4mModel {
       @Property({
         through: "recipe://name",
    @@ -924,7 +1125,7 @@ 
    }) name: string = ""; - @Collection({ through: "recipe://ingredient" }) + @HasMany({ through: "recipe://ingredient" }) ingredients: string[] = []; // Static query methods from Ad4mModel: @@ -947,13 +1148,13 @@
    // Using with PerspectiveProxy: await perspective.ensureSDNASubjectClass(Recipe);
    -

    Defined in

    -

    model/decorators.ts:544 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:528 (opens in a new tab)


    Optional

    Optional(opts): <T>(target: T, key: keyof T) => void

    -

    Decorator for defining optional properties on model classes.

    -

    Parameters

    +

    Convenience decorator for defining optional (not required) properties.

    +

    Parameters

    @@ -969,11 +1170,11 @@

    NameTypeDescriptionoptsPropertyOptionsProperty configuration options -

    Returns

    +
    NameTypeDescription
    optsPropertyOptionsProperty configuration (same options as @Property)
    +

    Returns

    fn

    ▸ <T>(target, key): void

    -
    Type parameters
    +
    Type parameters
    @@ -986,7 +1187,7 @@
    NameT -
    Parameters
    +
    Parameters
    @@ -1005,82 +1206,24 @@
    NameTypetargetTkeykeyof T -
    Returns
    +
    Returns

    void

    Description

    -

    The most flexible property decorator that allows you to define properties with full control over:

    -
      -
    • Whether the property is required
    • -
    • Whether the property is writable
    • -
    • How values are stored and retrieved
    • -
    • Custom getter/setter logic
    • -
    • Local vs network storage
    • -
    -

    Both

    -

    Property

    -

    and

    -

    Read Only

    -

    are specialized versions of

    -

    Optional

    -

    with preset configurations.

    +

    Equivalent to @Property but defaults required to false and does not +apply resolveLanguage or initial defaults. Use this when a property +may or may not have a value, and you want full control over its configuration.

    Example

    class Recipe extends Ad4mModel {
    -  // Basic optional property
    -  @Optional({
    -    through: "recipe://description"
    -  })
    +  @Optional({ through: "recipe://description" })
       description?: string;
    - 
    -  // Optional property with custom initial value
    -  @Optional({
    -    through: "recipe://status",
    -    initial: "recipe://draft",
    -    required: true
    -  })
    -  status: string = "";
    - 
    -  // Read-only property with custom getter
    -  @Optional({
    -    through: "recipe://rating",
    -    writable: false,
    -    getter: `
    -      findall(Rating, triple(Base, "recipe://user_rating", Rating), Ratings),
    -      sum_list(Ratings, Sum),
    -      length(Ratings, Count),
    -      Value is Sum / Count
    -    `
    -  })
    -  averageRating: number = 0;
    - 
    -  // Property that resolves to a Literal and is stored locally
    -  @Optional({
    -    through: "recipe://notes",
    -    resolveLanguage: "literal",
    -    local: true
    -  })
    -  notes?: string;
    - 
    -  // Property with custom getter and setter logic
    -  @Optional({
    -    through: "recipe://ingredients",
    -    getter: `
    -      triple(Base, "recipe://ingredients", RawValue),
    -      atom_json_term(RawValue, Value)
    -    `,
    -    setter: `
    -      atom_json_term(Value, JsonValue),
    -      Actions = [{"action": "setSingleTarget", "source": "this", "predicate": "recipe://ingredients", "target": JsonValue}]
    -    `
    -  })
    -  ingredients: string[] = [];
     }
    -

    Defined in

    -

    model/decorators.ts:249 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:357 (opens in a new tab)


    Property

    Property(opts): <T>(target: T, key: keyof T) => void

    -

    Decorator for defining required and writable properties on model classes.

    -

    Parameters

    +

    The primary property decorator for AD4M model classes.

    +

    Parameters

    @@ -1096,11 +1239,11 @@

    NameTypeDescriptionoptsPropertyOptionsProperty configuration -

    Returns

    +
    NameTypeDescription
    optsPropertyOptionsProperty configuration
    +

    Returns

    fn

    ▸ <T>(target, key): void

    -
    Type parameters
    +
    Type parameters
    @@ -1113,7 +1256,7 @@
    NameT -
    Parameters
    +
    Parameters
    @@ -1132,56 +1275,60 @@
    NameTypetargetTkeykeyof T -
    Returns
    +
    Returns

    void

    Description

    -

    A convenience decorator that defines a required property that must have an initial value and is writable by default. -This is equivalent to using

    -

    Optional

    -

    with required: true and writable: true.

    -

    Properties defined with this decorator:

    +

    The core property decorator with smart defaults. All other property decorators +(@Optional, @ReadOnly) are thin wrappers that adjust these defaults.

    +

    Smart defaults (all overridable):

      -
    • Must have a value (required)
    • -
    • Can be modified after creation (writable)
    • -
    • Default to "literal://string:uninitialized" if no initial value is provided
    • +
    • requiredfalse
    • +
    • readOnlyfalse
    • +
    • resolveLanguage"literal"
    • +
    • initialundefined (no link created until a value is explicitly set)
    +

    Properties are optional by default. When a model instance is created without +providing a value for an optional property, no link is added to the graph. +Set required: true explicitly when a property must always be present (this +also adds a "literal://string:uninitialized" sentinel as the initial value +so that the SDNA constructor creates a placeholder link).

    Example

    class User extends Ad4mModel {
    -  // Basic required property with default initial value
    +  // Optional property (default) — no link created until a value is set
       @Property({
         through: "user://name"
       })
       name: string = "";
      
    -  // Required property with custom initial value
    +  // Explicitly required property with sentinel initial value
       @Property({
         through: "user://status",
    -    initial: "user://active"
    +    required: true
       })
       status: string = "";
      
    -  // Required property with literal resolution
    +  // Required property with custom initial value
       @Property({
    -    through: "user://bio",
    -    resolveLanguage: "literal"
    +    through: "user://role",
    +    required: true,
    +    initial: "user://member"
       })
    -  bio: string = "";
    +  role: string = "";
      
    -  // Required property with custom getter/setter
    +  // Optional property with literal resolution
       @Property({
    -    through: "user://age",
    -    getter: `triple(Base, "user://birthYear", Year), Value is 2024 - Year`,
    -    setter: `Year is 2024 - Value, Actions = [{"action": "setSingleTarget", "source": "this", "predicate": "user://birthYear", "target": Year}]`
    +    through: "user://bio",
    +    resolveLanguage: "literal"
       })
    -  age: number = 0;
    +  bio: string = "";
     }
    -

    Defined in

    -

    model/decorators.ts:776 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:1029 (opens in a new tab)


    ReadOnly

    ReadOnly(opts): <T>(target: T, key: keyof T) => void

    Decorator for defining read-only properties on model classes.

    -

    Parameters

    +

    Parameters

    @@ -1197,11 +1344,11 @@

    NameTypeDescriptionoptsPropertyOptionsProperty configuration -

    Returns

    +
    NameTypeDescription
    optsPropertyOptionsProperty configuration
    +

    Returns

    fn

    ▸ <T>(target, key): void

    -
    Type parameters
    +
    Type parameters
    @@ -1214,7 +1361,7 @@
    NameT -
    Parameters
    +
    Parameters
    @@ -1233,13 +1380,11 @@
    NameTypetargetTkeykeyof T -
    Returns
    +
    Returns

    void

    Description

    -

    A convenience decorator that defines a property that can only be read and cannot be modified after initialization. -This is equivalent to using

    -

    Optional

    -

    with writable: false.

    +

    A convenience decorator that defines a read-only property. +Equivalent to @Property with readOnly: true.

    Read-only properties are ideal for:

    • Computed or derived values
    • @@ -1277,13 +1422,13 @@
      }) version: string = ""; }
    -

    Defined in

    -

    model/decorators.ts:840 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:1095 (opens in a new tab)


    Other Functions

    ExpressionGeneric

    ExpressionGeneric<DataType>(DataTypeClass): any

    -

    Type parameters

    +

    Type parameters

    @@ -1296,7 +1441,7 @@

    NameDataType -

    Parameters

    +

    Parameters

    @@ -1311,14 +1456,14 @@

    NameTypeDataTypeClassClassType<DataType> -

    Returns

    +

    Returns

    any

    -

    Defined in

    -

    expression/Expression.ts:42 (opens in a new tab)

    +

    Defined in

    +

    expression/Expression.ts:42 (opens in a new tab)


    ExpressionGenericInput

    ExpressionGenericInput<DataType>(DataTypeClass): any

    -

    Type parameters

    +

    Type parameters

    @@ -1331,7 +1476,7 @@

    NameDataType -

    Parameters

    +

    Parameters

    @@ -1346,14 +1491,14 @@

    NameTypeDataTypeClassClassType<DataType> -

    Returns

    +

    Returns

    any

    -

    Defined in

    -

    expression/Expression.ts:67 (opens in a new tab)

    +

    Defined in

    +

    expression/Expression.ts:67 (opens in a new tab)


    addLink

    -

    addLink(source, predicate, target): PerspectiveAction

    -

    Parameters

    +

    addLink(source, predicate, target): PerspectiveAction

    +

    Parameters

    @@ -1376,14 +1521,51 @@

    NameTypesourcestringpredicatestringtargetstring -

    Returns

    -

    PerspectiveAction

    -

    Defined in

    -

    model/decorators.ts:12 (opens in a new tab)

    +

    Returns

    +

    PerspectiveAction

    +

    Defined in

    +

    model/decorators.ts:232 (opens in a new tab)

    +
    +

    buildConformanceFilter

    +

    buildConformanceFilter(relationPredicate, targetClass): { conformanceConditions: ConformanceCondition[] ; getter: string } | undefined

    +

    Build a conformance filter for a relation whose target model is known.

    +

    Inspects the target class's property metadata to derive:

    +
      +
    • conformanceConditions: Structured, DB-agnostic conditions (flag & required checks)
    • +
    • getter: Pre-computed SurrealQL expression that traverses outgoing links and filters +target nodes to only those conforming to the target shape.
    • +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    relationPredicatestringThe relation's predicate URI (e.g. "flux://entry_type")
    targetClassAd4mModelLikeThe target model class (resolved from the target() thunk)
    +

    Returns

    +

    { conformanceConditions: ConformanceCondition[] ; getter: string } | undefined

    +

    { getter, conformanceConditions } or undefined if no conditions could be derived

    +

    Defined in

    +

    model/decorators.ts:146 (opens in a new tab)


    capSentence

    capSentence(cap): string

    -

    Parameters

    +

    Parameters

    @@ -1398,14 +1580,51 @@

    NameTypecapany -

    Returns

    +

    Returns

    string

    -

    Defined in

    -

    utils.ts:15 (opens in a new tab)

    +

    Defined in

    +

    utils.ts:15 (opens in a new tab)

    +
    +

    escapeSurrealString

    +

    escapeSurrealString(value): string

    +

    Escapes a string value for safe use in SurrealQL queries.

    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    valuestringThe string value to escape
    +

    Returns

    +

    string

    +

    The escaped string safe for SurrealQL interpolation (without surrounding quotes)

    +

    Description

    +

    Prevents SQL injection by properly escaping special characters in string values +that will be interpolated into SurrealQL queries. This handles the most common +special characters that could break SQL queries or enable injection attacks.

    +

    Single quotes, backslashes, and other special characters are escaped using +backslash notation, which is the standard escaping mechanism for SurrealQL.

    +

    Example

    +
    const userInput = "user's input with 'quotes'";
    +const escaped = escapeSurrealString(userInput);
    +const query = `SELECT * FROM link WHERE uri = '${escaped}'`;
    +// Results in: SELECT * FROM link WHERE uri = 'user\'s input with \'quotes\''
    +

    Defined in

    +

    utils.ts:49 (opens in a new tab)


    exprRef2String

    exprRef2String(ref): string

    -

    Parameters

    +

    Parameters

    @@ -1419,15 +1638,15 @@

    NameTyperefExpressionRef -

    Returns

    +
    NameType
    refExpressionRef
    +

    Returns

    string

    -

    Defined in

    -

    expression/ExpressionRef.ts:22 (opens in a new tab)

    +

    Defined in

    +

    expression/ExpressionRef.ts:22 (opens in a new tab)


    formatList

    formatList(list): any

    -

    Parameters

    +

    Parameters

    @@ -1442,14 +1661,107 @@

    NameTypelistany -

    Returns

    +

    Returns

    any

    -

    Defined in

    -

    utils.ts:1 (opens in a new tab)

    +

    Defined in

    +

    utils.ts:1 (opens in a new tab)

    +
    +

    generatePrologFacts

    +

    generatePrologFacts(ModelClass): string

    +

    Generate Prolog predicate facts from a model class's decorator metadata.

    +

    Given a model class decorated with @Model (and its @Flag, @Property, +@HasMany, @BelongsToMany decorators), this function emits a string of +Prolog clauses that can be prepended to any perspective.infer() call.

    +

    The generated predicates are:

    +
      +
    • Instance recognizermodelName(X) — matches instances of the model
    • +
    • Property gettersmodelName_propName(X, Value) — one per property
    • +
    • Relation gettersmodelName_relName(X, Values) — one per relation
    • +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    ModelClasstypeof Ad4mModelA class decorated with @Model that extends Ad4mModel
    +

    Returns

    +

    string

    +

    A multi-line Prolog string ready for use with perspective.infer()

    +

    Example

    +
    import { generatePrologFacts } from '@coasys/ad4m';
    + 
    +const facts = generatePrologFacts(Poll);
    +const result = await perspective.infer(\`
    +  \${facts}
    +  recent_popular_poll(X) :-
    +    poll(X),
    +    poll_vote_count(X, N), N > 10.
    +\`);
    +

    Defined in

    +

    model/Ad4mModel.ts:4680 (opens in a new tab)

    +
    +

    getPropertiesMetadata

    +

    getPropertiesMetadata(ctor): Record<string, PropertyMetadataEntry>

    +

    Retrieve property metadata for a given class constructor. +Walks the prototype chain so subclass decorators compose with parent decorators.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    ctorFunction
    +

    Returns

    +

    Record<string, PropertyMetadataEntry>

    +

    Defined in

    +

    model/decorators.ts:63 (opens in a new tab)

    +
    +

    getRelationsMetadata

    +

    getRelationsMetadata(ctor): Record<string, RelationMetadataEntry>

    +

    Retrieve relation metadata for a given class constructor. +Walks the prototype chain so subclass decorators compose with parent decorators.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    ctorFunction
    +

    Returns

    +

    Record<string, RelationMetadataEntry>

    +

    Defined in

    +

    model/decorators.ts:82 (opens in a new tab)


    hasLink

    hasLink(predicate): string

    -

    Parameters

    +

    Parameters

    @@ -1464,14 +1776,38 @@

    NameTypepredicatestring -

    Returns

    +

    Returns

    string

    -

    Defined in

    -

    model/decorators.ts:21 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:241 (opens in a new tab)

    +
    +

    instanceToSerializable

    +

    instanceToSerializable(instance): Record<string, any>

    +

    Convert a model instance to a plain serializable object. +Reads the property metadata and extracts values from the instance.

    +

    Parameters

    + + + + + + + + + + + + + +
    NameType
    instanceany
    +

    Returns

    +

    Record<string, any>

    +

    Defined in

    +

    model/decorators.ts:201 (opens in a new tab)


    isExpression

    isExpression(e): boolean

    -

    Parameters

    +

    Parameters

    @@ -1486,14 +1822,14 @@

    NameTypeeany -

    Returns

    +

    Returns

    boolean

    -

    Defined in

    -

    expression/Expression.ts:97 (opens in a new tab)

    +

    Defined in

    +

    expression/Expression.ts:97 (opens in a new tab)


    isLink

    isLink(l): boolean

    -

    Parameters

    +

    Parameters

    @@ -1508,14 +1844,14 @@

    NameTypelany -

    Returns

    +

    Returns

    boolean

    -

    Defined in

    -

    links/Links.ts:91 (opens in a new tab)

    +

    Defined in

    +

    links/Links.ts:91 (opens in a new tab)


    linkEqual

    linkEqual(l1, l2): boolean

    -

    Parameters

    +

    Parameters

    @@ -1533,15 +1869,17 @@

    NameTypel1LinkExpressionl2LinkExpression -

    Returns

    +
    NameType
    l1LinkExpression
    l2LinkExpression
    +

    Returns

    boolean

    -

    Defined in

    -

    links/Links.ts:83 (opens in a new tab)

    +

    Defined in

    +

    links/Links.ts:83 (opens in a new tab)


    -

    makeRandomPrologAtom

    -

    makeRandomPrologAtom(length): string

    -

    Parameters

    +

    makeRandomId

    +

    makeRandomId(length): string

    +

    Generate a random identifier string (lowercase alpha). +Generate a random identifier string of the given length (lowercase alpha).

    +

    Parameters

    @@ -1556,14 +1894,14 @@

    NameTypelengthnumber -

    Returns

    +

    Returns

    string

    -

    Defined in

    -

    model/decorators.ts:473 (opens in a new tab)

    +

    Defined in

    +

    model/decorators.ts:215 (opens in a new tab)


    parseExprUrl

    -

    parseExprUrl(url): ExpressionRef

    -

    Parameters

    +

    parseExprUrl(url): ExpressionRef

    +

    Parameters

    @@ -1578,7 +1916,71 @@

    NameTypeurlstring -

    Returns

    -

    ExpressionRef

    -

    Defined in

    -

    expression/ExpressionRef.ts:29 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file +

    Returns

    +

    ExpressionRef

    +

    Defined in

    +

    expression/ExpressionRef.ts:29 (opens in a new tab)

    +
    +

    setPropertyRegistryEntry

    +

    setPropertyRegistryEntry(ctor, propName, meta): void

    +

    Programmatically register property metadata for a given constructor. +Used by fromJSONSchema() and other dynamic model builders.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    ctorFunction
    propNamestring
    metaPropertyMetadataEntry & { writable?: boolean }
    +

    Returns

    +

    void

    +

    Defined in

    +

    model/decorators.ts:102 (opens in a new tab)

    +
    +

    setRelationRegistryEntry

    +

    setRelationRegistryEntry(ctor, relName, meta): void

    +

    Programmatically register relation metadata for a given constructor. +Used by fromJSONSchema() and other dynamic model builders.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + +
    NameType
    ctorFunction
    relNamestring
    metaRelationMetadataEntry
    +

    Returns

    +

    void

    +

    Defined in

    +

    model/decorators.ts:115 (opens in a new tab)


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/languages/index.html b/docs/languages.html similarity index 57% rename from docs/languages/index.html rename to docs/languages.html index ddfacec38..6c8fe83da 100644 --- a/docs/languages/index.html +++ b/docs/languages.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Languages

    Languages: Communication Protocols for Agents

    +
    Languages

    Languages: Communication Protocols for Agents

    Understanding Languages in AD4M

    In AD4M, Languages are the fundamental building blocks that define how agents communicate and share data. While we call them "Languages", they could just as well be called "Protocols" or "Data Storage Adapters" – they define the rules and mechanisms by which nodes in the network exchange information.

    The term "Language" was chosen deliberately: just as human languages enable people to communicate and share ideas, AD4M Languages enable digital agents to exchange data and interact. Alternative metaphors could have been "Games" or "Dances" – patterns of interaction between agents.

    @@ -19,7 +19,7 @@

    At their heart, Languages implement a simple but powerful mechanism:

    1. Storage: Take some data, store it in a shared space (could be a server, Holochain DHT, blockchain, etc.), and return a URI that points to that data
    2. -
    3. Retrieval: Take a URI and return the previously stored data (called an "Expression" in AD4M)
    4. +
    5. Retrieval: Take a URI and return the previously stored data (called an "Expression" in AD4M)

    This mechanism creates a universal way for agents to share and reference information, regardless of where or how it's actually stored. For example:

      @@ -28,7 +28,7 @@

      A Web2 Language might store data on a server and return a URL

    Universal Addressing Mechanism

    -

    AD4M's Language system extends the familiar URI/URL model into a truly universal addressing scheme. Every Expression (the signed data objects in AD4M) is addressable through a URI that combines:

    +

    AD4M's Language system extends the familiar URI/URL model into a truly universal addressing scheme. Every Expression (the signed data objects in AD4M) is addressable through a URI that combines:

    1. The Language's unique identifier (a hash of its implementation code)
    2. The Language-specific address for that data
    3. @@ -169,7 +169,7 @@

      // Define available interactions with expressions interactions(expression: Address): Interaction[]; }

    -

    Language interface in the API reference | +

    Language interface in the API reference | Language.ts in the codebase (opens in a new tab)

    Types of Languages

    AD4M supports several types of Languages for different purposes:

    @@ -253,7 +253,7 @@

    Isolated execution context
  • Secure communication channels
  • -

    For a detailed guide on creating your own Language, see the Language Development Guide.

    +

    For a detailed guide on creating your own Language, see the Language Development Guide.

    Language Templates

    To help you get started with creating your own languages, we have provided some templates that you can use as a starting point. These templates are Deno compatible and provide a basic structure for your language.

    -

    You can clone these repositories and modify them to create your own language. Remember to follow the guidelines for making your language Deno compatible.


    AD4M - The first social network
    \ No newline at end of file +

    You can clone these repositories and modify them to create your own language. Remember to follow the guidelines for making your language Deno compatible.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/neighbourhoods/index.html b/docs/neighbourhoods.html similarity index 58% rename from docs/neighbourhoods/index.html rename to docs/neighbourhoods.html index d3a6a92d2..fd11d27cd 100644 --- a/docs/neighbourhoods/index.html +++ b/docs/neighbourhoods.html @@ -11,9 +11,9 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Neighbourhoods

    Neighbourhoods: Collaborative Knowledge Spaces

    +
    Neighbourhoods

    Neighbourhoods: Collaborative Knowledge Spaces

    Understanding Neighbourhoods

    -

    Neighbourhoods transform private Perspectives into shared semantic spaces where multiple agents can collaborate. They represent AD4M's vision of group collaboration: decentralized, storage-agnostic, and centered around shared meaning rather than applications.

    +

    Neighbourhoods transform private Perspectives into shared semantic spaces where multiple agents can collaborate. They represent AD4M's vision of group collaboration: decentralized, storage-agnostic, and centered around shared meaning rather than applications.

    From Personal to Shared Knowledge

    While Perspectives are personal knowledge graphs, Neighbourhoods enable:

      @@ -308,4 +308,4 @@

      Handle conflicts gracefully

    -

    AD4M - The first social network
    \ No newline at end of file +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/perspectives/index.html b/docs/perspectives.html similarity index 55% rename from docs/perspectives/index.html rename to docs/perspectives.html index 93af1ca6a..d574dd879 100644 --- a/docs/perspectives/index.html +++ b/docs/perspectives.html @@ -11,7 +11,7 @@ --nextra-primary-hue: 204deg; --nextra-primary-saturation: 100%; } -
    Perspectives

    Perspectives: Agent-Centric Knowledge Graphs

    +
    Perspectives

    Perspectives: Agent-Centric Knowledge Graphs

    Understanding Perspectives

    Perspectives are semantic knowledge graphs inspired by the Semantic Web and Linked Data principles, but reimagined through an agent-centric lens. While traditional RDF graphs and Solid PODs are designed around data ownership, Perspectives emphasize that all knowledge is inherently subjective and tied to the agent who claims it.

    Objective vs. Subjective Data

    @@ -86,7 +86,7 @@

  • Collaborative spaces where multiple agents share and sync Perspectives
  • Real-time updates and p2p synchronization
  • -
  • See Neighbourhoods for more details
  • +
  • See Neighbourhoods for more details
  • @@ -136,7 +136,7 @@

    );

    Performance Note: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed and fast. Avoid subqueries (IN (SELECT ...)) as they can be very slow.

    Security Note: querySurrealDB() only allows read-only operations (SELECT, RETURN, etc.). Use perspective.add() and perspective.remove() to modify links.

    -

    For comprehensive examples and graph traversal patterns, see the SurrealDB Queries Guide.

    +

    For comprehensive examples and graph traversal patterns, see the SurrealDB Queries Guide.

    Prolog Integration (Legacy)

    Perspectives also include a Prolog engine for backward compatibility and advanced logic programming:

    // Basic Prolog query
    @@ -174,17 +174,17 @@ 

    Always remember to call dispose() when you're done with a subscription.

    Recommendation: Use SurrealDB for most queries (faster), and reserve Prolog for complex logic programming or custom SDNA rules.

    Advanced Data Modeling

    -

    AD4M provides a sophisticated data modeling system built on top of the Prolog integration. This allows you to:

    +

    AD4M provides a sophisticated data modeling system built on SHACL (Shapes Constraint Language) schemas. This allows you to:

    • Define TypeScript classes that map to semantic structures
    • Use decorators to specify relationships
    • Query with type safety and IDE support
    -

    For details on this powerful feature, see our guide on Model Classes.

    +

    For details on this powerful feature, see our guide on Model Classes.

    Basic Usage Examples

    Creating a Perspective:

    const myNotes = ad4m.perspective.add("My private notes");
    -

    The returning object will be an instance of PerspectiveProxy +

    The returning object will be an instance of PerspectiveProxy – which essentially will work as your database instance.

    Adding a Link:

    const link = {
    @@ -198,7 +198,7 @@ 

    const allLinks = await myNotes.get(
       new LinkQuery({ predicate: "sioc://likes" })
     );

    -

    What you get back will be an array of LinkExpressions:

    +

    What you get back will be an array of LinkExpressions:

    [
       {
         "author": "did:key:zQ3shv5VUAbtY5P1jGsPzy7L27FTxeDv2hnhVp9QT3ALNCnQ2",
    @@ -215,4 +215,4 @@ 

    } ]

    Even though this Perspective is not shared (yet) but just our private, local -graph database, we might want to share it as Neighbourhood.


    AD4M - The first social network
    \ No newline at end of file +graph database, we might want to share it as Neighbourhood.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/social-dna.html b/docs/social-dna.html new file mode 100644 index 000000000..cd62e7ee3 --- /dev/null +++ b/docs/social-dna.html @@ -0,0 +1,453 @@ +Social DNA: Making Social Interaction Patterns Explicit | AD4M Docs
    Social DNA

    Social DNA: Making Social Interaction Patterns Explicit

    +

    What is Social DNA?

    +

    Social DNA represents the core interaction patterns and social contracts within a digital space. Just as biological DNA encodes the rules for how cells interact and function, Social DNA encodes the rules for how agents (users) interact and collaborate in a digital space.

    +

    Think of it as the "business logic" of social applications, but with a crucial difference: instead of being buried in application code, these patterns are made explicit and separated from both:

    +
      +
    • The storage layer (Languages) - how data is actually stored and shared
    • +
    • The UI layer - how these interactions are presented to users
    • +
    +

    Why "Social DNA"?

    +

    In traditional applications, social interaction patterns are often:

    +
      +
    • Implicit in the application code
    • +
    • Tied to specific storage implementations
    • +
    • Mixed with UI concerns
    • +
    • Hard to modify or extend
    • +
    • Not portable between applications
    • +
    +

    Social DNA makes these patterns:

    +
      +
    • Explicit and declarative
    • +
    • Independent of storage details
    • +
    • Separated from UI concerns
    • +
    • Easy to modify and extend
    • +
    • Portable between applications
    • +
    +

    Example: A Simple Social Space

    +

    Let's look at a common social interaction pattern: posting and liking content. In a traditional app, this might be scattered across:

    +
      +
    • Database schemas
    • +
    • API endpoints
    • +
    • UI components
    • +
    • Business logic
    • +
    +

    With Social DNA, we can express this as a clear social contract:

    +
    // Define what a "post" means in this space
    +const postClass = {
    +  properties: {
    +    content: "string",
    +    author: "did",
    +    timestamp: "datetime"
    +  },
    +  actions: {
    +    like: "any agent can like a post once",
    +    comment: "any agent can comment on a post",
    +    edit: "only the author can edit their post"
    +  }
    +}
    + 
    +// Define what "trending" means in this space
    +const trendingRule = {
    +  condition: "post has more than 5 likes in last 24 hours",
    +  action: "mark post as trending"
    +}
    +

    This is just pseudo-code, but it illustrates how Social DNA makes interaction patterns explicit and declarative.

    +

    How Social DNA Works

    +

    AD4M implements Social DNA through two main mechanisms:

    +
      +
    1. +

      Subject Classes: Define what things mean in a space

      +
        +
      • Graph patterns that represent specific types of data
      • +
      • Properties and relationships between data
      • +
      • Validation rules for data integrity
      • +
      +
    2. +
    3. +

      Flows: Define what agents can do in a space

      +
        +
      • Preconditions for actions
      • +
      • State transitions
      • +
      • Effects of actions
      • +
      +
    4. +
    +

    Subject Classes are defined using SHACL (Shapes Constraint Language), a W3C standard for describing and validating RDF graphs. SHACL is a natural fit for AD4M because:

    +
      +
    • It's a standard for describing graph shapes — exactly what perspectives are
    • +
    • It's declarative and machine-readable
    • +
    • It supports property constraints, cardinality, and data types
    • +
    • It enables interoperability with the broader semantic web ecosystem
    • +
    +
    ℹ️

    You typically won't write SHACL by hand. AD4M provides Model Classes — TypeScript decorators +that automatically generate SHACL definitions from your class declarations. +(Think of ORMs vs raw SQL. See Model Classes for details.)

    +

    Subject Classes: Defining Things

    +

    Understanding Subject Classes

    +

    The term "Subject Class" was deliberately chosen to emphasize the subjective nature of pattern recognition in semantic graphs. Unlike traditional object-oriented programming where classes define objective structures, Subject Classes represent subjective interpretations of graph patterns – different ways of "seeing" meaning in the connections between expressions.

    +

    Subjective Pattern Recognition

    +

    Think of a Subject Class as a lens through which an application views and interprets graph patterns:

    +
      +
    • Different apps can have different "opinions" about what constitutes a meaningful pattern
    • +
    • The same base expression can be interpreted through multiple Subject Classes
    • +
    • Each Subject Class defines what properties and relationships are important to its perspective
    • +
    +

    For example, consider a base expression representing some content:

    +
    expression://xyz123
    +

    Different applications might interpret this through different Subject Classes:

    +
      +
    • A chat app might see it as a "Message" with replies and reactions
    • +
    • A task app might see it as a "Todo" with state and assignments
    • +
    • A social app might see it as a "Post" with likes and shares
    • +
    • A wiki might see it as a "Document" with citations and revisions
    • +
    +

    Each of these interpretations is equally valid – they're just different subjective lenses on the same underlying graph structure.

    +

    Subject-Oriented Programming

    +

    This approach is inspired by subject-oriented programming, where:

    +
      +
    • Behavior and structure are separated from the base objects
    • +
    • Different subjects can have different views of the same object
    • +
    • Multiple interpretations can coexist without conflict
    • +
    • New interpretations can be added without modifying existing ones
    • +
    +

    In AD4M, this means:

    +
      +
    • Subject Classes define patterns around base expressions
    • +
    • Multiple Subject Classes can match the same expression
    • +
    • New Subject Classes can be added without changing existing ones
    • +
    • Applications can choose which patterns matter to them
    • +
    +

    Base Expressions and Graph Patterns

    +

    Every Subject Class instance is anchored to a base expression, but its properties and relationships are defined by patterns in the surrounding graph:

    +
    Base Expression: expression://xyz123
    +
    +    ┌───────────────┬──┴──┬───────────────┐
    +    │               │     │               │
    +  state          author  title         comments
    +    │               │     │               │
    +  "done"        did:123  "Hi"     [expr1, expr2]
    +

    Different Subject Classes might look for different patterns around this same base:

    +
    // A Todo class looks for state and assignments
    +class Todo {
    +  state: string;    // Looks for todo://state links
    +  assignee: string; // Looks for todo://assigned-to links
    +}
    + 
    +// A Post class looks for social interactions
    +class Post {
    +  likes: string[];     // Looks for social://like links
    +  comments: string[];  // Looks for social://comment links
    +}
    + 
    +// Both can exist simultaneously on the same base expression
    +const todo = await perspective.getSubjectProxy<Todo>(baseExpr, "Todo");
    +const post = await perspective.getSubjectProxy<Post>(baseExpr, "Post");
    +

    How Subject Classes are Defined (SHACL)

    +

    Subject Classes are stored as SHACL shapes in the perspective's link graph. A SHACL NodeShape describes a class, and PropertyShapes describe its properties.

    +

    Here's how a Todo class maps to SHACL:

    +
    @Model({ name: "Todo" })
    +class Todo extends Ad4mModel {
    +  @Property({ through: "todo://state", initial: "todo://ready" })
    +  state: string = "";
    + 
    +  @Property({ through: "todo://has_title" })
    +  title?: string;
    + 
    +  @HasMany({ through: "todo://comment" })
    +  comments: string[] = [];
    +}
    +

    Key SHACL Concepts for AD4M

    +
    SHACL ConstraintAD4M MeaningExample
    sh:maxCount 1Scalar property (single value)state, title, name
    No sh:maxCountCollection (multiple values)comments, tags, members
    sh:minCount 1Required propertyMust be set on creation
    sh:datatype xsd:stringString valueStored as literal://string:...
    sh:class <uri>Reference to another Subject ClassTyped relationship
    ad4m://initialDefault value on creationInitial state
    ad4m://resolveLanguageExpression language for values"literal" for inline values
    ad4m://readOnlyProperty is read-onlyComputed/immutable property
    +

    Using Subject Classes in Code

    +

    While the PerspectiveProxy provides low-level methods for working with Subject Classes, +we strongly recommend using our high-level Ad4mModel system +(described in detail in the Model Classes guide). +This TypeScript-based approach provides:

    +
      +
    • Automatic SHACL generation from decorated classes
    • +
    • Type safety and IDE support
    • +
    • Rich ActiveRecord-style semantics
    • +
    • Clean, declarative syntax
    • +
    +

    Here's how to define and use Subject Classes the recommended way:

    +
    import { Ad4mModel, Model, Property, HasMany } from '@coasys/ad4m';
    + 
    +@Model({ name: "Todo" })
    +class Todo extends Ad4mModel {
    +  @Property({ through: "todo://state", initial: "todo://ready" })
    +  state: string = "";
    + 
    +  @Property({ through: "todo://has_title" })
    +  title?: string;
    + 
    +  @HasMany({ through: "todo://comment" })
    +  comments: string[] = [];
    +}
    + 
    +// Register the class with a perspective (once at app startup)
    +await Todo.register(perspective);
    + 
    +// Use it with full type safety and ActiveRecord patterns
    +const todo = new Todo(perspective);
    +todo.state = "todo://doing";
    +await todo.save();
    + 
    +// Query with the fluent API
    +const todos = await Todo.findAll(perspective);
    +const doneTodos = await Todo.query(perspective)
    +  .where({ state: "todo://done" })
    +  .get();
    +

    This approach automatically generates SHACL and provides a rich development experience.

    +

    Working with SHACL Directly

    +

    For advanced use cases, you can work with SHACL shapes directly using the SHACLShape class:

    +
    import { SHACLShape } from '@coasys/ad4m';
    + 
    +// Create a shape programmatically
    +const shape = new SHACLShape('recipe://Recipe');
    +shape.addProperty({
    +  path: 'recipe://name',
    +  datatype: 'xsd:string',
    +  maxCount: 1,
    +  minCount: 1,
    +});
    +shape.addProperty({
    +  path: 'recipe://ingredient',
    +  datatype: 'xsd:string',
    +  // No maxCount = collection
    +});
    + 
    +// Store in perspective
    +await perspective.addShacl('Recipe', shape);
    + 
    +// Retrieve
    +const retrieved = await perspective.getShacl('Recipe');
    + 
    +// List all shapes
    +const allShapes = await perspective.getAllShacl();
    +

    Understanding the Lower Level

    +

    For a complete understanding, here are the basic PerspectiveProxy methods that power the above abstractions:

    +
    // Add a subject class definition (SHACL) to a perspective
    +await Todo.register(perspective);
    + 
    +// Or add SHACL directly
    +await perspective.addShacl("Todo", shape);
    + 
    +// List all available subject classes
    +const classes = await perspective.subjectClasses();
    +// Returns: ["Todo"]
    + 
    +// Create a new subject instance
    +await perspective.createSubject("Todo", "expression://123");
    + 
    +// Check if an expression is an instance of a class
    +const isTodo = await perspective.isSubjectInstance("expression://123", "Todo");
    + 
    +// Get subject data
    +const todoData = await perspective.getSubjectData("Todo", "expression://123");
    + 
    +// Remove a subject (runs destructor if defined)
    +await perspective.removeSubject("Todo", "expression://123");
    + 
    +// Get all instances of a class
    +const allTodos = await perspective.getAllSubjectInstances("Todo");
    + 
    +// Get a proxy object
    +const todo = await perspective.getSubjectProxy("expression://123", "Todo");
    +

    While these methods are available, we recommend using the Ad4mModel system for most use cases. It provides a more maintainable and type-safe way to work with Subject Classes while handling all the low-level details automatically.

    +

    Flows: Defining Actions

    +

    Flows define what agents can do in a space and under what conditions. They manage state machines over expressions — defining states, transitions, and the actions that trigger them.

    +
    ℹ️

    Flows still use link-based state tracking internally. The flow state is determined +by querying links in the perspective, and actions modify links to change state.

    +

    Here's a complete example of a Todo flow:

    +
    // Define flow states and transitions
    +const todoFlow = {
    +  name: "TODO",
    +  states: {
    +    ready: 0,
    +    doing: 0.5,
    +    done: 1
    +  },
    +  // State is determined by todo://state links
    +  stateQuery: (base) => `todo://state`,
    +  transitions: [
    +    {
    +      from: "ready",
    +      to: "doing",
    +      action: "Start",
    +      effects: [
    +        { action: "addLink", source: "this", predicate: "todo://state", target: "todo://doing" },
    +        { action: "removeLink", source: "this", predicate: "todo://state", target: "todo://ready" }
    +      ]
    +    },
    +    {
    +      from: "doing",
    +      to: "done",
    +      action: "Finish",
    +      effects: [
    +        { action: "addLink", source: "this", predicate: "todo://state", target: "todo://done" },
    +        { action: "removeLink", source: "this", predicate: "todo://state", target: "todo://doing" }
    +      ]
    +    }
    +  ]
    +};
    +

    This flow defines:

    +
      +
    1. A named flow ("TODO") with states (0 = ready, 0.5 = doing, 1 = done)
    2. +
    3. How states are determined (by checking todo://state links)
    4. +
    5. Available actions for each state with their transitions and effects
    6. +
    +

    Using Flows in Code

    +
    // Get all flows defined in a perspective
    +const flows = await perspective.sdnaFlows();
    +// Returns: ["TODO"]
    + 
    +// Check what flows are available for an expression
    +const availableFlows = await perspective.availableFlows("expression://123");
    + 
    +// Start a flow on an expression
    +await perspective.startFlow("TODO", "expression://123");
    + 
    +// Get expressions in a specific flow state
    +const readyTodos = await perspective.expressionsInFlowState("TODO", 0);
    + 
    +// Get current state of an expression in a flow
    +const state = await perspective.flowState("TODO", "expression://123");
    +// Returns: 0, 0.5, or 1
    + 
    +// Get available actions for current state
    +const actions = await perspective.flowActions("TODO", "expression://123");
    +// Returns: ["Start"] if in ready state
    + 
    +// Execute an action
    +await perspective.runFlowAction("TODO", "expression://123", "Start");
    +// Transitions from ready (0) to doing (0.5)
    +

    Adding Flows to a Perspective

    +
    await perspective.addSdna("Todo", flowDefinition, "flow");
    + 
    +const flows = await perspective.sdnaFlows();
    +console.log(flows); // Should include "TODO"
    +

    Query Engines: SurrealDB & Prolog

    +

    AD4M provides two query engines for working with Social DNA and perspective data:

    +

    SurrealDB: High-Performance Queries (Recommended)

    +

    For most query needs, SurrealDB provides 10-100x faster performance than Prolog. It's especially powerful for:

    +
      +
    • Fast filtering and searching
    • +
    • Graph traversal queries using indexed in.uri and out.uri fields
    • +
    • Aggregations and analytics
    • +
    • Large dataset handling
    • +
    +
    // Fast query - find all todos in "done" state
    +const doneTodos = await perspective.querySurrealDB(
    +  "SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'todo://done'"
    +);
    + 
    +// Graph traversal - find all posts by Alice
    +const alicePosts = await perspective.querySurrealDB(
    +  "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'"
    +);
    + 
    +// Aggregation - count by type
    +const stats = await perspective.querySurrealDB(
    +  "SELECT predicate, count() as total FROM link GROUP BY predicate"
    +);
    +

    Performance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed.

    +

    Note: Ad4mModel uses SurrealDB by default for findAll() and query builder operations. See the SurrealDB Queries Guide for comprehensive examples.

    +

    The Prolog Engine (Legacy)

    +
    ⚠️

    The Prolog engine is maintained for backward compatibility. For new development, +use SurrealDB queries or the Ad4mModel system (which uses SurrealDB by default).

    +

    For custom logic programming and backward compatibility, AD4M includes a Prolog engine:

    +

    Core Predicates

    +
    // Basic graph predicates
    +triple(Subject, Predicate, Object).      // Access raw triples
    +link(Subject, Predicate, Object, Timestamp, Author).  // Access links with metadata
    + 
    +// Graph traversal
    +reachable(A, B).  // True if B can be reached from A through any predicates
    +

    When to use which?

    +
      +
    • Use SurrealDB for: Fast queries, graph traversal, analytics (most use cases)
    • +
    • Use Prolog for: Complex logic rules, backward compatibility
    • +
    +

    Using Social DNA in Your Space

    +

    To add Social DNA to a Perspective:

    +
    // Recommended: Use Model Classes (auto-generates SHACL)
    +await Todo.register(perspective);
    + 
    +// Or add SHACL shapes directly
    +const shape = new SHACLShape('todo://Todo');
    +shape.addProperty({ path: 'todo://state', datatype: 'xsd:string', maxCount: 1, minCount: 1 });
    +await perspective.addShacl('Todo', shape);
    + 
    +// Add a flow definition
    +await perspective.addSdna("Todo", flowDefinition, "flow");
    +

    Then query your data:

    +
    // Option 1: Use Ad4mModel with SurrealDB (recommended, 10-100x faster)
    +const activeTodos = await Todo.findAll(perspective, {
    +  where: { state: "active" }
    +});
    + 
    +// Option 2: Direct SurrealQL query
    +const todos = await perspective.querySurrealDB(
    +  "SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'active'"
    +);
    + 
    +// Option 3: Prolog (legacy, for backward compatibility)
    +const todos = await perspective.infer(
    +  'instance(Todo, "Todo"), property_getter("Todo", Todo, "state", "active")'
    +);
    +

    Best Practices

    +
      +
    1. +

      Start with Patterns

      +
        +
      • Identify common interaction patterns
      • +
      • Make implicit rules explicit
      • +
      • Think about preconditions and effects
      • +
      +
    2. +
    3. +

      Use Subject Classes for:

      +
        +
      • Data validation
      • +
      • Computed properties
      • +
      • Relationship definitions
      • +
      +
    4. +
    5. +

      Use Flows for:

      +
        +
      • Action permissions
      • +
      • State transitions
      • +
      • Complex processes
      • +
      +
    6. +
    7. +

      Keep it Simple

      +
        +
      • Start with basic patterns
      • +
      • Add complexity gradually
      • +
      • Use the high-level Model Classes when possible
      • +
      +
    8. +
    9. +

      Prefer SHACL over Prolog

      +
        +
      • SHACL is the standard for subject class definitions
      • +
      • Model Classes generate SHACL automatically
      • +
      • Prolog is maintained for backward compatibility only
      • +
      +
    10. +

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/social-dna/index.html b/docs/social-dna/index.html deleted file mode 100644 index ea0a4b9a9..000000000 --- a/docs/social-dna/index.html +++ /dev/null @@ -1,511 +0,0 @@ -Social DNA: Making Social Interaction Patterns Explicit | AD4M Docs
    Social DNA

    Social DNA: Making Social Interaction Patterns Explicit

    -

    What is Social DNA?

    -

    Social DNA represents the core interaction patterns and social contracts within a digital space. Just as biological DNA encodes the rules for how cells interact and function, Social DNA encodes the rules for how agents (users) interact and collaborate in a digital space.

    -

    Think of it as the "business logic" of social applications, but with a crucial difference: instead of being buried in application code, these patterns are made explicit and separated from both:

    -
      -
    • The storage layer (Languages) - how data is actually stored and shared
    • -
    • The UI layer - how these interactions are presented to users
    • -
    -

    Why "Social DNA"?

    -

    In traditional applications, social interaction patterns are often:

    -
      -
    • Implicit in the application code
    • -
    • Tied to specific storage implementations
    • -
    • Mixed with UI concerns
    • -
    • Hard to modify or extend
    • -
    • Not portable between applications
    • -
    -

    Social DNA makes these patterns:

    -
      -
    • Explicit and declarative
    • -
    • Independent of storage details
    • -
    • Separated from UI concerns
    • -
    • Easy to modify and extend
    • -
    • Portable between applications
    • -
    -

    Example: A Simple Social Space

    -

    Let's look at a common social interaction pattern: posting and liking content. In a traditional app, this might be scattered across:

    -
      -
    • Database schemas
    • -
    • API endpoints
    • -
    • UI components
    • -
    • Business logic
    • -
    -

    With Social DNA, we can express this as a clear social contract:

    -
    // Define what a "post" means in this space
    -const postClass = {
    -  properties: {
    -    content: "string",
    -    author: "did",
    -    timestamp: "datetime"
    -  },
    -  actions: {
    -    like: "any agent can like a post once",
    -    comment: "any agent can comment on a post",
    -    edit: "only the author can edit their post"
    -  }
    -}
    - 
    -// Define what "trending" means in this space
    -const trendingRule = {
    -  condition: "post has more than 5 likes in last 24 hours",
    -  action: "mark post as trending"
    -}
    -

    This is just pseudo-code, but it illustrates how Social DNA makes interaction patterns explicit and declarative.

    -

    How Social DNA Works

    -

    AD4M implements Social DNA through two main mechanisms:

    -
      -
    1. -

      Subject Classes: Define what things mean in a space

      -
        -
      • Graph patterns that represent specific types of data
      • -
      • Properties and relationships between data
      • -
      • Validation rules for data integrity
      • -
      -
    2. -
    3. -

      Flows: Define what agents can do in a space

      -
        -
      • Preconditions for actions
      • -
      • State transitions
      • -
      • Effects of actions
      • -
      -
    4. -
    -

    Both are implemented using Prolog, a logical programming language perfect for:

    -
      -
    • Pattern matching in graphs
    • -
    • Declarative rules
    • -
    • Complex reasoning
    • -
    -
    ℹ️

    Don't worry if you are unfamiliar with Prolog (opens in a new tab). You will normally either -use AI to write it for you, or you will use some of our abstraction layers to -avoid writing Prolog code yourself. (Think of ORMs vs raw SQL, AD4m comes with its own implementation Model Classes).

    -

    Subject Classes: Defining Things

    -

    Understanding Subject Classes

    -

    The term "Subject Class" was deliberately chosen to emphasize the subjective nature of pattern recognition in semantic graphs. Unlike traditional object-oriented programming where classes define objective structures, Subject Classes represent subjective interpretations of graph patterns – different ways of "seeing" meaning in the connections between expressions.

    -

    Subjective Pattern Recognition

    -

    Think of a Subject Class as a lens through which an application views and interprets graph patterns:

    -
      -
    • Different apps can have different "opinions" about what constitutes a meaningful pattern
    • -
    • The same base expression can be interpreted through multiple Subject Classes
    • -
    • Each Subject Class defines what properties and relationships are important to its perspective
    • -
    -

    For example, consider a base expression representing some content:

    -
    expression://xyz123
    -

    Different applications might interpret this through different Subject Classes:

    -
      -
    • A chat app might see it as a "Message" with replies and reactions
    • -
    • A task app might see it as a "Todo" with state and assignments
    • -
    • A social app might see it as a "Post" with likes and shares
    • -
    • A wiki might see it as a "Document" with citations and revisions
    • -
    -

    Each of these interpretations is equally valid – they're just different subjective lenses on the same underlying graph structure.

    -

    Subject-Oriented Programming

    -

    This approach is inspired by subject-oriented programming, where:

    -
      -
    • Behavior and structure are separated from the base objects
    • -
    • Different subjects can have different views of the same object
    • -
    • Multiple interpretations can coexist without conflict
    • -
    • New interpretations can be added without modifying existing ones
    • -
    -

    In AD4M, this means:

    -
      -
    • Subject Classes define patterns around base expressions
    • -
    • Multiple Subject Classes can match the same expression
    • -
    • New Subject Classes can be added without changing existing ones
    • -
    • Applications can choose which patterns matter to them
    • -
    -

    Base Expressions and Graph Patterns

    -

    Every Subject Class instance is anchored to a base expression, but its properties and relationships are defined by patterns in the surrounding graph:

    -
    Base Expression: expression://xyz123
    -
    -    ┌───────────────┬──┴──┬───────────────┐
    -    │               │     │               │
    -  state          author  title         comments
    -    │               │     │               │
    -  "done"        did:123  "Hi"     [expr1, expr2]
    -

    Different Subject Classes might look for different patterns around this same base:

    -
    // A Todo class looks for state and assignments
    -class Todo {
    -  state: string;    // Looks for todo://state links
    -  assignee: string; // Looks for todo://assigned-to links
    -}
    - 
    -// A Post class looks for social interactions
    -class Post {
    -  likes: string[];     // Looks for social://like links
    -  comments: string[];  // Looks for social://comment links
    -}
    - 
    -// Both can exist simultaneously on the same base expression
    -const todo = await perspective.getSubjectProxy<Todo>(baseExpr, "Todo");
    -const post = await perspective.getSubjectProxy<Post>(baseExpr, "Post");
    -

    Here's a complete example of a Todo class:

    -
    // Define a Todo class
    -subject_class("Todo", c).
    - 
    -// Constructor - called when creating new instances
    -constructor(c, '[{
    -    action: "addLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://ready"
    -}]').
    - 
    -// Instance check - what makes something a Todo?
    -instance(c, Base) :- triple(Base, "todo://state", _).
    - 
    -// Properties
    -property(c, "state").
    -property_getter(c, Base, "state", Value) :- 
    -    triple(Base, "todo://state", Value).
    -property_setter(c, "state", '[{
    -    action: "setSingleTarget", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "value"
    -}]').
    - 
    -// Resolvable properties (e.g., literal values)
    -property(c, "title").
    -property_resolve(c, "title").
    -property_resolve_language(c, "title", "literal").
    -property_getter(c, Base, "title", Value) :- 
    -    triple(Base, "todo://has_title", Value).
    - 
    -// Computed properties
    -property(c, "isLiked").
    -property_getter(c, Base, "isLiked", Value) :- 
    -    triple(Base, "flux://has_reaction", "flux://thumbsup"), 
    -    Value = true.
    - 
    -// Collections
    -collection(c, "comments").
    -collection_getter(c, Base, "comments", List) :- 
    -    findall(C, triple(Base, "todo://comment", C), List).
    -collection_adder(c, "comments", '[{
    -    action: "addLink", 
    -    source: "this", 
    -    predicate: "todo://comment", 
    -    target: "value"
    -}]').
    -

    This defines:

    -
      -
    • What makes something a Todo
    • -
    • What properties it has
    • -
    • How to get and set those properties
    • -
    • What collections it contains
    • -
    -

    Using Subject Classes in Code

    -

    While the PerspectiveProxy provides low-level methods for working with Subject Classes, -we strongly recommend using our high-level Ad4mModel system -(described in detail in the Model Classes guide). -This TypeScript-based approach provides:

    -
      -
    • Automatic Prolog code generation from decorated classes
    • -
    • Type safety and IDE support
    • -
    • Rich ActiveRecord-style semantics
    • -
    • Clean, declarative syntax
    • -
    -

    Here's how to define and use Subject Classes the recommended way:

    -
    import { Ad4mModel, ModelOptions, Property, Optional, Collection } from '@coasys/ad4m';
    - 
    -@ModelOptions({ name: "Todo" })
    -class Todo extends Ad4mModel {
    -  @Property({
    -    through: "todo://state",
    -    initial: "todo://ready"
    -  })
    -  state: string = "";
    - 
    -  @Optional({
    -    through: "todo://has_title",
    -    writable: true,
    -    resolveLanguage: "literal"
    -  })
    -  title?: string;
    - 
    -  @ReadOnly({
    -    through: "flux://has_reaction",
    -    getter: `triple(Base, "flux://has_reaction", "flux://thumbsup"), Value = true`
    -  })
    -  isLiked: boolean = false;
    - 
    -  @Collection({ 
    -    through: "todo://comment"
    -  })
    -  comments: string[] = [];
    - 
    -  // Static query methods
    -  @InstanceQuery()
    -  static async all(perspective: PerspectiveProxy): Promise<Todo[]> { return [] }
    - 
    -  @InstanceQuery({ where: { state: "todo://done" }})
    -  static async allDone(perspective: PerspectiveProxy): Promise<Todo[]> { return [] }
    -}
    - 
    -// Use it with full type safety and ActiveRecord patterns
    -const todo = new Todo(perspective);
    -todo.state = "todo://doing";
    -await todo.save();
    - 
    -// Query with type safety
    -const todos = await Todo.all(perspective);
    -const doneTodos = await Todo.allDone(perspective);
    -

    This approach automatically generates the Prolog code we saw earlier and provides a much richer development experience.

    -

    Understanding the Lower Level

    -

    For a complete understanding, here are the basic PerspectiveProxy methods that power the above abstractions:

    -
    // Add the subject class definition to a perspective
    -await perspective.addSdna("Todo", classDefinition, "subject_class");
    - 
    -// List all available subject classes
    -const classes = await perspective.subjectClasses();
    -// Returns: ["Todo"]
    - 
    -// Create a new subject instance
    -await perspective.createSubject("Todo", "expression://123");
    - 
    -// Check if an expression is an instance of a class
    -const isTodo = await perspective.isSubjectInstance("expression://123", "Todo");
    - 
    -// Get subject data
    -const todoData = await perspective.getSubjectData("Todo", "expression://123");
    - 
    -// Remove a subject (runs destructor if defined)
    -await perspective.removeSubject("Todo", "expression://123");
    - 
    -// Get all instances of a class
    -const allTodos = await perspective.getAllSubjectInstances("Todo");
    - 
    -// Get a proxy object
    -const todo = await perspective.getSubjectProxy("expression://123", "Todo");
    -

    While these methods are available, we recommend using the Ad4mModel system for most use cases. It provides a more maintainable and type-safe way to work with Subject Classes while handling all the low-level details automatically.

    -

    Flows: Defining Actions

    -

    Flows define what agents can do in a space and under what conditions. Here's a complete example of a Todo flow that manages state transitions:

    -
    // Register this flow with a name and reference (t)
    -register_sdna_flow("TODO", t).
    - 
    -// Define what expressions can enter this flow (all in this case)
    -flowable(_, t).
    - 
    -// Define the possible states (using numbers)
    -flow_state(ExprAddr, 0, t) :- triple(ExprAddr, "todo://state", "todo://ready").
    -flow_state(ExprAddr, 0.5, t) :- triple(ExprAddr, "todo://state", "todo://doing").
    -flow_state(ExprAddr, 1, t) :- triple(ExprAddr, "todo://state", "todo://done").
    - 
    -// Initial action when starting the flow
    -start_action('[{
    -    action: "addLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://ready"
    -}]', t).
    - 
    -// Define state transitions with actions
    -action(0, "Start", 0.5, '[{
    -    action: "addLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://doing"
    -}, {
    -    action: "removeLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://ready"
    -}]').
    - 
    -action(0.5, "Finish", 1, '[{
    -    action: "addLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://done"
    -}, {
    -    action: "removeLink", 
    -    source: "this", 
    -    predicate: "todo://state", 
    -    target: "todo://doing"
    -}]').
    -

    This flow defines:

    -
      -
    1. A named flow ("TODO") with states (0 = ready, 0.5 = doing, 1 = done)
    2. -
    3. What expressions can enter the flow (any expression)
    4. -
    5. How states are determined (by checking todo://state links)
    6. -
    7. Initial action when starting the flow
    8. -
    9. Available actions for each state with their transitions
    10. -
    -

    Using Flows in Code

    -

    You can work with flows using these methods:

    -
    // Get all flows defined in a perspective
    -const flows = await perspective.sdnaFlows();
    -// Returns: ["TODO"]
    - 
    -// Check what flows are available for an expression
    -const availableFlows = await perspective.availableFlows("expression://123");
    -// Returns flows that can be started on this expression
    - 
    -// Start a flow on an expression
    -await perspective.startFlow("TODO", "expression://123");
    -// This runs the start_action, putting the expression in initial state
    - 
    -// Get expressions in a specific flow state
    -const readyTodos = await perspective.expressionsInFlowState("TODO", 0);
    -// Returns expressions in the "ready" state
    - 
    -// Get current state of an expression in a flow
    -const state = await perspective.flowState("TODO", "expression://123");
    -// Returns: 0, 0.5, or 1
    - 
    -// Get available actions for current state
    -const actions = await perspective.flowActions("TODO", "expression://123");
    -// Returns: ["Start"] if in ready state
    - 
    -// Execute an action
    -await perspective.runFlowAction("TODO", "expression://123", "Start");
    -// Transitions from ready (0) to doing (0.5)
    -

    Adding Flows to a Perspective

    -

    To add a flow to your perspective:

    -
    // Add the flow definition
    -await perspective.addSdna("Todo", flowDefinition, "flow");
    - 
    -// Check if it was added
    -const flows = await perspective.sdnaFlows();
    -console.log(flows); // Should include "TODO"
    -

    Query Engines: SurrealDB & Prolog

    -

    AD4M provides two query engines for working with Social DNA and perspective data:

    -

    SurrealDB: High-Performance Queries (Recommended)

    -

    For most query needs, SurrealDB provides 10-100x faster performance than Prolog. It's especially powerful for:

    -
      -
    • Fast filtering and searching
    • -
    • Graph traversal queries using indexed in.uri and out.uri fields
    • -
    • Aggregations and analytics
    • -
    • Large dataset handling
    • -
    -
    // Fast query - find all todos in "done" state
    -const doneTodos = await perspective.querySurrealDB(
    -  "SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'todo://done'"
    -);
    - 
    -// Graph traversal - find all posts by Alice
    -const alicePosts = await perspective.querySurrealDB(
    -  "SELECT target FROM link WHERE in.uri = 'user://alice' AND predicate = 'authored'"
    -);
    - 
    -// Graph traversal - find comments on a specific post
    -const comments = await perspective.querySurrealDB(
    -  "SELECT source, target FROM link WHERE in.uri = 'post://123' AND predicate = 'has_comment'"
    -);
    - 
    -// Aggregation - count by type
    -const stats = await perspective.querySurrealDB(
    -  "SELECT predicate, count() as total FROM link GROUP BY predicate"
    -);
    -

    Performance Tip: Use in.uri (source) and out.uri (target) for graph traversal - they're indexed. Avoid subqueries as they're slow.

    -

    Note: Ad4mModel uses SurrealDB by default for findAll() and query builder operations. See the SurrealDB Queries Guide for comprehensive examples.

    -

    The Prolog Engine (For Advanced Logic & SDNA)

    -

    For custom Social DNA rules, complex logic programming, and backward compatibility, AD4M includes a Prolog engine:

    -

    Core Predicates

    -
    // Basic graph predicates
    -triple(Subject, Predicate, Object).      // Access raw triples
    -link(Subject, Predicate, Object, Timestamp, Author).  // Access links with metadata
    - 
    -// Graph traversal
    -reachable(A, B).  // True if B can be reached from A through any predicates
    - 
    -// Expression metadata
    -languageAddress(Expression, Address).  // Get language address for expression
    -languageName(Expression, Name).        // Get language name for expression
    -expressionAddress(Expression, Address). // Get expression address
    -

    Built-in Utilities

    -
    // Pagination and sorting
    -paginate(Data, PageNumber, PageSize, PageData).
    -sort_instances(Instances, SortKey, Direction, Sorted).
    - 
    -// String and data handling
    -remove_html_tags(Input, Output).
    -string_includes(String, Substring).
    -literal_from_url(Url, Decoded, Scheme).
    -json_property(JsonString, Property, Value).
    -

    When to use which?

    -
      -
    • Use SurrealDB for: Fast queries, graph traversal, analytics (most use cases)
    • -
    • Use Prolog for: Custom SDNA rules, complex logic, backward compatibility
    • -
    -

    Using Social DNA in Your Space

    -

    To add Social DNA to a Perspective:

    -
    // Add a subject class definition
    -perspective.addSDNA(classDefinition, "subject_class");
    - 
    -// Add a flow definition
    -perspective.addSDNA(flowDefinition, "flow");
    - 
    -// Add custom rules
    -perspective.addSDNA(customRules, "custom");
    -

    Then query it using SurrealDB (fast) or Prolog (advanced logic):

    -
    // Option 1: Use Ad4mModel with SurrealDB (recommended, 10-100x faster)
    -const activeTodos = await Todo.findAll(perspective, {
    -  where: { state: "active" }
    -});
    - 
    -// Option 2: Direct SurrealQL query
    -const todos = await perspective.querySurrealDB(
    -  "SELECT * FROM link WHERE predicate = 'todo://state' AND target = 'active'"
    -);
    - 
    -// Option 3: Prolog (for custom SDNA rules)
    -const todos = await perspective.infer(
    -  'instance(Todo, "Todo"), property_getter("Todo", Todo, "state", "active")'
    -);
    - 
    -// Check if an action is allowed (Prolog for complex logic)
    -const canVote = await perspective.infer(
    -  `can_vote("${agentDid}", "${proposalId}")`
    -);
    -

    Best Practices

    -
      -
    1. -

      Start with Patterns

      -
        -
      • Identify common interaction patterns
      • -
      • Make implicit rules explicit
      • -
      • Think about preconditions and effects
      • -
      -
    2. -
    3. -

      Use Subject Classes for:

      -
        -
      • Data validation
      • -
      • Computed properties
      • -
      • Relationship definitions
      • -
      -
    4. -
    5. -

      Use Flows for:

      -
        -
      • Action permissions
      • -
      • State transitions
      • -
      • Complex processes
      • -
      -
    6. -
    7. -

      Keep it Simple

      -
        -
      • Start with basic patterns
      • -
      • Add complexity gradually
      • -
      • Use the high-level Model Classes when possible
      • -
      -
    8. -

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/spanning-layer.html b/docs/spanning-layer.html new file mode 100644 index 000000000..fea122b18 --- /dev/null +++ b/docs/spanning-layer.html @@ -0,0 +1,159 @@ +AD4M as a Spanning Layer | AD4M Docs
    The Spanning Layer

    AD4M as a Spanning Layer

    +

    The Problem

    +

    The internet today is fragmented into isolated ecosystems:

    +
      +
    • Centralized platforms (Twitter, Facebook) — walled gardens that lock in users and data
    • +
    • Federated protocols (ActivityPub, Matrix) — better, but still siloed and fragmentation persists
    • +
    • P2P systems (IPFS, Holochain) — excellent for sovereignty, but lack interoperability
    • +
    • Semantic web (RDF, Solid) — great for data portability, but struggles with adoption
    • +
    +

    Each approach solves part of the problem, but we lack a universal layer that bridges them all.

    +

    AD4M's Solution: The Spanning Layer

    +

    AD4M doesn't replace these systems — it spans across them, creating a unified semantic layer that enables:

    +
      +
    1. Global addressing — any data, any protocol, one address format
    2. +
    3. Agent sovereignty — users own their data, keys, and runtime
    4. +
    5. Protocol agnosticism — mix HTTP, IPFS, Holochain data in one graph
    6. +
    7. Semantic interoperability — RDF-like links connect data across systems
    8. +
    9. Distributed collective intelligence — humans and AI agents collaborate
    10. +
    +

    Think of AD4M as a new layer in the internet stack:

    +
    ┌─────────────────────────────────────────────────┐
    +│         Applications (Flux, WE, custom)         │  ← User interfaces
    +├─────────────────────────────────────────────────┤
    +│              AD4M Spanning Layer                │  ← What we're building
    +│  (Perspectives, SDNA, Neighbourhoods, DIDs)     │
    +├─────────────────────────────────────────────────┤
    +│   Protocol Layer (HTTP, IPFS, Holochain, etc)  │  ← Languages wrap these
    +├─────────────────────────────────────────────────┤
    +│             Transport (TCP/IP, QUIC)            │
    +└─────────────────────────────────────────────────┘
    +

    How It Works

    +

    1. Agent-Centric Architecture

    +

    Unlike app-centric systems where apps own data, AD4M is agent-centric:

    +
      +
    • Each user runs their own executor (local runtime)
    • +
    • The executor holds the user's DID (decentralized identity) and keys
    • +
    • Perspectives (knowledge graphs) store the user's data locally
    • +
    • Apps connect to the executor via GraphQL or MCP
    • +
    +

    Result: Your data lives in your executor, accessible to any app you authorize. No single app owns your social graph or content.

    +

    2. Languages (Protocol Abstraction)

    +

    Languages are the bridge between AD4M and existing systems:

    +
      +
    • A Language wraps any storage/communication protocol
    • +
    • Each Language defines how to create/retrieve Expressions (data objects)
    • +
    • Expressions get universal addresses: <language_hash>://<address>
    • +
    +

    Examples:

    +
      +
    • http Language → http://example.com/data.json
    • +
    • ipfs Language → ipfs://Qm...
    • +
    • holochain Language → uhC0k.../entry_hash
    • +
    • Custom Language → Qm123.../my-id
    • +
    +

    Result: AD4M can reference data from any system using a consistent address scheme.

    +

    3. Perspectives (Subjective Knowledge Graphs)

    +

    Perspectives are RDF-like graphs built from links (triples):

    +
    <source> <predicate> <target>
    +

    Example perspective:

    +
    <did:key:z6Mk...>  <ad4m://posted>      <ipfs://Qm789>
    +<ipfs://Qm789>     <ad4m://has_title>   "Hello World"
    +<ipfs://Qm789>     <ad4m://has_author>  <did:key:z6Mk...>
    +

    Your perspective can mix data from any Language:

    +
      +
    • HTTP URLs alongside IPFS hashes
    • +
    • Holochain entries linked to local files
    • +
    • Semantic triples connecting it all
    • +
    +

    Result: True data portability — your knowledge graph transcends individual platforms.

    +

    4. Subject Classes (SDNA)

    +

    SHACL-based schemas that give structure to the link graph:

    +
    :MessageShape a sh:NodeShape ;
    +  sh:targetClass :Message ;
    +  sh:property [
    +    sh:path :body ;
    +    sh:datatype xsd:string ;
    +    sh:maxCount 1 ;
    +    sh:minCount 1 ;
    +  ] ;
    +  sh:property [
    +    sh:path :author ;
    +    sh:class :Agent ;
    +    sh:maxCount 1 ;
    +  ] .
    +

    SDNA provides:

    +
      +
    • Validation rules enforced across the network
    • +
    • Typed properties (string, integer, Agent, etc.)
    • +
    • Collections (one-to-many relationships)
    • +
    • Actions (state transitions via SHACL Flow)
    • +
    +

    Result: Structured data on top of the flexible link graph — ORM-like ergonomics with RDF's flexibility.

    +

    5. Neighbourhoods (Shared Perspectives)

    +

    Perspectives can be published as Neighbourhoods — shared spaces synced P2P:

    +
      +
    • Built on Holochain DHT (distributed hash table)
    • +
    • SDNA enforced by all members (validation rules)
    • +
    • Real-time synchronization via gossip protocol
    • +
    • Each member has a local replica
    • +
    +

    Result: Truly P2P collaboration — no servers, no single point of failure, agent-centric validation.

    +

    Spanning Layer in Action

    +

    Scenario: Cross-Platform Social Graph

    +
      +
    1. Alice runs AD4M on her laptop
    2. +
    3. Her perspective contains links to: +
        +
      • Twitter posts (via HTTP Language)
      • +
      • Photos on IPFS (via IPFS Language)
      • +
      • Messages in a Holochain neighbourhood
      • +
      • Local notes (via File Language)
      • +
      +
    4. +
    5. She publishes a Channel neighbourhood with Message SDNA
    6. +
    7. Bob (human) and DataBot (AI agent) join the neighbourhood
    8. +
    9. All three can post messages, validated by the shared SDNA
    10. +
    11. Each member's executor syncs changes P2P via Holochain
    12. +
    +

    Without AD4M: Alice's data is trapped in silos. She needs separate accounts, separate APIs, no interoperability.

    +

    With AD4M: Alice's data lives in her perspective, portable across protocols. Her social graph spans HTTP, IPFS, and Holochain seamlessly.

    +

    Why This Matters for AI Agents

    +

    AD4M's spanning layer is particularly powerful for AI agents because:

    +
      +
    1. Semantic understanding — RDF-like links provide explicit relationships
    2. +
    3. Protocol agnostic — agents don't need to learn every API, just AD4M
    4. +
    5. Structured data — SDNA defines clear schemas (no guessing)
    6. +
    7. Distributed intelligence — agents can join neighbourhoods and collaborate P2P
    8. +
    9. Cryptographic provenance — every action is signed, auditable
    10. +
    +

    Using MCP, AI agents can:

    +
      +
    • Discover data models via get_models
    • +
    • Create structured data via auto-generated tools
    • +
    • Join neighbourhoods and collaborate with humans
    • +
    • Subscribe to changes and react in real-time
    • +
    +

    Further Reading

    + +
    +

    The vision: A spanning layer where data is portable, agents are sovereign, and collective intelligence emerges from the synergy of humans and AI collaborating across any protocol. AD4M is the infrastructure for that future.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/1-perspective.html b/docs/tutorial/1-perspective.html new file mode 100644 index 000000000..b4ca043be --- /dev/null +++ b/docs/tutorial/1-perspective.html @@ -0,0 +1,87 @@ +Tutorial | AD4M Docs
    Tutorial
    Dealing with Perspectives

    Tutorial

    +

    This will get you to a shared Neighbourhood on Holochain in less than 20 +minutes! The code assumes an ad4m variable was setup as described in +Getting Started.

    +

    Create a Perspective and add content

    +

    Adding a new perspective is as easy as

    +
    const myPerspective = await ad4m.perspective.add("My new perspective");
    +

    The returned object is of type PerspectiveProxy, +which hides all the remote calls to the AD4M executor and can be treated like a +local database object.

    +

    Perspectives are basically local graph databases. +We can query all links on that proxy object with get:

    +
    const allLinks = await myPerspective.get(new LinkQuery({})); // => []
    +

    In this case it should return an empty array since we just created that perspective.

    +

    So let's add something! +With the following code I'm creating an adhoc semantic statement +representing what I think about AD4M...

    +
    import { Literal } from "@coasys/ad4m";
    + 
    +const me = await ad4m.agent.me();
    +const source = me.did;
    +const predicate = Literal.from("thinks").toUrl();
    +const target = Literal.from("AD4M will be the last social network").toUrl();
    + 
    +const linkExpresion = await myPerspective.add({ source, predicate, target });
    +

    Links consist of 3 URIs pointing to Expressions of Languages. +For this example, we made life easy by using the agent's DID and AD4M's Literal Language.

    +

    Agent DID

    +

    For the source of our link, we got the user's DID URI by first getting +the users Agent object with ad4m.agent.me(). +That has a DID property and DID URIs are considered valid URIs in AD4M +(they can be looked-up using the Agent bootstrap language which resolves +to the same Agent object we got through ad4m.agent.me() - just even if +that agent behind the resolved DID isn't me).

    +

    Literal

    +

    The Literal Language is an AD4M Language without back-end. +It stores JavaScript literals (i.e. strings, numbers and objects) +by encoding them into the Expression URL. +So,

    +
    Literal.from("thinks").toUrl();
    +

    returns literal://string:thinks - which is a valid URI - +and

    +
    Literal.from("AD4M will be the last social network").toUrl();
    +

    returns literal://string:AD4M%20will%20be%20the%20last%20social%20network. +This is basically like URL parameters and let's us get around introducing Languages +before using Perspectives and Links.

    +

    We can decode the URL into a JavaScript literal like so:

    +
    const string = Literal.fromUrl("literal://string:thinks").get();
    +// string == 'thinks'
    +

    LinkExpression

    +

    We have put in a Link object into myPerspective.add() +({source, predicate, target}), +but what this function returns is a LinkExpression.

    +

    Even though this Perspective is not shared (yet) but just our private, local +graph database, we might want to share it later +as Neighbourhood. +Then, all links added by some agent to their local Perspective will be shared +with the other agents using a LinkLanguage - a Language which defines Expressions +representing Links. That is LinkExpressions.

    +

    Using the generic Expression template, +LinkExpressions wrap Links with author, timestamp and signature:

    +
    {
    +    author: "did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    +    timestamp: "Sun Oct 23 2022 15:31:52 GMT+0200 (Central European Summer Time)",
    +    data: {
    +        source: "did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    +        predicate: "literal://string:thinks",
    +        target: "literal://string:AD4M%20will%20be%20the%20last%20social%20network",
    +    },
    +    proof: {
    +        key: "#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    +        signature: "xxxx",
    +    }
    +}

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/1-perspective/index.html b/docs/tutorial/1-perspective/index.html deleted file mode 100644 index f209d1175..000000000 --- a/docs/tutorial/1-perspective/index.html +++ /dev/null @@ -1,87 +0,0 @@ -Tutorial | AD4M Docs
    Tutorial
    Dealing with Perspectives

    Tutorial

    -

    This will get you to a shared Neighbourhood on Holochain in less than 20 -minutes! The code assumes an ad4m variable was setup as described in -Getting Started.

    -

    Create a Perspective and add content

    -

    Adding a new perspective is as easy as

    -
    const myPerspective = await ad4m.perspective.add("My new perspective");
    -

    The returned object is of type PerspectiveProxy, -which hides all the remote calls to the AD4M executor and can be treated like a -local database object.

    -

    Perspectives are basically local graph databases. -We can query all links on that proxy object with get:

    -
    const allLinks = await myPerspective.get(new LinkQuery({})); // => []
    -

    In this case it should return an empty array since we just created that perspective.

    -

    So let's add something! -With the following code I'm creating an adhoc semantic statement -representing what I think about AD4M...

    -
    import { Literal } from "@coasys/ad4m";
    - 
    -const me = await ad4m.agent.me();
    -const source = me.did;
    -const predicate = Literal.from("thinks").toUrl();
    -const target = Literal.from("AD4M will be the last social network").toUrl();
    - 
    -const linkExpresion = await myPerspective.add({ source, predicate, target });
    -

    Links consist of 3 URIs pointing to Expressions of Languages. -For this example, we made life easy by using the agent's DID and AD4M's Literal Language.

    -

    Agent DID

    -

    For the source of our link, we got the user's DID URI by first getting -the users Agent object with ad4m.agent.me(). -That has a DID property and DID URIs are considered valid URIs in AD4M -(they can be looked-up using the Agent bootstrap language which resolves -to the same Agent object we got through ad4m.agent.me() - just even if -that agent behind the resolved DID isn't me).

    -

    Literal

    -

    The Literal Language is an AD4M Language without back-end. -It stores JavaScript literals (i.e. strings, numbers and objects) -by encoding them into the Expression URL. -So,

    -
    Literal.from("thinks").toUrl();
    -

    returns literal://string:thinks - which is a valid URI - -and

    -
    Literal.from("AD4M will be the last social network").toUrl();
    -

    returns literal://string:AD4M%20will%20be%20the%20last%20social%20network. -This is basically like URL parameters and let's us get around introducing Languages -before using Perspectives and Links.

    -

    We can decode the URL into a JavaScript literal like so:

    -
    const string = Literal.fromUrl("literal://string:thinks").get();
    -// string == 'thinks'
    -

    LinkExpression

    -

    We have put in a Link object into myPerspective.add() -({source, predicate, target}), -but what this function returns is a LinkExpression.

    -

    Even though this Perspective is not shared (yet) but just our private, local -graph database, we might want to share it later -as Neighbourhood. -Then, all links added by some agent to their local Perspective will be shared -with the other agents using a LinkLanguage - a Language which defines Expressions -representing Links. That is LinkExpressions.

    -

    Using the generic Expression template, -LinkExpressions wrap Links with author, timestamp and signature:

    -
    {
    -    author: "did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    -    timestamp: "Sun Oct 23 2022 15:31:52 GMT+0200 (Central European Summer Time)",
    -    data: {
    -        source: "did:key:zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    -        predicate: "literal://string:thinks",
    -        target: "literal://string:AD4M%20will%20be%20the%20last%20social%20network",
    -    },
    -    proof: {
    -        key: "#zQ3shNWd4bg67ktTVg9EMnnrsRjhkH6cRNCjRRxfTaTqBniAf",
    -        signature: "xxxx",
    -    }
    -}

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/2-neighbourhood-publish.html b/docs/tutorial/2-neighbourhood-publish.html new file mode 100644 index 000000000..c0117e3d4 --- /dev/null +++ b/docs/tutorial/2-neighbourhood-publish.html @@ -0,0 +1,76 @@ +Publish Perspective as Neighbourhood | AD4M Docs
    Tutorial
    Publishing a Neighbourhood

    Publish Perspective as Neighbourhood

    +

    The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing +and thus synchronizing of links (see LinksAdapter). +While there can and will be many different implementations +with different trade-offs and features (like membranes etc.), +there currently is one fully implemented and Holochain based LinkLanguage with the name Perspective Diff Sync (opens in a new tab).

    +

    It is deployed on the current test network (Language Language v0.0.15, included in current network seed (opens in a new tab)) under the address: +QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8.

    +

    Creating our unique LinkLanguage clone through templating

    +

    But we should not just use this publicly known Language as the back-bone for our new Neighbourhood, +if we don't want to have everybody following this guide end up in the same network.

    +

    So what we want is to use this existing Language as a template and create a new copy with the same code +but different UUID and/name in order to create a fresh space for our new Neighbourhood.

    +

    What parameters can we adjust when using it as template? +Let's have a look at the Language's meta information:

    +
    const socialContextMeta = await ad4m.languages.meta(
    +  "QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8"
    +);
    +console.log(socialContextMeta);
    +

    Which should yield something like this:

    +
     {
    +  name: 'Perspective Diff Sync',
    +  address: 'QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8',
    +  description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',
    +  author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',
    +  templated: false,
    +  templateSourceLanguageAddress: null,
    +  templateAppliedParams: null,
    +  possibleTemplateParams: [ 'uuid', 'name', 'description' ],
    +  sourceCodeLink: 'https://github.com/perspect3vism/perspective-diff-sync'
    +}
    +

    The field possibleTemplateParams tells us that we can set a UUID and override name and description. +Let's leave description but change the name. +The function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:

    +
    const uniqueLinkLanguage = await ad4m.languages.applyTemplateAndPublish(
    +  "QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8",
    +  JSON.stringify({
    +    uuid: "84a329-77384c-1510fb",
    +    name: "Perspective Diff Sync clone for demo Neighbourhood",
    +  })
    +);
    +

    This function call has done a lot for us:

    +
      +
    1. It took the source language (first parameter) and made sure we got the code, +i.e. potentially downloading it from the Language of Languages.
    2. +
    3. The provided template parameters have been applied. In the case of a Language using Holochain, it has unpacked the Holochain DNA, changed the DNA variables according to the values given as template parameters and packed the DNA again (not touching the WASM code)
    4. +
    5. The resulting Language was published with meta information showing that it was templated, providing the source hash and template parameters.
    6. +
    +

    So the new templated Language is ready to be used.

    +

    Creating the Neighbourhood

    +

    With that new LinkLanguage, actually creating the Neighbourhood is simple. +We just have to provide the id of the perspective we want to upgrade to a +Neighbourhood and the address of the LinkLanguage used for that:

    +
    const meta = new Perspective();
    +const neighbourhoodUrl = await ad4m.neighbourhood.publishFromPerspective(
    +  myPerspective.uuid,
    +  uniqueLinkLanguage.address,
    +  meta
    +);
    +console.log(neighbourhoodUrl); // => neighbourhood://Qm123456789abcdef
    +

    The meta field a (static/snapshotted) Perspective that is immutably stored with +the Neighbourhood. It can hold arbitrary/semantic meta information about the +Neighbourhood but can technically stay empty, just like we did here.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/2-neighbourhood-publish/index.html b/docs/tutorial/2-neighbourhood-publish/index.html deleted file mode 100644 index 324f81d16..000000000 --- a/docs/tutorial/2-neighbourhood-publish/index.html +++ /dev/null @@ -1,76 +0,0 @@ -Publish Perspective as Neighbourhood | AD4M Docs
    Tutorial
    Publishing a Neighbourhood

    Publish Perspective as Neighbourhood

    -

    The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing -and thus synchronizing of links (see LinksAdapter). -While there can and will be many different implementations -with different trade-offs and features (like membranes etc.), -there currently is one fully implemented and Holochain based LinkLanguage with the name Perspective Diff Sync (opens in a new tab).

    -

    It is deployed on the current test network (Language Language v0.0.15, included in current network seed (opens in a new tab)) under the address: -QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8.

    -

    Creating our unique LinkLanguage clone through templating

    -

    But we should not just use this publicly known Language as the back-bone for our new Neighbourhood, -if we don't want to have everybody following this guide end up in the same network.

    -

    So what we want is to use this existing Language as a template and create a new copy with the same code -but different UUID and/name in order to create a fresh space for our new Neighbourhood.

    -

    What parameters can we adjust when using it as template? -Let's have a look at the Language's meta information:

    -
    const socialContextMeta = await ad4m.languages.meta(
    -  "QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8"
    -);
    -console.log(socialContextMeta);
    -

    Which should yield something like this:

    -
     {
    -  name: 'Perspective Diff Sync',
    -  address: 'QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8',
    -  description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',
    -  author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',
    -  templated: false,
    -  templateSourceLanguageAddress: null,
    -  templateAppliedParams: null,
    -  possibleTemplateParams: [ 'uuid', 'name', 'description' ],
    -  sourceCodeLink: 'https://github.com/perspect3vism/perspective-diff-sync'
    -}
    -

    The field possibleTemplateParams tells us that we can set a UUID and override name and description. -Let's leave description but change the name. -The function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:

    -
    const uniqueLinkLanguage = await ad4m.languages.applyTemplateAndPublish(
    -  "QmeBD9n9Z5yZsegxArToww5zmwtPpojXN6zXJsi7WwMUa8",
    -  JSON.stringify({
    -    uuid: "84a329-77384c-1510fb",
    -    name: "Perspective Diff Sync clone for demo Neighbourhood",
    -  })
    -);
    -

    This function call has done a lot for us:

    -
      -
    1. It took the source language (first parameter) and made sure we got the code, -i.e. potentially downloading it from the Language of Languages.
    2. -
    3. The provided template parameters have been applied. In the case of a Language using Holochain, it has unpacked the Holochain DNA, changed the DNA variables according to the values given as template parameters and packed the DNA again (not touching the WASM code)
    4. -
    5. The resulting Language was published with meta information showing that it was templated, providing the source hash and template parameters.
    6. -
    -

    So the new templated Language is ready to be used.

    -

    Creating the Neighbourhood

    -

    With that new LinkLanguage, actually creating the Neighbourhood is simple. -We just have to provide the id of the perspective we want to upgrade to a -Neighbourhood and the address of the LinkLanguage used for that:

    -
    const meta = new Perspective();
    -const neighbourhoodUrl = await ad4m.neighbourhood.publishFromPerspective(
    -  myPerspective.uuid,
    -  uniqueLinkLanguage.address,
    -  meta
    -);
    -console.log(neighbourhoodUrl); // => neighbourhood://Qm123456789abcdef
    -

    The meta field a (static/snapshotted) Perspective that is immutably stored with -the Neighbourhood. It can hold arbitrary/semantic meta information about the -Neighbourhood but can technically stay empty, just like we did here.


    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/3-neighbourhood-join.html b/docs/tutorial/3-neighbourhood-join.html new file mode 100644 index 000000000..d5a5c26f5 --- /dev/null +++ b/docs/tutorial/3-neighbourhood-join.html @@ -0,0 +1,32 @@ +Joining a Neighbourhood (on another node/agent) | AD4M Docs
    Tutorial
    Joining a Neighbourhood

    Joining a Neighbourhood (on another node/agent)

    +

    Assume everything above happened on Alice's agent. +Alice now shares the Neighbourhood's URL with Bob. +This is what Bob does to join the Neigbourhood, access it as a (local) Perspective +and retrieve the Expression Alice created and linked there:

    +
    const joinedNeighbourhood = await ad4m.neighbourhood.joinFromUrl(
    +  neighbourhoodUrl
    +);
    +const myPerspective = await ad4m.perspective.byUUID(joinedNeighbourhood.uuid);
    +const links = await myPerspective.get(
    +  new LinkQuery({
    +    predicate: Literal.from("thinks").toUrl(),
    +  })
    +);
    +links.forEach(async (link) => {
    +  const who = link.data.source;
    +  const what = Literal.fromUrl(link.data.target).get();
    +  console.log(who, " thinks that ", what);
    +});

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/3-neighbourhood-join/index.html b/docs/tutorial/3-neighbourhood-join/index.html deleted file mode 100644 index 2d75c66e6..000000000 --- a/docs/tutorial/3-neighbourhood-join/index.html +++ /dev/null @@ -1,32 +0,0 @@ -Joining a Neighbourhood (on another node/agent) | AD4M Docs
    Tutorial
    Joining a Neighbourhood

    Joining a Neighbourhood (on another node/agent)

    -

    Assume everything above happened on Alice's agent. -Alice now shares the Neighbourhood's URL with Bob. -This is what Bob does to join the Neigbourhood, access it as a (local) Perspective -and retrieve the Expression Alice created and linked there:

    -
    const joinedNeighbourhood = await ad4m.neighbourhood.joinFromUrl(
    -  neighbourhoodUrl
    -);
    -const myPerspective = await ad4m.perspective.byUUID(joinedNeighbourhood.uuid);
    -const links = await myPerspective.get(
    -  new LinkQuery({
    -    predicate: Literal.from("thinks").toUrl(),
    -  })
    -);
    -links.forEach(async (link) => {
    -  const who = link.data.source;
    -  const what = Literal.fromUrl(link.data.target).get();
    -  console.log(who, " thinks that ", what);
    -});

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/4-change-listener.html b/docs/tutorial/4-change-listener.html new file mode 100644 index 000000000..f79d82e55 --- /dev/null +++ b/docs/tutorial/4-change-listener.html @@ -0,0 +1,31 @@ +Listening to Perspective changes | AD4M Docs
    Tutorial
    Listening to Perspective changes

    Listening to Perspective changes

    +

    Perspectives that have been turned into Neighbourhoods are like entangled particles. +Every agent still has their local copy of the Perspective, but a change from any agent +will be shared with all other agents immediately, +resulting in AD4M automatically updating the local Perspective with the changes by +the others.

    +

    Even with Perspectives that are not shared as Neighbourhood, +a different UI could have access to the same Perspective and cause mutations +on it.

    +

    Apps/UIs can simply register a listener function on that +PerspectiveProxy object:

    +
    myPerspective.addListener("link-added", (addedLink: LinkExpression) => {
    +  console.log("Got a new link:", addedLink);
    +});
    + 
    +myPerspective.addListener("link-removed", (removedLink: LinkExpression) => {
    +  console.log("A link was removed:", removedLink);
    +});

    AD4M - The first social network
    \ No newline at end of file diff --git a/docs/tutorial/4-change-listener/index.html b/docs/tutorial/4-change-listener/index.html deleted file mode 100644 index 76917f9d8..000000000 --- a/docs/tutorial/4-change-listener/index.html +++ /dev/null @@ -1,31 +0,0 @@ -Listening to Perspective changes | AD4M Docs
    Tutorial
    Listening to Perspective changes

    Listening to Perspective changes

    -

    Perspectives that have been turned into Neighbourhoods are like entangled particles. -Every agent still has their local copy of the Perspective, but a change from any agent -will be shared with all other agents immediately, -resulting in AD4M automatically updating the local Perspective with the changes by -the others.

    -

    Even with Perspectives that are not shared as Neighbourhood, -a different UI could have access to the same Perspective and cause mutations -on it.

    -

    Apps/UIs can simply register a listener function on that -PerspectiveProxy object:

    -
    myPerspective.addListener("link-added", (addedLink: LinkExpression) => {
    -  console.log("Got a new link:", addedLink);
    -});
    - 
    -myPerspective.addListener("link-removed", (removedLink: LinkExpression) => {
    -  console.log("A link was removed:", removedLink);
    -});

    AD4M - The first social network
    \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68cdb2ec5..f505a83ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -775,11 +775,11 @@ importers: specifier: ^13.0.6 version: 13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0) nextra: - specifier: latest - version: 4.6.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@4.9.5) + specifier: ^2.13.4 + version: 2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) nextra-theme-docs: - specifier: latest - version: 4.6.1(@types/react@18.2.55)(immer@9.0.21)(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(nextra@4.6.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@4.9.5))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(use-sync-external-store@1.6.0(react@18.2.0)) + specifier: ^2.13.4 + version: 2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(nextra@2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -1098,9 +1098,6 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@antfu/install-pkg@1.1.0': - resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==} - '@apideck/better-ajv-errors@0.3.6': resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2003,8 +2000,8 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@braintree/sanitize-url@7.1.2': - resolution: {integrity: sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==} + '@braintree/sanitize-url@6.0.4': + resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} '@changesets/apply-release-plan@7.0.0': resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} @@ -2058,21 +2055,6 @@ packages: '@changesets/write@0.3.0': resolution: {integrity: sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==} - '@chevrotain/cst-dts-gen@11.1.1': - resolution: {integrity: sha512-fRHyv6/f542qQqiRGalrfJl/evD39mAvbJLCekPazhiextEatq1Jx1K/i9gSd5NNO0ds03ek0Cbo/4uVKmOBcw==} - - '@chevrotain/gast@11.1.1': - resolution: {integrity: sha512-Ko/5vPEYy1vn5CbCjjvnSO4U7GgxyGm+dfUZZJIWTlQFkXkyym0jFYrWEU10hyCjrA7rQtiHtBr0EaZqvHFZvg==} - - '@chevrotain/regexp-to-ast@11.1.1': - resolution: {integrity: sha512-ctRw1OKSXkOrR8VTvOxrQ5USEc4sNrfwXHa1NuTcR7wre4YbjPcKw+82C2uylg/TEwFRgwLmbhlln4qkmDyteg==} - - '@chevrotain/types@11.1.1': - resolution: {integrity: sha512-wb2ToxG8LkgPYnKe9FH8oGn3TMCBdnwiuNC5l5y+CtlaVRbCytU0kbVsk6CGrqTL4ZN4ksJa0TXOYbxpbthtqw==} - - '@chevrotain/utils@11.1.1': - resolution: {integrity: sha512-71eTYMzYXYSFPrbg/ZwftSaSDld7UYlS8OQa3lNnn9jzNtpFbaReRRyghzqS7rI3CDaorqpPJJcXGHK+FE1TVQ==} - '@coasys/ad4m-connect@0.8.1': resolution: {integrity: sha512-pbyeescsVOVAnXjn2Uh4BV0oWbuiseHT0HvGmDISdaJztaFv1MNglka2oOFf9xYmwz7PBExYNprnE5g75YVyNQ==} @@ -2667,30 +2649,6 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@floating-ui/core@1.7.4': - resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==} - - '@floating-ui/dom@1.7.5': - resolution: {integrity: sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==} - - '@floating-ui/react-dom@2.1.7': - resolution: {integrity: sha512-0tLRojf/1Go2JgEVm+3Frg9A3IW8bJgKgdO0BN5RkF//ufuz2joZM63Npau2ff3J6lUVYgDSNzNkR+aH3IVfjg==} - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' - - '@floating-ui/react@0.26.28': - resolution: {integrity: sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw==} - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' - - '@floating-ui/utils@0.2.10': - resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==} - - '@formatjs/intl-localematcher@0.6.2': - resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==} - '@graphql-tools/merge@8.4.2': resolution: {integrity: sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==} peerDependencies: @@ -2711,12 +2669,12 @@ packages: peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - '@headlessui/react@2.2.9': - resolution: {integrity: sha512-Mb+Un58gwBn0/yWZfyrCh0TJyurtT+dETj7YHleylHk5od3dv2XqETPGWMyQ5/7sYN7oWdyM1u9MvC0OC8UmzQ==} + '@headlessui/react@1.7.19': + resolution: {integrity: sha512-Ll+8q3OlMJfJbAKM/+/Y2q6PPYbryqNTXDbryx7SXLIDamkF6iQFbriYHga0dY44PvDhvvBWCx1Xj4U5+G4hOw==} engines: {node: '>=10'} peerDependencies: - react: ^18 || ^19 || ^19.0.0-rc - react-dom: ^18 || ^19 || ^19.0.0-rc + react: ^16 || ^17 || ^18 + react-dom: ^16 || ^17 || ^18 '@holochain/client@0.16.0': resolution: {integrity: sha512-GJEl6F3OSlDX71H+rtyUXpEuor7O9MhvNIi+Tq6obrysu71JsbXfR1rtmSBiNb9fttHOZLW60EzY/Lj3I9dv8g==} @@ -2765,12 +2723,6 @@ packages: '@iarna/toml@2.2.5': resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} - '@iconify/types@2.0.0': - resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} - - '@iconify/utils@3.1.0': - resolution: {integrity: sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==} - '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -2778,10 +2730,6 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@isaacs/cliui@9.0.0': - resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==} - engines: {node: '>=18'} - '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -2987,11 +2935,13 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - '@mdx-js/mdx@3.1.1': - resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==} + '@mdx-js/mdx@2.3.0': + resolution: {integrity: sha512-jLuwRlz8DQfQNiUCJR50Y09CGPq3fLtmtUQfVrj79E0JWu3dvsVcxVIcfhR5h0iXu+/z++zDrYeiJqifRynJkA==} - '@mermaid-js/parser@1.0.0': - resolution: {integrity: sha512-vvK0Hi/VWndxoh03Mmz6wa1KDriSPjS2XMZL/1l19HFwygiObEEoEwSDxOqyLzzAI6J2PU3261JjTMTO7x+BPw==} + '@mdx-js/react@2.3.0': + resolution: {integrity: sha512-zQH//gdOmuu7nt2oJR29vFhDv88oGPmVw6BggmrHeMI+xgEkp1B2dX9/bMBSYtK0dyLX/aOmesKS09g222K1/g==} + peerDependencies: + react: '>=16' '@metamask/safe-event-emitter@2.0.0': resolution: {integrity: sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q==} @@ -3413,43 +3363,6 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@react-aria/focus@3.21.4': - resolution: {integrity: sha512-6gz+j9ip0/vFRTKJMl3R30MHopn4i19HqqLfSQfElxJD+r9hBnYG1Q6Wd/kl/WRR1+CALn2F+rn06jUnf5sT8Q==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - - '@react-aria/interactions@3.27.0': - resolution: {integrity: sha512-D27pOy+0jIfHK60BB26AgqjjRFOYdvVSkwC31b2LicIzRCSPOSP06V4gMHuGmkhNTF4+YWDi1HHYjxIvMeiSlA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - - '@react-aria/ssr@3.9.10': - resolution: {integrity: sha512-hvTm77Pf+pMBhuBm760Li0BVIO38jv1IBws1xFm1NoL26PU+fe+FMW5+VZWyANR6nYL65joaJKZqOdTQMkO9IQ==} - engines: {node: '>= 12'} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - - '@react-aria/utils@3.33.0': - resolution: {integrity: sha512-yvz7CMH8d2VjwbSa5nGXqjU031tYhD8ddax95VzJsHSPyqHDEGfxul8RkhGV6oO7bVqZxVs6xY66NIgae+FHjw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - - '@react-stately/flags@3.1.2': - resolution: {integrity: sha512-2HjFcZx1MyQXoPqcBGALwWWmgFVUk2TuKVIQxCbRq7fPyWXIl6VHcakCLurdtYC2Iks7zizvz0Idv48MQ38DWg==} - - '@react-stately/utils@3.11.0': - resolution: {integrity: sha512-8LZpYowJ9eZmmYLpudbo/eclIRnbhWIJZ994ncmlKlouNzKohtM8qTC6B1w1pwUbiwGdUoyzLuQbeaIor5Dvcw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - - '@react-types/shared@3.33.0': - resolution: {integrity: sha512-xuUpP6MyuPmJtzNOqF5pzFUIHH2YogyOQfUQHag54PRmWB7AbjuGWBUv0l1UDmz6+AbzAYGmDVAzcRDOu2PFpw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - '@remix-run/router@1.14.2': resolution: {integrity: sha512-ACXpdMM9hmKZww21yEqWwiLws/UPLhNKvimN8RrYSqPSvB3ov7sLvAcfvaxePeLvccTQKGdkDIhLYApZVDFuKg==} engines: {node: '>=14.0.0'} @@ -3739,32 +3652,6 @@ packages: '@scure/bip39@1.2.1': resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} - '@shikijs/core@3.22.0': - resolution: {integrity: sha512-iAlTtSDDbJiRpvgL5ugKEATDtHdUVkqgHDm/gbD2ZS9c88mx7G1zSYjjOxp5Qa0eaW0MAQosFRmJSk354PRoQA==} - - '@shikijs/engine-javascript@3.22.0': - resolution: {integrity: sha512-jdKhfgW9CRtj3Tor0L7+yPwdG3CgP7W+ZEqSsojrMzCjD1e0IxIbwUMDDpYlVBlC08TACg4puwFGkZfLS+56Tw==} - - '@shikijs/engine-oniguruma@3.22.0': - resolution: {integrity: sha512-DyXsOG0vGtNtl7ygvabHd7Mt5EY8gCNqR9Y7Lpbbd/PbJvgWrqaKzH1JW6H6qFkuUa8aCxoiYVv8/YfFljiQxA==} - - '@shikijs/langs@3.22.0': - resolution: {integrity: sha512-x/42TfhWmp6H00T6uwVrdTJGKgNdFbrEdhaDwSR5fd5zhQ1Q46bHq9EO61SCEWJR0HY7z2HNDMaBZp8JRmKiIA==} - - '@shikijs/themes@3.22.0': - resolution: {integrity: sha512-o+tlOKqsr6FE4+mYJG08tfCFDS+3CG20HbldXeVoyP+cYSUxDhrFf3GPjE60U55iOkkjbpY2uC3It/eeja35/g==} - - '@shikijs/twoslash@3.22.0': - resolution: {integrity: sha512-GO27UPN+kegOMQvC+4XcLt0Mttyg+n16XKjmoKjdaNZoW+sOJV7FLdv2QKauqUDws6nE3EQPD+TFHEdyyoUBDw==} - peerDependencies: - typescript: '>=5.5.0' - - '@shikijs/types@3.22.0': - resolution: {integrity: sha512-491iAekgKDBFE67z70Ok5a8KBMsQ2IJwOWw3us/7ffQkIBCyOQfm/aNwVMBUriP02QshIfgHCBSIYAl3u2eWjg==} - - '@shikijs/vscode-textmate@10.0.2': - resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sinclair/typebox@0.24.51': resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} @@ -4112,13 +3999,13 @@ packages: '@textlint/markdown-to-ast@12.6.1': resolution: {integrity: sha512-T0HO+VrU9VbLRiEx/kH4+gwGMHNMIGkp0Pok+p0I33saOOLyhfGvwOKQgvt2qkxzQEV2L5MtGB8EnW4r5d3CqQ==} - '@theguild/remark-mermaid@0.3.0': - resolution: {integrity: sha512-Fy1J4FSj8totuHsHFpaeWyWRaRSIvpzGTRoEfnNJc1JmLV9uV70sYE3zcT+Jj5Yw20Xq4iCsiT+3Ho49BBZcBQ==} + '@theguild/remark-mermaid@0.0.5': + resolution: {integrity: sha512-e+ZIyJkEv9jabI4m7q29wZtZv+2iwPGsXJ2d46Zi7e+QcFudiyuqhLhHG/3gX3ZEB+hxTch+fpItyMS8jwbIcw==} peerDependencies: - react: ^18.2.0 || ^19.0.0 + react: ^18.2.0 - '@theguild/remark-npm2yarn@0.3.3': - resolution: {integrity: sha512-ma6DvR03gdbvwqfKx1omqhg9May/VYGdMHvTzB4VuxkyS7KzfZ/lzrj43hmcsggpMje0x7SADA/pcMph0ejRnA==} + '@theguild/remark-npm2yarn@0.2.1': + resolution: {integrity: sha512-jUTFWwDxtLEFtGZh/TW/w30ySaDJ8atKWH8dq2/IiQF61dPrGfETpl0WxD0VdBfuLOeU14/kop466oBSRO/5CA==} '@tootallnate/once@1.1.2': resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} @@ -4128,9 +4015,6 @@ packages: resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} engines: {node: '>=10.13.0'} - '@ts-morph/common@0.28.1': - resolution: {integrity: sha512-W74iWf7ILp1ZKNYXY5qbddNaml7e9Sedv5lvU1V8lftlitkc9Pq1A+jlH23ltDgWYeZFFEqGCD1Ies9hqu3O+g==} - '@tsconfig/node10@1.0.9': resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} @@ -4149,6 +4033,9 @@ packages: '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/acorn@4.0.6': + resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} + '@types/aria-query@5.0.4': resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} @@ -4185,99 +4072,15 @@ packages: '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} - '@types/d3-array@3.2.2': - resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==} - - '@types/d3-axis@3.0.6': - resolution: {integrity: sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==} - - '@types/d3-brush@3.0.6': - resolution: {integrity: sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==} - - '@types/d3-chord@3.0.6': - resolution: {integrity: sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==} - - '@types/d3-color@3.1.3': - resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==} - - '@types/d3-contour@3.0.6': - resolution: {integrity: sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==} - - '@types/d3-delaunay@6.0.4': - resolution: {integrity: sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==} - - '@types/d3-dispatch@3.0.7': - resolution: {integrity: sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==} - - '@types/d3-drag@3.0.7': - resolution: {integrity: sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==} - - '@types/d3-dsv@3.0.7': - resolution: {integrity: sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==} - - '@types/d3-ease@3.0.2': - resolution: {integrity: sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==} - - '@types/d3-fetch@3.0.7': - resolution: {integrity: sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==} - - '@types/d3-force@3.0.10': - resolution: {integrity: sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==} - - '@types/d3-format@3.0.4': - resolution: {integrity: sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==} - - '@types/d3-geo@3.1.0': - resolution: {integrity: sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==} - - '@types/d3-hierarchy@3.1.7': - resolution: {integrity: sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==} - - '@types/d3-interpolate@3.0.4': - resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==} - - '@types/d3-path@3.1.1': - resolution: {integrity: sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==} - - '@types/d3-polygon@3.0.2': - resolution: {integrity: sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==} - - '@types/d3-quadtree@3.0.6': - resolution: {integrity: sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==} - - '@types/d3-random@3.0.3': - resolution: {integrity: sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==} - '@types/d3-scale-chromatic@3.1.0': resolution: {integrity: sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==} '@types/d3-scale@4.0.9': resolution: {integrity: sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==} - '@types/d3-selection@3.0.11': - resolution: {integrity: sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==} - - '@types/d3-shape@3.1.8': - resolution: {integrity: sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==} - - '@types/d3-time-format@4.0.3': - resolution: {integrity: sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==} - '@types/d3-time@3.0.4': resolution: {integrity: sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==} - '@types/d3-timer@3.0.2': - resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} - - '@types/d3-transition@3.0.9': - resolution: {integrity: sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==} - - '@types/d3-zoom@3.0.8': - resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==} - - '@types/d3@7.4.3': - resolution: {integrity: sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==} - '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -4315,15 +4118,15 @@ packages: '@types/fs-extra@9.0.13': resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} - '@types/geojson@7946.0.16': - resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==} - '@types/glob@7.2.0': resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/hast@2.3.10': + resolution: {integrity: sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==} + '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} @@ -4411,9 +4214,6 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/nlcst@2.0.3': - resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} - '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} @@ -4620,11 +4420,6 @@ packages: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript/vfs@1.6.3': - resolution: {integrity: sha512-8Qs6/Tj2B8Uyo4lYJkopdCtrsfpF/ZlbTXK13Nq6JKN+Ih8FF9Oxg97gEp+zIS96wmkMdWUIETl35Yt9BITeiw==} - peerDependencies: - typescript: '*' - '@undecaf/barcode-detector-polyfill@0.9.20': resolution: {integrity: sha512-fD/7WjfhhCPJjNzVUyP1TNv29YzrsD6DO9mTdH5Xi9fbpg4VJdsqjiFxkat4//j7Y2xEADXIxzC/SvGdjMxDng==} @@ -4865,10 +4660,6 @@ packages: resolution: {integrity: sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ==} engines: {node: '>=8'} - '@xmldom/xmldom@0.9.8': - resolution: {integrity: sha512-p96FSY54r+WJ50FIOsCOjyj/wavs8921hG5+kVMmZgKcvIKxMXHTrjNJvRgWa/zuX3B6t2lijLNFaOyuxUH+2A==} - engines: {node: '>=14.6'} - '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -5166,6 +4957,12 @@ packages: peerDependencies: graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 + arch@2.2.0: + resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==} + + arg@1.0.0: + resolution: {integrity: sha512-Wk7TEzl1KqvTGs/uyhmHO/3XLd3t1UeU4IstvPXVzGPM522cTjqjNZ99esCkcL52sjqjo8e8CTBcWhkxvGzoAw==} + arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -5197,9 +4994,6 @@ packages: resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} engines: {node: '>= 0.4'} - array-iterate@2.0.1: - resolution: {integrity: sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==} - array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -5421,10 +5215,6 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - balanced-match@4.0.2: - resolution: {integrity: sha512-x0K50QvKQ97fdEz2kPehIerj+YTeptKF9hyYkKf6egnwmMWAkADiO0QCzSp0R5xN8FTZgYaBfSaue46Ej62nMg==} - engines: {node: 20 || >=22} - base-x@3.0.9: resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} @@ -5444,11 +5234,6 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - better-react-mathjax@2.3.0: - resolution: {integrity: sha512-K0ceQC+jQmB+NLDogO5HCpqmYf18AU2FxDbLdduYgkHYWZApFggkHE4dIaXCV1NqeoscESYXXo1GSkY6fA295w==} - peerDependencies: - react: '>=16.8' - bfj@7.1.0: resolution: {integrity: sha512-I6MMLkn+anzNdCUp9hMRyui1HaNEUCco50lxbvNS4+EyXg8lN3nJ48PjPWtbH8UVS9CuMoaKE9U2V3l29DaRQw==} engines: {node: '>= 8.0.0'} @@ -5527,10 +5312,6 @@ packages: brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - brace-expansion@5.0.2: - resolution: {integrity: sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==} - engines: {node: 20 || >=22} - braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -5751,6 +5532,10 @@ packages: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} engines: {node: '>=0.10.0'} + chalk@2.3.0: + resolution: {integrity: sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==} + engines: {node: '>=4'} + chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -5826,14 +5611,6 @@ packages: resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==} engines: {node: '>= 6'} - chevrotain-allstar@0.3.1: - resolution: {integrity: sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==} - peerDependencies: - chevrotain: ^11.0.0 - - chevrotain@11.1.1: - resolution: {integrity: sha512-f0yv5CPKaFxfsPTBzX7vGuim4oIC1/gcS7LUGdBSwl2dU6+FON6LVUksdOo1qJjoUvXNn45urgh8C+0a24pACQ==} - chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -5903,6 +5680,10 @@ packages: client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + clipboardy@1.2.2: + resolution: {integrity: sha512-16KrBOV7bHmHdxcQiCvfUFYVFyEah4FI8vYT1Fr7CGSA4G+xBWMEfUEQJS1hxeHGtI9ju1Bzs9uXSbj5HZKArw==} + engines: {node: '>=4'} + clipboardy@4.0.0: resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==} engines: {node: '>=18'} @@ -5944,16 +5725,10 @@ packages: resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==} engines: {node: '>= 4.0'} - code-block-writer@13.0.3: - resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==} - code-point-at@1.1.0: resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} engines: {node: '>=0.10.0'} - collapse-white-space@2.1.0: - resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} - collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -5992,10 +5767,6 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} - commander@13.1.0: - resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} - engines: {node: '>=18'} - commander@14.0.3: resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} engines: {node: '>=20'} @@ -6059,9 +5830,6 @@ packages: concat-with-sourcemaps@1.1.0: resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==} - confbox@0.1.8: - resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} - config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} @@ -6156,9 +5924,6 @@ packages: cose-base@1.0.3: resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} - cose-base@2.2.0: - resolution: {integrity: sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==} - cosmiconfig@5.2.1: resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} engines: {node: '>=4'} @@ -6410,11 +6175,6 @@ packages: peerDependencies: cytoscape: ^3.2.0 - cytoscape-fcose@2.2.0: - resolution: {integrity: sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==} - peerDependencies: - cytoscape: ^3.2.0 - cytoscape@3.33.1: resolution: {integrity: sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==} engines: {node: '>=0.10'} @@ -6979,6 +6739,9 @@ packages: resolution: {integrity: sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ==} engines: {node: '>=0.10.0'} + elkjs@0.9.3: + resolution: {integrity: sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==} + elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} @@ -7125,12 +6888,6 @@ packages: es6-promisify@5.0.0: resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} - esast-util-from-estree@2.0.0: - resolution: {integrity: sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==} - - esast-util-from-js@2.0.1: - resolution: {integrity: sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==} - esbuild-android-64@0.15.18: resolution: {integrity: sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==} engines: {node: '>=12'} @@ -7487,10 +7244,6 @@ packages: deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true - esm@3.2.25: - resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} - engines: {node: '>=6'} - espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -7521,29 +7274,23 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - estree-util-attach-comments@3.0.0: - resolution: {integrity: sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==} + estree-util-attach-comments@2.1.1: + resolution: {integrity: sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==} - estree-util-build-jsx@3.0.1: - resolution: {integrity: sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==} + estree-util-build-jsx@2.2.2: + resolution: {integrity: sha512-m56vOXcOBuaF+Igpb9OPAy7f9w9OIkb5yhjsZuaPm7HoGi4oTOQi0h2+yZ+AtKklYFZ+rPC4n0wYCJCEU1ONqg==} estree-util-is-identifier-name@2.1.0: resolution: {integrity: sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==} - estree-util-is-identifier-name@3.0.0: - resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} - - estree-util-scope@1.0.0: - resolution: {integrity: sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==} - - estree-util-to-js@2.0.0: - resolution: {integrity: sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==} + estree-util-to-js@1.2.0: + resolution: {integrity: sha512-IzU74r1PK5IMMGZXUVZbmiu4A1uhiPgW5hm1GjcOfr4ZzHaMPpLNJjR7HjXiIOzi25nZDrgFTobHTkV5Q6ITjA==} estree-util-value-to-estree@3.5.0: resolution: {integrity: sha512-aMV56R27Gv3QmfmF1MY12GWkGzzeAezAX+UplqHVASfjc9wNzI/X6hC0S9oxq61WT4aQesLGslWP9tKk6ghRZQ==} - estree-util-visit@2.0.0: - resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} + estree-util-visit@1.2.1: + resolution: {integrity: sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==} estree-walker@0.6.1: resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} @@ -7597,6 +7344,10 @@ packages: evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} + execa@0.8.0: + resolution: {integrity: sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==} + engines: {node: '>=4'} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -7631,6 +7382,10 @@ packages: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} + extend-shallow@2.0.1: + resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} + engines: {node: '>=0.10.0'} + extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -7692,9 +7447,6 @@ packages: fault@1.0.4: resolution: {integrity: sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==} - fault@2.0.1: - resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} - faye-websocket@0.10.0: resolution: {integrity: sha512-Xhj93RXbMSq8urNCUq4p9l0P6hnySJ/7YNRhYNug0bLOuii7pKO7xQFb5mx9xZXWCar88pLPb805PvUkwrLZpQ==} engines: {node: '>=0.4.0'} @@ -7709,15 +7461,6 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} @@ -7810,11 +7553,17 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flexsearch@0.7.43: + resolution: {integrity: sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==} + fluent-ffmpeg@2.1.3: resolution: {integrity: sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==} engines: {node: '>=18'} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + focus-visible@5.2.1: + resolution: {integrity: sha512-8Bx950VD1bWTQJEH/AM6SpEk+SU55aVnp4Ujhuuxy3eMEBCRwBnTBnVXr9YAPvZL3/CNjCa8u4IWfNmEO53whA==} + follow-redirects@1.15.5: resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} engines: {node: '>=4.0'} @@ -7984,6 +7733,10 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + get-stream@3.0.0: + resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} + engines: {node: '>=4'} + get-stream@4.1.0: resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} engines: {node: '>=6'} @@ -8010,6 +7763,12 @@ packages: getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + git-up@7.0.0: + resolution: {integrity: sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==} + + git-url-parse@13.1.1: + resolution: {integrity: sha512-PCFJyeSSdtnbfhSNRw9Wk96dDCNx+sogTe4YNXeXSJxt7xz5hvXekuRn9JX7m+Mf4OscCu8h+mtAl3+h5Fo8lQ==} + gitbook-plugin-fontsettings@2.0.0: resolution: {integrity: sha512-bZpz/Jev7lL1d3VNp41KHZD67UYqyqdOwbsJE6YEW93R2mGiLfZLpUs86d2nrY61BedhlNck1xF52FNT6sWeig==} engines: {gitbook: '>=2.4.0'} @@ -8163,6 +7922,10 @@ packages: resolution: {integrity: sha512-AnnKk7hFQFmU/2I9YSQf3xw44ctnSFCfp3zE0N6W174gqe9fWG/2rKaKxROK7CcI3XtERpjEKFqts8o319Kf7A==} engines: {node: '>= 10.x'} + gray-matter@4.0.3: + resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} + engines: {node: '>=6.0'} + growly@1.3.0: resolution: {integrity: sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==} @@ -8173,9 +7936,6 @@ packages: h3@1.10.1: resolution: {integrity: sha512-UBAUp47hmm4BB5/njB4LrEa9gpuvZj4/Qf/ynSMzO6Ku2RXaouxEfiG2E2IFnv6fxbhAkzjasDxmo6DFdEeXRg==} - hachure-fill@0.5.2: - resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==} - handle-thing@2.0.1: resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} @@ -8211,6 +7971,10 @@ packages: resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==} engines: {node: '>=0.10.0'} + has-flag@2.0.0: + resolution: {integrity: sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==} + engines: {node: '>=0.10.0'} + has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -8253,6 +8017,10 @@ packages: resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} engines: {node: '>=4'} + hash-obj@4.0.0: + resolution: {integrity: sha512-FwO1BUVWkyHasWDW4S8o0ssQXjvyghLV2rfVhnN36b2bbcj45eGiuzdn9XOvOpjV3TKQD7Gm2BWNXdE9V4KKYg==} + engines: {node: '>=12'} + hash.js@1.1.7: resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} @@ -8285,26 +8053,17 @@ packages: hast-util-raw@9.1.0: resolution: {integrity: sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==} - hast-util-to-estree@3.1.3: - resolution: {integrity: sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==} - - hast-util-to-html@9.0.5: - resolution: {integrity: sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==} - - hast-util-to-jsx-runtime@2.3.6: - resolution: {integrity: sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==} + hast-util-to-estree@2.3.3: + resolution: {integrity: sha512-ihhPIUPxN0v0w6M5+IiAZZrn0LH2uZomeWwhn7uP7avZC6TE7lIiEh2yBMPr5+zi1aUCXq6VoYRgs2Bw9xmycQ==} hast-util-to-parse5@8.0.1: resolution: {integrity: sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==} - hast-util-to-string@3.0.1: - resolution: {integrity: sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==} - hast-util-to-text@4.0.2: resolution: {integrity: sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==} - hast-util-whitespace@3.0.0: - resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + hast-util-whitespace@2.0.1: + resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} hastscript@9.0.1: resolution: {integrity: sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==} @@ -8616,8 +8375,8 @@ packages: inline-source-map@0.6.2: resolution: {integrity: sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==} - inline-style-parser@0.2.7: - resolution: {integrity: sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==} + inline-style-parser@0.1.1: + resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} inquirer-autosubmit-prompt@0.2.0: resolution: {integrity: sha512-mzNrusCk5L6kSzlN0Ioddn8yzrhYNLli+Sn2ZxMuLechMYAzakiFCIULxsxlQb5YKzthLGfrFACcWoAvM7p04Q==} @@ -8645,6 +8404,10 @@ packages: resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==} engines: {node: '>=12'} + intersection-observer@0.12.2: + resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} + deprecated: The Intersection Observer polyfill is no longer needed and can safely be removed. Intersection Observer has been Baseline since 2019. + invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} @@ -8760,6 +8523,10 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} hasBin: true + is-extendable@0.1.1: + resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} + engines: {node: '>=0.10.0'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -8848,6 +8615,10 @@ packages: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} + is-obj@3.0.0: + resolution: {integrity: sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==} + engines: {node: '>=12'} + is-observable@1.1.0: resolution: {integrity: sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==} engines: {node: '>=4'} @@ -8888,6 +8659,9 @@ packages: is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + is-reference@3.0.3: + resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} + is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -8913,6 +8687,9 @@ packages: is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + is-ssh@1.4.1: + resolution: {integrity: sha512-JNeu1wQsHjyHgn9NcWTaXq6zWSR6hqE0++zhfZlkFBbScNkyvxCdeV8sRkSBaeLKxmbpR21brail63ACNxJ0Tg==} + is-stream@1.1.0: resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} engines: {node: '>=0.10.0'} @@ -9059,10 +8836,6 @@ packages: resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} engines: {node: '>=14'} - jackspeak@4.2.3: - resolution: {integrity: sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==} - engines: {node: 20 || >=22} - jake@10.8.7: resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} engines: {node: '>=10'} @@ -9570,10 +9343,6 @@ packages: labeled-stream-splicer@2.0.2: resolution: {integrity: sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==} - langium@4.2.1: - resolution: {integrity: sha512-zu9QWmjpzJcomzdJQAHgDVhLGq5bLosVak1KVa40NzQHXfqr4eAHupvnPOVXEoLkg6Ocefvf/93d//SB7du4YQ==} - engines: {node: '>=20.10.0', npm: '>=10.2.3'} - language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} @@ -9591,9 +9360,6 @@ packages: layout-base@1.0.2: resolution: {integrity: sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==} - layout-base@2.0.1: - resolution: {integrity: sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==} - leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -9871,9 +9637,9 @@ packages: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} - markdown-extensions@2.0.0: - resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==} - engines: {node: '>=16'} + markdown-extensions@1.1.1: + resolution: {integrity: sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==} + engines: {node: '>=0.10.0'} markdown-table@2.0.0: resolution: {integrity: sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==} @@ -9881,16 +9647,14 @@ packages: markdown-table@3.0.4: resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} - marked@16.4.2: - resolution: {integrity: sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==} - engines: {node: '>= 20'} - hasBin: true - marked@4.3.0: resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} engines: {node: '>= 12'} hasBin: true + match-sorter@6.3.4: + resolution: {integrity: sha512-jfZW7cWS5y/1xswZo8VBOdudUiSd9nifYRWphc9M5D/ee4w4AoXLgBEdRbgVaxbMuagBPeUC5y2Hi8DO6o9aDg==} + matcher@3.0.0: resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==} engines: {node: '>=10'} @@ -9899,10 +9663,6 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - mathjax-full@3.2.2: - resolution: {integrity: sha512-+LfG9Fik+OuI8SLwsiR02IVdjcnRCy5MufYLi0C3TdMT56L/pjB0alMVGgoWJF8pN9Rc7FESycZB9BMNWIid5w==} - deprecated: Version 4 replaces this package with the scoped package @mathjax/src - mcporter@0.7.3: resolution: {integrity: sha512-egoPVYqTnWb3NjRIxo+xc8OrAI0dlPrJm9pAiZx0pImuNIV5rKhGtTnIfH/Y1ldGPVu74ibj3KR5c9U/QSdQFA==} engines: {node: '>=20.11.0'} @@ -9914,11 +9674,14 @@ packages: md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + mdast-util-definitions@5.1.2: + resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} + mdast-util-find-and-replace@1.1.1: resolution: {integrity: sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA==} - mdast-util-find-and-replace@3.0.2: - resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==} + mdast-util-find-and-replace@2.2.2: + resolution: {integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==} mdast-util-footnote@0.1.7: resolution: {integrity: sha512-QxNdO8qSxqbO2e3m09KwDKfWiLgqyCurdWTQ198NpbZ2hxntdc+VKS4fDJCmNWbAroUdYnSthu+XbZ8ovh8C3w==} @@ -9926,65 +9689,65 @@ packages: mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} - mdast-util-from-markdown@2.0.2: - resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + mdast-util-from-markdown@1.3.1: + resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} mdast-util-frontmatter@0.2.0: resolution: {integrity: sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ==} - mdast-util-frontmatter@2.0.1: - resolution: {integrity: sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==} - mdast-util-gfm-autolink-literal@0.1.3: resolution: {integrity: sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A==} - mdast-util-gfm-autolink-literal@2.0.1: - resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} + mdast-util-gfm-autolink-literal@1.0.3: + resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} - mdast-util-gfm-footnote@2.1.0: - resolution: {integrity: sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==} + mdast-util-gfm-footnote@1.0.2: + resolution: {integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==} mdast-util-gfm-strikethrough@0.2.3: resolution: {integrity: sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==} - mdast-util-gfm-strikethrough@2.0.0: - resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} + mdast-util-gfm-strikethrough@1.0.3: + resolution: {integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==} mdast-util-gfm-table@0.1.6: resolution: {integrity: sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==} - mdast-util-gfm-table@2.0.0: - resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} + mdast-util-gfm-table@1.0.7: + resolution: {integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==} mdast-util-gfm-task-list-item@0.1.6: resolution: {integrity: sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==} - mdast-util-gfm-task-list-item@2.0.0: - resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} + mdast-util-gfm-task-list-item@1.0.2: + resolution: {integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==} mdast-util-gfm@0.1.2: resolution: {integrity: sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ==} - mdast-util-gfm@3.1.0: - resolution: {integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==} + mdast-util-gfm@2.0.2: + resolution: {integrity: sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==} + + mdast-util-math@2.0.2: + resolution: {integrity: sha512-8gmkKVp9v6+Tgjtq6SYx9kGPpTf6FVYRa53/DLh479aldR9AyP48qeVOgNZ5X7QUK7nOy4yw7vg6mbiGcs9jWQ==} - mdast-util-math@3.0.0: - resolution: {integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==} + mdast-util-mdx-expression@1.3.2: + resolution: {integrity: sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==} - mdast-util-mdx-expression@2.0.1: - resolution: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==} + mdast-util-mdx-jsx@2.1.4: + resolution: {integrity: sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==} - mdast-util-mdx-jsx@3.2.0: - resolution: {integrity: sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==} + mdast-util-mdx@2.0.1: + resolution: {integrity: sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==} - mdast-util-mdx@3.0.0: - resolution: {integrity: sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==} + mdast-util-mdxjs-esm@1.3.1: + resolution: {integrity: sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==} - mdast-util-mdxjs-esm@2.0.1: - resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + mdast-util-phrasing@3.0.1: + resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} - mdast-util-phrasing@4.1.0: - resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + mdast-util-to-hast@12.3.0: + resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} mdast-util-to-hast@13.2.1: resolution: {integrity: sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==} @@ -9992,14 +9755,14 @@ packages: mdast-util-to-markdown@0.6.5: resolution: {integrity: sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==} - mdast-util-to-markdown@2.1.2: - resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + mdast-util-to-markdown@1.5.0: + resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} mdast-util-to-string@2.0.0: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} - mdast-util-to-string@4.0.0: - resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + mdast-util-to-string@3.2.0: + resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} mdn-data@2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} @@ -10055,18 +9818,15 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - mermaid@11.12.3: - resolution: {integrity: sha512-wN5ZSgJQIC+CHJut9xaKWsknLxaFBwCPwPkGTSUYrTiHORWvpT8RxGk849HPnpUAQ+/9BPRqYb80jTpearrHzQ==} + mermaid@10.9.5: + resolution: {integrity: sha512-eRlKEjzak4z1rcXeCd1OAlyawhrptClQDo8OuI8n6bSVqJ9oMfd5Lrf3Q+TdJHewi/9AIOc3UmEo8Fz+kNzzuQ==} methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} - mhchemparser@4.2.1: - resolution: {integrity: sha512-kYmyrCirqJf3zZ9t/0wGgRZ4/ZJw//VwaRVGA75C4nhE60vtnIzhl9J9ndkX/h6hxSN7pjg/cE0VxbnNM+bnDQ==} - - micromark-core-commonmark@2.0.3: - resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} + micromark-core-commonmark@1.1.0: + resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} micromark-extension-footnote@0.3.2: resolution: {integrity: sha512-gr/BeIxbIWQoUm02cIfK7mdMZ/fbroRpLsck4kvFtjbzP4yi+OPVbnukTc/zy0i7spC2xYE/dbX1Sur8BEDJsQ==} @@ -10074,134 +9834,146 @@ packages: micromark-extension-frontmatter@0.2.2: resolution: {integrity: sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A==} - micromark-extension-frontmatter@2.0.0: - resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==} - micromark-extension-gfm-autolink-literal@0.5.7: resolution: {integrity: sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw==} - micromark-extension-gfm-autolink-literal@2.1.0: - resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} + micromark-extension-gfm-autolink-literal@1.0.5: + resolution: {integrity: sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==} - micromark-extension-gfm-footnote@2.1.0: - resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} + micromark-extension-gfm-footnote@1.1.2: + resolution: {integrity: sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==} micromark-extension-gfm-strikethrough@0.6.5: resolution: {integrity: sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw==} - micromark-extension-gfm-strikethrough@2.1.0: - resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} + micromark-extension-gfm-strikethrough@1.0.7: + resolution: {integrity: sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==} micromark-extension-gfm-table@0.4.3: resolution: {integrity: sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA==} - micromark-extension-gfm-table@2.1.1: - resolution: {integrity: sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==} + micromark-extension-gfm-table@1.0.7: + resolution: {integrity: sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==} micromark-extension-gfm-tagfilter@0.3.0: resolution: {integrity: sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q==} - micromark-extension-gfm-tagfilter@2.0.0: - resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} + micromark-extension-gfm-tagfilter@1.0.2: + resolution: {integrity: sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==} micromark-extension-gfm-task-list-item@0.3.3: resolution: {integrity: sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==} - micromark-extension-gfm-task-list-item@2.1.0: - resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} + micromark-extension-gfm-task-list-item@1.0.5: + resolution: {integrity: sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==} micromark-extension-gfm@0.3.3: resolution: {integrity: sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A==} - micromark-extension-gfm@3.0.0: - resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + micromark-extension-gfm@2.0.3: + resolution: {integrity: sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==} - micromark-extension-math@3.1.0: - resolution: {integrity: sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==} + micromark-extension-math@2.1.2: + resolution: {integrity: sha512-es0CcOV89VNS9wFmyn+wyFTKweXGW4CEvdaAca6SWRWPyYCbBisnjaHLjWO4Nszuiud84jCpkHsqAJoa768Pvg==} - micromark-extension-mdx-expression@3.0.1: - resolution: {integrity: sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==} + micromark-extension-mdx-expression@1.0.8: + resolution: {integrity: sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==} - micromark-extension-mdx-jsx@3.0.2: - resolution: {integrity: sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==} + micromark-extension-mdx-jsx@1.0.5: + resolution: {integrity: sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==} - micromark-extension-mdx-md@2.0.0: - resolution: {integrity: sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==} + micromark-extension-mdx-md@1.0.1: + resolution: {integrity: sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==} - micromark-extension-mdxjs-esm@3.0.0: - resolution: {integrity: sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==} + micromark-extension-mdxjs-esm@1.0.5: + resolution: {integrity: sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==} - micromark-extension-mdxjs@3.0.0: - resolution: {integrity: sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==} + micromark-extension-mdxjs@1.0.1: + resolution: {integrity: sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==} - micromark-factory-destination@2.0.1: - resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + micromark-factory-destination@1.1.0: + resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} - micromark-factory-label@2.0.1: - resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + micromark-factory-label@1.1.0: + resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} - micromark-factory-mdx-expression@2.0.3: - resolution: {integrity: sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==} + micromark-factory-mdx-expression@1.0.9: + resolution: {integrity: sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==} - micromark-factory-space@2.0.1: - resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + micromark-factory-space@1.1.0: + resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} - micromark-factory-title@2.0.1: - resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + micromark-factory-title@1.1.0: + resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} - micromark-factory-whitespace@2.0.1: - resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + micromark-factory-whitespace@1.1.0: + resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} + + micromark-util-character@1.2.0: + resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} micromark-util-character@2.1.1: resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} - micromark-util-chunked@2.0.1: - resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + micromark-util-chunked@1.1.0: + resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} + + micromark-util-classify-character@1.1.0: + resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} - micromark-util-classify-character@2.0.1: - resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + micromark-util-combine-extensions@1.1.0: + resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} - micromark-util-combine-extensions@2.0.1: - resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + micromark-util-decode-numeric-character-reference@1.1.0: + resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} - micromark-util-decode-numeric-character-reference@2.0.2: - resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + micromark-util-decode-string@1.1.0: + resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} - micromark-util-decode-string@2.0.1: - resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + micromark-util-encode@1.1.0: + resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} micromark-util-encode@2.0.1: resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} - micromark-util-events-to-acorn@2.0.3: - resolution: {integrity: sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==} + micromark-util-events-to-acorn@1.2.3: + resolution: {integrity: sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==} - micromark-util-html-tag-name@2.0.1: - resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + micromark-util-html-tag-name@1.2.0: + resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} - micromark-util-normalize-identifier@2.0.1: - resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + micromark-util-normalize-identifier@1.1.0: + resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} - micromark-util-resolve-all@2.0.1: - resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + micromark-util-resolve-all@1.1.0: + resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} + + micromark-util-sanitize-uri@1.2.0: + resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} micromark-util-sanitize-uri@2.0.1: resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} - micromark-util-subtokenize@2.1.0: - resolution: {integrity: sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==} + micromark-util-subtokenize@1.1.0: + resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} + + micromark-util-symbol@1.1.0: + resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} micromark-util-symbol@2.0.1: resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + micromark-util-types@1.1.0: + resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} + micromark-util-types@2.0.2: resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==} micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} - micromark@4.0.2: - resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} + micromark@3.2.0: + resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -10286,10 +10058,6 @@ packages: minimalistic-crypto-utils@1.0.1: resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} - minimatch@10.2.1: - resolution: {integrity: sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==} - engines: {node: 20 || >=22} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -10320,9 +10088,6 @@ packages: resolution: {integrity: sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==} engines: {node: '>= 8.0.0'} - mj-context-menu@0.6.1: - resolution: {integrity: sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==} - mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} @@ -10338,9 +10103,6 @@ packages: mlly@1.5.0: resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} - mlly@1.8.0: - resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} - mocha@10.2.0: resolution: {integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==} engines: {node: '>= 14.0.0'} @@ -10417,11 +10179,26 @@ packages: resolution: {integrity: sha512-dle7yf655IMjyFUqn6Nxkb18r4AOAkzRcgcZv6WZ0IqrOH4QCEZ8Sm6I7XX21zvHdBeeMeTkhR9qT2Z0EJDx6A==} engines: {node: '>=10'} - next-themes@0.4.6: - resolution: {integrity: sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==} + next-mdx-remote@4.4.1: + resolution: {integrity: sha512-1BvyXaIou6xy3XoNF4yaMZUCb6vD2GTAa5ciOa6WoO+gAUTYsb1K4rI/HSC2ogAWLrb/7VSV52skz07vOzmqIQ==} + engines: {node: '>=14', npm: '>=7'} peerDependencies: - react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc + react: '>=16.x <=18.x' + react-dom: '>=16.x <=18.x' + + next-seo@6.8.0: + resolution: {integrity: sha512-zcxaV67PFXCSf8e6SXxbxPaOTgc8St/esxfsYXfQXMM24UESUVSXFm7f2A9HMkAwa0Gqn4s64HxYZAGfdF4Vhg==} + peerDependencies: + next: ^8.1.1-canary.54 || >=9.0.0 + react: '>=16.0.0' + react-dom: '>=16.0.0' + + next-themes@0.2.1: + resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} + peerDependencies: + next: '*' + react: '*' + react-dom: '*' next@13.5.11: resolution: {integrity: sha512-WUPJ6WbAX9tdC86kGTu92qkrRdgRqVrY++nwM+shmWQwmyxt4zhZfR59moXSI4N8GDYCBY3lIAqhzjDd4rTC8Q==} @@ -10438,21 +10215,21 @@ packages: sass: optional: true - nextra-theme-docs@4.6.1: - resolution: {integrity: sha512-u5Hh8erVcGOXO1FVrwYBgrEjyzdYQY0k/iAhLd8RofKp+Bru3fyLy9V9W34mfJ0KHKHjv/ldlDTlb4KlL4eIuQ==} + nextra-theme-docs@2.13.4: + resolution: {integrity: sha512-2XOoMfwBCTYBt8ds4ZHftt9Wyf2XsykiNo02eir/XEYB+sGeUoE77kzqfidjEOKCSzOHYbK9BDMcg2+B/2vYRw==} peerDependencies: - next: '>=14' - nextra: 4.6.1 - react: '>=18' - react-dom: '>=18' + next: '>=9.5.3' + nextra: 2.13.4 + react: '>=16.13.1' + react-dom: '>=16.13.1' - nextra@4.6.1: - resolution: {integrity: sha512-yz5WMJFZ5c58y14a6Rmwt+SJUYDdIgzWSxwtnpD4XAJTq3mbOqOg3VTaJqLiJjwRSxoFRHNA1yAhnhbvbw9zSg==} - engines: {node: '>=18'} + nextra@2.13.4: + resolution: {integrity: sha512-7of2rSBxuUa3+lbMmZwG9cqgftcoNOVQLTT6Rxf3EhBR9t1EI7b43dted8YoqSNaigdE3j1CoyNkX8N/ZzlEpw==} + engines: {node: '>=16'} peerDependencies: - next: '>=14' - react: '>=18' - react-dom: '>=18' + next: '>=9.5.3' + react: '>=16.13.1' + react-dom: '>=16.13.1' nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -10460,9 +10237,6 @@ packages: nise@5.1.7: resolution: {integrity: sha512-wWtNUhkT7k58uvWTB/Gy26eA/EJKtPZFVAhEilN5UYVmmGRYOURbejRUyKm0Uu9XVEW7K5nBOZfR8VMB4QR2RQ==} - nlcst-to-string@4.0.0: - resolution: {integrity: sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA==} - no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -10521,6 +10295,9 @@ packages: resolution: {integrity: sha512-SXzjefvZvJc5kn9kqsZhs0es8aQ1o9pnnIpzA6CPeHb7CaIfl+7OkO1n8uqyVawMzzUfhEXxW6vbqUsWEgSaFw==} hasBin: true + non-layered-tidy-tree-layout@2.0.2: + resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==} + normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} @@ -10566,6 +10343,10 @@ packages: engines: {node: '>= 4'} hasBin: true + npm-run-path@2.0.2: + resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} + engines: {node: '>=4'} + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -10574,8 +10355,8 @@ packages: resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - npm-to-yarn@3.0.1: - resolution: {integrity: sha512-tt6PvKu4WyzPwWUzy/hvPFqn+uwXO0K1ZHka8az3NnrhWJDmSqI8ncWq0fkL0k/lmmi5tAC11FXwXuh0rFbt1A==} + npm-to-yarn@2.2.1: + resolution: {integrity: sha512-O/j/ROyX0KGLG7O6Ieut/seQ0oiTpHF2tXAcFbpdTLQFiaNtkyTXXocM1fwpaa60dg1qpWj0nHlbNhx6qwuENQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} nth-check@1.0.2: @@ -10707,12 +10488,6 @@ packages: resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} - oniguruma-parser@0.12.1: - resolution: {integrity: sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==} - - oniguruma-to-es@4.3.4: - resolution: {integrity: sha512-3VhUGN3w2eYxnTzHn+ikMI+fp/96KoRSVK9/kMTcFqj1NRDh2IhQCKvYxDnWePKRXY/AqH+Fuiyb7VHSzBjHfA==} - open@7.4.2: resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==} engines: {node: '>=8'} @@ -10849,9 +10624,6 @@ packages: resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==} engines: {node: '>=8'} - package-manager-detector@1.6.0: - resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==} - pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} @@ -10885,12 +10657,15 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - parse-latin@7.0.0: - resolution: {integrity: sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==} - parse-numeric-range@1.3.0: resolution: {integrity: sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==} + parse-path@7.1.0: + resolution: {integrity: sha512-EuCycjZtfPcjWk7KTksnJ5xPMvWGA/6i4zrLYhRG0hGvC3GPU/jGUj3Cy+ZR0v30duV3e23R95T1lE2+lsndSw==} + + parse-url@8.1.0: + resolution: {integrity: sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==} + parse5-htmlparser2-tree-adapter@6.0.1: resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} @@ -10923,9 +10698,6 @@ packages: path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - path-data-parser@0.1.0: - resolution: {integrity: sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==} - path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -10981,9 +10753,6 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathe@2.0.3: - resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} @@ -10998,6 +10767,9 @@ packages: performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + periscopic@3.1.0: + resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} + picocolors@0.2.1: resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==} @@ -11008,10 +10780,6 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} - engines: {node: '>=12'} - pidtree@0.3.1: resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==} engines: {node: '>=0.10'} @@ -11062,9 +10830,6 @@ packages: pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} - pkg-types@1.3.1: - resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - pkg-up@3.1.0: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} @@ -11073,12 +10838,6 @@ packages: resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} engines: {node: '>=10.13.0'} - points-on-curve@0.2.0: - resolution: {integrity: sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==} - - points-on-path@0.2.1: - resolution: {integrity: sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==} - postcss-attribute-case-insensitive@5.0.2: resolution: {integrity: sha512-XIidXV8fDr0kKt28vqki84fRK8VW8eTuIa4PChv2MqKuT6C9UjmSKzen6KaWhWEoYvwxFCa7n/tC1SZ3tyq4SQ==} engines: {node: ^12 || ^14 || >=16} @@ -11766,12 +11525,18 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + property-information@7.1.0: resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + protocols@2.0.2: + resolution: {integrity: sha512-hHVTzba3wboROl0/aWRRG9dMytgH6ow//STBZh43l/wQgmMhYhOFi0EHWAPtoCz9IAUymsyP0TSBHkhgMEGNnQ==} + proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} @@ -11920,11 +11685,6 @@ packages: peerDependencies: react-scripts: '>=2.1.3' - react-compiler-runtime@19.1.0-rc.3: - resolution: {integrity: sha512-Cssogys2XZu6SqxRdX2xd8cQAf57BBvFbLEBlIa77161lninbKUn/EqbecCe7W3eqDQfg3rIoOwzExzgCh7h/g==} - peerDependencies: - react: ^17.0.0 || ^18.0.0 || ^19.0.0 || ^0.0.0-experimental - react-dev-utils@12.0.1: resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} engines: {node: '>=14'} @@ -11955,12 +11715,6 @@ packages: react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - react-medium-image-zoom@5.4.0: - resolution: {integrity: sha512-BsE+EnFVQzFIlyuuQrZ9iTwyKpKkqdFZV1ImEQN573QPqGrIUuNni7aF+sZwDcxlsuOMayCr6oO/PZR/yJnbRg==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react-qr-code@2.0.12: resolution: {integrity: sha512-k+pzP5CKLEGBRwZsDPp98/CAJeXlsYRHM2iZn1Sd5Th/HnKhIZCSg27PXO58zk8z02RaEryg+60xa4vyywMJwg==} peerDependencies: @@ -12059,20 +11813,6 @@ packages: resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} engines: {node: '>= 12.13.0'} - recma-build-jsx@1.0.0: - resolution: {integrity: sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==} - - recma-jsx@1.0.1: - resolution: {integrity: sha512-huSIy7VU2Z5OLv6oFLosQGGDqPqdO1iq6bWNAdhzMxSJP7RAso4fCZ1cKu8j9YHCZf3TPrq4dw3okhrylgcd7w==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - - recma-parse@1.0.0: - resolution: {integrity: sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==} - - recma-stringify@1.0.0: - resolution: {integrity: sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==} - recursive-readdir@2.2.3: resolution: {integrity: sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==} engines: {node: '>=6.0.0'} @@ -12115,15 +11855,6 @@ packages: regex-parser@2.3.0: resolution: {integrity: sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg==} - regex-recursion@6.0.2: - resolution: {integrity: sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==} - - regex-utilities@2.3.0: - resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==} - - regex@6.1.0: - resolution: {integrity: sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==} - regexp.prototype.flags@1.5.1: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} @@ -12147,21 +11878,15 @@ packages: rehype-katex@7.0.1: resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==} - rehype-parse@9.0.1: - resolution: {integrity: sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag==} - - rehype-pretty-code@0.14.1: - resolution: {integrity: sha512-IpG4OL0iYlbx78muVldsK86hdfNoht0z63AP7sekQNW2QOTmjxB7RbTO+rhIYNGRljgHxgVZoPwUl6bIC9SbjA==} - engines: {node: '>=18'} + rehype-pretty-code@0.9.11: + resolution: {integrity: sha512-Eq90eCYXQJISktfRZ8PPtwc5SUyH6fJcxS8XOMnHPUQZBtC6RYo67gGlley9X2nR8vlniPj0/7oCDEYHKQa/oA==} + engines: {node: '>=16'} peerDependencies: - shiki: ^1.0.0 || ^2.0.0 || ^3.0.0 + shiki: '*' rehype-raw@7.0.0: resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==} - rehype-recma@1.0.0: - resolution: {integrity: sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==} - relateurl@0.2.7: resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} engines: {node: '>= 0.10'} @@ -12172,23 +11897,20 @@ packages: remark-frontmatter@3.0.0: resolution: {integrity: sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA==} - remark-frontmatter@5.0.0: - resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} - remark-gfm@1.0.0: resolution: {integrity: sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA==} - remark-gfm@4.0.1: - resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==} + remark-gfm@3.0.1: + resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} - remark-math@6.0.0: - resolution: {integrity: sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==} + remark-math@5.1.1: + resolution: {integrity: sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw==} - remark-mdx@3.1.1: - resolution: {integrity: sha512-Pjj2IYlUY3+D8x00UJsIOg5BEvfMyeI+2uLPn9VO9Wg4MEtN/VTIq2NEJQfde9PnX15KgtHyl9S0BcTnWrIuWg==} + remark-mdx@2.3.0: + resolution: {integrity: sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==} - remark-parse@11.0.0: - resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + remark-parse@10.0.2: + resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} remark-parse@9.0.0: resolution: {integrity: sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==} @@ -12196,15 +11918,11 @@ packages: remark-reading-time@2.0.2: resolution: {integrity: sha512-ILjIuR0dQQ8pELPgaFvz7ralcSN62rD/L1pTUJgWb4gfua3ZwYEI8mnKGxEQCbrXSUF/OvycTkcUbifGOtOn5A==} - remark-rehype@11.1.2: - resolution: {integrity: sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==} + remark-rehype@10.1.0: + resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} - remark-smartypants@3.0.2: - resolution: {integrity: sha512-ILTWeOriIluwEvPjv67v7Blgrcx+LZOkAUVtKI3putuhlZm84FnqDORNXPPm+HY3NdZOMhyDwZ1E+eZB/Df5dA==} - engines: {node: '>=16.0.0'} - - remark-stringify@11.0.0: - resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + remove-accents@0.5.0: + resolution: {integrity: sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==} renderkid@3.0.0: resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} @@ -12304,18 +12022,6 @@ packages: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} - retext-latin@4.0.0: - resolution: {integrity: sha512-hv9woG7Fy0M9IlRQloq/N6atV82NxLGveq+3H2WOi79dtIYWN8OaxogDm77f8YnVXJL2VD3bbqowu5E3EMhBYA==} - - retext-smartypants@6.2.0: - resolution: {integrity: sha512-kk0jOU7+zGv//kfjXEBjdIryL1Acl4i9XNkHxtM7Tm5lFiCog576fjNC9hjoR7LTKQ0DsPWy09JummSsH1uqfQ==} - - retext-stringify@4.0.0: - resolution: {integrity: sha512-rtfN/0o8kL1e+78+uxPTqu1Klt0yPzKuQ2BfWwwfgIUSayyzxpM1PJzkKt4V8803uB9qSy32MvI7Xep9khTpiA==} - - retext@9.0.0: - resolution: {integrity: sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA==} - retry@0.13.1: resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} engines: {node: '>= 4'} @@ -12403,9 +12109,6 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - roughjs@4.6.6: - resolution: {integrity: sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==} - router@2.2.0: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} engines: {node: '>= 18'} @@ -12525,6 +12228,10 @@ packages: scroll-into-view-if-needed@3.1.0: resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==} + section-matter@1.0.0: + resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} + engines: {node: '>=4'} + select-hose@2.0.0: resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} @@ -12594,9 +12301,6 @@ packages: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} - server-only@0.0.1: - resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} - set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -12653,9 +12357,6 @@ packages: shiki@0.14.7: resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} - shiki@3.22.0: - resolution: {integrity: sha512-LBnhsoYEe0Eou4e1VgJACes+O6S6QC0w71fCSp5Oya79inkwkm15gQ1UF6VtQ8j/taMDh79hAB49WUk8ALQW3g==} - side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} engines: {node: '>= 0.4'} @@ -12710,10 +12411,6 @@ packages: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - slice-ansi@0.0.4: resolution: {integrity: sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw==} engines: {node: '>=0.10.0'} @@ -12736,6 +12433,10 @@ packages: resolution: {integrity: sha512-R5ocFmKZQFfSTstfOtHjJuAwbpGyf9qjQa1egyhvXSbM7emjrtLXtGdZsDJDABC85YBfVvrOiGWKSYXPKdvP1g==} hasBin: true + sort-keys@5.1.0: + resolution: {integrity: sha512-aSbHV0DaBcr7u0PVHXzM6NbZNAtrr9sF6+Qfs9UUVG7Ll3jQ6hHi8F/xqIIcn2rvIVbr0v/2zyjSdwSV47AgLQ==} + engines: {node: '>=12'} + source-list-map@2.0.1: resolution: {integrity: sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==} @@ -12801,10 +12502,6 @@ packages: resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} engines: {node: '>=6.0.0'} - speech-rule-engine@4.1.2: - resolution: {integrity: sha512-S6ji+flMEga+1QU79NDbwZ8Ivf0S/MpupQQiIC0rTpU/ZTKgcajijJJb1OcByBQDjrXCN1/DJtGz4ZJeBMPGJw==} - hasBin: true - split-on-first@1.1.0: resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} engines: {node: '>=6'} @@ -12990,6 +12687,10 @@ packages: resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} engines: {node: '>=12'} + strip-bom-string@1.0.0: + resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} + engines: {node: '>=0.10.0'} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -13002,6 +12703,10 @@ packages: resolution: {integrity: sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw==} engines: {node: '>=10'} + strip-eof@1.0.0: + resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} + engines: {node: '>=0.10.0'} + strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} @@ -13031,11 +12736,8 @@ packages: peerDependencies: webpack: ^5.0.0 - style-to-js@1.1.21: - resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==} - - style-to-object@1.0.14: - resolution: {integrity: sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==} + style-to-object@0.4.4: + resolution: {integrity: sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==} styled-jsx@5.1.1: resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} @@ -13090,6 +12792,10 @@ packages: resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==} engines: {node: '>=0.8.0'} + supports-color@4.5.0: + resolution: {integrity: sha512-ycQR/UbvI9xIlEdQT1TQqwoXtEldExbCEAJgRo5YXlmSKjv6ThHnP9/vwGa1gr19Gfw+LkFd7KqYMhzrRC5JYw==} + engines: {node: '>=4'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -13196,9 +12902,6 @@ packages: resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==} engines: {node: '>=18'} - tabbable@6.4.0: - resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==} - tailwindcss@3.4.1: resolution: {integrity: sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==} engines: {node: '>=14.0.0'} @@ -13291,18 +12994,14 @@ packages: tiny-lr@1.1.1: resolution: {integrity: sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA==} - tinyexec@1.0.2: - resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} - engines: {node: '>=18'} - - tinyglobby@0.2.15: - resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} - engines: {node: '>=12.0.0'} - - title@4.0.1: - resolution: {integrity: sha512-xRnPkJx9nvE5MF6LkB5e8QJjE2FW8269wTu/LQdf7zZqBgPly0QJPf/CWAo7srj5so4yXfoLEdCFgurlpi47zg==} + title@3.5.3: + resolution: {integrity: sha512-20JyowYglSEeCvZv3EZ0nZ046vLarO37prvV0mbtQV7C8DJPGgN967r8SJkqd3XK3K3lD3/Iyfp3avjfil8Q2Q==} hasBin: true + titleize@1.0.0: + resolution: {integrity: sha512-TARUb7z1pGvlLxgPk++7wJ6aycXF3GJ0sNSBTAsTuJrQG5QuZlkUQP+zl+nbjAh4gMX9yDw9ZYklMd7vAfJKEw==} + engines: {node: '>=0.10.0'} + tmp@0.0.28: resolution: {integrity: sha512-c2mmfiBmND6SOVxzogm1oda0OJ1HZVIk/5n26N59dDTh80MUeavpiCls4PGAdkX1PFkKokLpcf7prSjCeXLsJg==} engines: {node: '>=0.4.0'} @@ -13434,9 +13133,6 @@ packages: peerDependencies: mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X - ts-morph@27.0.2: - resolution: {integrity: sha512-fhUhgeljcrdZ+9DZND1De1029PrE+cMkIP7ooqkLRTrRLTqcki2AstsyJm0vRNbTbVCNJ0idGlbBrfqc7/nA8w==} - ts-node@10.9.1: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -13531,14 +13227,6 @@ packages: tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} - twoslash-protocol@0.3.6: - resolution: {integrity: sha512-FHGsJ9Q+EsNr5bEbgG3hnbkvEBdW5STgPU824AHUjB4kw0Dn4p8tABT7Ncg1Ie6V0+mDg3Qpy41VafZXcQhWMA==} - - twoslash@0.3.6: - resolution: {integrity: sha512-VuI5OKl+MaUO9UIW3rXKoPgHI3X40ZgB/j12VY6h98Ae1mCBihjPvhOPeJWlxCYcmSbmeZt5ZKkK0dsVtp+6pA==} - peerDependencies: - typescript: ^5.5.0 - type-check@0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} engines: {node: '>= 0.8.0'} @@ -13587,6 +13275,10 @@ packages: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} + type-fest@1.4.0: + resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} + engines: {node: '>=10'} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} @@ -13652,9 +13344,6 @@ packages: ufo@1.3.2: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} - ufo@1.6.3: - resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==} - uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -13705,8 +13394,8 @@ packages: resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} engines: {node: '>=4'} - unified@11.0.5: - resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} + unified@10.1.2: + resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} unified@9.2.2: resolution: {integrity: sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==} @@ -13724,6 +13413,9 @@ packages: unist-util-find-after@5.0.0: resolution: {integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==} + unist-util-generated@2.0.1: + resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==} + unist-util-is@4.1.0: resolution: {integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==} @@ -13733,15 +13425,18 @@ packages: unist-util-is@6.0.1: resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} - unist-util-modify-children@4.0.0: - resolution: {integrity: sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw==} + unist-util-position-from-estree@1.1.2: + resolution: {integrity: sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==} - unist-util-position-from-estree@2.0.0: - resolution: {integrity: sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==} + unist-util-position@4.0.4: + resolution: {integrity: sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==} unist-util-position@5.0.0: resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + unist-util-remove-position@4.0.2: + resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==} + unist-util-remove-position@5.0.0: resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} @@ -13751,24 +13446,30 @@ packages: unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + unist-util-stringify-position@3.0.3: + resolution: {integrity: sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==} + unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} - unist-util-visit-children@3.0.0: - resolution: {integrity: sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA==} - unist-util-visit-parents@3.1.1: resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==} unist-util-visit-parents@4.1.1: resolution: {integrity: sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==} + unist-util-visit-parents@5.1.3: + resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} + unist-util-visit-parents@6.0.2: resolution: {integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==} unist-util-visit@3.1.0: resolution: {integrity: sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==} + unist-util-visit@4.1.2: + resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} + unist-util-visit@5.1.0: resolution: {integrity: sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==} @@ -13884,11 +13585,6 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 - use-sync-external-store@1.6.0: - resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -13912,10 +13608,6 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} - uuid@11.1.0: - resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} - hasBin: true - uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. @@ -13929,6 +13621,11 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + uvu@0.5.6: + resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} + engines: {node: '>=8'} + hasBin: true + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -13988,15 +13685,24 @@ packages: vfile-location@5.0.3: resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} + vfile-matter@3.0.1: + resolution: {integrity: sha512-CAAIDwnh6ZdtrqAuxdElUqQRQDQgbbIrYtDYI8gCjXS1qQ+1XdLoK8FIZWxJwn0/I+BkSSZpar3SOgjemQz4fg==} + vfile-message@2.0.4: resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} + vfile-message@3.1.4: + resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} + vfile-message@4.0.3: resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} vfile@4.2.1: resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} + vfile@5.3.7: + resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} + vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} @@ -14067,32 +13773,12 @@ packages: vm-browserify@1.1.2: resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} - vscode-jsonrpc@8.2.0: - resolution: {integrity: sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==} - engines: {node: '>=14.0.0'} - - vscode-languageserver-protocol@3.17.5: - resolution: {integrity: sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==} - - vscode-languageserver-textdocument@1.0.12: - resolution: {integrity: sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==} - - vscode-languageserver-types@3.17.5: - resolution: {integrity: sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==} - - vscode-languageserver@9.0.1: - resolution: {integrity: sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==} - hasBin: true - vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} vscode-textmate@8.0.0: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - vscode-uri@3.1.0: - resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} - vue@3.4.19: resolution: {integrity: sha512-W/7Fc9KUkajFU8dBeDluM4sRGc/aa4YJnOYck8dkjgZoXtVsn3OeTGni66FV1l3+nvPA7VBFYtPioaGKUmEADw==} peerDependencies: @@ -14146,6 +13832,9 @@ packages: web-vitals@2.1.4: resolution: {integrity: sha512-sVWcwhU5mX6crfI5Vd2dC4qchyTqxV8URinzt25XqVh+bHEPGH4C3NPrNionCP7Obx59wrYEbNlw4Z8sjALzZg==} + web-worker@1.5.0: + resolution: {integrity: sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==} + webcrypto-core@1.7.8: resolution: {integrity: sha512-eBR98r9nQXTqXt/yDRtInszPMjTaSAMJAFDg2AHsgrnczawT1asx9YNBX6k5p+MekbPF4+s/UJJrr88zsTqkSg==} @@ -14270,9 +13959,6 @@ packages: engines: {node: '>= 8'} hasBin: true - wicked-good-xpath@1.3.0: - resolution: {integrity: sha512-Gd9+TUn5nXdwj/hFsPVx5cuHHiF5Bwuc30jZ4+ronF1qHK5O7HD0sgmXWSEgwKquT3ClLoKPVbO6qGwVwLzvAw==} - widest-line@3.1.0: resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} engines: {node: '>=8'} @@ -14526,24 +14212,6 @@ packages: react: optional: true - zustand@5.0.11: - resolution: {integrity: sha512-fdZY+dk7zn/vbWNCYmzZULHRrss0jx5pPFiOuMZ/5HJN6Yv3u+1Wswy/4MpZEkEGhtNH+pwxZB8OKgUBPzYAGg==} - engines: {node: '>=12.20.0'} - peerDependencies: - '@types/react': '>=18.0.0' - immer: '>=9.0.6' - react: '>=18.0.0' - use-sync-external-store: '>=1.2.0' - peerDependenciesMeta: - '@types/react': - optional: true - immer: - optional: true - react: - optional: true - use-sync-external-store: - optional: true - zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} @@ -14570,11 +14238,6 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@antfu/install-pkg@1.1.0': - dependencies: - package-manager-detector: 1.6.0 - tinyexec: 1.0.2 - '@apideck/better-ajv-errors@0.3.6(ajv@8.12.0)': dependencies: ajv: 8.12.0 @@ -15805,7 +15468,7 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@braintree/sanitize-url@7.1.2': {} + '@braintree/sanitize-url@6.0.4': {} '@changesets/apply-release-plan@7.0.0': dependencies: @@ -15955,23 +15618,6 @@ snapshots: human-id: 1.0.2 prettier: 2.8.8 - '@chevrotain/cst-dts-gen@11.1.1': - dependencies: - '@chevrotain/gast': 11.1.1 - '@chevrotain/types': 11.1.1 - lodash-es: 4.17.23 - - '@chevrotain/gast@11.1.1': - dependencies: - '@chevrotain/types': 11.1.1 - lodash-es: 4.17.23 - - '@chevrotain/regexp-to-ast@11.1.1': {} - - '@chevrotain/types@11.1.1': {} - - '@chevrotain/utils@11.1.1': {} - '@coasys/ad4m-connect@0.8.1(esbuild@0.27.3)': dependencies: '@undecaf/barcode-detector-polyfill': 0.9.20 @@ -16411,35 +16057,6 @@ snapshots: '@eslint/js@8.57.0': {} - '@floating-ui/core@1.7.4': - dependencies: - '@floating-ui/utils': 0.2.10 - - '@floating-ui/dom@1.7.5': - dependencies: - '@floating-ui/core': 1.7.4 - '@floating-ui/utils': 0.2.10 - - '@floating-ui/react-dom@2.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@floating-ui/dom': 1.7.5 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@floating-ui/react@0.26.28(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@floating-ui/react-dom': 2.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@floating-ui/utils': 0.2.10 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - tabbable: 6.4.0 - - '@floating-ui/utils@0.2.10': {} - - '@formatjs/intl-localematcher@0.6.2': - dependencies: - tslib: 2.8.1 - '@graphql-tools/merge@8.4.2(graphql@15.7.2(patch_hash=nr4gprddtjag7fz5nm4wirqs4q))': dependencies: '@graphql-tools/utils': 9.2.1(graphql@15.7.2(patch_hash=nr4gprddtjag7fz5nm4wirqs4q)) @@ -16464,15 +16081,12 @@ snapshots: dependencies: graphql: 15.7.2(patch_hash=nr4gprddtjag7fz5nm4wirqs4q) - '@headlessui/react@2.2.9(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@headlessui/react@1.7.19(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: - '@floating-ui/react': 0.26.28(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@react-aria/focus': 3.21.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@react-aria/interactions': 3.27.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@tanstack/react-virtual': 3.13.18(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + client-only: 0.0.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - use-sync-external-store: 1.6.0(react@18.2.0) '@holochain/client@0.16.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: @@ -16534,14 +16148,6 @@ snapshots: '@iarna/toml@2.2.5': {} - '@iconify/types@2.0.0': {} - - '@iconify/utils@3.1.0': - dependencies: - '@antfu/install-pkg': 1.1.0 - '@iconify/types': 2.0.0 - mlly: 1.8.0 - '@ioredis/commands@1.2.0': {} '@isaacs/cliui@8.0.2': @@ -16553,8 +16159,6 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@isaacs/cliui@9.0.0': {} - '@istanbuljs/load-nyc-config@1.1.0': dependencies: camelcase: 5.3.1 @@ -16988,39 +16592,33 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 - '@mdx-js/mdx@3.1.1': + '@mdx-js/mdx@2.3.0': dependencies: - '@types/estree': 1.0.8 '@types/estree-jsx': 1.0.5 - '@types/hast': 3.0.4 '@types/mdx': 2.0.13 - acorn: 8.11.3 - collapse-white-space: 2.1.0 - devlop: 1.1.0 - estree-util-is-identifier-name: 3.0.0 - estree-util-scope: 1.0.0 + estree-util-build-jsx: 2.2.2 + estree-util-is-identifier-name: 2.1.0 + estree-util-to-js: 1.2.0 estree-walker: 3.0.3 - hast-util-to-jsx-runtime: 2.3.6 - markdown-extensions: 2.0.0 - recma-build-jsx: 1.0.0 - recma-jsx: 1.0.1(acorn@8.11.3) - recma-stringify: 1.0.0 - rehype-recma: 1.0.0 - remark-mdx: 3.1.1 - remark-parse: 11.0.0 - remark-rehype: 11.1.2 - source-map: 0.7.4 - unified: 11.0.5 - unist-util-position-from-estree: 2.0.0 - unist-util-stringify-position: 4.0.0 - unist-util-visit: 5.1.0 - vfile: 6.0.3 + hast-util-to-estree: 2.3.3 + markdown-extensions: 1.1.1 + periscopic: 3.1.0 + remark-mdx: 2.3.0 + remark-parse: 10.0.2 + remark-rehype: 10.1.0 + unified: 10.1.2 + unist-util-position-from-estree: 1.1.2 + unist-util-stringify-position: 3.0.3 + unist-util-visit: 4.1.2 + vfile: 5.3.7 transitivePeerDependencies: - supports-color - '@mermaid-js/parser@1.0.0': + '@mdx-js/react@2.3.0(react@18.2.0)': dependencies: - langium: 4.2.1 + '@types/mdx': 2.0.13 + '@types/react': 18.2.55 + react: 18.2.0 '@metamask/safe-event-emitter@2.0.0': {} @@ -17401,55 +16999,6 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@react-aria/focus@3.21.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@react-aria/interactions': 3.27.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@react-aria/utils': 3.33.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@react-types/shared': 3.33.0(react@18.2.0) - '@swc/helpers': 0.5.2 - clsx: 2.1.1 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@react-aria/interactions@3.27.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@react-aria/ssr': 3.9.10(react@18.2.0) - '@react-aria/utils': 3.33.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@react-stately/flags': 3.1.2 - '@react-types/shared': 3.33.0(react@18.2.0) - '@swc/helpers': 0.5.2 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@react-aria/ssr@3.9.10(react@18.2.0)': - dependencies: - '@swc/helpers': 0.5.2 - react: 18.2.0 - - '@react-aria/utils@3.33.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@react-aria/ssr': 3.9.10(react@18.2.0) - '@react-stately/flags': 3.1.2 - '@react-stately/utils': 3.11.0(react@18.2.0) - '@react-types/shared': 3.33.0(react@18.2.0) - '@swc/helpers': 0.5.2 - clsx: 2.1.1 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@react-stately/flags@3.1.2': - dependencies: - '@swc/helpers': 0.5.2 - - '@react-stately/utils@3.11.0(react@18.2.0)': - dependencies: - '@swc/helpers': 0.5.2 - react: 18.2.0 - - '@react-types/shared@3.33.0(react@18.2.0)': - dependencies: - react: 18.2.0 - '@remix-run/router@1.14.2': {} '@rolldown/binding-android-arm64@1.0.0-beta.57': @@ -17715,48 +17264,6 @@ snapshots: '@noble/hashes': 1.3.2 '@scure/base': 1.1.5 - '@shikijs/core@3.22.0': - dependencies: - '@shikijs/types': 3.22.0 - '@shikijs/vscode-textmate': 10.0.2 - '@types/hast': 3.0.4 - hast-util-to-html: 9.0.5 - - '@shikijs/engine-javascript@3.22.0': - dependencies: - '@shikijs/types': 3.22.0 - '@shikijs/vscode-textmate': 10.0.2 - oniguruma-to-es: 4.3.4 - - '@shikijs/engine-oniguruma@3.22.0': - dependencies: - '@shikijs/types': 3.22.0 - '@shikijs/vscode-textmate': 10.0.2 - - '@shikijs/langs@3.22.0': - dependencies: - '@shikijs/types': 3.22.0 - - '@shikijs/themes@3.22.0': - dependencies: - '@shikijs/types': 3.22.0 - - '@shikijs/twoslash@3.22.0(typescript@4.9.5)': - dependencies: - '@shikijs/core': 3.22.0 - '@shikijs/types': 3.22.0 - twoslash: 0.3.6(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - - '@shikijs/types@3.22.0': - dependencies: - '@shikijs/vscode-textmate': 10.0.2 - '@types/hast': 3.0.4 - - '@shikijs/vscode-textmate@10.0.2': {} - '@sinclair/typebox@0.24.51': {} '@sinclair/typebox@0.27.8': {} @@ -18180,27 +17687,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@theguild/remark-mermaid@0.3.0(react@18.2.0)': + '@theguild/remark-mermaid@0.0.5(react@18.2.0)': dependencies: - mermaid: 11.12.3 + mermaid: 10.9.5 react: 18.2.0 unist-util-visit: 5.1.0 + transitivePeerDependencies: + - supports-color - '@theguild/remark-npm2yarn@0.3.3': + '@theguild/remark-npm2yarn@0.2.1': dependencies: - npm-to-yarn: 3.0.1 + npm-to-yarn: 2.2.1 unist-util-visit: 5.1.0 '@tootallnate/once@1.1.2': {} '@trysound/sax@0.2.0': {} - '@ts-morph/common@0.28.1': - dependencies: - minimatch: 10.2.1 - path-browserify: 1.0.1 - tinyglobby: 0.2.15 - '@tsconfig/node10@1.0.9': {} '@tsconfig/node12@1.0.11': {} @@ -18216,6 +17719,10 @@ snapshots: tslib: 2.8.1 optional: true + '@types/acorn@4.0.6': + dependencies: + '@types/estree': 1.0.8 + '@types/aria-query@5.0.4': {} '@types/babel__core@7.20.5': @@ -18270,123 +17777,14 @@ snapshots: dependencies: '@types/node': 16.18.76 - '@types/d3-array@3.2.2': {} - - '@types/d3-axis@3.0.6': - dependencies: - '@types/d3-selection': 3.0.11 - - '@types/d3-brush@3.0.6': - dependencies: - '@types/d3-selection': 3.0.11 - - '@types/d3-chord@3.0.6': {} - - '@types/d3-color@3.1.3': {} - - '@types/d3-contour@3.0.6': - dependencies: - '@types/d3-array': 3.2.2 - '@types/geojson': 7946.0.16 - - '@types/d3-delaunay@6.0.4': {} - - '@types/d3-dispatch@3.0.7': {} - - '@types/d3-drag@3.0.7': - dependencies: - '@types/d3-selection': 3.0.11 - - '@types/d3-dsv@3.0.7': {} - - '@types/d3-ease@3.0.2': {} - - '@types/d3-fetch@3.0.7': - dependencies: - '@types/d3-dsv': 3.0.7 - - '@types/d3-force@3.0.10': {} - - '@types/d3-format@3.0.4': {} - - '@types/d3-geo@3.1.0': - dependencies: - '@types/geojson': 7946.0.16 - - '@types/d3-hierarchy@3.1.7': {} - - '@types/d3-interpolate@3.0.4': - dependencies: - '@types/d3-color': 3.1.3 - - '@types/d3-path@3.1.1': {} - - '@types/d3-polygon@3.0.2': {} - - '@types/d3-quadtree@3.0.6': {} - - '@types/d3-random@3.0.3': {} - '@types/d3-scale-chromatic@3.1.0': {} '@types/d3-scale@4.0.9': dependencies: '@types/d3-time': 3.0.4 - '@types/d3-selection@3.0.11': {} - - '@types/d3-shape@3.1.8': - dependencies: - '@types/d3-path': 3.1.1 - - '@types/d3-time-format@4.0.3': {} - '@types/d3-time@3.0.4': {} - '@types/d3-timer@3.0.2': {} - - '@types/d3-transition@3.0.9': - dependencies: - '@types/d3-selection': 3.0.11 - - '@types/d3-zoom@3.0.8': - dependencies: - '@types/d3-interpolate': 3.0.4 - '@types/d3-selection': 3.0.11 - - '@types/d3@7.4.3': - dependencies: - '@types/d3-array': 3.2.2 - '@types/d3-axis': 3.0.6 - '@types/d3-brush': 3.0.6 - '@types/d3-chord': 3.0.6 - '@types/d3-color': 3.1.3 - '@types/d3-contour': 3.0.6 - '@types/d3-delaunay': 6.0.4 - '@types/d3-dispatch': 3.0.7 - '@types/d3-drag': 3.0.7 - '@types/d3-dsv': 3.0.7 - '@types/d3-ease': 3.0.2 - '@types/d3-fetch': 3.0.7 - '@types/d3-force': 3.0.10 - '@types/d3-format': 3.0.4 - '@types/d3-geo': 3.1.0 - '@types/d3-hierarchy': 3.1.7 - '@types/d3-interpolate': 3.0.4 - '@types/d3-path': 3.1.1 - '@types/d3-polygon': 3.0.2 - '@types/d3-quadtree': 3.0.6 - '@types/d3-random': 3.0.3 - '@types/d3-scale': 4.0.9 - '@types/d3-scale-chromatic': 3.1.0 - '@types/d3-selection': 3.0.11 - '@types/d3-shape': 3.1.8 - '@types/d3-time': 3.0.4 - '@types/d3-time-format': 4.0.3 - '@types/d3-timer': 3.0.2 - '@types/d3-transition': 3.0.9 - '@types/d3-zoom': 3.0.8 - '@types/debug@4.1.12': dependencies: '@types/ms': 0.7.34 @@ -18435,8 +17833,6 @@ snapshots: dependencies: '@types/node': 16.18.76 - '@types/geojson@7946.0.16': {} - '@types/glob@7.2.0': dependencies: '@types/minimatch': 5.1.2 @@ -18446,6 +17842,10 @@ snapshots: dependencies: '@types/node': 16.18.76 + '@types/hast@2.3.10': + dependencies: + '@types/unist': 2.0.10 + '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 @@ -18529,10 +17929,6 @@ snapshots: '@types/ms@0.7.34': {} - '@types/nlcst@2.0.3': - dependencies: - '@types/unist': 3.0.3 - '@types/node-fetch@2.6.11': dependencies: '@types/node': 16.18.76 @@ -18802,13 +18198,6 @@ snapshots: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 - '@typescript/vfs@1.6.3(typescript@4.9.5)': - dependencies: - debug: 4.3.4(supports-color@8.1.1) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - '@undecaf/barcode-detector-polyfill@0.9.20': dependencies: '@undecaf/zbar-wasm': 0.9.16 @@ -19439,8 +18828,6 @@ snapshots: dependencies: tslib: 2.6.2 - '@xmldom/xmldom@0.9.8': {} - '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} @@ -19486,10 +18873,6 @@ snapshots: dependencies: acorn: 8.11.3 - acorn-jsx@5.3.2(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - acorn-jsx@5.3.2(acorn@8.15.0): dependencies: acorn: 8.15.0 @@ -19715,6 +19098,10 @@ snapshots: ts-invariant: 0.4.4 tslib: 1.14.1 + arch@2.2.0: {} + + arg@1.0.0: {} + arg@4.1.3: {} arg@5.0.2: {} @@ -19750,8 +19137,6 @@ snapshots: get-intrinsic: 1.2.2 is-string: 1.0.7 - array-iterate@2.0.1: {} - array-union@2.1.0: {} array.prototype.findlastindex@1.2.3: @@ -20066,10 +19451,6 @@ snapshots: balanced-match@1.0.2: {} - balanced-match@4.0.2: - dependencies: - jackspeak: 4.2.3 - base-x@3.0.9: dependencies: safe-buffer: 5.2.1(patch_hash=qcepvj3ww73f2shgrehxggbrbq) @@ -20088,11 +19469,6 @@ snapshots: dependencies: is-windows: 1.0.2 - better-react-mathjax@2.3.0(react@18.2.0): - dependencies: - mathjax-full: 3.2.2 - react: 18.2.0 - bfj@7.1.0: dependencies: bluebird: 3.7.2 @@ -20221,10 +19597,6 @@ snapshots: dependencies: balanced-match: 1.0.2 - brace-expansion@5.0.2: - dependencies: - balanced-match: 4.0.2 - braces@3.0.2: dependencies: fill-range: 7.0.1 @@ -20537,6 +19909,12 @@ snapshots: strip-ansi: 3.0.1 supports-color: 2.0.0 + chalk@2.3.0: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 4.5.0 + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -20622,20 +20000,6 @@ snapshots: parse5: 7.1.2 parse5-htmlparser2-tree-adapter: 7.0.0 - chevrotain-allstar@0.3.1(chevrotain@11.1.1): - dependencies: - chevrotain: 11.1.1 - lodash-es: 4.17.23 - - chevrotain@11.1.1: - dependencies: - '@chevrotain/cst-dts-gen': 11.1.1 - '@chevrotain/gast': 11.1.1 - '@chevrotain/regexp-to-ast': 11.1.1 - '@chevrotain/types': 11.1.1 - '@chevrotain/utils': 11.1.1 - lodash-es: 4.17.23 - chokidar@3.5.3: dependencies: anymatch: 3.1.3 @@ -20703,6 +20067,11 @@ snapshots: client-only@0.0.1: {} + clipboardy@1.2.2: + dependencies: + arch: 2.2.0 + execa: 0.8.0 + clipboardy@4.0.0: dependencies: execa: 8.0.1 @@ -20747,12 +20116,8 @@ snapshots: chalk: 2.4.2 q: 1.5.1 - code-block-writer@13.0.3: {} - code-point-at@1.1.0: {} - collapse-white-space@2.1.0: {} - collect-v8-coverage@1.0.2: {} color-convert@1.9.3: @@ -20794,8 +20159,6 @@ snapshots: comma-separated-tokens@2.0.3: {} - commander@13.1.0: {} - commander@14.0.3: {} commander@2.20.3: {} @@ -20858,8 +20221,6 @@ snapshots: dependencies: source-map: 0.6.1 - confbox@0.1.8: {} - config-chain@1.1.13: dependencies: ini: 1.3.8 @@ -20938,10 +20299,6 @@ snapshots: dependencies: layout-base: 1.0.2 - cose-base@2.2.0: - dependencies: - layout-base: 2.0.1 - cosmiconfig@5.2.1: dependencies: import-fresh: 2.0.0 @@ -21303,11 +20660,6 @@ snapshots: cose-base: 1.0.3 cytoscape: 3.33.1 - cytoscape-fcose@2.2.0(cytoscape@3.33.1): - dependencies: - cose-base: 2.2.0 - cytoscape: 3.33.1 - cytoscape@3.33.1: {} d3-array@2.12.1: @@ -21879,6 +21231,8 @@ snapshots: elegant-spinner@1.0.1: {} + elkjs@0.9.3: {} + elliptic@6.5.4: dependencies: bn.js: 4.12.0(patch_hash=mdjtmbbjulugflauukpfkw6p4q) @@ -22068,20 +21422,6 @@ snapshots: dependencies: es6-promise: 4.2.8 - esast-util-from-estree@2.0.0: - dependencies: - '@types/estree-jsx': 1.0.5 - devlop: 1.1.0 - estree-util-visit: 2.0.0 - unist-util-position-from-estree: 2.0.0 - - esast-util-from-js@2.0.1: - dependencies: - '@types/estree-jsx': 1.0.5 - acorn: 8.15.0 - esast-util-from-estree: 2.0.0 - vfile-message: 4.0.3 - esbuild-android-64@0.15.18: optional: true @@ -22618,8 +21958,6 @@ snapshots: transitivePeerDependencies: - supports-color - esm@3.2.25: {} - espree@9.6.1: dependencies: acorn: 8.15.0 @@ -22642,27 +21980,19 @@ snapshots: estraverse@5.3.0: {} - estree-util-attach-comments@3.0.0: + estree-util-attach-comments@2.1.1: dependencies: '@types/estree': 1.0.8 - estree-util-build-jsx@3.0.1: + estree-util-build-jsx@2.2.2: dependencies: '@types/estree-jsx': 1.0.5 - devlop: 1.1.0 - estree-util-is-identifier-name: 3.0.0 + estree-util-is-identifier-name: 2.1.0 estree-walker: 3.0.3 estree-util-is-identifier-name@2.1.0: {} - estree-util-is-identifier-name@3.0.0: {} - - estree-util-scope@1.0.0: - dependencies: - '@types/estree': 1.0.8 - devlop: 1.1.0 - - estree-util-to-js@2.0.0: + estree-util-to-js@1.2.0: dependencies: '@types/estree-jsx': 1.0.5 astring: 1.9.0 @@ -22672,10 +22002,10 @@ snapshots: dependencies: '@types/estree': 1.0.8 - estree-util-visit@2.0.0: + estree-util-visit@1.2.1: dependencies: '@types/estree-jsx': 1.0.5 - '@types/unist': 3.0.3 + '@types/unist': 2.0.10 estree-walker@0.6.1: {} @@ -22732,6 +22062,16 @@ snapshots: md5.js: 1.3.5 safe-buffer: 5.2.1(patch_hash=qcepvj3ww73f2shgrehxggbrbq) + execa@0.8.0: + dependencies: + cross-spawn: 5.1.0 + get-stream: 3.0.0 + is-stream: 1.1.0 + npm-run-path: 2.0.2 + p-finally: 1.0.0 + signal-exit: 3.0.7 + strip-eof: 1.0.0 + execa@5.1.1: dependencies: cross-spawn: 7.0.3 @@ -22847,6 +22187,10 @@ snapshots: transitivePeerDependencies: - supports-color + extend-shallow@2.0.1: + dependencies: + is-extendable: 0.1.1 + extend@3.0.2: {} extendable-error@0.1.7: {} @@ -22905,10 +22249,6 @@ snapshots: dependencies: format: 0.2.2 - fault@2.0.1: - dependencies: - format: 0.2.2 - faye-websocket@0.10.0: dependencies: websocket-driver: 0.7.4 @@ -22925,10 +22265,6 @@ snapshots: dependencies: pend: 1.2.0 - fdir@6.5.0(picomatch@4.0.3): - optionalDependencies: - picomatch: 4.0.3 - fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 @@ -23041,11 +22377,15 @@ snapshots: flatted@3.3.1: {} + flexsearch@0.7.43: {} + fluent-ffmpeg@2.1.3: dependencies: async: 0.2.10 which: 1.3.1 + focus-visible@5.2.1: {} + follow-redirects@1.15.5: {} for-each@0.3.3: @@ -23232,6 +22572,8 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + get-stream@3.0.0: {} + get-stream@4.1.0: dependencies: pump: 3.0.0 @@ -23257,6 +22599,15 @@ snapshots: dependencies: assert-plus: 1.0.0 + git-up@7.0.0: + dependencies: + is-ssh: 1.4.1 + parse-url: 8.1.0 + + git-url-parse@13.1.1: + dependencies: + git-up: 7.0.0 + gitbook-plugin-fontsettings@2.0.0: {} gitbook-plugin-livereload@0.0.1: {} @@ -23457,6 +22808,13 @@ snapshots: graphql@15.7.2(patch_hash=nr4gprddtjag7fz5nm4wirqs4q): {} + gray-matter@4.0.3: + dependencies: + js-yaml: 3.14.1 + kind-of: 6.0.3 + section-matter: 1.0.0 + strip-bom-string: 1.0.0 + growly@1.3.0: optional: true @@ -23476,8 +22834,6 @@ snapshots: uncrypto: 0.1.3 unenv: 1.9.0 - hachure-fill@0.5.2: {} - handle-thing@2.0.1: {} handlebars@4.7.8: @@ -23508,6 +22864,8 @@ snapshots: has-flag@1.0.0: {} + has-flag@2.0.0: {} + has-flag@3.0.0: {} has-flag@4.0.0: {} @@ -23540,6 +22898,12 @@ snapshots: readable-stream: 3.6.2 safe-buffer: 5.2.1(patch_hash=qcepvj3ww73f2shgrehxggbrbq) + hash-obj@4.0.0: + dependencies: + is-obj: 3.0.0 + sort-keys: 5.1.0 + type-fest: 1.4.0 + hash.js@1.1.7: dependencies: inherits: 2.0.4 @@ -23610,61 +22974,26 @@ snapshots: web-namespaces: 2.0.1 zwitch: 2.0.4 - hast-util-to-estree@3.1.3: + hast-util-to-estree@2.3.3: dependencies: '@types/estree': 1.0.8 '@types/estree-jsx': 1.0.5 - '@types/hast': 3.0.4 + '@types/hast': 2.3.10 + '@types/unist': 2.0.10 comma-separated-tokens: 2.0.3 - devlop: 1.1.0 - estree-util-attach-comments: 3.0.0 - estree-util-is-identifier-name: 3.0.0 - hast-util-whitespace: 3.0.0 - mdast-util-mdx-expression: 2.0.1 - mdast-util-mdx-jsx: 3.2.0 - mdast-util-mdxjs-esm: 2.0.1 - property-information: 7.1.0 + estree-util-attach-comments: 2.1.1 + estree-util-is-identifier-name: 2.1.0 + hast-util-whitespace: 2.0.1 + mdast-util-mdx-expression: 1.3.2 + mdast-util-mdxjs-esm: 1.3.1 + property-information: 6.5.0 space-separated-tokens: 2.0.2 - style-to-js: 1.1.21 - unist-util-position: 5.0.0 + style-to-object: 0.4.4 + unist-util-position: 4.0.4 zwitch: 2.0.4 transitivePeerDependencies: - supports-color - hast-util-to-html@9.0.5: - dependencies: - '@types/hast': 3.0.4 - '@types/unist': 3.0.3 - ccount: 2.0.1 - comma-separated-tokens: 2.0.3 - hast-util-whitespace: 3.0.0 - html-void-elements: 3.0.0 - mdast-util-to-hast: 13.2.1 - property-information: 7.1.0 - space-separated-tokens: 2.0.2 - stringify-entities: 4.0.4 - zwitch: 2.0.4 - - hast-util-to-jsx-runtime@2.3.6: - dependencies: - '@types/estree': 1.0.8 - '@types/hast': 3.0.4 - '@types/unist': 3.0.3 - comma-separated-tokens: 2.0.3 - devlop: 1.1.0 - estree-util-is-identifier-name: 3.0.0 - hast-util-whitespace: 3.0.0 - mdast-util-mdx-expression: 2.0.1 - mdast-util-mdx-jsx: 3.2.0 - mdast-util-mdxjs-esm: 2.0.1 - property-information: 7.1.0 - space-separated-tokens: 2.0.2 - style-to-js: 1.1.21 - unist-util-position: 5.0.0 - vfile-message: 4.0.3 - transitivePeerDependencies: - - supports-color - hast-util-to-parse5@8.0.1: dependencies: '@types/hast': 3.0.4 @@ -23675,10 +23004,6 @@ snapshots: web-namespaces: 2.0.1 zwitch: 2.0.4 - hast-util-to-string@3.0.1: - dependencies: - '@types/hast': 3.0.4 - hast-util-to-text@4.0.2: dependencies: '@types/hast': 3.0.4 @@ -23686,9 +23011,7 @@ snapshots: hast-util-is-element: 3.0.0 unist-util-find-after: 5.0.0 - hast-util-whitespace@3.0.0: - dependencies: - '@types/hast': 3.0.4 + hast-util-whitespace@2.0.1: {} hastscript@9.0.1: dependencies: @@ -24063,7 +23386,7 @@ snapshots: dependencies: source-map: 0.5.7 - inline-style-parser@0.2.7: {} + inline-style-parser@0.1.1: {} inquirer-autosubmit-prompt@0.2.0: dependencies: @@ -24126,6 +23449,8 @@ snapshots: internmap@2.0.3: {} + intersection-observer@0.12.2: {} + invariant@2.2.4: dependencies: loose-envify: 1.4.0 @@ -24241,6 +23566,8 @@ snapshots: is-docker@3.0.0: {} + is-extendable@0.1.1: {} + is-extglob@2.1.1: {} is-finalizationregistry@1.0.2: @@ -24305,6 +23632,8 @@ snapshots: is-obj@2.0.0: {} + is-obj@3.0.0: {} + is-observable@1.1.0: dependencies: symbol-observable: 1.2.0 @@ -24331,6 +23660,10 @@ snapshots: dependencies: '@types/estree': 1.0.5 + is-reference@3.0.3: + dependencies: + '@types/estree': 1.0.8 + is-regex@1.1.4: dependencies: call-bind: 1.0.5 @@ -24352,6 +23685,10 @@ snapshots: dependencies: call-bind: 1.0.5 + is-ssh@1.4.1: + dependencies: + protocols: 2.0.2 + is-stream@1.1.0: {} is-stream@2.0.1: {} @@ -24499,10 +23836,6 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.2.3: - dependencies: - '@isaacs/cliui': 9.0.0 - jake@10.8.7: dependencies: async: 3.2.5 @@ -25474,14 +24807,6 @@ snapshots: inherits: 2.0.4 stream-splicer: 2.0.1 - langium@4.2.1: - dependencies: - chevrotain: 11.1.1 - chevrotain-allstar: 0.3.1(chevrotain@11.1.1) - vscode-languageserver: 9.0.1 - vscode-languageserver-textdocument: 1.0.12 - vscode-uri: 3.1.0 - language-subtag-registry@0.3.22: {} language-tags@1.0.9: @@ -25499,8 +24824,6 @@ snapshots: layout-base@1.0.2: {} - layout-base@2.0.1: {} - leven@3.1.0: {} levn@0.3.0: @@ -25790,7 +25113,7 @@ snapshots: map-obj@4.3.0: {} - markdown-extensions@2.0.0: {} + markdown-extensions@1.1.1: {} markdown-table@2.0.0: dependencies: @@ -25798,10 +25121,13 @@ snapshots: markdown-table@3.0.4: {} - marked@16.4.2: {} - marked@4.3.0: {} + match-sorter@6.3.4: + dependencies: + '@babel/runtime': 7.24.1 + remove-accents: 0.5.0 + matcher@3.0.0: dependencies: escape-string-regexp: 4.0.0 @@ -25809,13 +25135,6 @@ snapshots: math-intrinsics@1.1.0: {} - mathjax-full@3.2.2: - dependencies: - esm: 3.2.25 - mhchemparser: 4.2.1 - mj-context-menu: 0.6.1 - speech-rule-engine: 4.1.2 - mcporter@0.7.3: dependencies: '@iarna/toml': 2.2.5 @@ -25843,18 +25162,24 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + mdast-util-definitions@5.1.2: + dependencies: + '@types/mdast': 3.0.15 + '@types/unist': 2.0.10 + unist-util-visit: 4.1.2 + mdast-util-find-and-replace@1.1.1: dependencies: escape-string-regexp: 4.0.0 unist-util-is: 4.1.0 unist-util-visit-parents: 3.1.1 - mdast-util-find-and-replace@3.0.2: + mdast-util-find-and-replace@2.2.2: dependencies: - '@types/mdast': 4.0.4 + '@types/mdast': 3.0.15 escape-string-regexp: 5.0.0 - unist-util-is: 6.0.1 - unist-util-visit-parents: 6.0.2 + unist-util-is: 5.2.1 + unist-util-visit-parents: 5.1.3 mdast-util-footnote@0.1.7: dependencies: @@ -25873,20 +25198,20 @@ snapshots: transitivePeerDependencies: - supports-color - mdast-util-from-markdown@2.0.2: + mdast-util-from-markdown@1.3.1: dependencies: - '@types/mdast': 4.0.4 - '@types/unist': 3.0.3 + '@types/mdast': 3.0.15 + '@types/unist': 2.0.10 decode-named-character-reference: 1.3.0 - devlop: 1.1.0 - mdast-util-to-string: 4.0.0 - micromark: 4.0.2 - micromark-util-decode-numeric-character-reference: 2.0.2 - micromark-util-decode-string: 2.0.1 - micromark-util-normalize-identifier: 2.0.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - unist-util-stringify-position: 4.0.0 + mdast-util-to-string: 3.2.0 + micromark: 3.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-decode-string: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + unist-util-stringify-position: 3.0.3 + uvu: 0.5.6 transitivePeerDependencies: - supports-color @@ -25894,17 +25219,6 @@ snapshots: dependencies: micromark-extension-frontmatter: 0.2.2 - mdast-util-frontmatter@2.0.1: - dependencies: - '@types/mdast': 4.0.4 - devlop: 1.1.0 - escape-string-regexp: 5.0.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 - micromark-extension-frontmatter: 2.0.0 - transitivePeerDependencies: - - supports-color - mdast-util-gfm-autolink-literal@0.1.3: dependencies: ccount: 1.1.0 @@ -25913,48 +25227,39 @@ snapshots: transitivePeerDependencies: - supports-color - mdast-util-gfm-autolink-literal@2.0.1: + mdast-util-gfm-autolink-literal@1.0.3: dependencies: - '@types/mdast': 4.0.4 + '@types/mdast': 3.0.15 ccount: 2.0.1 - devlop: 1.1.0 - mdast-util-find-and-replace: 3.0.2 - micromark-util-character: 2.1.1 + mdast-util-find-and-replace: 2.2.2 + micromark-util-character: 1.2.0 - mdast-util-gfm-footnote@2.1.0: + mdast-util-gfm-footnote@1.0.2: dependencies: - '@types/mdast': 4.0.4 - devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 - micromark-util-normalize-identifier: 2.0.1 - transitivePeerDependencies: - - supports-color + '@types/mdast': 3.0.15 + mdast-util-to-markdown: 1.5.0 + micromark-util-normalize-identifier: 1.1.0 mdast-util-gfm-strikethrough@0.2.3: dependencies: mdast-util-to-markdown: 0.6.5 - mdast-util-gfm-strikethrough@2.0.0: + mdast-util-gfm-strikethrough@1.0.3: dependencies: - '@types/mdast': 4.0.4 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 - transitivePeerDependencies: - - supports-color + '@types/mdast': 3.0.15 + mdast-util-to-markdown: 1.5.0 mdast-util-gfm-table@0.1.6: dependencies: markdown-table: 2.0.0 mdast-util-to-markdown: 0.6.5 - mdast-util-gfm-table@2.0.0: + mdast-util-gfm-table@1.0.7: dependencies: - '@types/mdast': 4.0.4 - devlop: 1.1.0 + '@types/mdast': 3.0.15 markdown-table: 3.0.4 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 + mdast-util-from-markdown: 1.3.1 + mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color @@ -25962,14 +25267,10 @@ snapshots: dependencies: mdast-util-to-markdown: 0.6.5 - mdast-util-gfm-task-list-item@2.0.0: + mdast-util-gfm-task-list-item@1.0.2: dependencies: - '@types/mdast': 4.0.4 - devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 - transitivePeerDependencies: - - supports-color + '@types/mdast': 3.0.15 + mdast-util-to-markdown: 1.5.0 mdast-util-gfm@0.1.2: dependencies: @@ -25981,83 +25282,86 @@ snapshots: transitivePeerDependencies: - supports-color - mdast-util-gfm@3.1.0: + mdast-util-gfm@2.0.2: dependencies: - mdast-util-from-markdown: 2.0.2 - mdast-util-gfm-autolink-literal: 2.0.1 - mdast-util-gfm-footnote: 2.1.0 - mdast-util-gfm-strikethrough: 2.0.0 - mdast-util-gfm-table: 2.0.0 - mdast-util-gfm-task-list-item: 2.0.0 - mdast-util-to-markdown: 2.1.2 + mdast-util-from-markdown: 1.3.1 + mdast-util-gfm-autolink-literal: 1.0.3 + mdast-util-gfm-footnote: 1.0.2 + mdast-util-gfm-strikethrough: 1.0.3 + mdast-util-gfm-table: 1.0.7 + mdast-util-gfm-task-list-item: 1.0.2 + mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color - mdast-util-math@3.0.0: + mdast-util-math@2.0.2: dependencies: - '@types/hast': 3.0.4 - '@types/mdast': 4.0.4 - devlop: 1.1.0 + '@types/mdast': 3.0.15 longest-streak: 3.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 - unist-util-remove-position: 5.0.0 - transitivePeerDependencies: - - supports-color + mdast-util-to-markdown: 1.5.0 - mdast-util-mdx-expression@2.0.1: + mdast-util-mdx-expression@1.3.2: dependencies: '@types/estree-jsx': 1.0.5 - '@types/hast': 3.0.4 - '@types/mdast': 4.0.4 - devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-from-markdown: 1.3.1 + mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color - mdast-util-mdx-jsx@3.2.0: + mdast-util-mdx-jsx@2.1.4: dependencies: '@types/estree-jsx': 1.0.5 - '@types/hast': 3.0.4 - '@types/mdast': 4.0.4 - '@types/unist': 3.0.3 + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + '@types/unist': 2.0.10 ccount: 2.0.1 - devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 + mdast-util-from-markdown: 1.3.1 + mdast-util-to-markdown: 1.5.0 parse-entities: 4.0.2 stringify-entities: 4.0.4 - unist-util-stringify-position: 4.0.0 - vfile-message: 4.0.3 + unist-util-remove-position: 4.0.2 + unist-util-stringify-position: 3.0.3 + vfile-message: 3.1.4 transitivePeerDependencies: - supports-color - mdast-util-mdx@3.0.0: + mdast-util-mdx@2.0.1: dependencies: - mdast-util-from-markdown: 2.0.2 - mdast-util-mdx-expression: 2.0.1 - mdast-util-mdx-jsx: 3.2.0 - mdast-util-mdxjs-esm: 2.0.1 - mdast-util-to-markdown: 2.1.2 + mdast-util-from-markdown: 1.3.1 + mdast-util-mdx-expression: 1.3.2 + mdast-util-mdx-jsx: 2.1.4 + mdast-util-mdxjs-esm: 1.3.1 + mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color - mdast-util-mdxjs-esm@2.0.1: + mdast-util-mdxjs-esm@1.3.1: dependencies: '@types/estree-jsx': 1.0.5 - '@types/hast': 3.0.4 - '@types/mdast': 4.0.4 - devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-to-markdown: 2.1.2 + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-from-markdown: 1.3.1 + mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color - mdast-util-phrasing@4.1.0: + mdast-util-phrasing@3.0.1: dependencies: - '@types/mdast': 4.0.4 - unist-util-is: 6.0.1 + '@types/mdast': 3.0.15 + unist-util-is: 5.2.1 + + mdast-util-to-hast@12.3.0: + dependencies: + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-definitions: 5.1.2 + micromark-util-sanitize-uri: 1.2.0 + trim-lines: 3.0.1 + unist-util-generated: 2.0.1 + unist-util-position: 4.0.4 + unist-util-visit: 4.1.2 mdast-util-to-hast@13.2.1: dependencies: @@ -26080,23 +25384,22 @@ snapshots: repeat-string: 1.6.1 zwitch: 1.0.5 - mdast-util-to-markdown@2.1.2: + mdast-util-to-markdown@1.5.0: dependencies: - '@types/mdast': 4.0.4 - '@types/unist': 3.0.3 + '@types/mdast': 3.0.15 + '@types/unist': 2.0.10 longest-streak: 3.1.0 - mdast-util-phrasing: 4.1.0 - mdast-util-to-string: 4.0.0 - micromark-util-classify-character: 2.0.1 - micromark-util-decode-string: 2.0.1 - unist-util-visit: 5.1.0 + mdast-util-phrasing: 3.0.1 + mdast-util-to-string: 3.2.0 + micromark-util-decode-string: 1.1.0 + unist-util-visit: 4.1.2 zwitch: 2.0.4 mdast-util-to-string@2.0.0: {} - mdast-util-to-string@4.0.0: + mdast-util-to-string@3.2.0: dependencies: - '@types/mdast': 4.0.4 + '@types/mdast': 3.0.15 mdn-data@2.0.14: {} @@ -26167,51 +25470,51 @@ snapshots: merge2@1.4.1: {} - mermaid@11.12.3: + mermaid@10.9.5: dependencies: - '@braintree/sanitize-url': 7.1.2 - '@iconify/utils': 3.1.0 - '@mermaid-js/parser': 1.0.0 - '@types/d3': 7.4.3 + '@braintree/sanitize-url': 6.0.4 + '@types/d3-scale': 4.0.9 + '@types/d3-scale-chromatic': 3.1.0 cytoscape: 3.33.1 cytoscape-cose-bilkent: 4.1.0(cytoscape@3.33.1) - cytoscape-fcose: 2.2.0(cytoscape@3.33.1) d3: 7.9.0 d3-sankey: 0.12.3 dagre-d3-es: 7.0.13 dayjs: 1.11.19 dompurify: 3.3.1 + elkjs: 0.9.3 katex: 0.16.28 khroma: 2.1.0 lodash-es: 4.17.23 - marked: 16.4.2 - roughjs: 4.6.6 + mdast-util-from-markdown: 1.3.1 + non-layered-tidy-tree-layout: 2.0.2 stylis: 4.3.6 ts-dedent: 2.2.0 - uuid: 11.1.0 + uuid: 9.0.1 + web-worker: 1.5.0 + transitivePeerDependencies: + - supports-color methods@1.1.2: {} - mhchemparser@4.2.1: {} - - micromark-core-commonmark@2.0.3: + micromark-core-commonmark@1.1.0: dependencies: decode-named-character-reference: 1.3.0 - devlop: 1.1.0 - micromark-factory-destination: 2.0.1 - micromark-factory-label: 2.0.1 - micromark-factory-space: 2.0.1 - micromark-factory-title: 2.0.1 - micromark-factory-whitespace: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-chunked: 2.0.1 - micromark-util-classify-character: 2.0.1 - micromark-util-html-tag-name: 2.0.1 - micromark-util-normalize-identifier: 2.0.1 - micromark-util-resolve-all: 2.0.1 - micromark-util-subtokenize: 2.1.0 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-destination: 1.1.0 + micromark-factory-label: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-factory-title: 1.1.0 + micromark-factory-whitespace: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-classify-character: 1.1.0 + micromark-util-html-tag-name: 1.2.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 micromark-extension-footnote@0.3.2: dependencies: @@ -26223,36 +25526,29 @@ snapshots: dependencies: fault: 1.0.4 - micromark-extension-frontmatter@2.0.0: - dependencies: - fault: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - micromark-extension-gfm-autolink-literal@0.5.7: dependencies: micromark: 2.11.4 transitivePeerDependencies: - supports-color - micromark-extension-gfm-autolink-literal@2.1.0: + micromark-extension-gfm-autolink-literal@1.0.5: dependencies: - micromark-util-character: 2.1.1 - micromark-util-sanitize-uri: 2.0.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-character: 1.2.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 - micromark-extension-gfm-footnote@2.1.0: + micromark-extension-gfm-footnote@1.1.2: dependencies: - devlop: 1.1.0 - micromark-core-commonmark: 2.0.3 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-normalize-identifier: 2.0.1 - micromark-util-sanitize-uri: 2.0.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-core-commonmark: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 micromark-extension-gfm-strikethrough@0.6.5: dependencies: @@ -26260,14 +25556,14 @@ snapshots: transitivePeerDependencies: - supports-color - micromark-extension-gfm-strikethrough@2.1.0: + micromark-extension-gfm-strikethrough@1.0.7: dependencies: - devlop: 1.1.0 - micromark-util-chunked: 2.0.1 - micromark-util-classify-character: 2.0.1 - micromark-util-resolve-all: 2.0.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-chunked: 1.1.0 + micromark-util-classify-character: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 micromark-extension-gfm-table@0.4.3: dependencies: @@ -26275,19 +25571,19 @@ snapshots: transitivePeerDependencies: - supports-color - micromark-extension-gfm-table@2.1.1: + micromark-extension-gfm-table@1.0.7: dependencies: - devlop: 1.1.0 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 micromark-extension-gfm-tagfilter@0.3.0: {} - micromark-extension-gfm-tagfilter@2.0.0: + micromark-extension-gfm-tagfilter@1.0.2: dependencies: - micromark-util-types: 2.0.2 + micromark-util-types: 1.1.0 micromark-extension-gfm-task-list-item@0.3.3: dependencies: @@ -26295,13 +25591,13 @@ snapshots: transitivePeerDependencies: - supports-color - micromark-extension-gfm-task-list-item@2.1.0: + micromark-extension-gfm-task-list-item@1.0.5: dependencies: - devlop: 1.1.0 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 micromark-extension-gfm@0.3.3: dependencies: @@ -26314,174 +25610,187 @@ snapshots: transitivePeerDependencies: - supports-color - micromark-extension-gfm@3.0.0: + micromark-extension-gfm@2.0.3: dependencies: - micromark-extension-gfm-autolink-literal: 2.1.0 - micromark-extension-gfm-footnote: 2.1.0 - micromark-extension-gfm-strikethrough: 2.1.0 - micromark-extension-gfm-table: 2.1.1 - micromark-extension-gfm-tagfilter: 2.0.0 - micromark-extension-gfm-task-list-item: 2.1.0 - micromark-util-combine-extensions: 2.0.1 - micromark-util-types: 2.0.2 + micromark-extension-gfm-autolink-literal: 1.0.5 + micromark-extension-gfm-footnote: 1.1.2 + micromark-extension-gfm-strikethrough: 1.0.7 + micromark-extension-gfm-table: 1.0.7 + micromark-extension-gfm-tagfilter: 1.0.2 + micromark-extension-gfm-task-list-item: 1.0.5 + micromark-util-combine-extensions: 1.1.0 + micromark-util-types: 1.1.0 - micromark-extension-math@3.1.0: + micromark-extension-math@2.1.2: dependencies: '@types/katex': 0.16.8 - devlop: 1.1.0 katex: 0.16.28 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 - micromark-extension-mdx-expression@3.0.1: + micromark-extension-mdx-expression@1.0.8: dependencies: '@types/estree': 1.0.8 - devlop: 1.1.0 - micromark-factory-mdx-expression: 2.0.3 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-events-to-acorn: 2.0.3 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-mdx-expression: 1.0.9 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-events-to-acorn: 1.2.3 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 - micromark-extension-mdx-jsx@3.0.2: + micromark-extension-mdx-jsx@1.0.5: dependencies: + '@types/acorn': 4.0.6 '@types/estree': 1.0.8 - devlop: 1.1.0 - estree-util-is-identifier-name: 3.0.0 - micromark-factory-mdx-expression: 2.0.3 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-events-to-acorn: 2.0.3 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - vfile-message: 4.0.3 + estree-util-is-identifier-name: 2.1.0 + micromark-factory-mdx-expression: 1.0.9 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + vfile-message: 3.1.4 - micromark-extension-mdx-md@2.0.0: + micromark-extension-mdx-md@1.0.1: dependencies: - micromark-util-types: 2.0.2 + micromark-util-types: 1.1.0 - micromark-extension-mdxjs-esm@3.0.0: + micromark-extension-mdxjs-esm@1.0.5: dependencies: '@types/estree': 1.0.8 - devlop: 1.1.0 - micromark-core-commonmark: 2.0.3 - micromark-util-character: 2.1.1 - micromark-util-events-to-acorn: 2.0.3 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - unist-util-position-from-estree: 2.0.0 - vfile-message: 4.0.3 + micromark-core-commonmark: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-events-to-acorn: 1.2.3 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + unist-util-position-from-estree: 1.1.2 + uvu: 0.5.6 + vfile-message: 3.1.4 - micromark-extension-mdxjs@3.0.0: + micromark-extension-mdxjs@1.0.1: dependencies: acorn: 8.15.0 acorn-jsx: 5.3.2(acorn@8.15.0) - micromark-extension-mdx-expression: 3.0.1 - micromark-extension-mdx-jsx: 3.0.2 - micromark-extension-mdx-md: 2.0.0 - micromark-extension-mdxjs-esm: 3.0.0 - micromark-util-combine-extensions: 2.0.1 - micromark-util-types: 2.0.2 + micromark-extension-mdx-expression: 1.0.8 + micromark-extension-mdx-jsx: 1.0.5 + micromark-extension-mdx-md: 1.0.1 + micromark-extension-mdxjs-esm: 1.0.5 + micromark-util-combine-extensions: 1.1.0 + micromark-util-types: 1.1.0 - micromark-factory-destination@2.0.1: + micromark-factory-destination@1.1.0: dependencies: - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 - micromark-factory-label@2.0.1: + micromark-factory-label@1.1.0: dependencies: - devlop: 1.1.0 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 - micromark-factory-mdx-expression@2.0.3: + micromark-factory-mdx-expression@1.0.9: dependencies: '@types/estree': 1.0.8 - devlop: 1.1.0 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-events-to-acorn: 2.0.3 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - unist-util-position-from-estree: 2.0.0 - vfile-message: 4.0.3 + micromark-util-character: 1.2.0 + micromark-util-events-to-acorn: 1.2.3 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + unist-util-position-from-estree: 1.1.2 + uvu: 0.5.6 + vfile-message: 3.1.4 - micromark-factory-space@2.0.1: + micromark-factory-space@1.1.0: dependencies: - micromark-util-character: 2.1.1 - micromark-util-types: 2.0.2 + micromark-util-character: 1.2.0 + micromark-util-types: 1.1.0 - micromark-factory-title@2.0.1: + micromark-factory-title@1.1.0: dependencies: - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 - micromark-factory-whitespace@2.0.1: + micromark-factory-whitespace@1.1.0: dependencies: - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-util-character@1.2.0: + dependencies: + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 micromark-util-character@2.1.1: dependencies: micromark-util-symbol: 2.0.1 micromark-util-types: 2.0.2 - micromark-util-chunked@2.0.1: + micromark-util-chunked@1.1.0: dependencies: - micromark-util-symbol: 2.0.1 + micromark-util-symbol: 1.1.0 - micromark-util-classify-character@2.0.1: + micromark-util-classify-character@1.1.0: dependencies: - micromark-util-character: 2.1.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 - micromark-util-combine-extensions@2.0.1: + micromark-util-combine-extensions@1.1.0: dependencies: - micromark-util-chunked: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-chunked: 1.1.0 + micromark-util-types: 1.1.0 - micromark-util-decode-numeric-character-reference@2.0.2: + micromark-util-decode-numeric-character-reference@1.1.0: dependencies: - micromark-util-symbol: 2.0.1 + micromark-util-symbol: 1.1.0 - micromark-util-decode-string@2.0.1: + micromark-util-decode-string@1.1.0: dependencies: decode-named-character-reference: 1.3.0 - micromark-util-character: 2.1.1 - micromark-util-decode-numeric-character-reference: 2.0.2 - micromark-util-symbol: 2.0.1 + micromark-util-character: 1.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-symbol: 1.1.0 + + micromark-util-encode@1.1.0: {} micromark-util-encode@2.0.1: {} - micromark-util-events-to-acorn@2.0.3: + micromark-util-events-to-acorn@1.2.3: dependencies: + '@types/acorn': 4.0.6 '@types/estree': 1.0.8 - '@types/unist': 3.0.3 - devlop: 1.1.0 - estree-util-visit: 2.0.0 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 - vfile-message: 4.0.3 + '@types/unist': 2.0.10 + estree-util-visit: 1.2.1 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + vfile-message: 3.1.4 - micromark-util-html-tag-name@2.0.1: {} + micromark-util-html-tag-name@1.2.0: {} - micromark-util-normalize-identifier@2.0.1: + micromark-util-normalize-identifier@1.1.0: dependencies: - micromark-util-symbol: 2.0.1 + micromark-util-symbol: 1.1.0 - micromark-util-resolve-all@2.0.1: + micromark-util-resolve-all@1.1.0: dependencies: - micromark-util-types: 2.0.2 + micromark-util-types: 1.1.0 + + micromark-util-sanitize-uri@1.2.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-encode: 1.1.0 + micromark-util-symbol: 1.1.0 micromark-util-sanitize-uri@2.0.1: dependencies: @@ -26489,15 +25798,19 @@ snapshots: micromark-util-encode: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-subtokenize@2.1.0: + micromark-util-subtokenize@1.1.0: dependencies: - devlop: 1.1.0 - micromark-util-chunked: 2.0.1 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-chunked: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + + micromark-util-symbol@1.1.0: {} micromark-util-symbol@2.0.1: {} + micromark-util-types@1.1.0: {} + micromark-util-types@2.0.2: {} micromark@2.11.4: @@ -26507,25 +25820,25 @@ snapshots: transitivePeerDependencies: - supports-color - micromark@4.0.2: + micromark@3.2.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.4.3 decode-named-character-reference: 1.3.0 - devlop: 1.1.0 - micromark-core-commonmark: 2.0.3 - micromark-factory-space: 2.0.1 - micromark-util-character: 2.1.1 - micromark-util-chunked: 2.0.1 - micromark-util-combine-extensions: 2.0.1 - micromark-util-decode-numeric-character-reference: 2.0.2 - micromark-util-encode: 2.0.1 - micromark-util-normalize-identifier: 2.0.1 - micromark-util-resolve-all: 2.0.1 - micromark-util-sanitize-uri: 2.0.1 - micromark-util-subtokenize: 2.1.0 - micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-core-commonmark: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-combine-extensions: 1.1.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-encode: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 transitivePeerDependencies: - supports-color @@ -26582,10 +25895,6 @@ snapshots: minimalistic-crypto-utils@1.0.1: {} - minimatch@10.2.1: - dependencies: - brace-expansion: 5.0.2 - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -26614,8 +25923,6 @@ snapshots: mixme@0.5.10: {} - mj-context-menu@0.6.1: {} - mkdirp-classic@0.5.3: {} mkdirp@0.5.6: @@ -26631,13 +25938,6 @@ snapshots: pkg-types: 1.0.3 ufo: 1.3.2 - mlly@1.8.0: - dependencies: - acorn: 8.15.0 - pathe: 2.0.3 - pkg-types: 1.3.1 - ufo: 1.6.3 - mocha@10.2.0: dependencies: ansi-colors: 4.1.1 @@ -26734,8 +26034,26 @@ snapshots: dependencies: type-fest: 0.4.1 - next-themes@0.4.6(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + next-mdx-remote@4.4.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + '@mdx-js/mdx': 2.3.0 + '@mdx-js/react': 2.3.0(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + vfile: 5.3.7 + vfile-matter: 3.0.1 + transitivePeerDependencies: + - supports-color + + next-seo@6.8.0(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + next: 13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + next-themes@0.2.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: + next: 13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -26765,71 +26083,59 @@ snapshots: - '@babel/core' - babel-plugin-macros - nextra-theme-docs@4.6.1(@types/react@18.2.55)(immer@9.0.21)(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(nextra@4.6.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@4.9.5))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(use-sync-external-store@1.6.0(react@18.2.0)): + nextra-theme-docs@2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(nextra@2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - '@headlessui/react': 2.2.9(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@headlessui/react': 1.7.19(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@popperjs/core': 2.11.8 clsx: 2.1.1 + escape-string-regexp: 5.0.0 + flexsearch: 0.7.43 + focus-visible: 5.2.1 + git-url-parse: 13.1.1 + intersection-observer: 0.12.2 + match-sorter: 6.3.4 next: 13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0) - next-themes: 0.4.6(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - nextra: 4.6.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@4.9.5) + next-seo: 6.8.0(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + next-themes: 0.2.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + nextra: 2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 - react-compiler-runtime: 19.1.0-rc.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) scroll-into-view-if-needed: 3.1.0 - zod: 4.3.6 - zustand: 5.0.11(@types/react@18.2.55)(immer@9.0.21)(react@18.2.0)(use-sync-external-store@1.6.0(react@18.2.0)) - transitivePeerDependencies: - - '@types/react' - - immer - - use-sync-external-store + zod: 3.22.4 - nextra@4.6.1(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@4.9.5): + nextra@2.13.4(next@13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - '@formatjs/intl-localematcher': 0.6.2 - '@headlessui/react': 2.2.9(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@mdx-js/mdx': 3.1.1 + '@headlessui/react': 1.7.19(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@mdx-js/mdx': 2.3.0 + '@mdx-js/react': 2.3.0(react@18.2.0) '@napi-rs/simple-git': 0.1.22 - '@shikijs/twoslash': 3.22.0(typescript@4.9.5) - '@theguild/remark-mermaid': 0.3.0(react@18.2.0) - '@theguild/remark-npm2yarn': 0.3.3 - better-react-mathjax: 2.3.0(react@18.2.0) + '@theguild/remark-mermaid': 0.0.5(react@18.2.0) + '@theguild/remark-npm2yarn': 0.2.1 clsx: 2.1.1 - estree-util-to-js: 2.0.0 - estree-util-value-to-estree: 3.5.0 - fast-glob: 3.3.2 github-slugger: 2.0.0 - hast-util-to-estree: 3.1.3 + graceful-fs: 4.2.11 + gray-matter: 4.0.3 katex: 0.16.28 - mdast-util-from-markdown: 2.0.2 - mdast-util-gfm: 3.1.0 - mdast-util-to-hast: 13.2.1 - negotiator: 1.0.0 + lodash.get: 4.4.2 next: 13.5.11(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.70.0) + next-mdx-remote: 4.4.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + p-limit: 3.1.0 react: 18.2.0 - react-compiler-runtime: 19.1.0-rc.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) - react-medium-image-zoom: 5.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) rehype-katex: 7.0.1 - rehype-pretty-code: 0.14.1(shiki@3.22.0) + rehype-pretty-code: 0.9.11(shiki@0.14.7) rehype-raw: 7.0.0 - remark-frontmatter: 5.0.0 - remark-gfm: 4.0.1 - remark-math: 6.0.0 + remark-gfm: 3.0.1 + remark-math: 5.1.1 remark-reading-time: 2.0.2 - remark-smartypants: 3.0.2 - server-only: 0.0.1 - shiki: 3.22.0 - slash: 5.1.0 - title: 4.0.1 - ts-morph: 27.0.2 + shiki: 0.14.7 + slash: 3.0.0 + title: 3.5.3 unist-util-remove: 4.0.0 unist-util-visit: 5.1.0 - unist-util-visit-children: 3.0.0 - yaml: 2.3.4 - zod: 4.3.6 + zod: 3.22.4 transitivePeerDependencies: - supports-color - - typescript nice-try@1.0.5: {} @@ -26841,10 +26147,6 @@ snapshots: just-extend: 6.2.0 path-to-regexp: 6.2.1 - nlcst-to-string@4.0.0: - dependencies: - '@types/nlcst': 2.0.3 - no-case@3.0.4: dependencies: lower-case: 2.0.2 @@ -26897,6 +26199,8 @@ snapshots: dependencies: request: 2.88.2 + non-layered-tidy-tree-layout@2.0.2: {} + normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 @@ -26996,6 +26300,10 @@ snapshots: shell-quote: 1.8.1 string.prototype.padend: 3.1.5 + npm-run-path@2.0.2: + dependencies: + path-key: 2.0.1 + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -27004,7 +26312,7 @@ snapshots: dependencies: path-key: 4.0.0 - npm-to-yarn@3.0.1: {} + npm-to-yarn@2.2.1: {} nth-check@1.0.2: dependencies: @@ -27139,14 +26447,6 @@ snapshots: dependencies: mimic-function: 5.0.1 - oniguruma-parser@0.12.1: {} - - oniguruma-to-es@4.3.4: - dependencies: - oniguruma-parser: 0.12.1 - regex: 6.1.0 - regex-recursion: 6.0.2 - open@7.4.2: dependencies: is-docker: 2.2.1 @@ -27297,8 +26597,6 @@ snapshots: registry-url: 5.1.0 semver: 6.3.1 - package-manager-detector@1.6.0: {} - pako@1.0.11: {} pako@2.1.0: {} @@ -27355,16 +26653,15 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-latin@7.0.0: + parse-numeric-range@1.3.0: {} + + parse-path@7.1.0: dependencies: - '@types/nlcst': 2.0.3 - '@types/unist': 3.0.3 - nlcst-to-string: 4.0.0 - unist-util-modify-children: 4.0.0 - unist-util-visit-children: 3.0.0 - vfile: 6.0.3 + protocols: 2.0.2 - parse-numeric-range@1.3.0: {} + parse-url@8.1.0: + dependencies: + parse-path: 7.1.0 parse5-htmlparser2-tree-adapter@6.0.1: dependencies: @@ -27425,8 +26722,6 @@ snapshots: path-browserify@1.0.1: {} - path-data-parser@0.1.0: {} - path-exists@3.0.0: {} path-exists@4.0.0: {} @@ -27462,8 +26757,6 @@ snapshots: pathe@1.1.2: {} - pathe@2.0.3: {} - pathval@2.0.0: {} pbkdf2@3.1.2: @@ -27478,14 +26771,18 @@ snapshots: performance-now@2.1.0: {} + periscopic@3.1.0: + dependencies: + '@types/estree': 1.0.8 + estree-walker: 3.0.3 + is-reference: 3.0.3 + picocolors@0.2.1: {} picocolors@1.0.0: {} picomatch@2.3.1: {} - picomatch@4.0.3: {} - pidtree@0.3.1: {} pify@2.3.0: {} @@ -27535,25 +26832,12 @@ snapshots: mlly: 1.5.0 pathe: 1.1.2 - pkg-types@1.3.1: - dependencies: - confbox: 0.1.8 - mlly: 1.8.0 - pathe: 2.0.3 - pkg-up@3.1.0: dependencies: find-up: 3.0.0 pngjs@5.0.0: {} - points-on-curve@0.2.0: {} - - points-on-path@0.2.1: - dependencies: - path-data-parser: 0.1.0 - points-on-curve: 0.2.0 - postcss-attribute-case-insensitive@5.0.2(postcss@8.4.33): dependencies: postcss: 8.4.33 @@ -28318,11 +27602,15 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 + property-information@6.5.0: {} + property-information@7.1.0: {} proto-list@1.2.4: optional: true + protocols@2.0.2: {} + proxy-addr@2.0.7: dependencies: forwarded: 0.2.0 @@ -28481,10 +27769,6 @@ snapshots: react-scripts: 5.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.23.9))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(node-notifier@8.0.2)(react@18.2.0)(sass@1.70.0)(ts-node@10.9.1(@types/node@18.11.10)(typescript@4.9.5))(type-fest@4.41.0)(typescript@4.9.5)(utf-8-validate@5.0.10) semver: 5.7.2 - react-compiler-runtime@19.1.0-rc.3(react@18.2.0): - dependencies: - react: 18.2.0 - react-dev-utils@12.0.1(eslint@8.57.0)(typescript@4.9.5)(webpack@5.90.0): dependencies: '@babel/code-frame': 7.23.5 @@ -28542,11 +27826,6 @@ snapshots: react-is@18.2.0: {} - react-medium-image-zoom@5.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-qr-code@2.0.12(react@18.2.0): dependencies: prop-types: 15.8.1 @@ -28727,35 +28006,6 @@ snapshots: real-require@0.1.0: {} - recma-build-jsx@1.0.0: - dependencies: - '@types/estree': 1.0.8 - estree-util-build-jsx: 3.0.1 - vfile: 6.0.3 - - recma-jsx@1.0.1(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - estree-util-to-js: 2.0.0 - recma-parse: 1.0.0 - recma-stringify: 1.0.0 - unified: 11.0.5 - - recma-parse@1.0.0: - dependencies: - '@types/estree': 1.0.8 - esast-util-from-js: 2.0.1 - unified: 11.0.5 - vfile: 6.0.3 - - recma-stringify@1.0.0: - dependencies: - '@types/estree': 1.0.8 - estree-util-to-js: 2.0.0 - unified: 11.0.5 - vfile: 6.0.3 - recursive-readdir@2.2.3: dependencies: minimatch: 3.1.2 @@ -28798,16 +28048,6 @@ snapshots: regex-parser@2.3.0: {} - regex-recursion@6.0.2: - dependencies: - regex-utilities: 2.3.0 - - regex-utilities@2.3.0: {} - - regex@6.1.0: - dependencies: - regex-utilities: 2.3.0 - regexp.prototype.flags@1.5.1: dependencies: call-bind: 1.0.5 @@ -28845,21 +28085,12 @@ snapshots: unist-util-visit-parents: 6.0.2 vfile: 6.0.3 - rehype-parse@9.0.1: - dependencies: - '@types/hast': 3.0.4 - hast-util-from-html: 2.0.3 - unified: 11.0.5 - - rehype-pretty-code@0.14.1(shiki@3.22.0): + rehype-pretty-code@0.9.11(shiki@0.14.7): dependencies: - '@types/hast': 3.0.4 - hast-util-to-string: 3.0.1 + '@types/hast': 2.3.10 + hash-obj: 4.0.0 parse-numeric-range: 1.3.0 - rehype-parse: 9.0.1 - shiki: 3.22.0 - unified: 11.0.5 - unist-util-visit: 5.1.0 + shiki: 0.14.7 rehype-raw@7.0.0: dependencies: @@ -28867,14 +28098,6 @@ snapshots: hast-util-raw: 9.1.0 vfile: 6.0.3 - rehype-recma@1.0.0: - dependencies: - '@types/estree': 1.0.8 - '@types/hast': 3.0.4 - hast-util-to-estree: 3.1.3 - transitivePeerDependencies: - - supports-color - relateurl@0.2.7: {} remark-footnotes@3.0.0: @@ -28889,15 +28112,6 @@ snapshots: mdast-util-frontmatter: 0.2.0 micromark-extension-frontmatter: 0.2.2 - remark-frontmatter@5.0.0: - dependencies: - '@types/mdast': 4.0.4 - mdast-util-frontmatter: 2.0.1 - micromark-extension-frontmatter: 2.0.0 - unified: 11.0.5 - transitivePeerDependencies: - - supports-color - remark-gfm@1.0.0: dependencies: mdast-util-gfm: 0.1.2 @@ -28905,39 +28119,34 @@ snapshots: transitivePeerDependencies: - supports-color - remark-gfm@4.0.1: + remark-gfm@3.0.1: dependencies: - '@types/mdast': 4.0.4 - mdast-util-gfm: 3.1.0 - micromark-extension-gfm: 3.0.0 - remark-parse: 11.0.0 - remark-stringify: 11.0.0 - unified: 11.0.5 + '@types/mdast': 3.0.15 + mdast-util-gfm: 2.0.2 + micromark-extension-gfm: 2.0.3 + unified: 10.1.2 transitivePeerDependencies: - supports-color - remark-math@6.0.0: + remark-math@5.1.1: dependencies: - '@types/mdast': 4.0.4 - mdast-util-math: 3.0.0 - micromark-extension-math: 3.1.0 - unified: 11.0.5 - transitivePeerDependencies: - - supports-color + '@types/mdast': 3.0.15 + mdast-util-math: 2.0.2 + micromark-extension-math: 2.1.2 + unified: 10.1.2 - remark-mdx@3.1.1: + remark-mdx@2.3.0: dependencies: - mdast-util-mdx: 3.0.0 - micromark-extension-mdxjs: 3.0.0 + mdast-util-mdx: 2.0.1 + micromark-extension-mdxjs: 1.0.1 transitivePeerDependencies: - supports-color - remark-parse@11.0.0: + remark-parse@10.0.2: dependencies: - '@types/mdast': 4.0.4 - mdast-util-from-markdown: 2.0.2 - micromark-util-types: 2.0.2 - unified: 11.0.5 + '@types/mdast': 3.0.15 + mdast-util-from-markdown: 1.3.1 + unified: 10.1.2 transitivePeerDependencies: - supports-color @@ -28954,26 +28163,14 @@ snapshots: reading-time: 1.5.0 unist-util-visit: 3.1.0 - remark-rehype@11.1.2: - dependencies: - '@types/hast': 3.0.4 - '@types/mdast': 4.0.4 - mdast-util-to-hast: 13.2.1 - unified: 11.0.5 - vfile: 6.0.3 - - remark-smartypants@3.0.2: + remark-rehype@10.1.0: dependencies: - retext: 9.0.0 - retext-smartypants: 6.2.0 - unified: 11.0.5 - unist-util-visit: 5.1.0 + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-to-hast: 12.3.0 + unified: 10.1.2 - remark-stringify@11.0.0: - dependencies: - '@types/mdast': 4.0.4 - mdast-util-to-markdown: 2.1.2 - unified: 11.0.5 + remove-accents@0.5.0: {} renderkid@3.0.0: dependencies: @@ -29079,31 +28276,6 @@ snapshots: onetime: 7.0.0 signal-exit: 4.1.0 - retext-latin@4.0.0: - dependencies: - '@types/nlcst': 2.0.3 - parse-latin: 7.0.0 - unified: 11.0.5 - - retext-smartypants@6.2.0: - dependencies: - '@types/nlcst': 2.0.3 - nlcst-to-string: 4.0.0 - unist-util-visit: 5.1.0 - - retext-stringify@4.0.0: - dependencies: - '@types/nlcst': 2.0.3 - nlcst-to-string: 4.0.0 - unified: 11.0.5 - - retext@9.0.0: - dependencies: - '@types/nlcst': 2.0.3 - retext-latin: 4.0.0 - retext-stringify: 4.0.0 - unified: 11.0.5 - retry@0.13.1: {} reusify@1.0.4: {} @@ -29247,13 +28419,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.9.6 fsevents: 2.3.3 - roughjs@4.6.6: - dependencies: - hachure-fill: 0.5.2 - path-data-parser: 0.1.0 - points-on-curve: 0.2.0 - points-on-path: 0.2.1 - router@2.2.0: dependencies: debug: 4.4.3 @@ -29381,6 +28546,11 @@ snapshots: dependencies: compute-scroll-into-view: 3.1.1 + section-matter@1.0.0: + dependencies: + extend-shallow: 2.0.1 + kind-of: 6.0.3 + select-hose@2.0.0: {} selfsigned@2.4.1: @@ -29504,8 +28674,6 @@ snapshots: transitivePeerDependencies: - supports-color - server-only@0.0.1: {} - set-blocking@2.0.0: {} set-function-length@1.2.0: @@ -29570,17 +28738,6 @@ snapshots: vscode-oniguruma: 1.7.0 vscode-textmate: 8.0.0 - shiki@3.22.0: - dependencies: - '@shikijs/core': 3.22.0 - '@shikijs/engine-javascript': 3.22.0 - '@shikijs/engine-oniguruma': 3.22.0 - '@shikijs/langs': 3.22.0 - '@shikijs/themes': 3.22.0 - '@shikijs/types': 3.22.0 - '@shikijs/vscode-textmate': 10.0.2 - '@types/hast': 3.0.4 - side-channel-list@1.0.0: dependencies: es-errors: 1.3.0 @@ -29649,8 +28806,6 @@ snapshots: slash@4.0.0: {} - slash@5.1.0: {} - slice-ansi@0.0.4: {} slick@1.12.2: {} @@ -29681,6 +28836,10 @@ snapshots: sander: 0.5.1 sourcemap-codec: 1.4.8 + sort-keys@5.1.0: + dependencies: + is-plain-obj: 4.1.0 + source-list-map@2.0.1: {} source-map-js@1.0.2: {} @@ -29756,12 +28915,6 @@ snapshots: transitivePeerDependencies: - supports-color - speech-rule-engine@4.1.2: - dependencies: - '@xmldom/xmldom': 0.9.8 - commander: 13.1.0 - wicked-good-xpath: 1.3.0 - split-on-first@1.1.0: {} split2@4.2.0: {} @@ -29974,12 +29127,16 @@ snapshots: dependencies: ansi-regex: 6.2.2 + strip-bom-string@1.0.0: {} + strip-bom@3.0.0: {} strip-bom@4.0.0: {} strip-comments@2.0.1: {} + strip-eof@1.0.0: {} + strip-final-newline@2.0.0: {} strip-final-newline@3.0.0: {} @@ -29998,13 +29155,9 @@ snapshots: dependencies: webpack: 5.90.0 - style-to-js@1.1.21: - dependencies: - style-to-object: 1.0.14 - - style-to-object@1.0.14: + style-to-object@0.4.4: dependencies: - inline-style-parser: 0.2.7 + inline-style-parser: 0.1.1 styled-jsx@5.1.1(react@18.2.0): dependencies: @@ -30055,6 +29208,10 @@ snapshots: dependencies: has-flag: 1.0.0 + supports-color@4.5.0: + dependencies: + has-flag: 2.0.0 + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -30158,8 +29315,6 @@ snapshots: system-architecture@0.1.0: {} - tabbable@6.4.0: {} - tailwindcss@3.4.1(ts-node@10.9.1(@types/node@18.11.10)(typescript@4.9.5)): dependencies: '@alloc/quick-lru': 5.2.0 @@ -30273,18 +29428,14 @@ snapshots: transitivePeerDependencies: - supports-color - tinyexec@1.0.2: {} - - tinyglobby@0.2.15: + title@3.5.3: dependencies: - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 + arg: 1.0.0 + chalk: 2.3.0 + clipboardy: 1.2.2 + titleize: 1.0.0 - title@4.0.1: - dependencies: - arg: 5.0.2 - chalk: 5.6.2 - clipboardy: 4.0.0 + titleize@1.0.0: {} tmp@0.0.28: dependencies: @@ -30389,11 +29540,6 @@ snapshots: optionalDependencies: tsconfig-paths: 3.15.0 - ts-morph@27.0.2: - dependencies: - '@ts-morph/common': 0.28.1 - code-block-writer: 13.0.3 - ts-node@10.9.1(@types/node@14.18.63)(typescript@4.9.5): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -30539,16 +29685,6 @@ snapshots: tweetnacl@0.14.5: {} - twoslash-protocol@0.3.6: {} - - twoslash@0.3.6(typescript@4.9.5): - dependencies: - '@typescript/vfs': 1.6.3(typescript@4.9.5) - twoslash-protocol: 0.3.6 - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - type-check@0.3.2: dependencies: prelude-ls: 1.1.2 @@ -30577,6 +29713,8 @@ snapshots: type-fest@0.8.1: {} + type-fest@1.4.0: {} + type-fest@4.41.0: {} type-graphql@1.1.1(class-validator@0.13.2)(graphql@15.7.2(patch_hash=nr4gprddtjag7fz5nm4wirqs4q)): @@ -30655,8 +29793,6 @@ snapshots: ufo@1.3.2: {} - ufo@1.6.3: {} - uglify-js@3.17.4: optional: true @@ -30708,15 +29844,15 @@ snapshots: unicode-property-aliases-ecmascript@2.1.0: {} - unified@11.0.5: + unified@10.1.2: dependencies: - '@types/unist': 3.0.3 + '@types/unist': 2.0.10 bail: 2.0.2 - devlop: 1.1.0 extend: 3.0.2 + is-buffer: 2.0.5 is-plain-obj: 4.1.0 trough: 2.2.0 - vfile: 6.0.3 + vfile: 5.3.7 unified@9.2.2: dependencies: @@ -30741,6 +29877,8 @@ snapshots: '@types/unist': 3.0.3 unist-util-is: 6.0.1 + unist-util-generated@2.0.1: {} + unist-util-is@4.1.0: {} unist-util-is@5.2.1: @@ -30751,19 +29889,23 @@ snapshots: dependencies: '@types/unist': 3.0.3 - unist-util-modify-children@4.0.0: + unist-util-position-from-estree@1.1.2: dependencies: - '@types/unist': 3.0.3 - array-iterate: 2.0.1 + '@types/unist': 2.0.10 - unist-util-position-from-estree@2.0.0: + unist-util-position@4.0.4: dependencies: - '@types/unist': 3.0.3 + '@types/unist': 2.0.10 unist-util-position@5.0.0: dependencies: '@types/unist': 3.0.3 + unist-util-remove-position@4.0.2: + dependencies: + '@types/unist': 2.0.10 + unist-util-visit: 4.1.2 + unist-util-remove-position@5.0.0: dependencies: '@types/unist': 3.0.3 @@ -30779,11 +29921,11 @@ snapshots: dependencies: '@types/unist': 2.0.10 - unist-util-stringify-position@4.0.0: + unist-util-stringify-position@3.0.3: dependencies: - '@types/unist': 3.0.3 + '@types/unist': 2.0.10 - unist-util-visit-children@3.0.0: + unist-util-stringify-position@4.0.0: dependencies: '@types/unist': 3.0.3 @@ -30797,6 +29939,11 @@ snapshots: '@types/unist': 2.0.10 unist-util-is: 5.2.1 + unist-util-visit-parents@5.1.3: + dependencies: + '@types/unist': 2.0.10 + unist-util-is: 5.2.1 + unist-util-visit-parents@6.0.2: dependencies: '@types/unist': 3.0.3 @@ -30808,6 +29955,12 @@ snapshots: unist-util-is: 5.2.1 unist-util-visit-parents: 4.1.1 + unist-util-visit@4.1.2: + dependencies: + '@types/unist': 2.0.10 + unist-util-is: 5.2.1 + unist-util-visit-parents: 5.1.3 + unist-util-visit@5.1.0: dependencies: '@types/unist': 3.0.3 @@ -30916,10 +30069,6 @@ snapshots: dependencies: react: 18.2.0 - use-sync-external-store@1.6.0(react@18.2.0): - dependencies: - react: 18.2.0 - utf-8-validate@5.0.10: dependencies: node-gyp-build: 4.8.0(patch_hash=tidq6bjknpovdjep75bj5ccgke) @@ -30950,14 +30099,19 @@ snapshots: utils-merge@1.0.1: {} - uuid@11.1.0: {} - uuid@3.4.0: {} uuid@8.3.2: {} uuid@9.0.1: {} + uvu@0.5.6: + dependencies: + dequal: 2.0.3 + diff: 5.1.0 + kleur: 4.1.5 + sade: 1.8.1 + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@8.1.1: @@ -31012,11 +30166,22 @@ snapshots: '@types/unist': 3.0.3 vfile: 6.0.3 + vfile-matter@3.0.1: + dependencies: + '@types/js-yaml': 4.0.9 + is-buffer: 2.0.5 + js-yaml: 4.1.0 + vfile-message@2.0.4: dependencies: '@types/unist': 2.0.10 unist-util-stringify-position: 2.0.3 + vfile-message@3.1.4: + dependencies: + '@types/unist': 2.0.10 + unist-util-stringify-position: 3.0.3 + vfile-message@4.0.3: dependencies: '@types/unist': 3.0.3 @@ -31029,6 +30194,13 @@ snapshots: unist-util-stringify-position: 2.0.3 vfile-message: 2.0.4 + vfile@5.3.7: + dependencies: + '@types/unist': 2.0.10 + is-buffer: 2.0.5 + unist-util-stringify-position: 3.0.3 + vfile-message: 3.1.4 + vfile@6.0.3: dependencies: '@types/unist': 3.0.3 @@ -31086,27 +30258,10 @@ snapshots: vm-browserify@1.1.2: {} - vscode-jsonrpc@8.2.0: {} - - vscode-languageserver-protocol@3.17.5: - dependencies: - vscode-jsonrpc: 8.2.0 - vscode-languageserver-types: 3.17.5 - - vscode-languageserver-textdocument@1.0.12: {} - - vscode-languageserver-types@3.17.5: {} - - vscode-languageserver@9.0.1: - dependencies: - vscode-languageserver-protocol: 3.17.5 - vscode-oniguruma@1.7.0: {} vscode-textmate@8.0.0: {} - vscode-uri@3.1.0: {} - vue@3.4.19(typescript@5.3.3): dependencies: '@vue/compiler-dom': 3.4.19 @@ -31194,6 +30349,8 @@ snapshots: web-vitals@2.1.4: {} + web-worker@1.5.0: {} + webcrypto-core@1.7.8: dependencies: '@peculiar/asn1-schema': 2.3.8 @@ -31396,8 +30553,6 @@ snapshots: dependencies: isexe: 2.0.0 - wicked-good-xpath@1.3.0: {} - widest-line@3.1.0: dependencies: string-width: 4.2.3 @@ -31688,8 +30843,7 @@ snapshots: dependencies: zod: 4.3.6 - zod@3.22.4: - optional: true + zod@3.22.4: {} zod@4.3.6: {} @@ -31701,13 +30855,6 @@ snapshots: immer: 9.0.21 react: 18.2.0 - zustand@5.0.11(@types/react@18.2.55)(immer@9.0.21)(react@18.2.0)(use-sync-external-store@1.6.0(react@18.2.0)): - optionalDependencies: - '@types/react': 18.2.55 - immer: 9.0.21 - react: 18.2.0 - use-sync-external-store: 1.6.0(react@18.2.0) - zwitch@1.0.5: {} zwitch@2.0.4: {}