@opencode-ai/schema 0.0.0-next-14659
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/agent.d.ts +175 -0
- package/dist/agent.js +43 -0
- package/dist/catalog.d.ts +89 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.js +12 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +36 -0
- package/dist/credential.js +23 -0
- package/dist/durable-event-manifest.d.ts +10626 -0
- package/dist/durable-event-manifest.js +12 -0
- package/dist/event-manifest.d.ts +15309 -0
- package/dist/event-manifest.js +43 -0
- package/dist/event.d.ts +82 -0
- package/dist/event.js +73 -0
- package/dist/file-diff.d.ts +11 -0
- package/dist/file-diff.js +10 -0
- package/dist/filesystem-watcher.d.ts +102 -0
- package/dist/filesystem-watcher.js +11 -0
- package/dist/filesystem.d.ts +134 -0
- package/dist/filesystem.js +32 -0
- package/dist/ide-event.d.ts +96 -0
- package/dist/ide-event.js +10 -0
- package/dist/identifier.d.ts +3 -0
- package/dist/identifier.js +24 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +29 -0
- package/dist/installation-event.d.ts +189 -0
- package/dist/installation-event.js +16 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +572 -0
- package/dist/integration.js +93 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +28 -0
- package/dist/llm.js +19 -0
- package/dist/location.d.ts +36 -0
- package/dist/location.js +21 -0
- package/dist/lsp-event.d.ts +87 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +286 -0
- package/dist/mcp-event.js +25 -0
- package/dist/mcp.d.ts +39 -0
- package/dist/mcp.js +38 -0
- package/dist/model.d.ts +205 -0
- package/dist/model.js +86 -0
- package/dist/models-dev.d.ts +89 -0
- package/dist/models-dev.js +7 -0
- package/dist/permission-saved.d.ts +18 -0
- package/dist/permission-saved.js +12 -0
- package/dist/permission-v1.d.ts +1 -0
- package/dist/permission-v1.js +1 -0
- package/dist/permission.d.ts +346 -0
- package/dist/permission.js +45 -0
- package/dist/plugin.d.ts +105 -0
- package/dist/plugin.js +12 -0
- package/dist/project-copy.d.ts +29 -0
- package/dist/project-copy.js +21 -0
- package/dist/project-directories.d.ts +105 -0
- package/dist/project-directories.js +8 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +278 -0
- package/dist/project.js +44 -0
- package/dist/prompt-input.d.ts +106 -0
- package/dist/prompt-input.js +19 -0
- package/dist/prompt.d.ts +177 -0
- package/dist/prompt.js +43 -0
- package/dist/provider.d.ts +111 -0
- package/dist/provider.js +53 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +542 -0
- package/dist/pty.js +43 -0
- package/dist/question-v1.d.ts +1 -0
- package/dist/question-v1.js +1 -0
- package/dist/question.d.ts +516 -0
- package/dist/question.js +64 -0
- package/dist/reference.d.ts +140 -0
- package/dist/reference.js +31 -0
- package/dist/revert.d.ts +34 -0
- package/dist/revert.js +19 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +172 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +107 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-delivery.d.ts +4 -0
- package/dist/session-delivery.js +3 -0
- package/dist/session-event.d.ts +14225 -0
- package/dist/session-event.js +421 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-input.d.ts +145 -0
- package/dist/session-input.js +18 -0
- package/dist/session-message.d.ts +1318 -0
- package/dist/session-message.js +171 -0
- package/dist/session-status-event.d.ts +339 -0
- package/dist/session-status-event.js +43 -0
- package/dist/session-todo.d.ts +137 -0
- package/dist/session-todo.js +21 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +140 -0
- package/dist/session.js +43 -0
- package/dist/shell.d.ts +441 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +146 -0
- package/dist/skill.js +45 -0
- package/dist/tui-event.d.ts +387 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/legacy-event.d.ts +128 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +356 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +504 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7775 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +96 -0
- package/dist/vcs-event.js +11 -0
- package/dist/workspace-event.d.ts +307 -0
- package/dist/workspace-event.js +25 -0
- package/dist/workspace-id.d.ts +6 -0
- package/dist/workspace-id.js +16 -0
- package/dist/workspace.d.ts +9 -0
- package/dist/workspace.js +5 -0
- package/dist/worktree-event.d.ts +193 -0
- package/dist/worktree-event.js +18 -0
- package/package.json +41 -0
package/dist/prompt.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export interface Source extends Schema.Schema.Type<typeof Source> {
|
|
3
|
+
}
|
|
4
|
+
export declare const Source: Schema.Struct<{
|
|
5
|
+
readonly start: Schema.Finite;
|
|
6
|
+
readonly end: Schema.Finite;
|
|
7
|
+
readonly text: Schema.String;
|
|
8
|
+
}>;
|
|
9
|
+
export interface FileAttachment extends Schema.Schema.Type<typeof FileAttachment> {
|
|
10
|
+
}
|
|
11
|
+
export declare const FileAttachment: Schema.Struct<{
|
|
12
|
+
readonly uri: Schema.String;
|
|
13
|
+
readonly mime: Schema.String;
|
|
14
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
15
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
16
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
17
|
+
readonly start: Schema.Finite;
|
|
18
|
+
readonly end: Schema.Finite;
|
|
19
|
+
readonly text: Schema.String;
|
|
20
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
21
|
+
readonly start: Schema.Finite;
|
|
22
|
+
readonly end: Schema.Finite;
|
|
23
|
+
readonly text: Schema.String;
|
|
24
|
+
}>>, never, never>;
|
|
25
|
+
}> & {
|
|
26
|
+
create: (input: FileAttachment) => {
|
|
27
|
+
readonly uri: string;
|
|
28
|
+
readonly mime: string;
|
|
29
|
+
readonly name?: string | undefined;
|
|
30
|
+
readonly description?: string | undefined;
|
|
31
|
+
readonly source?: {
|
|
32
|
+
readonly start: number;
|
|
33
|
+
readonly end: number;
|
|
34
|
+
readonly text: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export interface AgentAttachment extends Schema.Schema.Type<typeof AgentAttachment> {
|
|
39
|
+
}
|
|
40
|
+
export declare const AgentAttachment: Schema.Struct<{
|
|
41
|
+
readonly name: Schema.String;
|
|
42
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
43
|
+
readonly start: Schema.Finite;
|
|
44
|
+
readonly end: Schema.Finite;
|
|
45
|
+
readonly text: Schema.String;
|
|
46
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
47
|
+
readonly start: Schema.Finite;
|
|
48
|
+
readonly end: Schema.Finite;
|
|
49
|
+
readonly text: Schema.String;
|
|
50
|
+
}>>, never, never>;
|
|
51
|
+
}>;
|
|
52
|
+
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
|
|
53
|
+
}
|
|
54
|
+
export declare const Prompt: Schema.Struct<{
|
|
55
|
+
readonly text: Schema.String;
|
|
56
|
+
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
57
|
+
readonly uri: Schema.String;
|
|
58
|
+
readonly mime: Schema.String;
|
|
59
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
60
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
61
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
62
|
+
readonly start: Schema.Finite;
|
|
63
|
+
readonly end: Schema.Finite;
|
|
64
|
+
readonly text: Schema.String;
|
|
65
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
66
|
+
readonly start: Schema.Finite;
|
|
67
|
+
readonly end: Schema.Finite;
|
|
68
|
+
readonly text: Schema.String;
|
|
69
|
+
}>>, never, never>;
|
|
70
|
+
}> & {
|
|
71
|
+
create: (input: FileAttachment) => {
|
|
72
|
+
readonly uri: string;
|
|
73
|
+
readonly mime: string;
|
|
74
|
+
readonly name?: string | undefined;
|
|
75
|
+
readonly description?: string | undefined;
|
|
76
|
+
readonly source?: {
|
|
77
|
+
readonly start: number;
|
|
78
|
+
readonly end: number;
|
|
79
|
+
readonly text: string;
|
|
80
|
+
} | undefined;
|
|
81
|
+
};
|
|
82
|
+
}>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
83
|
+
readonly uri: Schema.String;
|
|
84
|
+
readonly mime: Schema.String;
|
|
85
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
86
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
87
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
88
|
+
readonly start: Schema.Finite;
|
|
89
|
+
readonly end: Schema.Finite;
|
|
90
|
+
readonly text: Schema.String;
|
|
91
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
92
|
+
readonly start: Schema.Finite;
|
|
93
|
+
readonly end: Schema.Finite;
|
|
94
|
+
readonly text: Schema.String;
|
|
95
|
+
}>>, never, never>;
|
|
96
|
+
}> & {
|
|
97
|
+
create: (input: FileAttachment) => {
|
|
98
|
+
readonly uri: string;
|
|
99
|
+
readonly mime: string;
|
|
100
|
+
readonly name?: string | undefined;
|
|
101
|
+
readonly description?: string | undefined;
|
|
102
|
+
readonly source?: {
|
|
103
|
+
readonly start: number;
|
|
104
|
+
readonly end: number;
|
|
105
|
+
readonly text: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
};
|
|
108
|
+
}>>, never, never>;
|
|
109
|
+
readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
110
|
+
readonly name: Schema.String;
|
|
111
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
112
|
+
readonly start: Schema.Finite;
|
|
113
|
+
readonly end: Schema.Finite;
|
|
114
|
+
readonly text: Schema.String;
|
|
115
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
116
|
+
readonly start: Schema.Finite;
|
|
117
|
+
readonly end: Schema.Finite;
|
|
118
|
+
readonly text: Schema.String;
|
|
119
|
+
}>>, never, never>;
|
|
120
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
121
|
+
readonly name: Schema.String;
|
|
122
|
+
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
123
|
+
readonly start: Schema.Finite;
|
|
124
|
+
readonly end: Schema.Finite;
|
|
125
|
+
readonly text: Schema.String;
|
|
126
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
127
|
+
readonly start: Schema.Finite;
|
|
128
|
+
readonly end: Schema.Finite;
|
|
129
|
+
readonly text: Schema.String;
|
|
130
|
+
}>>, never, never>;
|
|
131
|
+
}>>>, never, never>;
|
|
132
|
+
}> & {
|
|
133
|
+
equivalence: import("effect/Equivalence").Equivalence<{
|
|
134
|
+
readonly text: string;
|
|
135
|
+
readonly files?: readonly {
|
|
136
|
+
readonly uri: string;
|
|
137
|
+
readonly mime: string;
|
|
138
|
+
readonly name?: string | undefined;
|
|
139
|
+
readonly description?: string | undefined;
|
|
140
|
+
readonly source?: {
|
|
141
|
+
readonly start: number;
|
|
142
|
+
readonly end: number;
|
|
143
|
+
readonly text: string;
|
|
144
|
+
} | undefined;
|
|
145
|
+
}[] | undefined;
|
|
146
|
+
readonly agents?: readonly {
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly source?: {
|
|
149
|
+
readonly start: number;
|
|
150
|
+
readonly end: number;
|
|
151
|
+
readonly text: string;
|
|
152
|
+
} | undefined;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
fromUserMessage: (input: Pick<Prompt, "text" | "files" | "agents">) => {
|
|
156
|
+
readonly text: string;
|
|
157
|
+
readonly files?: readonly {
|
|
158
|
+
readonly uri: string;
|
|
159
|
+
readonly mime: string;
|
|
160
|
+
readonly name?: string | undefined;
|
|
161
|
+
readonly description?: string | undefined;
|
|
162
|
+
readonly source?: {
|
|
163
|
+
readonly start: number;
|
|
164
|
+
readonly end: number;
|
|
165
|
+
readonly text: string;
|
|
166
|
+
} | undefined;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
readonly agents?: readonly {
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly source?: {
|
|
171
|
+
readonly start: number;
|
|
172
|
+
readonly end: number;
|
|
173
|
+
readonly text: string;
|
|
174
|
+
} | undefined;
|
|
175
|
+
}[] | undefined;
|
|
176
|
+
};
|
|
177
|
+
};
|
package/dist/prompt.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { optional } from "./schema.js";
|
|
3
|
+
import { statics } from "./schema.js";
|
|
4
|
+
export const Source = Schema.Struct({
|
|
5
|
+
start: Schema.Finite,
|
|
6
|
+
end: Schema.Finite,
|
|
7
|
+
text: Schema.String,
|
|
8
|
+
}).annotate({ identifier: "Prompt.Source" });
|
|
9
|
+
export const FileAttachment = Schema.Struct({
|
|
10
|
+
uri: Schema.String,
|
|
11
|
+
mime: Schema.String,
|
|
12
|
+
name: Schema.String.pipe(optional),
|
|
13
|
+
description: Schema.String.pipe(optional),
|
|
14
|
+
source: Source.pipe(optional),
|
|
15
|
+
})
|
|
16
|
+
.annotate({ identifier: "Prompt.FileAttachment" })
|
|
17
|
+
.pipe(statics((schema) => ({
|
|
18
|
+
create: (input) => schema.make({
|
|
19
|
+
uri: input.uri,
|
|
20
|
+
mime: input.mime,
|
|
21
|
+
name: input.name,
|
|
22
|
+
description: input.description,
|
|
23
|
+
source: input.source,
|
|
24
|
+
}),
|
|
25
|
+
})));
|
|
26
|
+
export const AgentAttachment = Schema.Struct({
|
|
27
|
+
name: Schema.String,
|
|
28
|
+
source: Source.pipe(optional),
|
|
29
|
+
}).annotate({ identifier: "Prompt.AgentAttachment" });
|
|
30
|
+
export const Prompt = Schema.Struct({
|
|
31
|
+
text: Schema.String,
|
|
32
|
+
files: Schema.Array(FileAttachment).pipe(optional),
|
|
33
|
+
agents: Schema.Array(AgentAttachment).pipe(optional),
|
|
34
|
+
})
|
|
35
|
+
.annotate({ identifier: "Prompt" })
|
|
36
|
+
.pipe(statics((schema) => ({
|
|
37
|
+
equivalence: Schema.toEquivalence(schema),
|
|
38
|
+
fromUserMessage: (input) => schema.make({
|
|
39
|
+
text: input.text,
|
|
40
|
+
...(input.files === undefined ? {} : { files: input.files }),
|
|
41
|
+
...(input.agents === undefined ? {} : { agents: input.agents }),
|
|
42
|
+
}),
|
|
43
|
+
})));
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export * as Provider from "./provider.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
4
|
+
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
5
|
+
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
6
|
+
openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
7
|
+
google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
8
|
+
googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
9
|
+
githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
10
|
+
amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
11
|
+
azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
12
|
+
openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
13
|
+
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
14
|
+
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
15
|
+
};
|
|
16
|
+
export type ID = typeof ID.Type;
|
|
17
|
+
export interface AISDK extends Schema.Schema.Type<typeof AISDK> {
|
|
18
|
+
}
|
|
19
|
+
export declare const AISDK: Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"aisdk">;
|
|
21
|
+
readonly package: Schema.String;
|
|
22
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
23
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
24
|
+
}>;
|
|
25
|
+
export interface Native extends Schema.Schema.Type<typeof Native> {
|
|
26
|
+
}
|
|
27
|
+
export declare const Native: Schema.Struct<{
|
|
28
|
+
readonly type: Schema.Literal<"native">;
|
|
29
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
30
|
+
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const Api: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"aisdk">;
|
|
34
|
+
readonly package: Schema.String;
|
|
35
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
36
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly type: Schema.Literal<"native">;
|
|
39
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
40
|
+
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
41
|
+
}>]>;
|
|
42
|
+
export type Api = typeof Api.Type;
|
|
43
|
+
export interface Request extends Schema.Schema.Type<typeof Request> {
|
|
44
|
+
}
|
|
45
|
+
export declare const Request: Schema.Struct<{
|
|
46
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
47
|
+
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
48
|
+
}>;
|
|
49
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
50
|
+
}
|
|
51
|
+
export declare const Info: Schema.Struct<{
|
|
52
|
+
readonly id: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
53
|
+
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
54
|
+
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
55
|
+
openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
56
|
+
google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
57
|
+
googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
58
|
+
githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
59
|
+
amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
60
|
+
azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
61
|
+
openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
62
|
+
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
63
|
+
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
64
|
+
};
|
|
65
|
+
readonly integrationID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Integration.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Integration.ID">>, never, never>;
|
|
66
|
+
readonly name: Schema.String;
|
|
67
|
+
readonly disabled: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
68
|
+
readonly api: Schema.Union<readonly [Schema.Struct<{
|
|
69
|
+
readonly type: Schema.Literal<"aisdk">;
|
|
70
|
+
readonly package: Schema.String;
|
|
71
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
72
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly type: Schema.Literal<"native">;
|
|
75
|
+
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
76
|
+
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
77
|
+
}>]>;
|
|
78
|
+
readonly request: Schema.Struct<{
|
|
79
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
80
|
+
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
81
|
+
}>;
|
|
82
|
+
}> & {
|
|
83
|
+
empty: (id: ID) => {
|
|
84
|
+
readonly id: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly api: {
|
|
87
|
+
readonly type: "aisdk";
|
|
88
|
+
readonly package: string;
|
|
89
|
+
readonly url?: string | undefined;
|
|
90
|
+
readonly settings?: {
|
|
91
|
+
readonly [x: string]: unknown;
|
|
92
|
+
} | undefined;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "native";
|
|
95
|
+
readonly settings: {
|
|
96
|
+
readonly [x: string]: unknown;
|
|
97
|
+
};
|
|
98
|
+
readonly url?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
readonly request: {
|
|
101
|
+
readonly headers: {
|
|
102
|
+
readonly [x: string]: string;
|
|
103
|
+
};
|
|
104
|
+
readonly body: {
|
|
105
|
+
readonly [x: string]: Schema.Json;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly integrationID?: (string & import("effect/Brand").Brand<"Integration.ID">) | undefined;
|
|
109
|
+
readonly disabled?: boolean | undefined;
|
|
110
|
+
};
|
|
111
|
+
};
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export * as Provider from "./provider.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional } from "./schema.js";
|
|
4
|
+
import { Integration } from "./integration.js";
|
|
5
|
+
import { statics } from "./schema.js";
|
|
6
|
+
export const ID = Schema.String.pipe(Schema.brand("ProviderV2.ID"), statics((schema) => ({
|
|
7
|
+
opencode: schema.make("opencode"),
|
|
8
|
+
anthropic: schema.make("anthropic"),
|
|
9
|
+
openai: schema.make("openai"),
|
|
10
|
+
google: schema.make("google"),
|
|
11
|
+
googleVertex: schema.make("google-vertex"),
|
|
12
|
+
githubCopilot: schema.make("github-copilot"),
|
|
13
|
+
amazonBedrock: schema.make("amazon-bedrock"),
|
|
14
|
+
azure: schema.make("azure"),
|
|
15
|
+
openrouter: schema.make("openrouter"),
|
|
16
|
+
mistral: schema.make("mistral"),
|
|
17
|
+
gitlab: schema.make("gitlab"),
|
|
18
|
+
})));
|
|
19
|
+
export const AISDK = Schema.Struct({
|
|
20
|
+
type: Schema.Literal("aisdk"),
|
|
21
|
+
package: Schema.String,
|
|
22
|
+
url: Schema.String.pipe(optional),
|
|
23
|
+
settings: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
24
|
+
}).annotate({ identifier: "Provider.AISDK" });
|
|
25
|
+
export const Native = Schema.Struct({
|
|
26
|
+
type: Schema.Literal("native"),
|
|
27
|
+
url: Schema.String.pipe(optional),
|
|
28
|
+
settings: Schema.Record(Schema.String, Schema.Unknown),
|
|
29
|
+
}).annotate({ identifier: "Provider.Native" });
|
|
30
|
+
export const Api = Schema.Union([AISDK, Native])
|
|
31
|
+
.pipe(Schema.toTaggedUnion("type"))
|
|
32
|
+
.annotate({ identifier: "Provider.Api" });
|
|
33
|
+
export const Request = Schema.Struct({
|
|
34
|
+
headers: Schema.Record(Schema.String, Schema.String),
|
|
35
|
+
body: Schema.Record(Schema.String, Schema.Json),
|
|
36
|
+
}).annotate({ identifier: "Provider.Request" });
|
|
37
|
+
export const Info = Schema.Struct({
|
|
38
|
+
id: ID,
|
|
39
|
+
integrationID: Integration.ID.pipe(optional),
|
|
40
|
+
name: Schema.String,
|
|
41
|
+
disabled: Schema.Boolean.pipe(optional),
|
|
42
|
+
api: Api,
|
|
43
|
+
request: Request,
|
|
44
|
+
})
|
|
45
|
+
.annotate({ identifier: "ProviderV2.Info" })
|
|
46
|
+
.pipe(statics((schema) => ({
|
|
47
|
+
empty: (id) => schema.make({
|
|
48
|
+
id,
|
|
49
|
+
name: id,
|
|
50
|
+
api: { type: "native", settings: {} },
|
|
51
|
+
request: { headers: {}, body: {} },
|
|
52
|
+
}),
|
|
53
|
+
})));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as PtyTicket from "./pty-ticket.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ConnectToken: Schema.Struct<{
|
|
4
|
+
readonly ticket: Schema.String;
|
|
5
|
+
readonly expires_in: Schema.Int;
|
|
6
|
+
}>;
|
|
7
|
+
export interface ConnectToken extends Schema.Schema.Type<typeof ConnectToken> {
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * as PtyTicket from "./pty-ticket.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { PositiveInt } from "./schema.js";
|
|
4
|
+
export const ConnectToken = Schema.Struct({
|
|
5
|
+
ticket: Schema.String,
|
|
6
|
+
expires_in: PositiveInt,
|
|
7
|
+
}).annotate({ identifier: "PtyTicket.ConnectToken" });
|