@opencode/schema 0.0.0-dev-537 → 0.0.0-dev-549
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/job.d.ts +113 -0
- package/dist/job.js +41 -0
- package/package.json +1 -1
package/dist/job.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export * as Job from "./job.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Kind: Schema.Literals<readonly ["shell", "subagent", "image"]>;
|
|
4
|
+
export type Kind = typeof Kind.Type;
|
|
5
|
+
export declare const Status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
6
|
+
export type Status = typeof Status.Type;
|
|
7
|
+
export interface Time extends Schema.Schema.Type<typeof Time> {
|
|
8
|
+
}
|
|
9
|
+
export declare const Time: Schema.Struct<{
|
|
10
|
+
readonly started: Schema.Finite;
|
|
11
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
12
|
+
}>;
|
|
13
|
+
export interface Shell extends Schema.Schema.Type<typeof Shell> {
|
|
14
|
+
}
|
|
15
|
+
export declare const Shell: Schema.Struct<{
|
|
16
|
+
readonly id: Schema.String;
|
|
17
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
18
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
19
|
+
};
|
|
20
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
21
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
22
|
+
readonly time: Schema.Struct<{
|
|
23
|
+
readonly started: Schema.Finite;
|
|
24
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
25
|
+
}>;
|
|
26
|
+
readonly kind: Schema.tag<"shell">;
|
|
27
|
+
readonly shellID: Schema.String;
|
|
28
|
+
readonly command: Schema.String;
|
|
29
|
+
}>;
|
|
30
|
+
export interface Subagent extends Schema.Schema.Type<typeof Subagent> {
|
|
31
|
+
}
|
|
32
|
+
export declare const Subagent: Schema.Struct<{
|
|
33
|
+
readonly id: Schema.String;
|
|
34
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
35
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
36
|
+
};
|
|
37
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
38
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
39
|
+
readonly time: Schema.Struct<{
|
|
40
|
+
readonly started: Schema.Finite;
|
|
41
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
42
|
+
}>;
|
|
43
|
+
readonly kind: Schema.tag<"subagent">;
|
|
44
|
+
readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
45
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
46
|
+
};
|
|
47
|
+
readonly agent: Schema.String;
|
|
48
|
+
readonly description: Schema.String;
|
|
49
|
+
}>;
|
|
50
|
+
export interface Image extends Schema.Schema.Type<typeof Image> {
|
|
51
|
+
}
|
|
52
|
+
export declare const Image: Schema.Struct<{
|
|
53
|
+
readonly id: Schema.String;
|
|
54
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
55
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
56
|
+
};
|
|
57
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
58
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
59
|
+
readonly time: Schema.Struct<{
|
|
60
|
+
readonly started: Schema.Finite;
|
|
61
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly kind: Schema.tag<"image">;
|
|
64
|
+
readonly path: Schema.String;
|
|
65
|
+
readonly model: Schema.String;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
68
|
+
readonly id: Schema.String;
|
|
69
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
70
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
71
|
+
};
|
|
72
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
73
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
74
|
+
readonly time: Schema.Struct<{
|
|
75
|
+
readonly started: Schema.Finite;
|
|
76
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
77
|
+
}>;
|
|
78
|
+
readonly kind: Schema.tag<"shell">;
|
|
79
|
+
readonly shellID: Schema.String;
|
|
80
|
+
readonly command: Schema.String;
|
|
81
|
+
}>, Schema.Struct<{
|
|
82
|
+
readonly id: Schema.String;
|
|
83
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
84
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
85
|
+
};
|
|
86
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
87
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
88
|
+
readonly time: Schema.Struct<{
|
|
89
|
+
readonly started: Schema.Finite;
|
|
90
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
91
|
+
}>;
|
|
92
|
+
readonly kind: Schema.tag<"subagent">;
|
|
93
|
+
readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
94
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
95
|
+
};
|
|
96
|
+
readonly agent: Schema.String;
|
|
97
|
+
readonly description: Schema.String;
|
|
98
|
+
}>, Schema.Struct<{
|
|
99
|
+
readonly id: Schema.String;
|
|
100
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
101
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
102
|
+
};
|
|
103
|
+
readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
|
|
104
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
105
|
+
readonly time: Schema.Struct<{
|
|
106
|
+
readonly started: Schema.Finite;
|
|
107
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
108
|
+
}>;
|
|
109
|
+
readonly kind: Schema.tag<"image">;
|
|
110
|
+
readonly path: Schema.String;
|
|
111
|
+
readonly model: Schema.String;
|
|
112
|
+
}>]>;
|
|
113
|
+
export type Info = typeof Info.Type;
|
package/dist/job.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export * as Job from "./job.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional } from "./schema.js";
|
|
4
|
+
import { SessionID } from "./session-id.js";
|
|
5
|
+
export const Kind = Schema.Literals(["shell", "subagent", "image"]).annotate({ identifier: "Job.Kind" });
|
|
6
|
+
export const Status = Schema.Literals(["running", "completed", "error", "cancelled"]).annotate({
|
|
7
|
+
identifier: "Job.Status",
|
|
8
|
+
});
|
|
9
|
+
export const Time = Schema.Struct({
|
|
10
|
+
started: Schema.Finite.annotate({ description: "Start time in milliseconds since the Unix epoch" }),
|
|
11
|
+
completed: optional(Schema.Finite).annotate({
|
|
12
|
+
description: "Completion time in milliseconds since the Unix epoch",
|
|
13
|
+
}),
|
|
14
|
+
}).annotate({ identifier: "Job.Time" });
|
|
15
|
+
const Base = {
|
|
16
|
+
id: Schema.String,
|
|
17
|
+
sessionID: SessionID,
|
|
18
|
+
status: Status,
|
|
19
|
+
title: optional(Schema.String),
|
|
20
|
+
time: Time,
|
|
21
|
+
};
|
|
22
|
+
export const Shell = Schema.Struct({
|
|
23
|
+
kind: Schema.tag("shell"),
|
|
24
|
+
...Base,
|
|
25
|
+
shellID: Schema.String,
|
|
26
|
+
command: Schema.String,
|
|
27
|
+
}).annotate({ identifier: "Job.Shell" });
|
|
28
|
+
export const Subagent = Schema.Struct({
|
|
29
|
+
kind: Schema.tag("subagent"),
|
|
30
|
+
...Base,
|
|
31
|
+
childSessionID: SessionID,
|
|
32
|
+
agent: Schema.String,
|
|
33
|
+
description: Schema.String,
|
|
34
|
+
}).annotate({ identifier: "Job.Subagent" });
|
|
35
|
+
export const Image = Schema.Struct({
|
|
36
|
+
kind: Schema.tag("image"),
|
|
37
|
+
...Base,
|
|
38
|
+
path: Schema.String,
|
|
39
|
+
model: Schema.String,
|
|
40
|
+
}).annotate({ identifier: "Job.Image" });
|
|
41
|
+
export const Info = Schema.Union([Shell, Subagent, Image]).pipe(Schema.toTaggedUnion("kind"), Schema.annotate({ identifier: "Job.Info" }));
|