Sign In

@opencode-ai/protocol

Package Overview
Dependencies
Maintainers
2
Versions
1223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencode-ai/protocol - npm Package Compare versions

Comparing version
0.0.0-dev-18189
to
0.0.0-dev-18190
+10
-0
dist/groups/vcs.d.ts

@@ -30,2 +30,12 @@ import { Location } from "@opencode-ai/schema/location";

}>>;
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.branches", "GET", "/api/vcs/branches", never, Schema.toCodecStringTree<Schema.Struct<{
readonly search: Schema.optional<Schema.String>;
readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
readonly location: Schema.optional<Schema.Struct<{
readonly directory: Schema.optional<Schema.String>;
readonly workspace: Schema.optional<Schema.String>;
}>>;
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
readonly location: typeof Location.Info;
readonly data: Schema.$Array<Schema.String>;
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.diff", "GET", "/api/vcs/diff", never, Schema.toCodecStringTree<Schema.Struct<{

@@ -32,0 +42,0 @@ readonly mode: Schema.Literals<readonly ["working", "branch"]>;

+16
-1
import { FileDiff } from "@opencode-ai/schema/file-diff";
import { Location } from "@opencode-ai/schema/location";
import { NonNegativeInt } from "@opencode-ai/schema/schema";
import { NonNegativeInt, PositiveInt } from "@opencode-ai/schema/schema";
import { Vcs } from "@opencode-ai/schema/vcs";

@@ -8,2 +8,7 @@ import { Schema } from "effect";

import { LocationQuery, locationQueryOpenApi } from "./location.js";
const BranchesQuery = Schema.Struct({
...LocationQuery.fields,
search: Schema.optional(Schema.String),
limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional),
});
const DiffQuery = Schema.Struct({

@@ -35,2 +40,12 @@ ...LocationQuery.fields,

})))
.add(HttpApiEndpoint.get("vcs.branches", "/api/vcs/branches", {
query: BranchesQuery,
success: Location.response(Vcs.BranchList),
})
.annotateMerge(locationQueryOpenApi)
.annotateMerge(OpenApi.annotations({
identifier: "v2.vcs.branches",
summary: "VCS branches",
description: "List local and remote branches available at the requested location.",
})))
.add(HttpApiEndpoint.get("vcs.diff", "/api/vcs/diff", {

@@ -37,0 +52,0 @@ query: DiffQuery,

@@ -27,2 +27,3 @@ import { Schema } from "effect";

readonly from: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "AbsolutePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "AbsolutePath">>, never, never>;
readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Trim>>, Schema.optionalKey<Schema.Trim>, never, never>;
readonly strategy: Schema.brand<Schema.Trim, "Worktree.StrategyID">;

@@ -29,0 +30,0 @@ }>>, never, Schema.toCodecJson<Schema.Struct<{

+2
-2
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/protocol",
"version": "0.0.0-dev-18189",
"version": "0.0.0-dev-18190",
"type": "module",

@@ -35,3 +35,3 @@ "license": "MIT",

"dependencies": {
"@opencode-ai/schema": "0.0.0-dev-18189",
"@opencode-ai/schema": "0.0.0-dev-18190",
"effect": "4.0.0-rc.111"

@@ -38,0 +38,0 @@ },