@opencode/protocol 0.0.0-dev-19726 → 0.0.0-dev-19729
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1 -1
- package/dist/groups/fs.d.ts +12 -0
- package/dist/groups/fs.js +17 -0
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -45,4 +45,4 @@ export const groupNames = {
|
|
|
45
45
|
"server.config": "config",
|
|
46
46
|
};
|
|
47
47
|
export const promiseOmitEndpoints = new Set(["pty.connect", "persistentPty.connect"]);
|
|
48
|
-
export const effectOmitEndpoints = new Set(["fs.read", "pty.connect", "persistentPty.connect"]);
|
|
48
|
+
export const effectOmitEndpoints = new Set(["fs.read", "fs.write", "pty.connect", "persistentPty.connect"]);
|
package/dist/groups/fs.d.ts
CHANGED
|
@@ -33,4 +33,16 @@ export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", Htt
|
|
|
33
33
|
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
34
34
|
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
35
35
|
}>>;
|
|
36
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.write", "POST", "/api/experimental/fs/write", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
37
|
+
readonly path: Schema.String;
|
|
38
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
39
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
40
|
+
}>>;
|
|
41
|
+
}>>, Schema.toCodecJson<Schema.Uint8Array>, never, Schema.toCodecJson<Schema.Struct<{
|
|
42
|
+
readonly location: Schema.Struct<{
|
|
43
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
44
|
+
}>;
|
|
45
|
+
readonly data: Schema.Struct<{
|
|
46
|
+
readonly path: Schema.brand<Schema.String, "AbsolutePath">;
|
|
47
|
+
}>;
|
|
36
48
|
}>>, never, never, never>, false>;
|
package/dist/groups/fs.js
CHANGED
|
@@ -11,6 +11,12 @@ const ListQuery = Schema.Struct({
|
|
|
11
11
|
description: "An absolute path or a path relative to the requested location. Defaults to the location directory.",
|
|
12
12
|
}),
|
|
13
13
|
});
|
|
14
|
+
const WriteQuery = Schema.Struct({
|
|
15
|
+
...LocationQuery.fields,
|
|
16
|
+
path: Schema.String.annotate({
|
|
17
|
+
description: "An absolute path or a path relative to the requested location. Missing parent directories are created.",
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
14
20
|
const FindQuery = Schema.Struct({
|
|
15
21
|
...LocationQuery.fields,
|
|
16
22
|
query: FileSystem.FindInput.fields.query,
|
|
@@ -48,6 +54,17 @@ export const FileSystemGroup = HttpApiGroup.make("server.fs")
|
|
|
48
54
|
identifier: "fs.find",
|
|
49
55
|
summary: "Find files",
|
|
50
56
|
description: "Find recursively ranked filesystem entries relative to the requested location.",
|
|
57
|
+
})))
|
|
58
|
+
.add(HttpApiEndpoint.post("fs.write", "/api/experimental/fs/write", {
|
|
59
|
+
query: WriteQuery,
|
|
60
|
+
payload: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
|
|
61
|
+
success: Location.response(FileSystem.Write),
|
|
62
|
+
})
|
|
63
|
+
.annotateMerge(locationQueryOpenApi)
|
|
64
|
+
.annotateMerge(OpenApi.annotations({
|
|
65
|
+
identifier: "experimental.fs.write",
|
|
66
|
+
summary: "Write file",
|
|
67
|
+
description: "Write the raw request body to an absolute path or a path relative to the requested location, creating parent directories, and return the resolved absolute path. Unlike read, the target is not confined to the location. Experimental: may change without compatibility guarantees.",
|
|
51
68
|
})))
|
|
52
69
|
.annotateMerge(OpenApi.annotations({
|
|
53
70
|
title: "filesystem",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/protocol",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19729",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typecheck": "tsgo --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@opencode/schema": "0.0.0-dev-
|
|
35
|
+
"@opencode/schema": "0.0.0-dev-19729",
|
|
36
36
|
"effect": "4.0.0-rc.112"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|