@opencode/schema 0.0.0-dev-55 → 0.0.0-dev-57
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/plugin.d.ts +15 -0
- package/dist/plugin.js +11 -1
- package/package.json +1 -1
package/dist/plugin.d.ts
CHANGED
|
@@ -21,8 +21,21 @@ export declare const Features: Schema.Struct<{
|
|
|
21
21
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
22
22
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
23
23
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
24
|
+
/** The package exports `./gui-experimental`, the GUI bundle the desktop app loads. */
|
|
25
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
24
26
|
}>;
|
|
25
27
|
export type Features = typeof Features.Type;
|
|
28
|
+
/** A plugin's prebuilt CommonJS `./gui-experimental` bundle. */
|
|
29
|
+
export interface GuiBundle extends Schema.Schema.Type<typeof GuiBundle> {
|
|
30
|
+
}
|
|
31
|
+
export declare const GuiBundle: Schema.Struct<{
|
|
32
|
+
/** The bundle's CommonJS code. */
|
|
33
|
+
readonly code: Schema.String;
|
|
34
|
+
/** An opaque value that changes whenever the plugin, its options or its bundle change. */
|
|
35
|
+
readonly revision: Schema.String;
|
|
36
|
+
/** The plugin's options from its `opencode.json` entry, as its server entry receives them. */
|
|
37
|
+
readonly options: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
38
|
+
}>;
|
|
26
39
|
export declare const State: Schema.Union<readonly [Schema.Struct<{
|
|
27
40
|
readonly status: Schema.Literal<"active">;
|
|
28
41
|
}>, Schema.Struct<{
|
|
@@ -53,6 +66,8 @@ export declare const Info: Schema.Struct<{
|
|
|
53
66
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
54
67
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
55
68
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
69
|
+
/** The package exports `./gui-experimental`, the GUI bundle the desktop app loads. */
|
|
70
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
56
71
|
}>;
|
|
57
72
|
readonly state: Schema.Union<readonly [Schema.Struct<{
|
|
58
73
|
readonly status: Schema.Literal<"active">;
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ export * as Plugin from "./plugin.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { ephemeral, inventory } from "./event.js";
|
|
4
4
|
import { optional } from "./schema.js";
|
|
5
|
-
export const ID = Schema.String.pipe(Schema.brand("Plugin.ID"));
|
|
5
|
+
export const ID = Schema.String.pipe(Schema.brand("Plugin.ID"), Schema.annotate({ identifier: "Plugin.ID" }));
|
|
6
6
|
export const Source = Schema.Union([
|
|
7
7
|
Schema.Struct({ type: Schema.Literal("builtin") }),
|
|
8
8
|
Schema.Struct({
|
|
@@ -19,7 +19,17 @@ export const Features = Schema.Struct({
|
|
|
19
19
|
server: Schema.Literal(true).pipe(optional),
|
|
20
20
|
tui: Schema.Literal(true).pipe(optional),
|
|
21
21
|
rpc: Schema.Literal(true).pipe(optional),
|
|
22
|
+
/** The package exports `./gui-experimental`, the GUI bundle the desktop app loads. */
|
|
23
|
+
gui: Schema.Literal(true).pipe(optional),
|
|
22
24
|
}).annotate({ identifier: "Plugin.Features" });
|
|
25
|
+
export const GuiBundle = Schema.Struct({
|
|
26
|
+
/** The bundle's CommonJS code. */
|
|
27
|
+
code: Schema.String,
|
|
28
|
+
/** An opaque value that changes whenever the plugin, its options or its bundle change. */
|
|
29
|
+
revision: Schema.String,
|
|
30
|
+
/** The plugin's options from its `opencode.json` entry, as its server entry receives them. */
|
|
31
|
+
options: Schema.Record(Schema.String, Schema.Json),
|
|
32
|
+
}).annotate({ identifier: "Plugin.GuiBundle" });
|
|
23
33
|
export const State = Schema.Union([
|
|
24
34
|
Schema.Struct({ status: Schema.Literal("active") }),
|
|
25
35
|
Schema.Struct({ status: Schema.Literal("failed"), error: Schema.String, ref: Schema.String.pipe(optional) }),
|