@opencode/schema 2.0.1 → 2.0.3
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/config/shell.d.ts +9 -0
- package/dist/config/shell.js +7 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +8 -0
- package/dist/session-message.d.ts +32 -2
- package/dist/session-message.js +6 -0
- package/dist/session-transfer.d.ts +12 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as ConfigShell from "./shell.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Option: Schema.Struct<{
|
|
4
|
+
readonly path: Schema.String;
|
|
5
|
+
readonly name: Schema.String;
|
|
6
|
+
readonly acceptable: Schema.Boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export interface Option extends Schema.Schema.Type<typeof Option> {
|
|
9
|
+
}
|
package/dist/config.d.ts
CHANGED
|
@@ -83,6 +83,18 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
83
83
|
}>, {}>;
|
|
84
84
|
export declare class Info extends Info_base {
|
|
85
85
|
}
|
|
86
|
+
export declare const Preferences: Schema.Struct<{
|
|
87
|
+
readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
88
|
+
readonly websearch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Literal<false>, typeof ConfigWebSearch.Info]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Literal<false>, typeof ConfigWebSearch.Info]>>, never, never>;
|
|
89
|
+
}>;
|
|
90
|
+
export interface Preferences extends Schema.Schema.Type<typeof Preferences> {
|
|
91
|
+
}
|
|
92
|
+
export declare const PreferencesPatch: Schema.Struct<{
|
|
93
|
+
readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
|
|
94
|
+
readonly websearch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.Union<readonly [Schema.Literal<false>, typeof ConfigWebSearch.Info]>>>>, Schema.optionalKey<Schema.NullOr<Schema.Union<readonly [Schema.Literal<false>, typeof ConfigWebSearch.Info]>>>, never, never>;
|
|
95
|
+
}>;
|
|
96
|
+
export interface PreferencesPatch extends Schema.Schema.Type<typeof PreferencesPatch> {
|
|
97
|
+
}
|
|
86
98
|
declare const Document_base: Schema.Class<Document, Schema.Struct<{
|
|
87
99
|
readonly type: Schema.Literal<"document">;
|
|
88
100
|
readonly path: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "AbsolutePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "AbsolutePath">>, never, never>;
|
package/dist/config.js
CHANGED
|
@@ -107,6 +107,14 @@ export class Info extends Schema.Class("Config.Info")({
|
|
|
107
107
|
experimental: ConfigExperimental.Info.pipe(optional),
|
|
108
108
|
}) {
|
|
109
109
|
}
|
|
110
|
+
export const Preferences = Schema.Struct({
|
|
111
|
+
shell: Schema.String.pipe(optional),
|
|
112
|
+
websearch: ConfigWebSearch.Selection.pipe(optional),
|
|
113
|
+
}).annotate({ identifier: "Config.Preferences" });
|
|
114
|
+
export const PreferencesPatch = Schema.Struct({
|
|
115
|
+
shell: Schema.NullOr(Schema.String).pipe(optional),
|
|
116
|
+
websearch: Schema.NullOr(ConfigWebSearch.Selection).pipe(optional),
|
|
117
|
+
}).annotate({ identifier: "Config.PreferencesPatch" });
|
|
110
118
|
export class Document extends Schema.Class("Config.Document")({
|
|
111
119
|
type: Schema.Literal("document"),
|
|
112
120
|
path: AbsolutePath.pipe(optional),
|
|
@@ -1291,6 +1291,25 @@ export declare const Compaction: Schema.Union<readonly [Schema.Struct<{
|
|
|
1291
1291
|
readonly type: Schema.tag<"compaction">;
|
|
1292
1292
|
}>]>;
|
|
1293
1293
|
export type Compaction = CompactionRunning | CompactionCompleted | CompactionFailed;
|
|
1294
|
+
/**
|
|
1295
|
+
* Marks the Session going idle: every step since the previous marker belongs to
|
|
1296
|
+
* one turn, including prompts steered in while it was busy. A shutdown does not
|
|
1297
|
+
* record one, since the resumed execution continues the same turn.
|
|
1298
|
+
*/
|
|
1299
|
+
export interface Idle extends Schema.Schema.Type<typeof Idle> {
|
|
1300
|
+
}
|
|
1301
|
+
export declare const Idle: Schema.Struct<{
|
|
1302
|
+
readonly type: Schema.tag<"idle">;
|
|
1303
|
+
readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
|
|
1304
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
1305
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
1306
|
+
fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
1307
|
+
};
|
|
1308
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
1309
|
+
readonly time: Schema.Struct<{
|
|
1310
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
1311
|
+
}>;
|
|
1312
|
+
}>;
|
|
1294
1313
|
export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
1295
1314
|
readonly type: Schema.tag<"agent-switched">;
|
|
1296
1315
|
readonly agent: Schema.brand<Schema.String, "Agent.ID">;
|
|
@@ -2002,6 +2021,17 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
|
2002
2021
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
2003
2022
|
}>;
|
|
2004
2023
|
readonly type: Schema.tag<"compaction">;
|
|
2005
|
-
}>]
|
|
2006
|
-
|
|
2024
|
+
}>]>, Schema.Struct<{
|
|
2025
|
+
readonly type: Schema.tag<"idle">;
|
|
2026
|
+
readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
|
|
2027
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
2028
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
2029
|
+
fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
2030
|
+
};
|
|
2031
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
2032
|
+
readonly time: Schema.Struct<{
|
|
2033
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
2034
|
+
}>;
|
|
2035
|
+
}>]>;
|
|
2036
|
+
export type Info = AgentSelected | ModelSelected | LocationSwitched | User | Synthetic | System | Skill | Shell | Assistant | Compaction | Idle;
|
|
2007
2037
|
export type Type = Info["type"];
|
package/dist/session-message.js
CHANGED
|
@@ -213,6 +213,11 @@ export const CompactionFailed = Schema.Struct({
|
|
|
213
213
|
...CompactionUsage,
|
|
214
214
|
}).annotate({ identifier: "Session.Message.Compaction.Failed" });
|
|
215
215
|
export const Compaction = Schema.Union([CompactionRunning, CompactionCompleted, CompactionFailed]).pipe(Schema.toTaggedUnion("status"), Schema.annotate({ identifier: "Session.Message.Compaction" }));
|
|
216
|
+
export const Idle = Schema.Struct({
|
|
217
|
+
...Base,
|
|
218
|
+
type: Schema.tag("idle"),
|
|
219
|
+
outcome: Schema.Literals(["succeeded", "failed", "interrupted"]),
|
|
220
|
+
}).annotate({ identifier: "Session.Message.Idle" });
|
|
216
221
|
export const Info = Schema.Union([
|
|
217
222
|
AgentSelected,
|
|
218
223
|
ModelSelected,
|
|
@@ -224,4 +229,5 @@ export const Info = Schema.Union([
|
|
|
224
229
|
Shell,
|
|
225
230
|
Assistant,
|
|
226
231
|
Compaction,
|
|
232
|
+
Idle,
|
|
227
233
|
]).annotate({ identifier: "Session.Message.Info" });
|
|
@@ -893,5 +893,16 @@ export declare const Data: Schema.Struct<{
|
|
|
893
893
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
894
894
|
}>;
|
|
895
895
|
readonly type: Schema.tag<"compaction">;
|
|
896
|
-
}>]
|
|
896
|
+
}>]>, Schema.Struct<{
|
|
897
|
+
readonly type: Schema.tag<"idle">;
|
|
898
|
+
readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
|
|
899
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
900
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
901
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
902
|
+
};
|
|
903
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
904
|
+
readonly time: Schema.Struct<{
|
|
905
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
906
|
+
}>;
|
|
907
|
+
}>]>>;
|
|
897
908
|
}>;
|