@opencode-ai/schema 0.0.0-dev-17604 → 0.0.0-dev-17635
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 +44 -4
- package/dist/plugin.js +22 -3
- package/package.json +1 -1
package/dist/plugin.d.ts
CHANGED
|
@@ -2,11 +2,51 @@ export * as Plugin from "./plugin.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
export declare const ID: Schema.brand<Schema.String, "Plugin.ID">;
|
|
4
4
|
export type ID = typeof ID.Type;
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export declare const Source: Schema.Union<readonly [Schema.Struct<{
|
|
6
|
+
readonly type: Schema.Literal<"builtin">;
|
|
7
|
+
}>, Schema.Struct<{
|
|
8
|
+
readonly type: Schema.Literal<"package">;
|
|
9
|
+
readonly package: Schema.String;
|
|
10
|
+
}>, Schema.Struct<{
|
|
11
|
+
readonly type: Schema.Literal<"local">;
|
|
12
|
+
readonly path: Schema.String;
|
|
13
|
+
}>, Schema.Struct<{
|
|
14
|
+
readonly type: Schema.Literal<"sdk">;
|
|
15
|
+
}>]>;
|
|
16
|
+
export type Source = typeof Source.Type;
|
|
17
|
+
export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
8
18
|
readonly id: Schema.brand<Schema.String, "Plugin.ID">;
|
|
9
|
-
|
|
19
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"builtin">;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly type: Schema.Literal<"package">;
|
|
23
|
+
readonly package: Schema.String;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly type: Schema.Literal<"local">;
|
|
26
|
+
readonly path: Schema.String;
|
|
27
|
+
}>, Schema.Struct<{
|
|
28
|
+
readonly type: Schema.Literal<"sdk">;
|
|
29
|
+
}>]>;
|
|
30
|
+
readonly status: Schema.Literal<"active">;
|
|
31
|
+
readonly tui: Schema.Boolean;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Plugin.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Plugin.ID">>, never, never>;
|
|
34
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
35
|
+
readonly type: Schema.Literal<"builtin">;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly type: Schema.Literal<"package">;
|
|
38
|
+
readonly package: Schema.String;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly type: Schema.Literal<"local">;
|
|
41
|
+
readonly path: Schema.String;
|
|
42
|
+
}>, Schema.Struct<{
|
|
43
|
+
readonly type: Schema.Literal<"sdk">;
|
|
44
|
+
}>]>;
|
|
45
|
+
readonly status: Schema.Literal<"failed">;
|
|
46
|
+
readonly error: Schema.String;
|
|
47
|
+
readonly tui: Schema.Boolean;
|
|
48
|
+
}>]>;
|
|
49
|
+
export type Info = typeof Info.Type;
|
|
10
50
|
export declare const Event: {
|
|
11
51
|
Added: Schema.Struct<{
|
|
12
52
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
package/dist/plugin.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
export * as Plugin from "./plugin.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { ephemeral, inventory } from "./event.js";
|
|
4
|
+
import { optional } from "./schema.js";
|
|
4
5
|
export const ID = Schema.String.pipe(Schema.brand("Plugin.ID"));
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export const Source = Schema.Union([
|
|
7
|
+
Schema.Struct({ type: Schema.Literal("builtin") }),
|
|
8
|
+
Schema.Struct({ type: Schema.Literal("package"), package: Schema.String }),
|
|
9
|
+
Schema.Struct({ type: Schema.Literal("local"), path: Schema.String }),
|
|
10
|
+
Schema.Struct({ type: Schema.Literal("sdk") }),
|
|
11
|
+
]).annotate({ identifier: "Plugin.Source" });
|
|
12
|
+
export const Info = Schema.Union([
|
|
13
|
+
Schema.Struct({
|
|
14
|
+
id: ID,
|
|
15
|
+
source: Source,
|
|
16
|
+
status: Schema.Literal("active"),
|
|
17
|
+
tui: Schema.Boolean,
|
|
18
|
+
}),
|
|
19
|
+
Schema.Struct({
|
|
20
|
+
id: ID.pipe(optional),
|
|
21
|
+
source: Source,
|
|
22
|
+
status: Schema.Literal("failed"),
|
|
23
|
+
error: Schema.String,
|
|
24
|
+
tui: Schema.Boolean,
|
|
25
|
+
}),
|
|
26
|
+
]).annotate({ identifier: "Plugin.Info" });
|
|
8
27
|
const Added = ephemeral({
|
|
9
28
|
type: "plugin.added",
|
|
10
29
|
schema: { id: ID },
|