@casual-simulation/aux-records
Advanced tools
Changelog
V3.3.2
Changelog
V3.3.13
Added ai.chat.allowedModels
feature to enforce model usage limits, restricting access to specific models based on configuration.
Added shared documents.
Shared documents utilize insts to be able to share data without using bots and tags.
Additionally, shared documents can be loaded and unloaded at will.
The following functions have been added:
os.getSharedDocument(name)
- Gets a document that is stored in the current inst.os.getSharedDocument(recordName, inst, name)
- Gets a document that is stored in the specified inst.os.getLocalDocument(name)
- Gets a document that is stored on this device.os.getMemoryDocument()
- Gets a document that is stored in memory and cleared upon refresh.Usage:
// Get a document stored in this inst named "test"
const doc = await os.getSharedDocument('test');
// maps work like the Map type (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
const inventory = doc.getMap<number>('inventory');
inventory.set('spoons', 2);
inventory.set('forks', 3);
os.log('Number of spoons: ' + inventory.get('spoons'));
// arrays work like regular JavaScript arrays:
const shoppingList = doc.getArray<string>('shoppingList');
shoppingList.push('cereal', 'milk', 'eggs');
os.log('Shopping list:', inventory.toArray());
// Text is a special type that makes it easy to work with long strings
const blogPost = doc.getText('blogPost');
blogPost.insert(0, 'Hello, world!');
os.log('Blog Post:\n', blogPost.toString());
os.joinRoom()
.Changelog
V3.3.0
casualos
, and provides functionality to query the CasualOS backend API.login
- Authenticates the cilent to a CasualOS backend.query
- Queries a CasualOS backend.repl
- A Read-eval-print-loop (REPL) that makes interacting with the CasualOS backend via JavaScript really easy.os.calculateViewportCoordinatesFromPosition(portal, position)
- Calculates the viewport coordinates from the given 3D position in the portal.
portal
is the portal that the request is from (one of grid
, miniGrid
, map
, or miniMap
).position
is the 3D position in the portal.(X: 0, Y: 0)
represents the center of the camera while (X: -1, Y: -1)
represents the lower left corner and (X: 1, Y: 1)
represents the upper right corner.os.calculateViewportCoordinatesFromScreenCoordinates(portal, coordinates)
- Calculates the viewport coordinates from the given 2D screen position.
portal
is the portal that the request is for (one of grid
, miniGrid
, map
, or miniMap
).position
is the 2D position on the screen.os.calculateScreenCoordinatesFromViewportCoordinates(portal, coordinates)
- Calculates the screen coordinates from the given 2D viewport coordinates.
portal
is the portal that the request is for (one of grid
, miniGrid
, map
, or miniMap
).position
is the 2D viewport coordinates that the screen coordinates should be found for.transient-input
support for Apple Vision Pro.
superUser
user role.
none
, and superUser
.superUser
role.none
role.superUser
role, a user has access to some operations that they would not normally have access to, including:
getUserInfo
for all userscreateAccount
listSessions
for all userslistRecords
for all users and studioslistStudios
for all userslistStudioMembers
for all studiosgetSubscriptions
for all users and studiossessionKey
and a connectionKey
in the local storage of their web browser to keep them logged in.sessionKey
and connectionKey
query params are specified in the URL, they will be used instead of the stored ones.updateSubscription
operation (POST /api/v2/subscriptions/update
) to allow super users to grant a subscription to users or studios.
miniGridPortal
did not support using os.focusOn()
with a position.