@opencode/schema 0.0.0-reserved → 2.0.1
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 +164 -0
- package/dist/agent.js +46 -0
- package/dist/catalog.d.ts +69 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +76 -0
- package/dist/command.js +13 -0
- package/dist/config/agent.d.ts +42 -0
- package/dist/config/agent.js +20 -0
- package/dist/config/command.d.ts +28 -0
- package/dist/config/command.js +13 -0
- package/dist/config/compaction.d.ts +14 -0
- package/dist/config/compaction.js +13 -0
- package/dist/config/experimental.d.ts +17 -0
- package/dist/config/experimental.js +16 -0
- package/dist/config/formatter.d.ts +11 -0
- package/dist/config/formatter.js +11 -0
- package/dist/config/lsp.d.ts +20 -0
- package/dist/config/lsp.js +16 -0
- package/dist/config/mcp.d.ts +18 -0
- package/dist/config/mcp.js +14 -0
- package/dist/config/media.d.ts +15 -0
- package/dist/config/media.js +14 -0
- package/dist/config/model.d.ts +18 -0
- package/dist/config/model.js +28 -0
- package/dist/config/plugin.d.ts +11 -0
- package/dist/config/plugin.js +10 -0
- package/dist/config/policy.d.ts +10 -0
- package/dist/config/policy.js +8 -0
- package/dist/config/provider.d.ts +173 -0
- package/dist/config/provider.js +72 -0
- package/dist/config/reference.d.ts +21 -0
- package/dist/config/reference.js +18 -0
- package/dist/config/tool-output.d.ts +8 -0
- package/dist/config/tool-output.js +8 -0
- package/dist/config/warming.d.ts +10 -0
- package/dist/config/warming.js +16 -0
- package/dist/config/watcher.d.ts +7 -0
- package/dist/config/watcher.js +7 -0
- package/dist/config/websearch.d.ts +9 -0
- package/dist/config/websearch.js +13 -0
- package/dist/config/worktree.d.ts +7 -0
- package/dist/config/worktree.js +7 -0
- package/dist/config.d.ts +180 -0
- package/dist/config.js +138 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +191 -0
- package/dist/credential.js +39 -0
- package/dist/durable-event-manifest.d.ts +3 -0
- package/dist/durable-event-manifest.js +5 -0
- package/dist/event-log.d.ts +14 -0
- package/dist/event-log.js +17 -0
- package/dist/event-manifest.d.ts +12758 -0
- package/dist/event-manifest.js +47 -0
- package/dist/event.d.ts +142 -0
- package/dist/event.js +110 -0
- package/dist/file-diff.d.ts +21 -0
- package/dist/file-diff.js +18 -0
- package/dist/filesystem-v1.d.ts +1 -0
- package/dist/filesystem-v1.js +1 -0
- package/dist/filesystem.d.ts +118 -0
- package/dist/filesystem.js +35 -0
- package/dist/form.d.ts +1259 -0
- package/dist/form.js +120 -0
- package/dist/ide-event.d.ts +76 -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 +41 -0
- package/dist/index.js +41 -0
- package/dist/installation-event.d.ts +149 -0
- package/dist/installation-event.js +16 -0
- package/dist/instruction-entry.d.ts +29 -0
- package/dist/instruction-entry.js +26 -0
- package/dist/instruction.d.ts +13 -0
- package/dist/instruction.js +8 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +1604 -0
- package/dist/integration.js +85 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +4 -0
- package/dist/llm.js +3 -0
- package/dist/location.d.ts +37 -0
- package/dist/location.js +22 -0
- package/dist/lsp-event.d.ts +67 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +222 -0
- package/dist/mcp-event.js +24 -0
- package/dist/mcp.d.ts +138 -0
- package/dist/mcp.js +111 -0
- package/dist/model.d.ts +247 -0
- package/dist/model.js +116 -0
- package/dist/models-dev.d.ts +69 -0
- package/dist/models-dev.js +7 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +5 -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 +311 -0
- package/dist/permission.js +46 -0
- package/dist/persistent-pty.d.ts +559 -0
- package/dist/persistent-pty.js +55 -0
- package/dist/plugin.d.ts +132 -0
- package/dist/plugin.js +37 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +264 -0
- package/dist/project.js +46 -0
- package/dist/prompt-input.d.ts +143 -0
- package/dist/prompt-input.js +25 -0
- package/dist/prompt.d.ts +297 -0
- package/dist/prompt.js +61 -0
- package/dist/provider.d.ts +105 -0
- package/dist/provider.js +50 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +462 -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 +15 -0
- package/dist/question.js +15 -0
- package/dist/reference.d.ts +120 -0
- package/dist/reference.js +30 -0
- package/dist/rpc.d.ts +111 -0
- package/dist/rpc.js +9 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +132 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +87 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-error.d.ts +9 -0
- package/dist/session-error.js +8 -0
- package/dist/session-event.d.ts +21315 -0
- package/dist/session-event.js +557 -0
- package/dist/session-fork.d.ts +26 -0
- package/dist/session-fork.js +11 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-inbox.d.ts +748 -0
- package/dist/session-inbox.js +47 -0
- package/dist/session-message.d.ts +2007 -0
- package/dist/session-message.js +227 -0
- package/dist/session-metadata.d.ts +8 -0
- package/dist/session-metadata.js +9 -0
- package/dist/session-provider-context.d.ts +54 -0
- package/dist/session-provider-context.js +17 -0
- package/dist/session-revert.d.ts +672 -0
- package/dist/session-revert.js +63 -0
- package/dist/session-stats.d.ts +186 -0
- package/dist/session-stats.js +53 -0
- package/dist/session-status-event.d.ts +299 -0
- package/dist/session-status-event.js +45 -0
- package/dist/session-transfer.d.ts +897 -0
- package/dist/session-transfer.js +8 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +236 -0
- package/dist/session.js +55 -0
- package/dist/shell.d.ts +381 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +133 -0
- package/dist/skill.js +48 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +14 -0
- package/dist/token-usage.js +14 -0
- package/dist/tool.d.ts +78 -0
- package/dist/tool.js +22 -0
- package/dist/tui-event.d.ts +307 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/filesystem.d.ts +78 -0
- package/dist/v1/filesystem.js +8 -0
- package/dist/v1/legacy-event.d.ts +108 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +316 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +444 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7657 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +76 -0
- package/dist/vcs-event.js +11 -0
- package/dist/vcs.d.ts +35 -0
- package/dist/vcs.js +23 -0
- package/dist/websearch.d.ts +108 -0
- package/dist/websearch.js +31 -0
- package/dist/workspace-event.d.ts +247 -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 +15 -0
- package/dist/workspace.js +14 -0
- package/dist/worktree-event.d.ts +153 -0
- package/dist/worktree-event.js +18 -0
- package/dist/worktree.d.ts +277 -0
- package/dist/worktree.js +82 -0
- package/package.json +33 -6
- package/README.md +0 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * as PromptInput from "./prompt-input.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { AgentAttachment, PromptMention } from "./prompt.js";
|
|
4
|
+
import { optional, statics } from "./schema.js";
|
|
5
|
+
import { Skill } from "./skill.js";
|
|
6
|
+
export const FileAttachment = Schema.Struct({
|
|
7
|
+
uri: Schema.String,
|
|
8
|
+
name: Schema.String.pipe(optional),
|
|
9
|
+
description: Schema.String.pipe(optional),
|
|
10
|
+
mention: PromptMention.pipe(optional),
|
|
11
|
+
})
|
|
12
|
+
.annotate({ identifier: "PromptInput.FileAttachment" })
|
|
13
|
+
.pipe(statics((schema) => ({
|
|
14
|
+
create: (input) => schema.make(input),
|
|
15
|
+
})));
|
|
16
|
+
export const SkillAttachment = Schema.Struct({
|
|
17
|
+
id: Skill.ID,
|
|
18
|
+
mention: PromptMention.pipe(optional),
|
|
19
|
+
}).annotate({ identifier: "PromptInput.SkillAttachment" });
|
|
20
|
+
export const Prompt = Schema.Struct({
|
|
21
|
+
text: Schema.String,
|
|
22
|
+
files: Schema.Array(FileAttachment).pipe(optional),
|
|
23
|
+
agents: Schema.Array(AgentAttachment).pipe(optional),
|
|
24
|
+
skills: Schema.Array(SkillAttachment).pipe(optional),
|
|
25
|
+
}).annotate({ identifier: "PromptInput" });
|
package/dist/prompt.d.ts
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export interface PromptMention extends Schema.Schema.Type<typeof PromptMention> {
|
|
3
|
+
}
|
|
4
|
+
export declare const PromptMention: Schema.Struct<{
|
|
5
|
+
readonly start: Schema.Finite;
|
|
6
|
+
readonly end: Schema.Finite;
|
|
7
|
+
readonly text: Schema.String;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const FileSource: Schema.Union<readonly [Schema.Struct<{
|
|
10
|
+
readonly type: Schema.Literal<"inline">;
|
|
11
|
+
}>, Schema.Struct<{
|
|
12
|
+
readonly type: Schema.Literal<"uri">;
|
|
13
|
+
readonly uri: Schema.String;
|
|
14
|
+
}>]>;
|
|
15
|
+
export type FileSource = typeof FileSource.Type;
|
|
16
|
+
export declare const Base64: Schema.String;
|
|
17
|
+
export type Base64 = typeof Base64.Type;
|
|
18
|
+
export interface FileAttachment extends Schema.Schema.Type<typeof FileAttachment> {
|
|
19
|
+
}
|
|
20
|
+
export declare const FileAttachment: Schema.Struct<{
|
|
21
|
+
readonly data: Schema.String;
|
|
22
|
+
readonly mime: Schema.String;
|
|
23
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"inline">;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly type: Schema.Literal<"uri">;
|
|
27
|
+
readonly uri: Schema.String;
|
|
28
|
+
}>]>;
|
|
29
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
30
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
31
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
32
|
+
readonly start: Schema.Finite;
|
|
33
|
+
readonly end: Schema.Finite;
|
|
34
|
+
readonly text: Schema.String;
|
|
35
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
36
|
+
readonly start: Schema.Finite;
|
|
37
|
+
readonly end: Schema.Finite;
|
|
38
|
+
readonly text: Schema.String;
|
|
39
|
+
}>>, never, never>;
|
|
40
|
+
}> & {
|
|
41
|
+
create: (input: FileAttachment) => {
|
|
42
|
+
readonly data: string;
|
|
43
|
+
readonly source: {
|
|
44
|
+
readonly type: "inline";
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: "uri";
|
|
47
|
+
readonly uri: string;
|
|
48
|
+
};
|
|
49
|
+
readonly mime: string;
|
|
50
|
+
readonly description?: string | undefined;
|
|
51
|
+
readonly name?: string | undefined;
|
|
52
|
+
readonly mention?: {
|
|
53
|
+
readonly start: number;
|
|
54
|
+
readonly end: number;
|
|
55
|
+
readonly text: string;
|
|
56
|
+
} | undefined;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export interface AgentAttachment extends Schema.Schema.Type<typeof AgentAttachment> {
|
|
60
|
+
}
|
|
61
|
+
export declare const AgentAttachment: Schema.Struct<{
|
|
62
|
+
readonly name: Schema.String;
|
|
63
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
64
|
+
readonly start: Schema.Finite;
|
|
65
|
+
readonly end: Schema.Finite;
|
|
66
|
+
readonly text: Schema.String;
|
|
67
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
68
|
+
readonly start: Schema.Finite;
|
|
69
|
+
readonly end: Schema.Finite;
|
|
70
|
+
readonly text: Schema.String;
|
|
71
|
+
}>>, never, never>;
|
|
72
|
+
}>;
|
|
73
|
+
export interface SkillAttachment extends Schema.Schema.Type<typeof SkillAttachment> {
|
|
74
|
+
}
|
|
75
|
+
export declare const SkillAttachment: Schema.Struct<{
|
|
76
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
77
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
78
|
+
readonly text: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
79
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
80
|
+
readonly start: Schema.Finite;
|
|
81
|
+
readonly end: Schema.Finite;
|
|
82
|
+
readonly text: Schema.String;
|
|
83
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
84
|
+
readonly start: Schema.Finite;
|
|
85
|
+
readonly end: Schema.Finite;
|
|
86
|
+
readonly text: Schema.String;
|
|
87
|
+
}>>, never, never>;
|
|
88
|
+
}>;
|
|
89
|
+
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
|
|
90
|
+
}
|
|
91
|
+
export declare const Prompt: Schema.Struct<{
|
|
92
|
+
readonly text: Schema.String;
|
|
93
|
+
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
94
|
+
readonly data: Schema.String;
|
|
95
|
+
readonly mime: Schema.String;
|
|
96
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
97
|
+
readonly type: Schema.Literal<"inline">;
|
|
98
|
+
}>, Schema.Struct<{
|
|
99
|
+
readonly type: Schema.Literal<"uri">;
|
|
100
|
+
readonly uri: Schema.String;
|
|
101
|
+
}>]>;
|
|
102
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
103
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
104
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
105
|
+
readonly start: Schema.Finite;
|
|
106
|
+
readonly end: Schema.Finite;
|
|
107
|
+
readonly text: Schema.String;
|
|
108
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
109
|
+
readonly start: Schema.Finite;
|
|
110
|
+
readonly end: Schema.Finite;
|
|
111
|
+
readonly text: Schema.String;
|
|
112
|
+
}>>, never, never>;
|
|
113
|
+
}> & {
|
|
114
|
+
create: (input: FileAttachment) => {
|
|
115
|
+
readonly data: string;
|
|
116
|
+
readonly source: {
|
|
117
|
+
readonly type: "inline";
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "uri";
|
|
120
|
+
readonly uri: string;
|
|
121
|
+
};
|
|
122
|
+
readonly mime: string;
|
|
123
|
+
readonly description?: string | undefined;
|
|
124
|
+
readonly name?: string | undefined;
|
|
125
|
+
readonly mention?: {
|
|
126
|
+
readonly start: number;
|
|
127
|
+
readonly end: number;
|
|
128
|
+
readonly text: string;
|
|
129
|
+
} | undefined;
|
|
130
|
+
};
|
|
131
|
+
}>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
132
|
+
readonly data: Schema.String;
|
|
133
|
+
readonly mime: Schema.String;
|
|
134
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly type: Schema.Literal<"inline">;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly type: Schema.Literal<"uri">;
|
|
138
|
+
readonly uri: Schema.String;
|
|
139
|
+
}>]>;
|
|
140
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
141
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
142
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
143
|
+
readonly start: Schema.Finite;
|
|
144
|
+
readonly end: Schema.Finite;
|
|
145
|
+
readonly text: Schema.String;
|
|
146
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
147
|
+
readonly start: Schema.Finite;
|
|
148
|
+
readonly end: Schema.Finite;
|
|
149
|
+
readonly text: Schema.String;
|
|
150
|
+
}>>, never, never>;
|
|
151
|
+
}> & {
|
|
152
|
+
create: (input: FileAttachment) => {
|
|
153
|
+
readonly data: string;
|
|
154
|
+
readonly source: {
|
|
155
|
+
readonly type: "inline";
|
|
156
|
+
} | {
|
|
157
|
+
readonly type: "uri";
|
|
158
|
+
readonly uri: string;
|
|
159
|
+
};
|
|
160
|
+
readonly mime: string;
|
|
161
|
+
readonly description?: string | undefined;
|
|
162
|
+
readonly name?: string | undefined;
|
|
163
|
+
readonly mention?: {
|
|
164
|
+
readonly start: number;
|
|
165
|
+
readonly end: number;
|
|
166
|
+
readonly text: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
};
|
|
169
|
+
}>>, never, never>;
|
|
170
|
+
readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
171
|
+
readonly name: Schema.String;
|
|
172
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
173
|
+
readonly start: Schema.Finite;
|
|
174
|
+
readonly end: Schema.Finite;
|
|
175
|
+
readonly text: Schema.String;
|
|
176
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
177
|
+
readonly start: Schema.Finite;
|
|
178
|
+
readonly end: Schema.Finite;
|
|
179
|
+
readonly text: Schema.String;
|
|
180
|
+
}>>, never, never>;
|
|
181
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
182
|
+
readonly name: Schema.String;
|
|
183
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
184
|
+
readonly start: Schema.Finite;
|
|
185
|
+
readonly end: Schema.Finite;
|
|
186
|
+
readonly text: Schema.String;
|
|
187
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
188
|
+
readonly start: Schema.Finite;
|
|
189
|
+
readonly end: Schema.Finite;
|
|
190
|
+
readonly text: Schema.String;
|
|
191
|
+
}>>, never, never>;
|
|
192
|
+
}>>>, never, never>;
|
|
193
|
+
readonly skills: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
194
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
195
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
196
|
+
readonly text: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
197
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
198
|
+
readonly start: Schema.Finite;
|
|
199
|
+
readonly end: Schema.Finite;
|
|
200
|
+
readonly text: Schema.String;
|
|
201
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
202
|
+
readonly start: Schema.Finite;
|
|
203
|
+
readonly end: Schema.Finite;
|
|
204
|
+
readonly text: Schema.String;
|
|
205
|
+
}>>, never, never>;
|
|
206
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
207
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
208
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
209
|
+
readonly text: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
210
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
211
|
+
readonly start: Schema.Finite;
|
|
212
|
+
readonly end: Schema.Finite;
|
|
213
|
+
readonly text: Schema.String;
|
|
214
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
215
|
+
readonly start: Schema.Finite;
|
|
216
|
+
readonly end: Schema.Finite;
|
|
217
|
+
readonly text: Schema.String;
|
|
218
|
+
}>>, never, never>;
|
|
219
|
+
}>>>, never, never>;
|
|
220
|
+
}> & {
|
|
221
|
+
equivalence: import("effect/Equivalence").Equivalence<{
|
|
222
|
+
readonly text: string;
|
|
223
|
+
readonly agents?: readonly {
|
|
224
|
+
readonly name: string;
|
|
225
|
+
readonly mention?: {
|
|
226
|
+
readonly start: number;
|
|
227
|
+
readonly end: number;
|
|
228
|
+
readonly text: string;
|
|
229
|
+
} | undefined;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
readonly skills?: readonly {
|
|
232
|
+
readonly id: string & import("effect/Brand").Brand<"Skill.ID">;
|
|
233
|
+
readonly name: string & import("effect/Brand").Brand<"Skill.Name">;
|
|
234
|
+
readonly text?: string | undefined;
|
|
235
|
+
readonly mention?: {
|
|
236
|
+
readonly start: number;
|
|
237
|
+
readonly end: number;
|
|
238
|
+
readonly text: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
}[] | undefined;
|
|
241
|
+
readonly files?: readonly {
|
|
242
|
+
readonly data: string;
|
|
243
|
+
readonly source: {
|
|
244
|
+
readonly type: "inline";
|
|
245
|
+
} | {
|
|
246
|
+
readonly type: "uri";
|
|
247
|
+
readonly uri: string;
|
|
248
|
+
};
|
|
249
|
+
readonly mime: string;
|
|
250
|
+
readonly description?: string | undefined;
|
|
251
|
+
readonly name?: string | undefined;
|
|
252
|
+
readonly mention?: {
|
|
253
|
+
readonly start: number;
|
|
254
|
+
readonly end: number;
|
|
255
|
+
readonly text: string;
|
|
256
|
+
} | undefined;
|
|
257
|
+
}[] | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
fromUserMessage: (input: Pick<Prompt, "text" | "files" | "agents" | "skills">) => {
|
|
260
|
+
readonly text: string;
|
|
261
|
+
readonly agents?: readonly {
|
|
262
|
+
readonly name: string;
|
|
263
|
+
readonly mention?: {
|
|
264
|
+
readonly start: number;
|
|
265
|
+
readonly end: number;
|
|
266
|
+
readonly text: string;
|
|
267
|
+
} | undefined;
|
|
268
|
+
}[] | undefined;
|
|
269
|
+
readonly skills?: readonly {
|
|
270
|
+
readonly id: string & import("effect/Brand").Brand<"Skill.ID">;
|
|
271
|
+
readonly name: string & import("effect/Brand").Brand<"Skill.Name">;
|
|
272
|
+
readonly text?: string | undefined;
|
|
273
|
+
readonly mention?: {
|
|
274
|
+
readonly start: number;
|
|
275
|
+
readonly end: number;
|
|
276
|
+
readonly text: string;
|
|
277
|
+
} | undefined;
|
|
278
|
+
}[] | undefined;
|
|
279
|
+
readonly files?: readonly {
|
|
280
|
+
readonly data: string;
|
|
281
|
+
readonly source: {
|
|
282
|
+
readonly type: "inline";
|
|
283
|
+
} | {
|
|
284
|
+
readonly type: "uri";
|
|
285
|
+
readonly uri: string;
|
|
286
|
+
};
|
|
287
|
+
readonly mime: string;
|
|
288
|
+
readonly description?: string | undefined;
|
|
289
|
+
readonly name?: string | undefined;
|
|
290
|
+
readonly mention?: {
|
|
291
|
+
readonly start: number;
|
|
292
|
+
readonly end: number;
|
|
293
|
+
readonly text: string;
|
|
294
|
+
} | undefined;
|
|
295
|
+
}[] | undefined;
|
|
296
|
+
};
|
|
297
|
+
};
|
package/dist/prompt.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { optional } from "./schema.js";
|
|
3
|
+
import { statics } from "./schema.js";
|
|
4
|
+
import { Skill } from "./skill.js";
|
|
5
|
+
export const PromptMention = Schema.Struct({
|
|
6
|
+
start: Schema.Finite,
|
|
7
|
+
end: Schema.Finite,
|
|
8
|
+
text: Schema.String,
|
|
9
|
+
}).annotate({ identifier: "Prompt.Mention" });
|
|
10
|
+
export const FileSource = Schema.Union([
|
|
11
|
+
Schema.Struct({ type: Schema.Literal("inline") }),
|
|
12
|
+
Schema.Struct({ type: Schema.Literal("uri"), uri: Schema.String }),
|
|
13
|
+
])
|
|
14
|
+
.pipe(Schema.toTaggedUnion("type"))
|
|
15
|
+
.annotate({ identifier: "Prompt.FileSource" });
|
|
16
|
+
export const Base64 = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/)).annotate({ identifier: "Prompt.Base64" });
|
|
17
|
+
export const FileAttachment = Schema.Struct({
|
|
18
|
+
data: Base64,
|
|
19
|
+
mime: Schema.String,
|
|
20
|
+
source: FileSource,
|
|
21
|
+
name: Schema.String.pipe(optional),
|
|
22
|
+
description: Schema.String.pipe(optional),
|
|
23
|
+
mention: PromptMention.pipe(optional),
|
|
24
|
+
})
|
|
25
|
+
.annotate({ identifier: "Prompt.FileAttachment" })
|
|
26
|
+
.pipe(statics((schema) => ({
|
|
27
|
+
create: (input) => schema.make({
|
|
28
|
+
data: input.data,
|
|
29
|
+
mime: input.mime,
|
|
30
|
+
source: input.source,
|
|
31
|
+
name: input.name,
|
|
32
|
+
description: input.description,
|
|
33
|
+
mention: input.mention,
|
|
34
|
+
}),
|
|
35
|
+
})));
|
|
36
|
+
export const AgentAttachment = Schema.Struct({
|
|
37
|
+
name: Schema.String,
|
|
38
|
+
mention: PromptMention.pipe(optional),
|
|
39
|
+
}).annotate({ identifier: "Prompt.AgentAttachment" });
|
|
40
|
+
export const SkillAttachment = Schema.Struct({
|
|
41
|
+
id: Skill.ID,
|
|
42
|
+
name: Skill.Name,
|
|
43
|
+
text: Schema.String.pipe(optional),
|
|
44
|
+
mention: PromptMention.pipe(optional),
|
|
45
|
+
}).annotate({ identifier: "Prompt.SkillAttachment" });
|
|
46
|
+
export const Prompt = Schema.Struct({
|
|
47
|
+
text: Schema.String,
|
|
48
|
+
files: Schema.Array(FileAttachment).pipe(optional),
|
|
49
|
+
agents: Schema.Array(AgentAttachment).pipe(optional),
|
|
50
|
+
skills: Schema.Array(SkillAttachment).pipe(optional),
|
|
51
|
+
})
|
|
52
|
+
.annotate({ identifier: "Prompt" })
|
|
53
|
+
.pipe(statics((schema) => ({
|
|
54
|
+
equivalence: Schema.toEquivalence(schema),
|
|
55
|
+
fromUserMessage: (input) => schema.make({
|
|
56
|
+
text: input.text,
|
|
57
|
+
...(input.files === undefined ? {} : { files: input.files }),
|
|
58
|
+
...(input.agents === undefined ? {} : { agents: input.agents }),
|
|
59
|
+
...(input.skills === undefined ? {} : { skills: input.skills }),
|
|
60
|
+
}),
|
|
61
|
+
})));
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export * as Provider from "./provider.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
4
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
5
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
6
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
7
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
8
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
9
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
10
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
11
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
12
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
13
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
14
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
15
|
+
};
|
|
16
|
+
export type ID = typeof ID.Type;
|
|
17
|
+
export declare const Package: Schema.String;
|
|
18
|
+
export type Package = typeof Package.Type;
|
|
19
|
+
export declare const Activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
|
|
20
|
+
export type Activation = typeof Activation.Type;
|
|
21
|
+
export type Compaction = typeof Compaction.Type;
|
|
22
|
+
export declare const Compaction: Schema.Union<readonly [Schema.Struct<{
|
|
23
|
+
readonly mode: Schema.Literal<"local">;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly mode: Schema.Literal<"provider">;
|
|
26
|
+
readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
27
|
+
}>]>;
|
|
28
|
+
export declare const Overlays: {
|
|
29
|
+
settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
30
|
+
headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
31
|
+
body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
32
|
+
};
|
|
33
|
+
export declare const Settings: Schema.$Record<Schema.String, Schema.Any>;
|
|
34
|
+
export type Settings = typeof Settings.Type;
|
|
35
|
+
export interface Request extends Schema.Schema.Type<typeof Request> {
|
|
36
|
+
}
|
|
37
|
+
export declare const Request: Schema.Struct<{
|
|
38
|
+
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Any>>;
|
|
39
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
40
|
+
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
41
|
+
}>;
|
|
42
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
43
|
+
}
|
|
44
|
+
export declare const Info: Schema.Struct<{
|
|
45
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
46
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
47
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
48
|
+
readonly id: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
49
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
50
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
51
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
52
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
53
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
54
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
55
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
56
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
57
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
58
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
59
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
60
|
+
};
|
|
61
|
+
readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
62
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
63
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
64
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
65
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
66
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
67
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
68
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
69
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
70
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
71
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
72
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
73
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Provider.ID"> & {
|
|
74
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
75
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
76
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
77
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
78
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
79
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
80
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
81
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
82
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
83
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
84
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
85
|
+
}>, never, never>;
|
|
86
|
+
readonly integrationID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Integration.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Integration.ID">>, never, never>;
|
|
87
|
+
readonly name: Schema.String;
|
|
88
|
+
readonly activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
|
|
89
|
+
readonly package: Schema.String;
|
|
90
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
91
|
+
readonly mode: Schema.Literal<"local">;
|
|
92
|
+
}>, Schema.Struct<{
|
|
93
|
+
readonly mode: Schema.Literal<"provider">;
|
|
94
|
+
readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
95
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
96
|
+
readonly mode: Schema.Literal<"local">;
|
|
97
|
+
}>, Schema.Struct<{
|
|
98
|
+
readonly mode: Schema.Literal<"provider">;
|
|
99
|
+
readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
100
|
+
}>]>>, never, never>;
|
|
101
|
+
/** Session WebSocket policy for routes that support it; omitted means disabled. */
|
|
102
|
+
readonly websocket: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
103
|
+
}> & {
|
|
104
|
+
empty: (id: ID) => Info;
|
|
105
|
+
};
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export * as Provider from "./provider.js";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
import { Integration } from "./integration.js";
|
|
4
|
+
import { optional, PositiveInt, statics } from "./schema.js";
|
|
5
|
+
export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), statics((schema) => ({
|
|
6
|
+
opencode: schema.make("opencode"),
|
|
7
|
+
anthropic: schema.make("anthropic"),
|
|
8
|
+
openai: schema.make("openai"),
|
|
9
|
+
google: schema.make("google"),
|
|
10
|
+
googleVertex: schema.make("google-vertex"),
|
|
11
|
+
githubCopilot: schema.make("github-copilot"),
|
|
12
|
+
amazonBedrock: schema.make("amazon-bedrock"),
|
|
13
|
+
azure: schema.make("azure"),
|
|
14
|
+
openrouter: schema.make("openrouter"),
|
|
15
|
+
mistral: schema.make("mistral"),
|
|
16
|
+
gitlab: schema.make("gitlab"),
|
|
17
|
+
})));
|
|
18
|
+
export const Package = Schema.String;
|
|
19
|
+
export const Activation = Schema.Literals(["auto", "enabled", "disabled"]);
|
|
20
|
+
export const Compaction = Schema.Union([
|
|
21
|
+
Schema.Struct({ mode: Schema.Literal("local") }),
|
|
22
|
+
Schema.Struct({ mode: Schema.Literal("provider"), threshold: PositiveInt.pipe(optional) }),
|
|
23
|
+
]).annotate({ identifier: "Provider.Compaction" });
|
|
24
|
+
export const Overlays = {
|
|
25
|
+
settings: Schema.Record(Schema.String, Schema.Any).pipe(optional),
|
|
26
|
+
headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
|
27
|
+
body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
|
|
28
|
+
};
|
|
29
|
+
export const Settings = Schema.Record(Schema.String, Schema.Any).annotate({ identifier: "Provider.Settings" });
|
|
30
|
+
export const Request = Schema.Struct({
|
|
31
|
+
settings: Settings.pipe(Schema.withConstructorDefault(Effect.succeed({}))),
|
|
32
|
+
headers: Schema.Record(Schema.String, Schema.String),
|
|
33
|
+
body: Schema.Record(Schema.String, Schema.Any),
|
|
34
|
+
}).annotate({ identifier: "Provider.Request" });
|
|
35
|
+
export const Info = Schema.Struct({
|
|
36
|
+
id: ID,
|
|
37
|
+
canonical: ID.pipe(optional),
|
|
38
|
+
integrationID: Integration.ID.pipe(optional),
|
|
39
|
+
name: Schema.String,
|
|
40
|
+
activation: Activation,
|
|
41
|
+
package: Package,
|
|
42
|
+
compaction: Compaction.pipe(optional),
|
|
43
|
+
/** Session WebSocket policy for routes that support it; omitted means disabled. */
|
|
44
|
+
websocket: Schema.Boolean.pipe(optional),
|
|
45
|
+
...Overlays,
|
|
46
|
+
})
|
|
47
|
+
.annotate({ identifier: "Provider.Info" })
|
|
48
|
+
.pipe(statics(() => ({
|
|
49
|
+
empty: (id) => ({ id, name: id, activation: "auto", package: "" }),
|
|
50
|
+
})));
|
|
@@ -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" });
|