# Syndicate utils ## cache_actor An actor that observes patterns and reässerts the values they capture for a given lifetime. Takes the arguments `{ dataspace: #!any lifetime: double }`. The lifetime of a cache counts down from moment a value is asserted. Example configuration: ``` ? [ ; Require the nix_actor during observations. ?nixspace> ? _> [ $config > ] ?nixspace> ? _> [ $config > ] ; Cache anything captured by observers in the $nixspace for an hour. ; The nix_actor is not required during caching. $config ? ?cap> [ $cap { dataspace: $nixspace lifetime: 3600.0 } ] ] ``` ## json_translator Wrapper that executes a command, parses its JSON output, converts to Preserves record ``, and publishes and messages to its initial dataspace. ## json_socket_translator Utility to communicate with sockets that send and receive lines of JSON using `` and `` messages. Compatible with [mpv](https://mpv.io/), see [mpv.config-example.pr](./mpv.config-example.pr). Do not send messages immediately to the dataspace passed `json_socket_translator`, wait until it asserts ``. ## mintsturdyref A utility for minting [Sturdyrefs](https://synit.org/book/operation/builtin/gatekeeper.html#sturdyrefs). ## mount_actor Actor for mounting filesystems on Linux. Sample Syndicate server script: ``` # Assert a file-system we want to mount. # Transform mount assertions into mount status observations. ? [ ? [ ] ] # Assert mounting succeded. ? [ ready> ] # Assert mount failed. ? > [ failed> ] # Assert the details into the machine dataspace. ? [ $config ? [ $machine ] ] # Require the mount_actor daemon. > # Pass the daemon the config dataspace. ? ?cap> [ $cap { dataspace: $config } ] ``` ## msg A utility that sends messages to `$SYNDICATE_ROUTE`. ## net_mapper Publishes ICMP packet round-trip-times. See [net_mapper.prs](./net_mapper.prs) for a protocol description. [Source](./src/net_mapper.nim). Example script: ``` ? [ $machine ? [ $log ! ] $config [ > ? ?cap> [ $cap { dataspace: $machine } ] ] ] ``` ## preserve_process_environment This utility serializes it's process environment to Preserves and prints it to stdout. It can be used to feed the environment variables of a nested child of the Syndicate server back to the server. For example, to retreive the environmental variables that a desktop manager passed on to its children. ## syndump Utility for printing assertions and messages. Parses the command-line arguments as a pattern, connects a dataspace via `$SYNDICATE_ROUTE`, and writes observations to standard-output. Published assertions are prefixed by the `+` character, retractions by `-`, and messages by `!`. Example ```sh # Print patterns in use, filter down with AWK to only the published patterns. $ FS=':' syndump '' | awk -F : '/^+/ { print $2 }' ```