Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:casual-simulation/casualos into …
Browse files Browse the repository at this point in the history
…feature/integrate-xp-api
  • Loading branch information
LandonSiler committed Nov 19, 2024
2 parents bb1431c + d1c69ba commit dedd343
Show file tree
Hide file tree
Showing 94 changed files with 9,365 additions and 2,270 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# CasualOS Changelog

## V3.3.13

#### Date: 11/8/2024

### :rocket: Features

- 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:

```typescript
// 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());
```

### :bug: Bug Fixes

- Fixed an issue where CasualOS would prompt for login when trying to join a room using `os.joinRoom()`.

## V3.3.12

#### Date: 10/25/2024
Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env'],
};
2 changes: 1 addition & 1 deletion docker/docker-compose.dev-otel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
ports:
- '6379:6379'
livekit:
image: livekit/livekit-server:v1.6.1
image: livekit/livekit-server:v1.8.0
command: --config /etc/livekit.yaml
restart: always
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- ./conf/redis.conf:/etc/redis.conf
command: ['redis-server', '/etc/redis.conf']
livekit:
image: livekit/livekit-server:v1.6.1
image: livekit/livekit-server:v1.8.0
restart: always
depends_on:
- redis
Expand Down
14 changes: 9 additions & 5 deletions docs/docs/components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const DataTagLink = ({tag}) => {
throw new Error(`No tag map for tag ${tag}`);
}
return (
<a href={useBaseUrl(tagMap[tag]) + '#' + tag.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}>
<a href={relativeLink(tagMap[tag]) + '#' + tag.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}>
<NormalCode>#{tag}</NormalCode>
</a>
);
Expand Down Expand Up @@ -339,8 +339,12 @@ export const tagMap = {
privacyFeatures: 'tags/auth-bot',
};

function relativeLink(path) {
return new URL(path, import.meta.url).href;
}

export const ListenTagLink = ({tag}) => (
<a href={useBaseUrl('tags/listen') + '#' + tag.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}>
<a href={relativeLink('tags/listen') + '#' + tag.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}>
<NormalCode>{tag}</NormalCode>
</a>
);
Expand All @@ -352,7 +356,7 @@ export const TypeLink = ({type, children}) => {
console.warn('No hash for type', action);
return c;
}
const url = useBaseUrl(hash) + '#' + type;
const url = relativeLink(hash) + '#' + type;
return <a href={url}>{c}</a>;
}

Expand All @@ -371,7 +375,7 @@ export const ActionLink = ({action, children}) => {
console.warn('No hash for action', action);
return c;
}
const url = useBaseUrl(hash) + '#' + id;
const url = relativeLink(hash) + '#' + id;
return <a href={url}>{c}</a>;
}

Expand Down Expand Up @@ -422,7 +426,7 @@ export const Badges = ({children}) => (


export const VariableLink = ({name, children, ...attrs}) => (
<a href={useBaseUrl('variables') + '#' + name.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()} {...attrs}>
<a href={relativeLink('variables') + '#' + name.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()} {...attrs}>
{children ? children : (<NormalCode>{name}</NormalCode>)}
</a>
);
Expand Down
8 changes: 5 additions & 3 deletions docs/docs/glossary/AuxFile.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { GlossaryRef } from './index';

_AUX commonly stands for **A**utomatic **U**ser **E**xperience but it can also stand for **A**mbient **U**ser **E**xperience._

AUX (pronounced "awks") is a term that we use to talk about an computer system that provides access to an interactive model for multiple people across multiple devices and geographic locations.
This means that AUXes are designed to work on a wide variety of devices (phones, laptops, VR headsets, etc.), and they remain synced regardless of where in the world you are.

With respect to CasualOS, every [inst](#instance) is an AUX because CasualOS does the hard work to ensure that everything is synced and works across all connected devices.
With respect to CasualOS, every <GlossaryRef term="instance">inst</GlossaryRef> is an AUX because CasualOS does the hard work to ensure that everything is synced and works across all connected devices.

You may also come across the term "AUX File". AUX files are files that use the `.aux` filename extension and contain [JSON](https://en.wikipedia.org/wiki/JSON) formatted data which represents a set of bots and their tags.

Expand All @@ -14,6 +16,6 @@ AUX Files come in two different versions:
They are most useful for when you would like to save and reload the exact state of bots or when you would like to export bot data to an external system.
- Version 2
- Version 2 AUX Files contain a set of [conflict-free](https://crdt.tech/) updates to a set of bots as base64 encoded strings embedded in JSON.
They are most useful for when you would like to ensure the initialization of a shared [inst](#instance) doesn't run into issues with duplicated data or when you want to manually share a set of changes offline.
They are most useful for when you would like to ensure the initialization of a shared <GlossaryRef term="instance">inst</GlossaryRef> doesn't run into issues with duplicated data or when you want to manually share a set of changes offline.

Usually, AUX files are utilized as an easy way to save/load [bots](#bot) from an inst.
Usually, AUX files are utilized as an easy way to save/load <GlossaryRef term="bot">bots</GlossaryRef> from an inst.
2 changes: 1 addition & 1 deletion docs/docs/glossary/CasualOS.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GlossaryRef } from './index'

[CasualOS](https://casualos.com/) a website that makes it easy to author [AUXes](#aux) and share them with other people.
[CasualOS](https://casualos.com/) a website that makes it easy to author <GlossaryRef term="aux">AUXes</GlossaryRef> and share them with other people.
Computers that run CasualOS are called <GlossaryRef term='server'>servers</GlossaryRef> and can host <GlossaryRef term='instance'>instances</GlossaryRef>.

CasualOS is maintained by a non-profit company called [Casual Simulation](https://casualsimulation.org/) and is free for anyone to use.
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/glossary/Dimension.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Dimensions are the names of [tags](#tag) that are used by [bots](#bot) in the [instance](#instance).
import { GlossaryRef } from './index'

Dimensions are the names of <GlossaryRef term="tag">tags</GlossaryRef> that are used by <GlossaryRef term="bot">bots</GlossaryRef> in the <GlossaryRef term="instance">instance</GlossaryRef>.
They are most commonly used by portals to show only some of the bots in the instance in the portal.

For example if you have three bots and two of them have the `#home=true` tag,
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/glossary/Portal.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GlossaryRef } from './index';

Portals are places where humans can interface with [bots](#bot).
Portals utilize [dimensions](#dimension) to allow interacting with and visualizing subsets of bots.
Portals are places where humans can interface with <GlossaryRef term="bot">bots</GlossaryRef>.
Portals utilize <GlossaryRef term="dimension">dimensions</GlossaryRef> to allow interacting with and visualizing subsets of bots.

A list of built-in portals is available on the [`configBot` documentation](./tags#config-bot-tags).
A list of built-in portals is available on the [`configBot` documentation](../tags/config-bot.mdx).

#### See Also

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/glossary/TagPortal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The tagPortal is a <GlossaryRef term="portal">portal</GlossaryRef> that is used
The tagPortal can be opened by setting the <TagLink tag='tagPortal'/> tag on the <VariableLink name='configBot'/> to a string matching the following format: `{botID}.{tagName}`.
Where `{botID}` is replaced with the ID of the <GlossaryRef term='bot'/> and `{tagName}` is replaced by the name of the tag that should be shown in the portal.

Portals are places where humans can interface with [bots](#bot).
Portals utilize [dimensions](#dimension) to allow interacting with and visualizing subsets of bots.
Portals are places where humans can interface with <GlossaryRef term="bot">bots</GlossaryRef>.
Portals utilize <GlossaryRef term="dimension">dimensions</GlossaryRef> to allow interacting with and visualizing subsets of bots.

A list of built-in portals is available on the [`configBot` documentation](./tags#config-bot-tags).
A list of built-in portals is available on the [`configBot` documentation](../tags/config-bot.mdx).

#### See Also

Expand Down
6 changes: 4 additions & 2 deletions docs/docs/glossary/abCore.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
abCore is a set of [bots](#bot) that augment the built-in CasualOS [portals](#portal) and behavior to make authoring experiences easier.
When an [instance](#instance) is started, abCore is automatically loaded for convience.
import { GlossaryRef } from './index';

abCore is a set of <GlossaryRef term="bot">bots</GlossaryRef> that augment the built-in CasualOS <GlossaryRef term="portal">portals</GlossaryRef> and behavior to make authoring experiences easier.
When an <GlossaryRef term="instance">instance</GlossaryRef> is started, abCore is automatically loaded for convience.

#### See Also

Expand Down
6 changes: 5 additions & 1 deletion docs/docs/glossary/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import Tooltip from 'rc-tooltip';

import 'rc-tooltip/assets/bootstrap.css';

function relativeLink(path) {
return new URL(path, import.meta.url).href;
}

export const Glossary = [
{ id: 'aux', title: 'AUX', content: () => <AUX/> },
{ id: 'abCore', title: 'abCore', content: () => <AB1/> },
Expand Down Expand Up @@ -67,7 +71,7 @@ export const GlossaryRef = ({term, children}) => {
}
return (
<Tooltip placement="top" overlay={<GlossaryWindow item={item}/>}>
<a href={useBaseUrl('glossary') + `#${item.id.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}`}>{children}</a>
<a href={relativeLink('glossary') + `#${item.id.replace(/[\.\(\)\@\[\]]/g, '').toLowerCase()}`}>{children}</a>
</Tooltip>
)
};
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ Script tags are tags whose value is prefixed with the `@` symbol and they repres
Script tags (also known as listeners) must be valid [JavaScript](https://javascript.info/intro) code and can perform fairly arbitrary actions.
This includes searching, creating and destroying bots, changing bot tags, showing messages to the user, making web requests, saving permanent records, and more.

Script tags that have one of the names listed [here](/listen-tags) can be executed directly by CasualOS.
Script tags that have one of the names listed [here](./tags/listen.mdx) can be executed directly by CasualOS.
Additionally, it is possible to trigger scripts from other scripts using the <ActionLink action='shout(name, arg?)'/> and <ActionLink action='whisper(bot, name, arg?)'/> actions.

For a tutorial on scripting and the basics of CasualOS, check out the [Pillars of Casual Simulation](/).
Finally, you can check out the comprehensive [list of actions](/actions) that are supported in CasualOS.
Finally, you can check out the comprehensive [list of actions](./actions/ai.mdx) that are supported in CasualOS.

```typescript
/**
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tags/behavior.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ If set to `false`, then CasualOS will not change any tags, but it will still sen
Whether the bot interacts with the pointer.

Bots that are pointable can receive clicks, pointer enter/exit, and drop events.
Note that the <TagLink tag='pointable'/> tag also affects whether the content inside an [iframe form](#iframe-form) is interactable.
Note that the <TagLink tag='pointable'/> tag also affects whether the content inside an [iframe form](./visualization.mdx#iframe-form) is interactable.

#### Possible values are:

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/tags/config-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,13 @@ https://auxplayer.org?inst=my-aux&dataPortal=test.html

The 3D position of the player's mouse pointer.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `mousePointerRotation`

The 3D rotation of the player's mouse pointer.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.

### `mousePointerPortal`

Expand All @@ -574,13 +574,13 @@ The portal that the player's mouse pointer is in.

The 3D position of the player's left controller.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `leftPointerRotation`

The 3D rotation of the player's left controller.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.

### `leftPointerPortal`

Expand All @@ -590,13 +590,13 @@ The portal that the player's left controller is in.

The 3D position of the player's right controller.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `rightPointerRotation`

The 3D rotation of the player's right controller.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.

### `rightPointerPortal`

Expand Down
22 changes: 11 additions & 11 deletions docs/docs/tags/portal-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Whether the player will be able to pan the camera inside the portal.

The minimum values that the camera can pan to in the portal.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

#### Possible values are:
<PossibleValuesTable>
Expand All @@ -226,7 +226,7 @@ See the documentation on [Vectors](#vector-tags) for more info.

The maximum X and Y values that the camera can pan to in the portal.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

#### Possible values are:
<PossibleValuesTable>
Expand Down Expand Up @@ -271,7 +271,7 @@ For usability reasons, CasualOS limits this value to between 0 and 58 degrees (`

The Y angle (theta) is used to rotate the camera left and right. Mathematically, a value of 0 means the camera is facing the front face of bots and a value of `π / 2` means the camera is facing the left face of the bots.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

#### Possible values are:
<PossibleValuesTable>
Expand Down Expand Up @@ -468,12 +468,12 @@ The "type" of a camera determines how objects are visualized and how they appear
Whether to disable transparency on the [canvas element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) that the 3D content is displayed on.

Set this tag to `true` on the grid portal to fix rendering issues with 3D models that use alpha cutoff.
Note that when this value is `true`, [iframe forms](#iframe-form) will cease to function properly.
Note that when this value is `true`, [iframe forms](./visualization.mdx#iframe-form) will cease to function properly.

#### Possible values are:
<PossibleValuesTable>
<PossibleValueCode value='false'>
The canvas element is transparent to support <a href='#iframe-form'>iframe forms</a>. (Default)
The canvas element is transparent to support <a href='./visualization.mdx#iframe-form'>iframe forms</a>. (Default)
</PossibleValueCode>
<PossibleValueCode value='true'>
The canvas element is not transparent 3D models that use alpha cutoff.
Expand Down Expand Up @@ -1216,7 +1216,7 @@ Larger Y values are closer to the bottom of the screen and lower values are clos

The 3D position of the player's camera in the grid portal.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `cameraPositionOffset`

Expand All @@ -1229,7 +1229,7 @@ The offset that should be applied to the 3D position of the player's camera in t

Useful for moving the player around in VR.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `cameraRotation`

Expand All @@ -1243,7 +1243,7 @@ The 3D rotation of the player's camera in the grid portal.

Units are in radians.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.

### `cameraRotationOffset`
<Badges>
Expand All @@ -1255,7 +1255,7 @@ The offset that should be applied to the 3D rotation of the player's camera in t

Units are in radians.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.

### `cameraZoom`

Expand Down Expand Up @@ -1290,7 +1290,7 @@ Larger values indicate that the camera is zoomed in more (objects appear bigger)

The 3D position of the focus point for the player's camera in the grid portal.

See the documentation on [Vectors](#vector-tags) for more info.
See the documentation on [Vectors](../tags.mdx#vector-tags) for more info.

### `imuSupported`

Expand All @@ -1310,4 +1310,4 @@ Whether IMU data is supported on this device.

The 3D rotation of the device as determined by the IMU.

See the documentation on [Rotations](#rotation-tags) for more info.
See the documentation on [Rotations](../tags.mdx#rotation-tags) for more info.
Loading

0 comments on commit dedd343

Please sign in to comment.