@kilocode/protocol 0.0.0-stage → 0.0.0-v2-9
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 +58 -0
- package/dist/api.js +77 -0
- package/dist/client.d.ts +63 -0
- package/dist/client.js +55 -0
- package/dist/errors.d.ts +193 -0
- package/dist/errors.js +152 -0
- package/dist/groups/agent.d.ts +225 -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 +14 -0
- package/dist/groups/config.js +32 -0
- package/dist/groups/credential.d.ts +93 -0
- package/dist/groups/credential.js +50 -0
- package/dist/groups/debug.d.ts +22 -0
- package/dist/groups/debug.js +49 -0
- package/dist/groups/event.d.ts +14853 -0
- package/dist/groups/event.js +51 -0
- package/dist/groups/form.d.ts +138 -0
- package/dist/groups/form.js +18 -0
- package/dist/groups/fs.d.ts +48 -0
- package/dist/groups/fs.js +73 -0
- package/dist/groups/generate.d.ts +33 -0
- package/dist/groups/generate.js +23 -0
- package/dist/groups/integration.d.ts +1724 -0
- package/dist/groups/integration.js +169 -0
- package/dist/groups/location.d.ts +23 -0
- package/dist/groups/location.js +45 -0
- package/dist/groups/mcp.d.ts +103 -0
- package/dist/groups/mcp.js +114 -0
- package/dist/groups/message.d.ts +1416 -0
- package/dist/groups/message.js +77 -0
- package/dist/groups/migration.d.ts +28 -0
- package/dist/groups/migration.js +21 -0
- package/dist/groups/model.d.ts +399 -0
- package/dist/groups/model.js +33 -0
- package/dist/groups/permission.d.ts +175 -0
- package/dist/groups/permission.js +110 -0
- package/dist/groups/persistent-pty.d.ts +242 -0
- package/dist/groups/persistent-pty.js +92 -0
- package/dist/groups/plugin.d.ts +86 -0
- package/dist/groups/plugin.js +45 -0
- package/dist/groups/project.d.ts +83 -0
- package/dist/groups/project.js +33 -0
- package/dist/groups/provider.d.ts +231 -0
- package/dist/groups/provider.js +34 -0
- package/dist/groups/pty.d.ts +151 -0
- package/dist/groups/pty.js +112 -0
- package/dist/groups/reference.d.ts +25 -0
- package/dist/groups/reference.js +33 -0
- package/dist/groups/rpc.d.ts +21 -0
- package/dist/groups/rpc.js +24 -0
- package/dist/groups/server.d.ts +44 -0
- package/dist/groups/server.js +53 -0
- package/dist/groups/session.d.ts +11380 -0
- package/dist/groups/session.js +611 -0
- package/dist/groups/shell.d.ts +125 -0
- package/dist/groups/shell.js +64 -0
- package/dist/groups/skill.d.ts +19 -0
- package/dist/groups/skill.js +20 -0
- package/dist/groups/vcs.d.ts +87 -0
- package/dist/groups/vcs.js +93 -0
- package/dist/groups/voice.d.ts +93 -0
- package/dist/groups/voice.js +89 -0
- package/dist/groups/websearch.d.ts +29 -0
- package/dist/groups/websearch.js +34 -0
- package/dist/groups/worktree.d.ts +41 -0
- package/dist/groups/worktree.js +52 -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 +1830 -0
- package/dist/simulation.js +497 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Session } from "@opencode/schema/session";
|
|
2
|
+
import { SessionMessage } from "@opencode/schema/session-message";
|
|
3
|
+
import { Location } from "@opencode/schema/location";
|
|
4
|
+
import { Schema, Struct } from "effect";
|
|
5
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
6
|
+
import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js";
|
|
7
|
+
// Keyed by message type so a new message type cannot be left out of the filter.
|
|
8
|
+
const MessageTypes = {
|
|
9
|
+
"agent-switched": true,
|
|
10
|
+
"model-switched": true,
|
|
11
|
+
"location-switched": true,
|
|
12
|
+
user: true,
|
|
13
|
+
synthetic: true,
|
|
14
|
+
system: true,
|
|
15
|
+
skill: true,
|
|
16
|
+
shell: true,
|
|
17
|
+
assistant: true,
|
|
18
|
+
compaction: true,
|
|
19
|
+
idle: true,
|
|
20
|
+
};
|
|
21
|
+
export const SessionMessagesQuery = Schema.Struct({
|
|
22
|
+
limit: Schema.optional(Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(200))).annotate({
|
|
23
|
+
description: "Maximum number of messages to return. When omitted, the endpoint returns its default page size.",
|
|
24
|
+
}),
|
|
25
|
+
order: Schema.optional(Schema.Union([Schema.Literal("asc"), Schema.Literal("desc")])).annotate({
|
|
26
|
+
description: "Message order for the first page. Use desc for newest first or asc for oldest first.",
|
|
27
|
+
}),
|
|
28
|
+
cursor: Schema.optional(Schema.String.annotate({
|
|
29
|
+
description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.",
|
|
30
|
+
})),
|
|
31
|
+
type: Schema.optional(Schema.Literals(Object.keys(MessageTypes))).annotate({
|
|
32
|
+
description: "Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.",
|
|
33
|
+
}),
|
|
34
|
+
}).annotate({ identifier: "SessionMessagesQuery" });
|
|
35
|
+
const PublicLocationSwitched = Schema.Struct({
|
|
36
|
+
...Struct.omit(SessionMessage.LocationSwitched.fields, ["location", "previous"]),
|
|
37
|
+
location: Location.PublicRef,
|
|
38
|
+
previous: Schema.Struct({
|
|
39
|
+
location: Location.PublicRef,
|
|
40
|
+
projectID: SessionMessage.LocationSwitched.fields.projectID,
|
|
41
|
+
subpath: SessionMessage.LocationSwitched.fields.subpath,
|
|
42
|
+
}).pipe(Schema.optional),
|
|
43
|
+
}).annotate({ identifier: "Session.Message.LocationSwitched" });
|
|
44
|
+
export const PublicSessionMessage = Schema.Union([
|
|
45
|
+
SessionMessage.AgentSelected,
|
|
46
|
+
SessionMessage.ModelSelected,
|
|
47
|
+
PublicLocationSwitched,
|
|
48
|
+
SessionMessage.User,
|
|
49
|
+
SessionMessage.Synthetic,
|
|
50
|
+
SessionMessage.System,
|
|
51
|
+
SessionMessage.Skill,
|
|
52
|
+
SessionMessage.Shell,
|
|
53
|
+
SessionMessage.Assistant,
|
|
54
|
+
SessionMessage.Compaction,
|
|
55
|
+
SessionMessage.Idle,
|
|
56
|
+
]).annotate({ identifier: "Session.Message.Info" });
|
|
57
|
+
export const MessageGroup = HttpApiGroup.make("server.message")
|
|
58
|
+
.add(HttpApiEndpoint.get("session.messages", "/api/session/:sessionID/message", {
|
|
59
|
+
params: { sessionID: Session.ID },
|
|
60
|
+
query: SessionMessagesQuery,
|
|
61
|
+
success: Schema.Struct({
|
|
62
|
+
data: Schema.Array(PublicSessionMessage),
|
|
63
|
+
cursor: Schema.Struct({
|
|
64
|
+
previous: Schema.String.pipe(Schema.optional),
|
|
65
|
+
next: Schema.String.pipe(Schema.optional),
|
|
66
|
+
}),
|
|
67
|
+
}).annotate({ identifier: "SessionMessagesResponse" }),
|
|
68
|
+
error: [InvalidCursorError, SessionNotFoundError, UnknownError],
|
|
69
|
+
}).annotateMerge(OpenApi.annotations({
|
|
70
|
+
identifier: "session.message.list",
|
|
71
|
+
summary: "Get session messages",
|
|
72
|
+
description: "Retrieve projected messages for a session, optionally filtered by type. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline, passing the same type filter on each page.",
|
|
73
|
+
})))
|
|
74
|
+
.annotateMerge(OpenApi.annotations({
|
|
75
|
+
title: "session",
|
|
76
|
+
description: "Experimental message routes.",
|
|
77
|
+
}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
|
+
export declare const V1MigrationStatus: Schema.Union<readonly [Schema.Struct<{
|
|
4
|
+
readonly status: Schema.Literals<readonly ["required", "completed"]>;
|
|
5
|
+
}>, Schema.Struct<{
|
|
6
|
+
readonly status: Schema.Literal<"running">;
|
|
7
|
+
readonly progress: Schema.Struct<{
|
|
8
|
+
readonly label: Schema.String;
|
|
9
|
+
readonly numerator: Schema.optional<Schema.Int>;
|
|
10
|
+
readonly denominator: Schema.optional<Schema.Int>;
|
|
11
|
+
}>;
|
|
12
|
+
}>, Schema.Struct<{
|
|
13
|
+
readonly status: Schema.Literal<"error">;
|
|
14
|
+
readonly error: Schema.String;
|
|
15
|
+
}>]>;
|
|
16
|
+
export declare const MigrationGroup: HttpApiGroup.HttpApiGroup<"server.migration", HttpApiEndpoint.HttpApiEndpoint<"migration.v1.status", "GET", "/api/experimental/migration/v1", never, never, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
|
|
17
|
+
readonly status: Schema.Literals<readonly ["required", "completed"]>;
|
|
18
|
+
}>, Schema.Struct<{
|
|
19
|
+
readonly status: Schema.Literal<"running">;
|
|
20
|
+
readonly progress: Schema.Struct<{
|
|
21
|
+
readonly label: Schema.String;
|
|
22
|
+
readonly numerator: Schema.optional<Schema.Int>;
|
|
23
|
+
readonly denominator: Schema.optional<Schema.Int>;
|
|
24
|
+
}>;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly status: Schema.Literal<"error">;
|
|
27
|
+
readonly error: Schema.String;
|
|
28
|
+
}>]>>, never, never, never>, false>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
3
|
+
const V1MigrationProgress = Schema.Struct({
|
|
4
|
+
label: Schema.String,
|
|
5
|
+
numerator: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
6
|
+
denominator: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
7
|
+
});
|
|
8
|
+
export const V1MigrationStatus = Schema.Union([
|
|
9
|
+
Schema.Struct({ status: Schema.Literals(["required", "completed"]) }),
|
|
10
|
+
Schema.Struct({ status: Schema.Literal("running"), progress: V1MigrationProgress }),
|
|
11
|
+
Schema.Struct({ status: Schema.Literal("error"), error: Schema.String }),
|
|
12
|
+
]);
|
|
13
|
+
export const MigrationGroup = HttpApiGroup.make("server.migration")
|
|
14
|
+
.add(HttpApiEndpoint.get("migration.v1.status", "/api/experimental/migration/v1", {
|
|
15
|
+
success: V1MigrationStatus,
|
|
16
|
+
}).annotateMerge(OpenApi.annotations({
|
|
17
|
+
identifier: "experimental.migration.v1.status",
|
|
18
|
+
summary: "Get V1 migration status",
|
|
19
|
+
description: "Return the progress of the V1 to V2 session history migration.",
|
|
20
|
+
})))
|
|
21
|
+
.annotateMerge(OpenApi.annotations({ title: "migration" }));
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { Model } from "@opencode/schema/model";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
4
|
+
import { ServiceUnavailableError } from "../errors.js";
|
|
5
|
+
export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
6
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
7
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
10
|
+
readonly location: Schema.Struct<{
|
|
11
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12
|
+
}>;
|
|
13
|
+
readonly data: Schema.UndefinedOr<Schema.Struct<{
|
|
14
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
15
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
16
|
+
readonly type: Schema.Literal<"summary">;
|
|
17
|
+
}>, Schema.Struct<{
|
|
18
|
+
readonly type: Schema.Literal<"native">;
|
|
19
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"summary">;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly type: Schema.Literal<"native">;
|
|
23
|
+
}>]>>, never, never>;
|
|
24
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
25
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
26
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
27
|
+
readonly type: Schema.Literal<"summary">;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
readonly type: Schema.Literal<"native">;
|
|
30
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
31
|
+
readonly type: Schema.Literal<"summary">;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"native">;
|
|
34
|
+
}>]>>, never, never>;
|
|
35
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
36
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
37
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
38
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
39
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
40
|
+
readonly modelID: Schema.brand<Schema.String, "Model.ID">;
|
|
41
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
42
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
43
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
44
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
45
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
46
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
47
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
48
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
49
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
50
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
51
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
52
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
53
|
+
};
|
|
54
|
+
readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
55
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
56
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
57
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
58
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
59
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
60
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
61
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
62
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
63
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
64
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
65
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
66
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
67
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
68
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
69
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
70
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
71
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
72
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
73
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
74
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
75
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
76
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
77
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
78
|
+
}>, never, never>;
|
|
79
|
+
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
80
|
+
readonly name: Schema.String;
|
|
81
|
+
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
82
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
83
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
84
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
85
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
86
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
87
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
88
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
89
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
90
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
91
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
92
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
93
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
94
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
95
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
96
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
97
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
98
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
99
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
100
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
101
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
102
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
103
|
+
}>>, never, never>;
|
|
104
|
+
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
105
|
+
readonly capabilities: Schema.Struct<{
|
|
106
|
+
readonly tools: Schema.Boolean;
|
|
107
|
+
readonly input: Schema.$Array<Schema.String>;
|
|
108
|
+
readonly output: Schema.$Array<Schema.String>;
|
|
109
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
110
|
+
}> & {
|
|
111
|
+
default: () => {
|
|
112
|
+
tools: true;
|
|
113
|
+
input: string[];
|
|
114
|
+
output: string[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly variants: Schema.$Array<Schema.Struct<{
|
|
118
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
119
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
120
|
+
readonly type: Schema.Literal<"summary">;
|
|
121
|
+
}>, Schema.Struct<{
|
|
122
|
+
readonly type: Schema.Literal<"native">;
|
|
123
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
124
|
+
readonly type: Schema.Literal<"summary">;
|
|
125
|
+
}>, Schema.Struct<{
|
|
126
|
+
readonly type: Schema.Literal<"native">;
|
|
127
|
+
}>]>>, never, never>;
|
|
128
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
129
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
130
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
131
|
+
readonly type: Schema.Literal<"summary">;
|
|
132
|
+
}>, Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"native">;
|
|
134
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly type: Schema.Literal<"summary">;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly type: Schema.Literal<"native">;
|
|
138
|
+
}>]>>, never, never>;
|
|
139
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
140
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
141
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
142
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
143
|
+
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
144
|
+
}>>;
|
|
145
|
+
readonly time: Schema.Struct<{
|
|
146
|
+
readonly released: Schema.Finite;
|
|
147
|
+
}>;
|
|
148
|
+
readonly cost: Schema.$Array<Schema.Struct<{
|
|
149
|
+
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
150
|
+
readonly type: Schema.tag<"context">;
|
|
151
|
+
readonly size: Schema.Int;
|
|
152
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
153
|
+
readonly type: Schema.tag<"context">;
|
|
154
|
+
readonly size: Schema.Int;
|
|
155
|
+
}>>, never, never>;
|
|
156
|
+
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
157
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
158
|
+
};
|
|
159
|
+
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
160
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
161
|
+
};
|
|
162
|
+
readonly cache: Schema.Struct<{
|
|
163
|
+
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
164
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
165
|
+
};
|
|
166
|
+
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
167
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
168
|
+
};
|
|
169
|
+
}>;
|
|
170
|
+
}>>;
|
|
171
|
+
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
172
|
+
readonly enabled: Schema.Boolean;
|
|
173
|
+
readonly limit: Schema.Struct<{
|
|
174
|
+
readonly context: Schema.Int;
|
|
175
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
176
|
+
readonly output: Schema.Int;
|
|
177
|
+
}>;
|
|
178
|
+
}> & {
|
|
179
|
+
default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
|
|
180
|
+
id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
181
|
+
modelID: string & import("effect/Brand").Brand<"Model.ID">;
|
|
182
|
+
providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
183
|
+
name: string & import("effect/Brand").Brand<"Model.ID">;
|
|
184
|
+
capabilities: {
|
|
185
|
+
tools: true;
|
|
186
|
+
input: string[];
|
|
187
|
+
output: string[];
|
|
188
|
+
};
|
|
189
|
+
variants: never[];
|
|
190
|
+
time: {
|
|
191
|
+
released: number;
|
|
192
|
+
};
|
|
193
|
+
cost: never[];
|
|
194
|
+
status: "active";
|
|
195
|
+
enabled: true;
|
|
196
|
+
limit: {
|
|
197
|
+
context: number;
|
|
198
|
+
output: number;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
}>;
|
|
202
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.list", "GET", "/api/model", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
203
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
204
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
205
|
+
}>>;
|
|
206
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
207
|
+
readonly location: Schema.Struct<{
|
|
208
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
209
|
+
}>;
|
|
210
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
211
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
212
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
213
|
+
readonly type: Schema.Literal<"summary">;
|
|
214
|
+
}>, Schema.Struct<{
|
|
215
|
+
readonly type: Schema.Literal<"native">;
|
|
216
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
217
|
+
readonly type: Schema.Literal<"summary">;
|
|
218
|
+
}>, Schema.Struct<{
|
|
219
|
+
readonly type: Schema.Literal<"native">;
|
|
220
|
+
}>]>>, never, never>;
|
|
221
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
222
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
223
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
224
|
+
readonly type: Schema.Literal<"summary">;
|
|
225
|
+
}>, Schema.Struct<{
|
|
226
|
+
readonly type: Schema.Literal<"native">;
|
|
227
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
228
|
+
readonly type: Schema.Literal<"summary">;
|
|
229
|
+
}>, Schema.Struct<{
|
|
230
|
+
readonly type: Schema.Literal<"native">;
|
|
231
|
+
}>]>>, never, never>;
|
|
232
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
233
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
234
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
235
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
236
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
237
|
+
readonly modelID: Schema.brand<Schema.String, "Model.ID">;
|
|
238
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
239
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
240
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
241
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
242
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
243
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
244
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
245
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
246
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
247
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
248
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
249
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
250
|
+
};
|
|
251
|
+
readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
252
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
253
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
254
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
255
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
256
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
257
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
258
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
259
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
260
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
261
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
262
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
263
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
264
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
265
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
266
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
267
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
268
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
269
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
270
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
271
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
272
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
273
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
274
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
275
|
+
}>, never, never>;
|
|
276
|
+
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
277
|
+
readonly name: Schema.String;
|
|
278
|
+
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
279
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
280
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
281
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
282
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
283
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
284
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
285
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
286
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
287
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
288
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
289
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
290
|
+
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
291
|
+
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
292
|
+
readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
|
|
293
|
+
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
294
|
+
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
295
|
+
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
296
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
297
|
+
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
298
|
+
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
299
|
+
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
300
|
+
}>>, never, never>;
|
|
301
|
+
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
302
|
+
readonly capabilities: Schema.Struct<{
|
|
303
|
+
readonly tools: Schema.Boolean;
|
|
304
|
+
readonly input: Schema.$Array<Schema.String>;
|
|
305
|
+
readonly output: Schema.$Array<Schema.String>;
|
|
306
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
307
|
+
}> & {
|
|
308
|
+
default: () => {
|
|
309
|
+
tools: true;
|
|
310
|
+
input: string[];
|
|
311
|
+
output: string[];
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
readonly variants: Schema.$Array<Schema.Struct<{
|
|
315
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
316
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
317
|
+
readonly type: Schema.Literal<"summary">;
|
|
318
|
+
}>, Schema.Struct<{
|
|
319
|
+
readonly type: Schema.Literal<"native">;
|
|
320
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
321
|
+
readonly type: Schema.Literal<"summary">;
|
|
322
|
+
}>, Schema.Struct<{
|
|
323
|
+
readonly type: Schema.Literal<"native">;
|
|
324
|
+
}>]>>, never, never>;
|
|
325
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
326
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
327
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
328
|
+
readonly type: Schema.Literal<"summary">;
|
|
329
|
+
}>, Schema.Struct<{
|
|
330
|
+
readonly type: Schema.Literal<"native">;
|
|
331
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
332
|
+
readonly type: Schema.Literal<"summary">;
|
|
333
|
+
}>, Schema.Struct<{
|
|
334
|
+
readonly type: Schema.Literal<"native">;
|
|
335
|
+
}>]>>, never, never>;
|
|
336
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
337
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
338
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
339
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
340
|
+
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
341
|
+
}>>;
|
|
342
|
+
readonly time: Schema.Struct<{
|
|
343
|
+
readonly released: Schema.Finite;
|
|
344
|
+
}>;
|
|
345
|
+
readonly cost: Schema.$Array<Schema.Struct<{
|
|
346
|
+
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
347
|
+
readonly type: Schema.tag<"context">;
|
|
348
|
+
readonly size: Schema.Int;
|
|
349
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
350
|
+
readonly type: Schema.tag<"context">;
|
|
351
|
+
readonly size: Schema.Int;
|
|
352
|
+
}>>, never, never>;
|
|
353
|
+
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
354
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
355
|
+
};
|
|
356
|
+
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
357
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
358
|
+
};
|
|
359
|
+
readonly cache: Schema.Struct<{
|
|
360
|
+
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
361
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
362
|
+
};
|
|
363
|
+
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
364
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
365
|
+
};
|
|
366
|
+
}>;
|
|
367
|
+
}>>;
|
|
368
|
+
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
369
|
+
readonly enabled: Schema.Boolean;
|
|
370
|
+
readonly limit: Schema.Struct<{
|
|
371
|
+
readonly context: Schema.Int;
|
|
372
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
373
|
+
readonly output: Schema.Int;
|
|
374
|
+
}>;
|
|
375
|
+
}> & {
|
|
376
|
+
default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
|
|
377
|
+
id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
378
|
+
modelID: string & import("effect/Brand").Brand<"Model.ID">;
|
|
379
|
+
providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
380
|
+
name: string & import("effect/Brand").Brand<"Model.ID">;
|
|
381
|
+
capabilities: {
|
|
382
|
+
tools: true;
|
|
383
|
+
input: string[];
|
|
384
|
+
output: string[];
|
|
385
|
+
};
|
|
386
|
+
variants: never[];
|
|
387
|
+
time: {
|
|
388
|
+
released: number;
|
|
389
|
+
};
|
|
390
|
+
cost: never[];
|
|
391
|
+
status: "active";
|
|
392
|
+
enabled: true;
|
|
393
|
+
limit: {
|
|
394
|
+
context: number;
|
|
395
|
+
output: number;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
}>;
|
|
399
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never>, false>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Model } from "@opencode/schema/model";
|
|
2
|
+
import { Location } from "@opencode/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
5
|
+
import { ServiceUnavailableError } from "../errors.js";
|
|
6
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
|
+
export const ModelGroup = HttpApiGroup.make("server.model")
|
|
8
|
+
.add(HttpApiEndpoint.get("model.list", "/api/model", {
|
|
9
|
+
query: LocationQuery,
|
|
10
|
+
success: Location.response(Schema.Array(Model.Info)),
|
|
11
|
+
error: ServiceUnavailableError,
|
|
12
|
+
})
|
|
13
|
+
.annotateMerge(locationQueryOpenApi)
|
|
14
|
+
.annotateMerge(OpenApi.annotations({
|
|
15
|
+
identifier: "model.list",
|
|
16
|
+
summary: "List models",
|
|
17
|
+
description: "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.",
|
|
18
|
+
})))
|
|
19
|
+
.add(HttpApiEndpoint.get("model.default", "/api/model/default", {
|
|
20
|
+
query: LocationQuery,
|
|
21
|
+
success: Location.response(Schema.UndefinedOr(Model.Info)),
|
|
22
|
+
error: ServiceUnavailableError,
|
|
23
|
+
})
|
|
24
|
+
.annotateMerge(locationQueryOpenApi)
|
|
25
|
+
.annotateMerge(OpenApi.annotations({
|
|
26
|
+
identifier: "model.default",
|
|
27
|
+
summary: "Get default model",
|
|
28
|
+
description: "Retrieve the model used when a session has no explicit model selection.",
|
|
29
|
+
})))
|
|
30
|
+
.annotateMerge(OpenApi.annotations({
|
|
31
|
+
title: "model",
|
|
32
|
+
description: "Experimental model routes.",
|
|
33
|
+
}));
|