@opencode/protocol 0.0.0-beta-19275
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/api.d.ts +56 -0
- package/dist/api.js +79 -0
- package/dist/client.d.ts +64 -0
- package/dist/client.js +50 -0
- package/dist/errors.d.ts +153 -0
- package/dist/errors.js +122 -0
- package/dist/groups/agent.d.ts +194 -0
- package/dist/groups/agent.js +30 -0
- package/dist/groups/command.d.ts +15 -0
- package/dist/groups/command.js +20 -0
- package/dist/groups/config.d.ts +9 -0
- package/dist/groups/config.js +16 -0
- package/dist/groups/credential.d.ts +32 -0
- package/dist/groups/credential.js +40 -0
- package/dist/groups/debug.d.ts +17 -0
- package/dist/groups/debug.js +23 -0
- package/dist/groups/event.d.ts +14798 -0
- package/dist/groups/event.js +51 -0
- package/dist/groups/form.d.ts +781 -0
- package/dist/groups/form.js +95 -0
- package/dist/groups/fs.d.ts +35 -0
- package/dist/groups/fs.js +53 -0
- package/dist/groups/generate.d.ts +33 -0
- package/dist/groups/generate.js +23 -0
- package/dist/groups/health.d.ts +15 -0
- package/dist/groups/health.js +20 -0
- package/dist/groups/integration.d.ts +1154 -0
- package/dist/groups/integration.js +149 -0
- package/dist/groups/location.d.ts +16 -0
- package/dist/groups/location.js +34 -0
- package/dist/groups/mcp.d.ts +82 -0
- package/dist/groups/mcp.js +78 -0
- package/dist/groups/message.d.ts +688 -0
- package/dist/groups/message.js +37 -0
- package/dist/groups/migration.d.ts +28 -0
- package/dist/groups/migration.js +21 -0
- package/dist/groups/model.d.ts +312 -0
- package/dist/groups/model.js +33 -0
- package/dist/groups/permission.d.ts +156 -0
- package/dist/groups/permission.js +97 -0
- package/dist/groups/persistent-pty.d.ts +249 -0
- package/dist/groups/persistent-pty.js +91 -0
- package/dist/groups/plugin.d.ts +91 -0
- package/dist/groups/plugin.js +55 -0
- package/dist/groups/project.d.ts +90 -0
- package/dist/groups/project.js +39 -0
- package/dist/groups/provider.d.ts +154 -0
- package/dist/groups/provider.js +34 -0
- package/dist/groups/pty.d.ts +147 -0
- package/dist/groups/pty.js +113 -0
- package/dist/groups/reference.d.ts +29 -0
- package/dist/groups/reference.js +20 -0
- package/dist/groups/rpc.d.ts +22 -0
- package/dist/groups/rpc.js +24 -0
- package/dist/groups/server.d.ts +5 -0
- package/dist/groups/server.js +11 -0
- package/dist/groups/session.d.ts +10593 -0
- package/dist/groups/session.js +557 -0
- package/dist/groups/shell.d.ts +152 -0
- package/dist/groups/shell.js +82 -0
- package/dist/groups/skill.d.ts +20 -0
- package/dist/groups/skill.js +20 -0
- package/dist/groups/vcs.d.ts +70 -0
- package/dist/groups/vcs.js +76 -0
- package/dist/groups/websearch.d.ts +28 -0
- package/dist/groups/websearch.js +34 -0
- package/dist/groups/workspace.d.ts +22 -0
- package/dist/groups/workspace.js +27 -0
- package/dist/groups/worktree.d.ts +47 -0
- package/dist/groups/worktree.js +61 -0
- package/dist/middleware/authorization.d.ts +13 -0
- package/dist/middleware/authorization.js +6 -0
- package/dist/middleware/schema-error.d.ts +13 -0
- package/dist/middleware/schema-error.js +4 -0
- package/dist/simulation.d.ts +1801 -0
- package/dist/simulation.js +487 -0
- package/package.json +45 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
4
|
+
import { ShellNotFoundError } from "../errors.js";
|
|
5
|
+
export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpApiEndpoint.HttpApiEndpoint<"shell.list", "GET", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
6
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
7
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
8
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
9
|
+
}>>;
|
|
10
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
11
|
+
readonly location: typeof Location.Info;
|
|
12
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
13
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
14
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
15
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
16
|
+
};
|
|
17
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
18
|
+
readonly command: Schema.String;
|
|
19
|
+
readonly cwd: Schema.String;
|
|
20
|
+
readonly shell: Schema.String;
|
|
21
|
+
readonly file: Schema.String;
|
|
22
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
23
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
24
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
25
|
+
readonly time: Schema.Struct<{
|
|
26
|
+
readonly started: Schema.Finite;
|
|
27
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
28
|
+
}>;
|
|
29
|
+
}>>;
|
|
30
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.create", "POST", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
31
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
32
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
33
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
34
|
+
}>>;
|
|
35
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
36
|
+
readonly command: Schema.String;
|
|
37
|
+
readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
38
|
+
readonly timeout: Schema.Int;
|
|
39
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
40
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
41
|
+
readonly location: typeof Location.Info;
|
|
42
|
+
readonly data: Schema.Struct<{
|
|
43
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
44
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
45
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
46
|
+
};
|
|
47
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
48
|
+
readonly command: Schema.String;
|
|
49
|
+
readonly cwd: Schema.String;
|
|
50
|
+
readonly shell: Schema.String;
|
|
51
|
+
readonly file: Schema.String;
|
|
52
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
53
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
54
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
55
|
+
readonly time: Schema.Struct<{
|
|
56
|
+
readonly started: Schema.Finite;
|
|
57
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.get", "GET", "/api/shell/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
61
|
+
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
62
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
63
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
64
|
+
};
|
|
65
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
66
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
67
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
68
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
69
|
+
}>>;
|
|
70
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
71
|
+
readonly location: typeof Location.Info;
|
|
72
|
+
readonly data: Schema.Struct<{
|
|
73
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
74
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
75
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
76
|
+
};
|
|
77
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
78
|
+
readonly command: Schema.String;
|
|
79
|
+
readonly cwd: Schema.String;
|
|
80
|
+
readonly shell: Schema.String;
|
|
81
|
+
readonly file: Schema.String;
|
|
82
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
83
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
84
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
85
|
+
readonly time: Schema.Struct<{
|
|
86
|
+
readonly started: Schema.Finite;
|
|
87
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
88
|
+
}>;
|
|
89
|
+
}>;
|
|
90
|
+
}>>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.timeout", "PATCH", "/api/shell/:id/timeout", Schema.toCodecStringTree<Schema.Struct<{
|
|
91
|
+
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
92
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
93
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
94
|
+
};
|
|
95
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
96
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
97
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
98
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
99
|
+
}>>;
|
|
100
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
101
|
+
readonly timeout: Schema.Int;
|
|
102
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
103
|
+
readonly location: typeof Location.Info;
|
|
104
|
+
readonly data: Schema.Struct<{
|
|
105
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
106
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
107
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
108
|
+
};
|
|
109
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
110
|
+
readonly command: Schema.String;
|
|
111
|
+
readonly cwd: Schema.String;
|
|
112
|
+
readonly shell: Schema.String;
|
|
113
|
+
readonly file: Schema.String;
|
|
114
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
115
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
116
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
117
|
+
readonly time: Schema.Struct<{
|
|
118
|
+
readonly started: Schema.Finite;
|
|
119
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
120
|
+
}>;
|
|
121
|
+
}>;
|
|
122
|
+
}>>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.output", "GET", "/api/shell/:id/output", Schema.toCodecStringTree<Schema.Struct<{
|
|
123
|
+
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
124
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
125
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
126
|
+
};
|
|
127
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
128
|
+
readonly cursor: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
129
|
+
readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
130
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
131
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
132
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
133
|
+
}>>;
|
|
134
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
135
|
+
readonly location: typeof Location.Info;
|
|
136
|
+
readonly data: Schema.Struct<{
|
|
137
|
+
readonly output: Schema.String;
|
|
138
|
+
readonly cursor: Schema.Int;
|
|
139
|
+
readonly size: Schema.Int;
|
|
140
|
+
readonly truncated: Schema.Boolean;
|
|
141
|
+
}>;
|
|
142
|
+
}>>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.remove", "DELETE", "/api/shell/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
143
|
+
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
144
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
145
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
146
|
+
};
|
|
147
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
148
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
149
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
150
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
151
|
+
}>>;
|
|
152
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never>, false>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Shell } from "@opencode/schema/shell";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { NonNegativeInt } from "@opencode/schema/schema";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
6
|
+
import { ShellNotFoundError } from "../errors.js";
|
|
7
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
8
|
+
const TimeoutInput = Schema.Struct({
|
|
9
|
+
timeout: NonNegativeInt,
|
|
10
|
+
});
|
|
11
|
+
export const ShellGroup = HttpApiGroup.make("server.shell")
|
|
12
|
+
.add(HttpApiEndpoint.get("shell.list", "/api/shell", {
|
|
13
|
+
query: LocationQuery,
|
|
14
|
+
success: Location.response(Schema.Array(Shell.Info)),
|
|
15
|
+
})
|
|
16
|
+
.annotateMerge(locationQueryOpenApi)
|
|
17
|
+
.annotateMerge(OpenApi.annotations({
|
|
18
|
+
identifier: "v2.shell.list",
|
|
19
|
+
summary: "List running shell commands",
|
|
20
|
+
description: "List currently running shell commands for a location. Exited commands are not included.",
|
|
21
|
+
})))
|
|
22
|
+
.add(HttpApiEndpoint.post("shell.create", "/api/shell", {
|
|
23
|
+
query: LocationQuery,
|
|
24
|
+
payload: Shell.CreateInput,
|
|
25
|
+
success: Location.response(Shell.Info),
|
|
26
|
+
})
|
|
27
|
+
.annotateMerge(locationQueryOpenApi)
|
|
28
|
+
.annotateMerge(OpenApi.annotations({
|
|
29
|
+
identifier: "v2.shell.create",
|
|
30
|
+
summary: "Run shell command",
|
|
31
|
+
description: "Spawn one non-interactive shell command for a location. Combined stdout/stderr is captured to a file pageable via output.",
|
|
32
|
+
})))
|
|
33
|
+
.add(HttpApiEndpoint.get("shell.get", "/api/shell/:id", {
|
|
34
|
+
params: { id: Shell.ID },
|
|
35
|
+
query: LocationQuery,
|
|
36
|
+
success: Location.response(Shell.Info),
|
|
37
|
+
error: ShellNotFoundError,
|
|
38
|
+
})
|
|
39
|
+
.annotateMerge(locationQueryOpenApi)
|
|
40
|
+
.annotateMerge(OpenApi.annotations({
|
|
41
|
+
identifier: "v2.shell.get",
|
|
42
|
+
summary: "Get shell command",
|
|
43
|
+
description: "Get one shell command, including its status and exit code once exited.",
|
|
44
|
+
})))
|
|
45
|
+
.add(HttpApiEndpoint.patch("shell.timeout", "/api/shell/:id/timeout", {
|
|
46
|
+
params: { id: Shell.ID },
|
|
47
|
+
query: LocationQuery,
|
|
48
|
+
payload: TimeoutInput,
|
|
49
|
+
success: Location.response(Shell.Info),
|
|
50
|
+
error: ShellNotFoundError,
|
|
51
|
+
})
|
|
52
|
+
.annotateMerge(locationQueryOpenApi)
|
|
53
|
+
.annotateMerge(OpenApi.annotations({
|
|
54
|
+
identifier: "v2.shell.timeout",
|
|
55
|
+
summary: "Update shell timeout",
|
|
56
|
+
description: "Replace a running shell command's timeout from now, or clear it with zero.",
|
|
57
|
+
})))
|
|
58
|
+
.add(HttpApiEndpoint.get("shell.output", "/api/shell/:id/output", {
|
|
59
|
+
params: { id: Shell.ID },
|
|
60
|
+
query: Schema.Struct({ ...LocationQuery.fields, ...Shell.OutputInput.fields }),
|
|
61
|
+
success: Location.response(Shell.Output),
|
|
62
|
+
error: ShellNotFoundError,
|
|
63
|
+
})
|
|
64
|
+
.annotateMerge(locationQueryOpenApi)
|
|
65
|
+
.annotateMerge(OpenApi.annotations({
|
|
66
|
+
identifier: "v2.shell.output",
|
|
67
|
+
summary: "Read shell output",
|
|
68
|
+
description: "Page through captured combined output by absolute byte cursor.",
|
|
69
|
+
})))
|
|
70
|
+
.add(HttpApiEndpoint.delete("shell.remove", "/api/shell/:id", {
|
|
71
|
+
params: { id: Shell.ID },
|
|
72
|
+
query: LocationQuery,
|
|
73
|
+
success: HttpApiSchema.NoContent,
|
|
74
|
+
error: ShellNotFoundError,
|
|
75
|
+
})
|
|
76
|
+
.annotateMerge(locationQueryOpenApi)
|
|
77
|
+
.annotateMerge(OpenApi.annotations({
|
|
78
|
+
identifier: "v2.shell.remove",
|
|
79
|
+
summary: "Remove shell command",
|
|
80
|
+
description: "Terminate and remove one shell command and its retained output.",
|
|
81
|
+
})))
|
|
82
|
+
.annotateMerge(OpenApi.annotations({ title: "shell", description: "Experimental location-scoped shell command routes." }));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
export declare const SkillGroup: HttpApiGroup.HttpApiGroup<"server.skill", HttpApiEndpoint.HttpApiEndpoint<"skill.list", "GET", "/api/skill", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
6
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
7
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
10
|
+
readonly location: typeof Location.Info;
|
|
11
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
12
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
13
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
14
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
15
|
+
readonly slash: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
16
|
+
readonly autoinvoke: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
17
|
+
readonly location: Schema.brand<Schema.String, "AbsolutePath">;
|
|
18
|
+
readonly content: Schema.String;
|
|
19
|
+
}>>;
|
|
20
|
+
}>>, never, never, never>, false>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Skill } from "@opencode/schema/skill";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const SkillGroup = HttpApiGroup.make("server.skill")
|
|
7
|
+
.add(HttpApiEndpoint.get("skill.list", "/api/skill", {
|
|
8
|
+
query: LocationQuery,
|
|
9
|
+
success: Location.response(Schema.Array(Skill.Info)),
|
|
10
|
+
})
|
|
11
|
+
.annotateMerge(locationQueryOpenApi)
|
|
12
|
+
.annotateMerge(OpenApi.annotations({
|
|
13
|
+
identifier: "v2.skill.list",
|
|
14
|
+
summary: "List skills",
|
|
15
|
+
description: "Retrieve currently registered skills.",
|
|
16
|
+
})))
|
|
17
|
+
.annotateMerge(OpenApi.annotations({
|
|
18
|
+
title: "skill",
|
|
19
|
+
description: "Experimental skill routes.",
|
|
20
|
+
}));
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
import { ServiceUnavailableError } from "../errors.js";
|
|
5
|
+
export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEndpoint.HttpApiEndpoint<"vcs.get", "GET", "/api/vcs", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
6
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
7
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
8
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
9
|
+
}>>;
|
|
10
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
11
|
+
readonly location: typeof Location.Info;
|
|
12
|
+
readonly data: Schema.Struct<{
|
|
13
|
+
readonly branch: Schema.Struct<{
|
|
14
|
+
readonly current: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
15
|
+
readonly default: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.base", "GET", "/api/vcs/base", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
19
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
20
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
21
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
22
|
+
}>>;
|
|
23
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
24
|
+
readonly location: typeof Location.Info;
|
|
25
|
+
readonly data: Schema.NullOr<Schema.Struct<{
|
|
26
|
+
readonly name: Schema.String;
|
|
27
|
+
readonly ref: Schema.String;
|
|
28
|
+
readonly source: Schema.Literals<readonly ["reflog", "default"]>;
|
|
29
|
+
}>>;
|
|
30
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.status", "GET", "/api/vcs/status", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
31
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
32
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
33
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
34
|
+
}>>;
|
|
35
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
36
|
+
readonly location: typeof Location.Info;
|
|
37
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
38
|
+
readonly file: Schema.String;
|
|
39
|
+
readonly additions: Schema.Int;
|
|
40
|
+
readonly deletions: Schema.Int;
|
|
41
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
42
|
+
}>>;
|
|
43
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.branches", "GET", "/api/vcs/branches", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
44
|
+
readonly search: Schema.optional<Schema.String>;
|
|
45
|
+
readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
46
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
47
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
48
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
49
|
+
}>>;
|
|
50
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
51
|
+
readonly location: typeof Location.Info;
|
|
52
|
+
readonly data: Schema.$Array<Schema.String>;
|
|
53
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.diff", "GET", "/api/vcs/diff", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
54
|
+
readonly mode: Schema.Literals<readonly ["working", "branch", "committed"]>;
|
|
55
|
+
readonly base: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
56
|
+
readonly context: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
57
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
58
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
59
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
60
|
+
}>>;
|
|
61
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
62
|
+
readonly location: typeof Location.Info;
|
|
63
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
64
|
+
readonly file: Schema.String;
|
|
65
|
+
readonly patch: Schema.String;
|
|
66
|
+
readonly additions: Schema.Int;
|
|
67
|
+
readonly deletions: Schema.Int;
|
|
68
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
69
|
+
}>>;
|
|
70
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never>, false>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { FileDiff } from "@opencode/schema/file-diff";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { NonNegativeInt, PositiveInt, optional } from "@opencode/schema/schema";
|
|
4
|
+
import { Vcs } from "@opencode/schema/vcs";
|
|
5
|
+
import { Schema } from "effect";
|
|
6
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
7
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
8
|
+
import { ServiceUnavailableError } from "../errors.js";
|
|
9
|
+
const BranchesQuery = Schema.Struct({
|
|
10
|
+
...LocationQuery.fields,
|
|
11
|
+
search: Schema.optional(Schema.String),
|
|
12
|
+
limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional),
|
|
13
|
+
});
|
|
14
|
+
const DiffQuery = Schema.Struct({
|
|
15
|
+
...LocationQuery.fields,
|
|
16
|
+
mode: Vcs.Mode,
|
|
17
|
+
base: optional(Schema.String),
|
|
18
|
+
context: Schema.NumberFromString.pipe(Schema.decodeTo(NonNegativeInt), Schema.optional),
|
|
19
|
+
});
|
|
20
|
+
export const VcsGroup = HttpApiGroup.make("server.vcs")
|
|
21
|
+
.add(HttpApiEndpoint.get("vcs.get", "/api/vcs", {
|
|
22
|
+
query: LocationQuery,
|
|
23
|
+
success: Location.response(Vcs.Info),
|
|
24
|
+
})
|
|
25
|
+
.annotateMerge(locationQueryOpenApi)
|
|
26
|
+
.annotateMerge(OpenApi.annotations({
|
|
27
|
+
identifier: "v2.vcs.get",
|
|
28
|
+
summary: "VCS info",
|
|
29
|
+
description: "Get current and default branch information for the requested location.",
|
|
30
|
+
})))
|
|
31
|
+
.add(HttpApiEndpoint.get("vcs.base", "/api/vcs/base", {
|
|
32
|
+
query: LocationQuery,
|
|
33
|
+
success: Location.response(Schema.NullOr(Vcs.Base)),
|
|
34
|
+
error: ServiceUnavailableError,
|
|
35
|
+
})
|
|
36
|
+
.annotateMerge(locationQueryOpenApi)
|
|
37
|
+
.annotateMerge(OpenApi.annotations({
|
|
38
|
+
identifier: "v2.vcs.base",
|
|
39
|
+
summary: "VCS review base",
|
|
40
|
+
description: "Infer a local review base from named branch creation history, or the repository default only when currently on that branch. Returns null before the first commit or when the provider lacks base metadata; ambiguous Git history requires an explicit base on diff requests.",
|
|
41
|
+
})))
|
|
42
|
+
.add(HttpApiEndpoint.get("vcs.status", "/api/vcs/status", {
|
|
43
|
+
query: LocationQuery,
|
|
44
|
+
success: Location.response(Schema.Array(Vcs.FileStatus)),
|
|
45
|
+
})
|
|
46
|
+
.annotateMerge(locationQueryOpenApi)
|
|
47
|
+
.annotateMerge(OpenApi.annotations({
|
|
48
|
+
identifier: "v2.vcs.status",
|
|
49
|
+
summary: "VCS status",
|
|
50
|
+
description: "List uncommitted working-copy changes relative to the requested location.",
|
|
51
|
+
})))
|
|
52
|
+
.add(HttpApiEndpoint.get("vcs.branches", "/api/vcs/branches", {
|
|
53
|
+
query: BranchesQuery,
|
|
54
|
+
success: Location.response(Vcs.BranchList),
|
|
55
|
+
})
|
|
56
|
+
.annotateMerge(locationQueryOpenApi)
|
|
57
|
+
.annotateMerge(OpenApi.annotations({
|
|
58
|
+
identifier: "v2.vcs.branches",
|
|
59
|
+
summary: "VCS branches",
|
|
60
|
+
description: "List local and remote branches available at the requested location.",
|
|
61
|
+
})))
|
|
62
|
+
.add(HttpApiEndpoint.get("vcs.diff", "/api/vcs/diff", {
|
|
63
|
+
query: DiffQuery,
|
|
64
|
+
success: Location.response(Schema.Array(FileDiff.Info)),
|
|
65
|
+
error: ServiceUnavailableError,
|
|
66
|
+
})
|
|
67
|
+
.annotateMerge(locationQueryOpenApi)
|
|
68
|
+
.annotateMerge(OpenApi.annotations({
|
|
69
|
+
identifier: "v2.vcs.diff",
|
|
70
|
+
summary: "VCS diff",
|
|
71
|
+
description: "Diff HEAD to the working copy (working), the base merge-base to the working copy (branch), or the base merge-base to HEAD (committed). Omitting base preserves repository-default comparison; supplying it overrides the comparison without saving it.",
|
|
72
|
+
})))
|
|
73
|
+
.annotateMerge(OpenApi.annotations({
|
|
74
|
+
title: "vcs",
|
|
75
|
+
description: "Location-scoped version control routes.",
|
|
76
|
+
}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { WebSearch } from "@opencode/schema/websearch";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
5
|
+
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
6
|
+
export declare const WebSearchGroup: HttpApiGroup.HttpApiGroup<"server.websearch", HttpApiEndpoint.HttpApiEndpoint<"websearch.providers", "GET", "/api/websearch/provider", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
7
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
8
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
9
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
10
|
+
}>>;
|
|
11
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
12
|
+
readonly location: typeof Location.Info;
|
|
13
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
14
|
+
readonly id: Schema.brand<Schema.String, "WebSearch.ID">;
|
|
15
|
+
readonly name: Schema.String;
|
|
16
|
+
}>>;
|
|
17
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"websearch.query", "POST", "/api/websearch", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
18
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
19
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
20
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
21
|
+
}>>;
|
|
22
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
23
|
+
readonly query: Schema.String;
|
|
24
|
+
readonly providerID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WebSearch.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "WebSearch.ID">>, never, never>;
|
|
25
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
26
|
+
readonly location: typeof Location.Info;
|
|
27
|
+
readonly data: typeof WebSearch.Response;
|
|
28
|
+
}>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { WebSearch } from "@opencode/schema/websearch";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
+
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
6
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
|
+
export const WebSearchGroup = HttpApiGroup.make("server.websearch")
|
|
8
|
+
.add(HttpApiEndpoint.get("websearch.providers", "/api/websearch/provider", {
|
|
9
|
+
query: LocationQuery,
|
|
10
|
+
success: Location.response(Schema.Array(WebSearch.Provider)),
|
|
11
|
+
error: ServiceUnavailableError,
|
|
12
|
+
})
|
|
13
|
+
.annotateMerge(locationQueryOpenApi)
|
|
14
|
+
.annotateMerge(OpenApi.annotations({
|
|
15
|
+
identifier: "v2.websearch.providers",
|
|
16
|
+
summary: "List web search providers",
|
|
17
|
+
description: "Return the registered web search providers.",
|
|
18
|
+
})))
|
|
19
|
+
.add(HttpApiEndpoint.post("websearch.query", "/api/websearch", {
|
|
20
|
+
query: LocationQuery,
|
|
21
|
+
payload: Schema.Struct(WebSearch.Input.fields),
|
|
22
|
+
success: Location.response(WebSearch.Response),
|
|
23
|
+
error: [InvalidRequestError, ServiceUnavailableError],
|
|
24
|
+
})
|
|
25
|
+
.annotateMerge(locationQueryOpenApi)
|
|
26
|
+
.annotateMerge(OpenApi.annotations({
|
|
27
|
+
identifier: "v2.websearch.query",
|
|
28
|
+
summary: "Search the web",
|
|
29
|
+
description: "Run one web search through the selected provider. Specify a provider to override the configured default.",
|
|
30
|
+
})))
|
|
31
|
+
.annotateMerge(OpenApi.annotations({
|
|
32
|
+
title: "websearch",
|
|
33
|
+
description: "Location-scoped web search routes.",
|
|
34
|
+
}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
import { ConflictError, ProviderNotFoundError, UnknownError } from "../errors.js";
|
|
4
|
+
export declare const WorkspaceGroup: HttpApiGroup.HttpApiGroup<"server.workspace", HttpApiEndpoint.HttpApiEndpoint<"workspace.create", "POST", "/api/workspace", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
5
|
+
readonly id: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
6
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
7
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
8
|
+
}>;
|
|
9
|
+
readonly provider: Schema.String;
|
|
10
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
11
|
+
readonly data: Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
13
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
14
|
+
};
|
|
15
|
+
}>>, Schema.toCodecJson<typeof ConflictError | typeof ProviderNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"workspace.destroy", "DELETE", "/api/workspace/:workspaceID", Schema.toCodecStringTree<Schema.Struct<{
|
|
16
|
+
workspaceID: Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
17
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
18
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
19
|
+
};
|
|
20
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
21
|
+
readonly destroyed: Schema.Boolean;
|
|
22
|
+
}>>, Schema.toCodecJson<typeof UnknownError>, never, never>, false>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Workspace } from "@opencode/schema/workspace";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { ConflictError, ProviderNotFoundError, UnknownError } from "../errors.js";
|
|
5
|
+
export const WorkspaceGroup = HttpApiGroup.make("server.workspace")
|
|
6
|
+
.add(HttpApiEndpoint.post("workspace.create", "/api/workspace", {
|
|
7
|
+
payload: Schema.Struct({
|
|
8
|
+
id: Workspace.ID.pipe(Schema.optional),
|
|
9
|
+
provider: Schema.String,
|
|
10
|
+
}),
|
|
11
|
+
success: Schema.Struct({ data: Workspace.ID }),
|
|
12
|
+
error: [ConflictError, ProviderNotFoundError],
|
|
13
|
+
}).annotateMerge(OpenApi.annotations({
|
|
14
|
+
identifier: "v2.workspace.create",
|
|
15
|
+
summary: "Create workspace",
|
|
16
|
+
description: "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.",
|
|
17
|
+
})))
|
|
18
|
+
.add(HttpApiEndpoint.delete("workspace.destroy", "/api/workspace/:workspaceID", {
|
|
19
|
+
params: { workspaceID: Workspace.ID },
|
|
20
|
+
success: Workspace.DestroyResult,
|
|
21
|
+
error: UnknownError,
|
|
22
|
+
}).annotateMerge(OpenApi.annotations({
|
|
23
|
+
identifier: "v2.workspace.destroy",
|
|
24
|
+
summary: "Destroy workspace",
|
|
25
|
+
description: "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.",
|
|
26
|
+
})))
|
|
27
|
+
.annotateMerge(OpenApi.annotations({ title: "workspace", description: "Workspace lifecycle routes." }));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
3
|
+
declare const WorktreeError_base: Schema.Class<WorktreeError, Schema.Struct<{
|
|
4
|
+
readonly name: Schema.Literal<"WorktreeError">;
|
|
5
|
+
readonly data: Schema.Struct<{
|
|
6
|
+
readonly message: Schema.String;
|
|
7
|
+
readonly forceRequired: Schema.optional<Schema.Boolean>;
|
|
8
|
+
}>;
|
|
9
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
|
+
export declare class WorktreeError extends WorktreeError_base {
|
|
11
|
+
}
|
|
12
|
+
export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree", HttpApiEndpoint.HttpApiEndpoint<"worktree.list", "GET", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
13
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
14
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
15
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
16
|
+
}>>;
|
|
17
|
+
}>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
18
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
19
|
+
readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
20
|
+
}>>>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.create", "POST", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
21
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
22
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
23
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
24
|
+
}>>;
|
|
25
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
26
|
+
readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Trim, "Worktree.StrategyID">>>, Schema.optionalKey<Schema.brand<Schema.Trim, "Worktree.StrategyID">>, never, never>;
|
|
27
|
+
readonly from: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "AbsolutePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "AbsolutePath">>, never, never>;
|
|
28
|
+
readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Trim>>, Schema.optionalKey<Schema.Trim>, never, never>;
|
|
29
|
+
readonly directory: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "AbsolutePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "AbsolutePath">>, never, never>;
|
|
30
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
31
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
32
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
33
|
+
}>>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.remove", "DELETE", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
34
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
35
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
36
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
37
|
+
}>>;
|
|
38
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
39
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
40
|
+
readonly force: Schema.Boolean;
|
|
41
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.refresh", "POST", "/api/worktree/refresh", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
42
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
43
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
44
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
45
|
+
}>>;
|
|
46
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof WorktreeError>, never, never>, false>;
|
|
47
|
+
export {};
|