Sign In

@opencode-ai/protocol

Package Overview
Dependencies
Maintainers
2
Versions
1051
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-next-14693
to
0.0.0-next-14706
+153
-0
dist/groups/model.d.ts

@@ -159,2 +159,155 @@ import { Model } from "@opencode-ai/schema/model";

}>;
}>>, HttpApiEndpoint.Json<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
readonly location: Schema.optional<Schema.Struct<{
readonly directory: Schema.optional<Schema.String>;
readonly workspace: Schema.optional<Schema.String>;
}>>;
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
readonly location: typeof Location.Info;
readonly data: Schema.UndefinedOr<Schema.Struct<{
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
};
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Family">>, never, never>;
readonly name: Schema.String;
readonly api: Schema.Union<readonly [Schema.Struct<{
readonly type: Schema.Literal<"aisdk">;
readonly package: Schema.String;
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
}>, Schema.Struct<{
readonly type: Schema.Literal<"native">;
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
}>]>;
readonly capabilities: Schema.Struct<{
readonly tools: Schema.Boolean;
readonly input: Schema.$Array<Schema.String>;
readonly output: Schema.$Array<Schema.String>;
}>;
readonly request: Schema.Struct<{
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
readonly headers: Schema.$Record<Schema.String, Schema.String>;
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
}>;
readonly variants: Schema.$Array<Schema.Struct<{
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
readonly headers: Schema.$Record<Schema.String, Schema.String>;
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
readonly id: Schema.brand<Schema.String, "VariantID">;
}>>;
readonly time: Schema.Struct<{
readonly released: Schema.Finite;
}>;
readonly cost: Schema.$Array<Schema.Struct<{
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
readonly type: Schema.Literal<"context">;
readonly size: Schema.Int;
}>>>, Schema.optionalKey<Schema.Struct<{
readonly type: Schema.Literal<"context">;
readonly size: Schema.Int;
}>>, never, never>;
readonly input: Schema.Finite;
readonly output: Schema.Finite;
readonly cache: Schema.Struct<{
readonly read: Schema.Finite;
readonly write: Schema.Finite;
}>;
}>>;
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
readonly enabled: Schema.Boolean;
readonly limit: Schema.Struct<{
readonly context: Schema.Int;
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
readonly output: Schema.Int;
}>;
}> & {
empty: (providerID: import("@opencode-ai/schema/provider").ID, modelID: Model.ID) => {
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
readonly providerID: string & import("effect/Brand").Brand<"ProviderV2.ID">;
readonly name: string;
readonly api: {
readonly type: "aisdk";
readonly package: string;
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
readonly url?: string | undefined;
readonly settings?: {
readonly [x: string]: unknown;
} | undefined;
} | {
readonly type: "native";
readonly settings: {
readonly [x: string]: unknown;
};
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
readonly url?: string | undefined;
};
readonly capabilities: {
readonly tools: boolean;
readonly input: readonly string[];
readonly output: readonly string[];
};
readonly request: {
readonly settings: {
readonly [x: string]: unknown;
};
readonly headers: {
readonly [x: string]: string;
};
readonly body: {
readonly [x: string]: Schema.Json;
};
readonly variant?: string | undefined;
};
readonly variants: readonly {
readonly settings: {
readonly [x: string]: unknown;
};
readonly headers: {
readonly [x: string]: string;
};
readonly body: {
readonly [x: string]: Schema.Json;
};
readonly id: string & import("effect/Brand").Brand<"VariantID">;
}[];
readonly time: {
readonly released: number;
};
readonly cost: readonly {
readonly input: number;
readonly output: number;
readonly cache: {
readonly read: number;
readonly write: number;
};
readonly tier?: {
readonly type: "context";
readonly size: number;
} | undefined;
}[];
readonly status: "alpha" | "beta" | "deprecated" | "active";
readonly enabled: boolean;
readonly limit: {
readonly context: number;
readonly output: number;
readonly input?: number | undefined;
};
readonly family?: (string & import("effect/Brand").Brand<"Family">) | undefined;
};
}>;
}>>, HttpApiEndpoint.Json<typeof ServiceUnavailableError>, never, never>, false>;

@@ -19,5 +19,16 @@ import { Model } from "@opencode-ai/schema/model";

})))
.add(HttpApiEndpoint.get("model.default", "/api/model/default", {
query: LocationQuery,
success: Location.response(Schema.UndefinedOr(Model.Info)),
error: ServiceUnavailableError,
})
.annotateMerge(locationQueryOpenApi)
.annotateMerge(OpenApi.annotations({
identifier: "v2.model.default",
summary: "Get default model",
description: "Retrieve the model used when a session has no explicit model selection.",
})))
.annotateMerge(OpenApi.annotations({
title: "models",
description: "Experimental model routes.",
}));
+2
-2
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/protocol",
"version": "0.0.0-next-14693",
"version": "0.0.0-next-14706",
"type": "module",

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

"dependencies": {
"@opencode-ai/schema": "0.0.0-next-14693",
"@opencode-ai/schema": "0.0.0-next-14706",
"effect": "4.0.0-beta.83"

@@ -32,0 +32,0 @@ },

Sorry, the diff of this file is too big to display