STAXIS

staxis js platform -> gitlab project
staxis on gitlab gitlab project 🏷️ V-0.X-Beta
We’re actively updating this manual. Content and layout may change as we refine it.

Library Packs

A library pack exposes a shared API under its label. Use it for functions that other packs call directly. The Core loads its factory, while attach and detach are reserved for runtime layers. Library files remain subject to the integrity and import checks enabled for the project, but their APIs are shared directly through library lookup, without a Vault token.

Create the Manifest

Create system-lrpcks/greetings/manifest.json. The label matches the directory name. The shared typology is library.

                {
                    "label": "greetings",
                    "typology": "library",
                    "icon": "G",
                    "version": "1.0.0",
                    "method": "main.js",
                    "require": false,
                    "description": "Shared greeting functions"
                }
            

Write the Entry Point

Save this as system-lrpcks/greetings/main.js. The defineLayer wrapper marks the factory for the Core. Its builder returns the API object itself. The #core:layers import is provided by the Staxis project's package imports.

                import { defineLayer } from '#core:layers'

                export default defineLayer(() => ({
                    greet(name) {
                        return 'Hello, ' + String(name)
                    }
                }))
            

Use the Library

Place greetings before its consumers in the stack. A consumer can declare "require": ["greetings"] in its manifest and request the API inside its factory or methods. Destructure libraries and logs from the equipments passed to the factory.

                const greetings = libraries.require('greetings')

                    if (!greetings || typeof greetings.greet !== 'function') {
                        throw new Error('The greetings library is unavailable')
                    }

                    logs('message', greetings.greet('Staxis'))
            

The current lookup can return an error string when the library is missing, so check for the methods you need. This access path takes a label without a Vault token. Use a runtime layer when consumers need access governed by its manifest permissions and managed lifecycle.

Register and Review

With typology library, integrity verification uses KEY:LIBRARY from the private .keys file. After reviewing a new or changed pack, run node project updateHMAC, then node project start. Updating integrity records accepts the reviewed files as the baseline.

The Manager's init command creates the starting files. Review the generated skeleton before use. The current library template contains an undefined text reference that needs to be replaced with your implementation.