@opencode-ai/protocol 0.0.0-dev-18189 → 0.0.0-dev-18190

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.
@@ -27,6 +27,16 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
27
27
  readonly deletions: Schema.Int;
28
28
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
29
29
  }>>;
30
+ }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.branches", "GET", "/api/vcs/branches", never, Schema.toCodecStringTree<Schema.Struct<{
31
+ readonly search: Schema.optional<Schema.String>;
32
+ readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
33
+ readonly location: Schema.optional<Schema.Struct<{
34
+ readonly directory: Schema.optional<Schema.String>;
35
+ readonly workspace: Schema.optional<Schema.String>;
36
+ }>>;
37
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
38
+ readonly location: typeof Location.Info;
39
+ readonly data: Schema.$Array<Schema.String>;
30
40
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.diff", "GET", "/api/vcs/diff", never, Schema.toCodecStringTree<Schema.Struct<{
31
41
  readonly mode: Schema.Literals<readonly ["working", "branch"]>;
32
42
  readonly context: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
@@ -1,10 +1,15 @@
1
1
  import { FileDiff } from "@opencode-ai/schema/file-diff";
2
2
  import { Location } from "@opencode-ai/schema/location";
3
- import { NonNegativeInt } from "@opencode-ai/schema/schema";
3
+ import { NonNegativeInt, PositiveInt } from "@opencode-ai/schema/schema";
4
4
  import { Vcs } from "@opencode-ai/schema/vcs";
5
5
  import { Schema } from "effect";
6
6
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
7
7
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
8
+ const BranchesQuery = Schema.Struct({
9
+ ...LocationQuery.fields,
10
+ search: Schema.optional(Schema.String),
11
+ limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional),
12
+ });
8
13
  const DiffQuery = Schema.Struct({
9
14
  ...LocationQuery.fields,
10
15
  mode: Vcs.Mode,
@@ -30,6 +35,16 @@ export const VcsGroup = HttpApiGroup.make("server.vcs")
30
35
  identifier: "v2.vcs.status",
31
36
  summary: "VCS status",
32
37
  description: "List uncommitted working-copy changes relative to the requested location.",
38
+ })))
39
+ .add(HttpApiEndpoint.get("vcs.branches", "/api/vcs/branches", {
40
+ query: BranchesQuery,
41
+ success: Location.response(Vcs.BranchList),
42
+ })
43
+ .annotateMerge(locationQueryOpenApi)
44
+ .annotateMerge(OpenApi.annotations({
45
+ identifier: "v2.vcs.branches",
46
+ summary: "VCS branches",
47
+ description: "List local and remote branches available at the requested location.",
33
48
  })))
34
49
  .add(HttpApiEndpoint.get("vcs.diff", "/api/vcs/diff", {
35
50
  query: DiffQuery,
@@ -24,6 +24,7 @@ export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree",
24
24
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
25
25
  readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
26
26
  readonly from: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "AbsolutePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "AbsolutePath">>, never, never>;
27
+ readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Trim>>, Schema.optionalKey<Schema.Trim>, never, never>;
27
28
  readonly strategy: Schema.brand<Schema.Trim, "Worktree.StrategyID">;
28
29
  }>>, never, Schema.toCodecJson<Schema.Struct<{
29
30
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-dev-18189",
4
+ "version": "0.0.0-dev-18190",
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-ai/schema": "0.0.0-dev-18189",
35
+ "@opencode-ai/schema": "0.0.0-dev-18190",
36
36
  "effect": "4.0.0-rc.111"
37
37
  },
38
38
  "devDependencies": {