@opencode/protocol 0.0.0-dev-20436 → 0.0.0-dev-20438
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/groups/vcs.d.ts +15 -3
- package/dist/groups/vcs.js +19 -2
- package/package.json +2 -2
package/dist/groups/vcs.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
-
import { ServiceUnavailableError } from "../errors.js";
|
|
4
|
-
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
3
|
+
import { ConflictError, InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
4
|
+
declare const VcsInitNotSupportedError_base: Schema.Class<VcsInitNotSupportedError, Schema.TaggedStruct<"VcsInitNotSupportedError", {
|
|
5
|
+
readonly providerID: Schema.String;
|
|
6
|
+
readonly message: Schema.String;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
export declare class VcsInitNotSupportedError extends VcsInitNotSupportedError_base {
|
|
9
|
+
}
|
|
10
|
+
export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEndpoint.HttpApiEndpoint<"vcs.init", "POST", "/api/vcs/init", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
11
|
+
readonly provider: Schema.optional<Schema.String>;
|
|
12
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
13
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
14
|
+
}>>;
|
|
15
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError | typeof ServiceUnavailableError | typeof VcsInitNotSupportedError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.get", "GET", "/api/vcs", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
16
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
17
|
readonly directory: Schema.optional<Schema.String>;
|
|
7
18
|
}>>;
|
|
@@ -73,3 +84,4 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
|
|
|
73
84
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
74
85
|
}>>;
|
|
75
86
|
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never>, false>;
|
|
87
|
+
export {};
|
package/dist/groups/vcs.js
CHANGED
|
@@ -3,9 +3,15 @@ import { Location } from "@opencode/schema/location";
|
|
|
3
3
|
import { NonNegativeInt, PositiveInt, optional } from "@opencode/schema/schema";
|
|
4
4
|
import { Vcs } from "@opencode/schema/vcs";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
|
-
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
6
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
7
7
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
8
|
-
import { ServiceUnavailableError } from "../errors.js";
|
|
8
|
+
import { ConflictError, InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
9
|
+
const InitQuery = Schema.Struct({
|
|
10
|
+
...LocationQuery.fields,
|
|
11
|
+
provider: Schema.optional(Schema.String),
|
|
12
|
+
});
|
|
13
|
+
export class VcsInitNotSupportedError extends Schema.TaggedError()("VcsInitNotSupportedError", { providerID: Schema.String, message: Schema.String }, { httpApiStatus: 501 }) {
|
|
14
|
+
}
|
|
9
15
|
const BranchesQuery = Schema.Struct({
|
|
10
16
|
...LocationQuery.fields,
|
|
11
17
|
search: Schema.optional(Schema.String),
|
|
@@ -18,6 +24,17 @@ const DiffQuery = Schema.Struct({
|
|
|
18
24
|
context: Schema.NumberFromString.pipe(Schema.decodeTo(NonNegativeInt), Schema.optional),
|
|
19
25
|
});
|
|
20
26
|
export const VcsGroup = HttpApiGroup.make("server.vcs")
|
|
27
|
+
.add(HttpApiEndpoint.post("vcs.init", "/api/vcs/init", {
|
|
28
|
+
query: InitQuery,
|
|
29
|
+
success: HttpApiSchema.NoContent,
|
|
30
|
+
error: [ConflictError, InvalidRequestError, VcsInitNotSupportedError, ServiceUnavailableError],
|
|
31
|
+
})
|
|
32
|
+
.annotateMerge(locationQueryOpenApi)
|
|
33
|
+
.annotateMerge(OpenApi.annotations({
|
|
34
|
+
identifier: "vcs.init",
|
|
35
|
+
summary: "Initialize VCS repository",
|
|
36
|
+
description: "Initialize a repository using the selected VCS provider in a markerless project's directory and refresh its location services. Omitting provider defaults to git; built-in git and hg providers support initialization. An unknown provider returns 400; a registered provider without init returns 501.",
|
|
37
|
+
})))
|
|
21
38
|
.add(HttpApiEndpoint.get("vcs.get", "/api/vcs", {
|
|
22
39
|
query: LocationQuery,
|
|
23
40
|
success: Location.response(Vcs.Info),
|
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-20438",
|
|
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-20438",
|
|
36
36
|
"effect": "4.0.0-rc.112"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|