@opencode-ai/schema 0.0.0-next-15090 → 0.0.0-next-15092
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 +13 -9
- package/dist/agent.js +5 -2
- package/dist/command.d.ts +5 -5
- package/dist/command.js +3 -2
- package/dist/durable-event-manifest.d.ts +146 -96
- package/dist/event-manifest.d.ts +390 -282
- package/dist/event.d.ts +2 -1
- package/dist/event.js +12 -4
- package/dist/file-diff.d.ts +11 -1
- package/dist/file-diff.js +13 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/model.d.ts +46 -30
- package/dist/model.js +10 -9
- package/dist/money.d.ts +10 -0
- package/dist/money.js +5 -0
- package/dist/session-event.d.ts +748 -486
- package/dist/session-event.js +30 -27
- package/dist/session-input.d.ts +6 -6
- package/dist/session-input.js +3 -3
- package/dist/session-message.d.ts +238 -619
- package/dist/session-message.js +57 -44
- package/dist/session-revert.d.ts +479 -0
- package/dist/session-revert.js +63 -0
- package/dist/session.d.ts +26 -22
- package/dist/session.js +9 -13
- package/dist/shell.d.ts +42 -42
- package/dist/shell.js +1 -1
- package/dist/skill.d.ts +16 -9
- package/dist/skill.js +14 -11
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +13 -0
- package/dist/token-usage.js +11 -0
- package/dist/v1/session.d.ts +62 -62
- package/dist/v1/session.js +5 -5
- package/package.json +1 -1
- package/dist/revert.d.ts +0 -35
- package/dist/revert.js +0 -19
package/dist/session.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ export * as Session from "./session.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { SessionEvent } from "./session-event.js";
|
|
4
4
|
import { SessionID } from "./session-id.js";
|
|
5
|
+
import { Revert } from "./session-revert.js";
|
|
5
6
|
export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
|
|
6
7
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
7
8
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
8
9
|
};
|
|
9
10
|
export type ID = SessionID;
|
|
10
11
|
export declare const Event: typeof SessionEvent;
|
|
12
|
+
export { Revert };
|
|
11
13
|
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
12
14
|
}
|
|
13
15
|
export declare const Info: Schema.Struct<{
|
|
@@ -27,6 +29,7 @@ export declare const Info: Schema.Struct<{
|
|
|
27
29
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
28
30
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
29
31
|
};
|
|
32
|
+
/** Messages before this exclusive boundary are copied into the fork. */
|
|
30
33
|
readonly messageID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
31
34
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
32
35
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -39,6 +42,7 @@ export declare const Info: Schema.Struct<{
|
|
|
39
42
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
40
43
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
41
44
|
};
|
|
45
|
+
/** Messages before this exclusive boundary are copied into the fork. */
|
|
42
46
|
readonly messageID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
43
47
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
44
48
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -50,9 +54,9 @@ export declare const Info: Schema.Struct<{
|
|
|
50
54
|
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
51
55
|
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
52
56
|
};
|
|
53
|
-
readonly agent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "
|
|
57
|
+
readonly agent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Agent.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Agent.ID">>, never, never>;
|
|
54
58
|
readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
55
|
-
readonly id: Schema.brand<Schema.String, "
|
|
59
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
56
60
|
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
57
61
|
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
58
62
|
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
@@ -66,9 +70,9 @@ export declare const Info: Schema.Struct<{
|
|
|
66
70
|
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
67
71
|
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
68
72
|
};
|
|
69
|
-
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
|
|
73
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
70
74
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
71
|
-
readonly id: Schema.brand<Schema.String, "
|
|
75
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
72
76
|
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
73
77
|
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
74
78
|
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
@@ -82,9 +86,11 @@ export declare const Info: Schema.Struct<{
|
|
|
82
86
|
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
83
87
|
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
84
88
|
};
|
|
85
|
-
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
|
|
89
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
86
90
|
}>>, never, never>;
|
|
87
|
-
readonly cost: Schema.Finite
|
|
91
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
92
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
93
|
+
};
|
|
88
94
|
readonly tokens: Schema.Struct<{
|
|
89
95
|
readonly input: Schema.Finite;
|
|
90
96
|
readonly output: Schema.Finite;
|
|
@@ -117,20 +123,19 @@ export declare const Info: Schema.Struct<{
|
|
|
117
123
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
118
124
|
};
|
|
119
125
|
readonly partID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
120
|
-
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String
|
|
121
|
-
readonly diff: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
126
|
+
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Snapshot.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Snapshot.ID">>, never, never>;
|
|
122
127
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
128
|
+
readonly file: Schema.String;
|
|
129
|
+
readonly patch: Schema.String;
|
|
125
130
|
readonly additions: Schema.Int;
|
|
126
131
|
readonly deletions: Schema.Int;
|
|
127
|
-
readonly
|
|
132
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
128
133
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
134
|
+
readonly file: Schema.String;
|
|
135
|
+
readonly patch: Schema.String;
|
|
131
136
|
readonly additions: Schema.Int;
|
|
132
137
|
readonly deletions: Schema.Int;
|
|
133
|
-
readonly
|
|
138
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
134
139
|
}>>>, never, never>;
|
|
135
140
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
136
141
|
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
@@ -138,20 +143,19 @@ export declare const Info: Schema.Struct<{
|
|
|
138
143
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
139
144
|
};
|
|
140
145
|
readonly partID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
141
|
-
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String
|
|
142
|
-
readonly diff: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
146
|
+
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Snapshot.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Snapshot.ID">>, never, never>;
|
|
143
147
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
144
|
-
readonly
|
|
145
|
-
readonly
|
|
148
|
+
readonly file: Schema.String;
|
|
149
|
+
readonly patch: Schema.String;
|
|
146
150
|
readonly additions: Schema.Int;
|
|
147
151
|
readonly deletions: Schema.Int;
|
|
148
|
-
readonly
|
|
152
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
149
153
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
150
|
-
readonly
|
|
151
|
-
readonly
|
|
154
|
+
readonly file: Schema.String;
|
|
155
|
+
readonly patch: Schema.String;
|
|
152
156
|
readonly additions: Schema.Int;
|
|
153
157
|
readonly deletions: Schema.Int;
|
|
154
|
-
readonly
|
|
158
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
155
159
|
}>>>, never, never>;
|
|
156
160
|
}>>, never, never>;
|
|
157
161
|
}>;
|
package/dist/session.js
CHANGED
|
@@ -8,29 +8,25 @@ import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
|
8
8
|
import { SessionEvent } from "./session-event.js";
|
|
9
9
|
import { SessionID } from "./session-id.js";
|
|
10
10
|
import { SessionMessage } from "./session-message.js";
|
|
11
|
-
import {
|
|
11
|
+
import { Money } from "./money.js";
|
|
12
|
+
import { TokenUsage } from "./token-usage.js";
|
|
13
|
+
import { Revert } from "./session-revert.js";
|
|
12
14
|
export const ID = SessionID;
|
|
13
15
|
export const Event = SessionEvent;
|
|
16
|
+
export { Revert };
|
|
14
17
|
export const Info = Schema.Struct({
|
|
15
18
|
id: ID,
|
|
16
19
|
parentID: ID.pipe(optional),
|
|
17
20
|
fork: Schema.Struct({
|
|
18
21
|
sessionID: ID,
|
|
22
|
+
/** Messages before this exclusive boundary are copied into the fork. */
|
|
19
23
|
messageID: SessionMessage.ID.pipe(optional),
|
|
20
24
|
}).pipe(optional),
|
|
21
25
|
projectID: Project.ID,
|
|
22
26
|
agent: Agent.ID.pipe(optional),
|
|
23
27
|
model: Model.Ref.pipe(optional),
|
|
24
|
-
cost:
|
|
25
|
-
tokens:
|
|
26
|
-
input: Schema.Finite,
|
|
27
|
-
output: Schema.Finite,
|
|
28
|
-
reasoning: Schema.Finite,
|
|
29
|
-
cache: Schema.Struct({
|
|
30
|
-
read: Schema.Finite,
|
|
31
|
-
write: Schema.Finite,
|
|
32
|
-
}),
|
|
33
|
-
}),
|
|
28
|
+
cost: Money.USD,
|
|
29
|
+
tokens: TokenUsage.Info,
|
|
34
30
|
time: Schema.Struct({
|
|
35
31
|
created: DateTimeUtcFromMillis,
|
|
36
32
|
updated: DateTimeUtcFromMillis,
|
|
@@ -39,8 +35,8 @@ export const Info = Schema.Struct({
|
|
|
39
35
|
title: Schema.String,
|
|
40
36
|
location: Location.Ref,
|
|
41
37
|
subpath: RelativePath.pipe(optional),
|
|
42
|
-
revert: Revert.
|
|
43
|
-
}).annotate({ identifier: "
|
|
38
|
+
revert: Revert.pipe(optional),
|
|
39
|
+
}).annotate({ identifier: "Session.Info" });
|
|
44
40
|
export const ListAnchor = Schema.Struct({
|
|
45
41
|
id: ID,
|
|
46
42
|
time: Schema.Finite,
|
package/dist/shell.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as Shell from "./shell.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
export declare const ID: Schema.brand<Schema.String, "
|
|
4
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
5
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
4
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
5
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
6
6
|
};
|
|
7
7
|
export type ID = typeof ID.Type;
|
|
8
8
|
export declare const Status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
@@ -16,9 +16,9 @@ export interface Time extends Schema.Schema.Type<typeof Time> {
|
|
|
16
16
|
export declare const Metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
17
17
|
export type Metadata = typeof Metadata.Type;
|
|
18
18
|
export declare const Info: Schema.Struct<{
|
|
19
|
-
readonly id: Schema.brand<Schema.String, "
|
|
20
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
21
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
19
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
20
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
21
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
22
22
|
};
|
|
23
23
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
24
24
|
readonly command: Schema.String;
|
|
@@ -64,9 +64,9 @@ export declare const Event: {
|
|
|
64
64
|
}>>, never, never>;
|
|
65
65
|
readonly data: Schema.Struct<{
|
|
66
66
|
readonly info: Schema.Struct<{
|
|
67
|
-
readonly id: Schema.brand<Schema.String, "
|
|
68
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
69
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
67
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
68
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
69
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
70
70
|
};
|
|
71
71
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
72
72
|
readonly command: Schema.String;
|
|
@@ -88,9 +88,9 @@ export declare const Event: {
|
|
|
88
88
|
durable: undefined;
|
|
89
89
|
data: Schema.Struct<{
|
|
90
90
|
readonly info: Schema.Struct<{
|
|
91
|
-
readonly id: Schema.brand<Schema.String, "
|
|
92
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
93
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
91
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
92
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
93
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
94
94
|
};
|
|
95
95
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
96
96
|
readonly command: Schema.String;
|
|
@@ -134,9 +134,9 @@ export declare const Event: {
|
|
|
134
134
|
}>, never, never>;
|
|
135
135
|
}>>, never, never>;
|
|
136
136
|
readonly data: Schema.Struct<{
|
|
137
|
-
readonly id: Schema.brand<Schema.String, "
|
|
138
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
139
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
137
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
138
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
139
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
140
140
|
};
|
|
141
141
|
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
142
142
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
@@ -146,9 +146,9 @@ export declare const Event: {
|
|
|
146
146
|
durability: "ephemeral";
|
|
147
147
|
durable: undefined;
|
|
148
148
|
data: Schema.Struct<{
|
|
149
|
-
readonly id: Schema.brand<Schema.String, "
|
|
150
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
151
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
149
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
150
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
151
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
152
152
|
};
|
|
153
153
|
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
154
154
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
@@ -181,9 +181,9 @@ export declare const Event: {
|
|
|
181
181
|
}>, never, never>;
|
|
182
182
|
}>>, never, never>;
|
|
183
183
|
readonly data: Schema.Struct<{
|
|
184
|
-
readonly id: Schema.brand<Schema.String, "
|
|
185
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
186
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
184
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
185
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
186
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
187
187
|
};
|
|
188
188
|
}>;
|
|
189
189
|
}> & {
|
|
@@ -191,9 +191,9 @@ export declare const Event: {
|
|
|
191
191
|
durability: "ephemeral";
|
|
192
192
|
durable: undefined;
|
|
193
193
|
data: Schema.Struct<{
|
|
194
|
-
readonly id: Schema.brand<Schema.String, "
|
|
195
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
196
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
194
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
195
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
196
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
197
197
|
};
|
|
198
198
|
}>;
|
|
199
199
|
};
|
|
@@ -225,9 +225,9 @@ export declare const Event: {
|
|
|
225
225
|
}>>, never, never>;
|
|
226
226
|
readonly data: Schema.Struct<{
|
|
227
227
|
readonly info: Schema.Struct<{
|
|
228
|
-
readonly id: Schema.brand<Schema.String, "
|
|
229
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
230
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
228
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
229
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
230
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
231
231
|
};
|
|
232
232
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
233
233
|
readonly command: Schema.String;
|
|
@@ -249,9 +249,9 @@ export declare const Event: {
|
|
|
249
249
|
durable: undefined;
|
|
250
250
|
data: Schema.Struct<{
|
|
251
251
|
readonly info: Schema.Struct<{
|
|
252
|
-
readonly id: Schema.brand<Schema.String, "
|
|
253
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
254
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
252
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
253
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
254
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
255
255
|
};
|
|
256
256
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
257
257
|
readonly command: Schema.String;
|
|
@@ -294,9 +294,9 @@ export declare const Event: {
|
|
|
294
294
|
}>, never, never>;
|
|
295
295
|
}>>, never, never>;
|
|
296
296
|
readonly data: Schema.Struct<{
|
|
297
|
-
readonly id: Schema.brand<Schema.String, "
|
|
298
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
299
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
297
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
298
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
299
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
300
300
|
};
|
|
301
301
|
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
302
302
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
@@ -306,9 +306,9 @@ export declare const Event: {
|
|
|
306
306
|
durability: "ephemeral";
|
|
307
307
|
durable: undefined;
|
|
308
308
|
data: Schema.Struct<{
|
|
309
|
-
readonly id: Schema.brand<Schema.String, "
|
|
310
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
311
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
309
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
310
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
311
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
312
312
|
};
|
|
313
313
|
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
314
314
|
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
@@ -340,9 +340,9 @@ export declare const Event: {
|
|
|
340
340
|
}>, never, never>;
|
|
341
341
|
}>>, never, never>;
|
|
342
342
|
readonly data: Schema.Struct<{
|
|
343
|
-
readonly id: Schema.brand<Schema.String, "
|
|
344
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
345
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
343
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
344
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
345
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
346
346
|
};
|
|
347
347
|
}>;
|
|
348
348
|
}> & {
|
|
@@ -350,9 +350,9 @@ export declare const Event: {
|
|
|
350
350
|
durability: "ephemeral";
|
|
351
351
|
durable: undefined;
|
|
352
352
|
data: Schema.Struct<{
|
|
353
|
-
readonly id: Schema.brand<Schema.String, "
|
|
354
|
-
create: () => string & import("effect/Brand").Brand<"
|
|
355
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"
|
|
353
|
+
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
354
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
355
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
356
356
|
};
|
|
357
357
|
}>;
|
|
358
358
|
}];
|
package/dist/shell.js
CHANGED
|
@@ -4,7 +4,7 @@ import { optional } from "./schema.js";
|
|
|
4
4
|
import { ephemeral, inventory } from "./event.js";
|
|
5
5
|
import { ascending } from "./identifier.js";
|
|
6
6
|
import { NonNegativeInt, statics } from "./schema.js";
|
|
7
|
-
const IDSchema = Schema.String.check(Schema.isStartsWith("sh_")).pipe(Schema.brand("
|
|
7
|
+
const IDSchema = Schema.String.check(Schema.isStartsWith("sh_")).pipe(Schema.brand("Shell.ID"));
|
|
8
8
|
export const ID = IDSchema.pipe(statics((schema) => {
|
|
9
9
|
const create = () => schema.make("sh_" + ascending());
|
|
10
10
|
return {
|
package/dist/skill.d.ts
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
export * as Skill from "./skill.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "Skill.ID">;
|
|
4
|
+
export type ID = typeof ID.Type;
|
|
5
|
+
export declare const Name: Schema.brand<Schema.String, "Skill.Name">;
|
|
6
|
+
export type Name = typeof Name.Type;
|
|
3
7
|
export interface DirectorySource extends Schema.Schema.Type<typeof DirectorySource> {
|
|
4
8
|
}
|
|
5
9
|
export declare const DirectorySource: Schema.Struct<{
|
|
6
|
-
readonly type: Schema.
|
|
10
|
+
readonly type: Schema.tag<"directory">;
|
|
7
11
|
readonly path: Schema.brand<Schema.String, "AbsolutePath">;
|
|
8
12
|
}>;
|
|
9
13
|
export interface UrlSource extends Schema.Schema.Type<typeof UrlSource> {
|
|
10
14
|
}
|
|
11
15
|
export declare const UrlSource: Schema.Struct<{
|
|
12
|
-
readonly type: Schema.
|
|
16
|
+
readonly type: Schema.tag<"url">;
|
|
13
17
|
readonly url: Schema.String;
|
|
14
18
|
}>;
|
|
15
19
|
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
16
20
|
}
|
|
17
21
|
export declare const Info: Schema.Struct<{
|
|
18
|
-
readonly
|
|
22
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
23
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
19
24
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
20
25
|
readonly slash: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
21
26
|
readonly autoinvoke: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -93,9 +98,10 @@ export declare const Event: {
|
|
|
93
98
|
export interface EmbeddedSource extends Schema.Schema.Type<typeof EmbeddedSource> {
|
|
94
99
|
}
|
|
95
100
|
export declare const EmbeddedSource: Schema.Struct<{
|
|
96
|
-
readonly type: Schema.
|
|
101
|
+
readonly type: Schema.tag<"embedded">;
|
|
97
102
|
readonly skill: Schema.suspend<Schema.Struct<{
|
|
98
|
-
readonly
|
|
103
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
104
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
99
105
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
100
106
|
readonly slash: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
101
107
|
readonly autoinvoke: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -105,15 +111,16 @@ export declare const EmbeddedSource: Schema.Struct<{
|
|
|
105
111
|
}>;
|
|
106
112
|
export type Source = DirectorySource | UrlSource | EmbeddedSource;
|
|
107
113
|
export declare const Source: Schema.Union<readonly [Schema.Struct<{
|
|
108
|
-
readonly type: Schema.
|
|
114
|
+
readonly type: Schema.tag<"directory">;
|
|
109
115
|
readonly path: Schema.brand<Schema.String, "AbsolutePath">;
|
|
110
116
|
}>, Schema.Struct<{
|
|
111
|
-
readonly type: Schema.
|
|
117
|
+
readonly type: Schema.tag<"url">;
|
|
112
118
|
readonly url: Schema.String;
|
|
113
119
|
}>, Schema.Struct<{
|
|
114
|
-
readonly type: Schema.
|
|
120
|
+
readonly type: Schema.tag<"embedded">;
|
|
115
121
|
readonly skill: Schema.suspend<Schema.Struct<{
|
|
116
|
-
readonly
|
|
122
|
+
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
123
|
+
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
117
124
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
118
125
|
readonly slash: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
119
126
|
readonly autoinvoke: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
package/dist/skill.js
CHANGED
|
@@ -3,29 +3,32 @@ import { Schema } from "effect";
|
|
|
3
3
|
import { optional } from "./schema.js";
|
|
4
4
|
import { AbsolutePath } from "./schema.js";
|
|
5
5
|
import { ephemeral, inventory } from "./event.js";
|
|
6
|
+
export const ID = Schema.String.pipe(Schema.brand("Skill.ID"));
|
|
7
|
+
export const Name = Schema.String.pipe(Schema.brand("Skill.Name"));
|
|
6
8
|
export const DirectorySource = Schema.Struct({
|
|
7
|
-
type: Schema.
|
|
9
|
+
type: Schema.tag("directory"),
|
|
8
10
|
path: AbsolutePath,
|
|
9
|
-
}).annotate({ identifier: "
|
|
11
|
+
}).annotate({ identifier: "Skill.DirectorySource" });
|
|
10
12
|
export const UrlSource = Schema.Struct({
|
|
11
|
-
type: Schema.
|
|
13
|
+
type: Schema.tag("url"),
|
|
12
14
|
url: Schema.String,
|
|
13
|
-
}).annotate({ identifier: "
|
|
15
|
+
}).annotate({ identifier: "Skill.UrlSource" });
|
|
14
16
|
export const Info = Schema.Struct({
|
|
15
|
-
|
|
17
|
+
id: ID,
|
|
18
|
+
name: Name,
|
|
16
19
|
description: Schema.String.pipe(optional),
|
|
17
20
|
slash: Schema.Boolean.pipe(optional),
|
|
18
21
|
autoinvoke: Schema.Boolean.pipe(optional),
|
|
19
22
|
location: AbsolutePath,
|
|
20
23
|
content: Schema.String,
|
|
21
|
-
}).annotate({ identifier: "
|
|
24
|
+
}).annotate({ identifier: "Skill.Info" });
|
|
22
25
|
const Updated = ephemeral({ type: "skill.updated", schema: {} });
|
|
23
26
|
export const Event = { Updated, Definitions: inventory(Updated) };
|
|
24
27
|
export const EmbeddedSource = Schema.Struct({
|
|
25
|
-
type: Schema.
|
|
28
|
+
type: Schema.tag("embedded"),
|
|
26
29
|
skill: Schema.suspend(() => Info),
|
|
27
|
-
}).annotate({ identifier: "
|
|
28
|
-
export const Source = Object.assign(Schema.Union([DirectorySource, UrlSource, EmbeddedSource]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "
|
|
30
|
+
}).annotate({ identifier: "Skill.EmbeddedSource" });
|
|
31
|
+
export const Source = Object.assign(Schema.Union([DirectorySource, UrlSource, EmbeddedSource]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Skill.Source" })), {
|
|
29
32
|
equals: (a, b) => {
|
|
30
33
|
if (a.type !== b.type)
|
|
31
34
|
return false;
|
|
@@ -34,12 +37,12 @@ export const Source = Object.assign(Schema.Union([DirectorySource, UrlSource, Em
|
|
|
34
37
|
if (a.type === "url" && b.type === "url")
|
|
35
38
|
return a.url === b.url;
|
|
36
39
|
if (a.type === "embedded" && b.type === "embedded")
|
|
37
|
-
return a.skill.
|
|
40
|
+
return a.skill.id === b.skill.id;
|
|
38
41
|
return false;
|
|
39
42
|
},
|
|
40
43
|
key: (source) => source.type === "directory"
|
|
41
44
|
? `directory:${source.path}`
|
|
42
45
|
: source.type === "url"
|
|
43
46
|
? `url:${source.url}`
|
|
44
|
-
: `embedded:${source.skill.
|
|
47
|
+
: `embedded:${source.skill.id}`,
|
|
45
48
|
});
|
package/dist/snapshot.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * as TokenUsage from "./token-usage.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
4
|
+
}
|
|
5
|
+
export declare const Info: Schema.Struct<{
|
|
6
|
+
readonly input: Schema.Finite;
|
|
7
|
+
readonly output: Schema.Finite;
|
|
8
|
+
readonly reasoning: Schema.Finite;
|
|
9
|
+
readonly cache: Schema.Struct<{
|
|
10
|
+
readonly read: Schema.Finite;
|
|
11
|
+
readonly write: Schema.Finite;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * as TokenUsage from "./token-usage.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export const Info = Schema.Struct({
|
|
4
|
+
input: Schema.Finite,
|
|
5
|
+
output: Schema.Finite,
|
|
6
|
+
reasoning: Schema.Finite,
|
|
7
|
+
cache: Schema.Struct({
|
|
8
|
+
read: Schema.Finite,
|
|
9
|
+
write: Schema.Finite,
|
|
10
|
+
}),
|
|
11
|
+
}).annotate({ identifier: "TokenUsage.Info" });
|