Files
plainleaf/web/syscalls/config.ts
T
Zef HemelandGitHub dc2987a3f9 Sync engine rearchitecture (#1516)
* Don't require auth for .ping
* Finally introducing loggers
* Remove file list caching from disk_space_primitives
I don't think this is required anymore with the sync model
* Simplification of space primitives and more tests
* More reliable online status
* Add .zed settings
* Remove selfUpdate argument from `writeFile` no longer used
- Add `sync` config schema and document sync options
- Move sync config handling to client boot logic
- Move BootConfig type to ui_types.ts
- Remove sync env vars from server
- Update documentation for sync and architecture
* Improve sync logic and proxy routing for full sync state
* Add BoxProxy for late-bound client and improve Lua boot
- Add isMobile syscall for editor
* Add concurrency to sync process and log indexing duration
* Better service worker lifecycle management
2025-09-12 14:43:57 +02:00

30 lines
801 B
TypeScript

import type { SysCallMapping } from "../../lib/plugos/system.ts";
import type { Config } from "../config.ts";
export function configSyscalls(config: Config): SysCallMapping {
return {
"config.get": (_ctx, path: string, defaultValue: any) => {
return config.get(path, defaultValue);
},
"config.set": (
_ctx,
keyOrValues: string | string[] | Record<string, any>,
value?: any,
) => {
config.set(keyOrValues as any, value);
},
"config.has": (_ctx, path: string) => {
return config.has(path);
},
"config.define": (_ctx, key: string, schema: any) => {
config.define(key, schema);
},
"config.getValues": () => {
return config.values;
},
"config.getSchemas": () => {
return config.schemas;
},
};
}