SharedOS API / @aicoo/sharedos-os
@aicoo/sharedos-os
Standard permission-controlled file tool adapters for SharedOS.
npm install @aicoo/sharedos-os@next
Hosts provide storage implementations; this package provides one canonical
files namespace, portable argument schemas, canonical resource paths, exact
per-call capability resolution, and tool definitions. Memory is represented by
files under host-defined paths, not by a second storage namespace.
The standard handlers also use files as their logical tool namespace and
sharedos as their catalog source. Hosts must explicitly include files in an
effective namespace selection before those handlers can be discovered.
Filesystem providers must still enforce root containment and reject symlink
escapes.
SharedOS is currently an 0.x prerelease.
Interfaces
StandardOsProviders
Defined in: index.ts:121
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
<a id="property-files"></a> files? | readonly | ResourceProvider | index.ts:122 |
Type Aliases
FilePath
FilePath =
z.infer<typeofFilePathSchema>>
Defined in: index.ts:23
FilesAppendArguments
FilesAppendArguments =
z.infer<typeofFilesAppendArgumentsSchema>>
Defined in: index.ts:75
FilesCreateArguments
FilesCreateArguments =
z.infer<typeofFilesCreateArgumentsSchema>>
Defined in: index.ts:56
FilesDeleteArguments
FilesDeleteArguments =
z.infer<typeofFilesDeleteArgumentsSchema>>
Defined in: index.ts:84
FilesGrepArguments
FilesGrepArguments =
z.infer<typeofFilesGrepArgumentsSchema>>
Defined in: index.ts:47
FilesPathArguments
FilesPathArguments =
z.infer<typeofFilesPathArgumentsSchema>>
Defined in: index.ts:26
FilesReplaceArguments
FilesReplaceArguments =
z.infer<typeofFilesReplaceArgumentsSchema>>
Defined in: index.ts:65
FilesSearchArguments
FilesSearchArguments =
z.infer<typeofFilesSearchArgumentsSchema>>
Defined in: index.ts:35
FilesSnapshotCreateArguments
FilesSnapshotCreateArguments =
z.infer<typeofFilesSnapshotCreateArgumentsSchema>>
Defined in: index.ts:92
FilesSnapshotListArguments
FilesSnapshotListArguments =
z.infer<typeofFilesSnapshotListArgumentsSchema>>
Defined in: index.ts:100
FilesSnapshotRestoreArguments
FilesSnapshotRestoreArguments =
z.infer<typeofFilesSnapshotRestoreArgumentsSchema>>
Defined in: index.ts:109
Variables
FilePathSchema
constFilePathSchema:ZodArray<ZodString,"many">>
Defined in: index.ts:22
FILES_NAMESPACE
constFILES_NAMESPACE:"files"="files"
Defined in: index.ts:19
The canonical SharedOS resource plane. Memory is a role of files, not a second store.
FilesAppendArgumentsSchema
constFilesAppendArgumentsSchema:ZodObject<{content:ZodType<JsonValue,ZodTypeDef,JsonValue>>;expectedVersion:ZodOptional<ZodString>>;metadata:ZodOptional<ZodRecord<ZodString,ZodType<JsonValue,ZodTypeDef,JsonValue>>>>>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {content:JsonValue;expectedVersion?:string;metadata?:Record<string,JsonValue>>;path:string[]; }, {content:JsonValue;expectedVersion?:string;metadata?:Record<string,JsonValue>>;path:string[]; }>
Defined in: index.ts:67
FilesCreateArgumentsSchema
constFilesCreateArgumentsSchema:ZodObject<{content:ZodType<JsonValue,ZodTypeDef,JsonValue>>;metadata:ZodOptional<ZodRecord<ZodString,ZodType<JsonValue,ZodTypeDef,JsonValue>>>>>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {content:JsonValue;metadata?:Record<string,JsonValue>>;path:string[]; }, {content:JsonValue;metadata?:Record<string,JsonValue>>;path:string[]; }>
Defined in: index.ts:49
FilesDeleteArgumentsSchema
constFilesDeleteArgumentsSchema:ZodObject<{expectedVersion:ZodOptional<ZodString>>;path:ZodArray<ZodString,"many">>;recursive:ZodDefault<ZodBoolean>>; },"strict",ZodTypeAny, {expectedVersion?:string;path:string[];recursive:boolean; }, {expectedVersion?:string;path:string[];recursive?:boolean; }>
Defined in: index.ts:77
FilesGrepArgumentsSchema
constFilesGrepArgumentsSchema:ZodObject<{caseSensitive:ZodDefault<ZodBoolean>>;contextAfter:ZodDefault<ZodNumber>>;contextBefore:ZodDefault<ZodNumber>>;mode:ZodDefault<ZodEnum<["literal","regex"]>>;path:ZodArray<ZodString,"many">>;pattern:ZodString; },"strict",ZodTypeAny, {caseSensitive:boolean;contextAfter:number;contextBefore:number;mode:"literal"|"regex";path:string[];pattern:string; }, {caseSensitive?:boolean;contextAfter?:number;contextBefore?:number;mode?:"literal"|"regex";path:string[];pattern:string; }>
Defined in: index.ts:37
FilesPathArgumentsSchema
constFilesPathArgumentsSchema:ZodObject<{path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {path:string[]; }, {path:string[]; }>
Defined in: index.ts:25
FilesReplaceArgumentsSchema
constFilesReplaceArgumentsSchema:ZodObject<{content:ZodType<JsonValue,ZodTypeDef,JsonValue>>;expectedVersion:ZodOptional<ZodString>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {content:JsonValue;expectedVersion?:string;path:string[]; }, {content:JsonValue;expectedVersion?:string;path:string[]; }>
Defined in: index.ts:58
FilesSearchArgumentsSchema
constFilesSearchArgumentsSchema:ZodObject<{limit:ZodOptional<ZodNumber>>;path:ZodArray<ZodString,"many">>;query:ZodString; },"strict",ZodTypeAny, {limit?:number;path:string[];query:string; }, {limit?:number;path:string[];query:string; }>
Defined in: index.ts:28
FilesSnapshotCreateArgumentsSchema
constFilesSnapshotCreateArgumentsSchema:ZodObject<{label:ZodOptional<ZodString>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {label?:string;path:string[]; }, {label?:string;path:string[]; }>
Defined in: index.ts:86
FilesSnapshotListArgumentsSchema
constFilesSnapshotListArgumentsSchema:ZodObject<{limit:ZodOptional<ZodNumber>>;path:ZodArray<ZodString,"many">>; },"strict",ZodTypeAny, {limit?:number;path:string[]; }, {limit?:number;path:string[]; }>
Defined in: index.ts:94
FilesSnapshotRestoreArgumentsSchema
constFilesSnapshotRestoreArgumentsSchema:ZodObject<{expectedVersion:ZodOptional<ZodString>>;path:ZodArray<ZodString,"many">>;snapshotId:ZodString; },"strict",ZodTypeAny, {expectedVersion?:string;path:string[];snapshotId:string; }, {expectedVersion?:string;path:string[];snapshotId:string; }>
Defined in: index.ts:102
SHAREDOS_TOOL_SOURCE
constSHAREDOS_TOOL_SOURCE:"sharedos"="sharedos"
Defined in: index.ts:20
Functions
createFileTools()
createFileTools(
provider): readonlyToolHandler[]
Defined in: index.ts:143
Portable file tools over one host-owned provider.
A host may expose roots such as Raw, Memory, Workspace, and Wiki, but they remain paths in this one resource plane. Search indexes and context mounts must preserve the same file grants; they are not independent authority.
Parameters
| Parameter | Type |
|---|---|
provider | ResourceProvider |
Returns
readonly ToolHandler[]
registerStandardOsTools()
registerStandardOsTools(
kernel,providers):void
Defined in: index.ts:125
Parameters
| Parameter | Type |
|---|---|
kernel | Pick<SharedOSKernel, "registerTool"> |
providers | StandardOsProviders |
Returns
void