@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/event.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export type Payload<D extends Definition = Definition> = D extends DurableDefini
|
|
|
54
54
|
};
|
|
55
55
|
type Input<Type extends string, Fields extends Readonly<Record<PropertyKey, Schema.Codec<unknown, unknown>>>> = {
|
|
56
56
|
readonly type: Type;
|
|
57
|
+
readonly identifier?: string;
|
|
57
58
|
readonly durable?: {
|
|
58
59
|
readonly version: number;
|
|
59
60
|
readonly aggregate: string;
|
|
@@ -72,7 +73,7 @@ export declare function durable<const Type extends string, const Fields extends
|
|
|
72
73
|
readonly durable: Schema.Struct<{
|
|
73
74
|
readonly aggregateID: Schema.String;
|
|
74
75
|
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
75
|
-
readonly version: Schema.brand<Schema.Int, "Event.Version">;
|
|
76
|
+
readonly version: Schema.decodeTo<Schema.toType<Schema.brand<Schema.Int, "Event.Version">>, Schema.Literal<number>, never, never>;
|
|
76
77
|
}>;
|
|
77
78
|
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
78
79
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
package/dist/event.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as Event from "./event.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { Schema, SchemaTransformation } from "effect";
|
|
3
3
|
import { optional } from "./schema.js";
|
|
4
4
|
import { ascending } from "./identifier.js";
|
|
5
5
|
import { Location } from "./location.js";
|
|
@@ -16,16 +16,24 @@ export const Version = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(S
|
|
|
16
16
|
const DurableEnvelope = Schema.Struct({ aggregateID: Schema.String, seq: Seq, version: Version });
|
|
17
17
|
export function durable(input) {
|
|
18
18
|
const data = Schema.Struct(input.schema);
|
|
19
|
+
const durable = Schema.Struct({
|
|
20
|
+
aggregateID: DurableEnvelope.fields.aggregateID,
|
|
21
|
+
seq: DurableEnvelope.fields.seq,
|
|
22
|
+
version: Schema.Literal(input.durable.version).pipe(Schema.decodeTo(Schema.toType(Version), SchemaTransformation.transform({
|
|
23
|
+
decode: () => Version.make(input.durable.version),
|
|
24
|
+
encode: () => input.durable.version,
|
|
25
|
+
}))),
|
|
26
|
+
});
|
|
19
27
|
return Schema.Struct({
|
|
20
28
|
id: ID,
|
|
21
29
|
created: DateTimeUtcFromMillis,
|
|
22
30
|
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
23
31
|
type: Schema.Literal(input.type),
|
|
24
|
-
durable
|
|
32
|
+
durable,
|
|
25
33
|
location: optional(Location.Ref),
|
|
26
34
|
data,
|
|
27
35
|
})
|
|
28
|
-
.annotate({ identifier: input.type })
|
|
36
|
+
.annotate({ identifier: input.identifier ?? input.type })
|
|
29
37
|
.pipe(statics(() => ({
|
|
30
38
|
type: input.type,
|
|
31
39
|
durability: "durable",
|
|
@@ -43,7 +51,7 @@ export function ephemeral(input) {
|
|
|
43
51
|
location: optional(Location.Ref),
|
|
44
52
|
data,
|
|
45
53
|
})
|
|
46
|
-
.annotate({ identifier: input.type })
|
|
54
|
+
.annotate({ identifier: input.identifier ?? input.type })
|
|
47
55
|
.pipe(statics(() => ({
|
|
48
56
|
type: input.type,
|
|
49
57
|
durability: "ephemeral",
|
package/dist/file-diff.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
export * as FileDiff from "./file-diff.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
export declare const Info: Schema.Struct<{
|
|
4
|
+
readonly file: Schema.String;
|
|
5
|
+
readonly patch: Schema.String;
|
|
6
|
+
readonly additions: Schema.Int;
|
|
7
|
+
readonly deletions: Schema.Int;
|
|
8
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
9
|
+
}>;
|
|
10
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
11
|
+
}
|
|
12
|
+
/** V1 snapshot and persisted session diff shape. */
|
|
13
|
+
export declare const LegacyInfo: Schema.Struct<{
|
|
4
14
|
readonly file: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
5
15
|
readonly patch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
6
16
|
readonly additions: Schema.Finite;
|
|
7
17
|
readonly deletions: Schema.Finite;
|
|
8
18
|
readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["added", "deleted", "modified"]>>>, Schema.optionalKey<Schema.Literals<readonly ["added", "deleted", "modified"]>>, never, never>;
|
|
9
19
|
}>;
|
|
10
|
-
export interface
|
|
20
|
+
export interface LegacyInfo extends Schema.Schema.Type<typeof LegacyInfo> {
|
|
11
21
|
}
|
package/dist/file-diff.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
export * as FileDiff from "./file-diff.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import { optional } from "./schema.js";
|
|
3
|
+
import { NonNegativeInt, optional } from "./schema.js";
|
|
4
4
|
export const Info = Schema.Struct({
|
|
5
|
-
file:
|
|
6
|
-
patch:
|
|
5
|
+
file: Schema.String,
|
|
6
|
+
patch: Schema.String,
|
|
7
|
+
additions: NonNegativeInt,
|
|
8
|
+
deletions: NonNegativeInt,
|
|
9
|
+
status: Schema.Literals(["added", "deleted", "modified"]),
|
|
10
|
+
}).annotate({ identifier: "FileDiff.Info" });
|
|
11
|
+
/** V1 snapshot and persisted session diff shape. */
|
|
12
|
+
export const LegacyInfo = Schema.Struct({
|
|
13
|
+
file: Schema.String.pipe(optional),
|
|
14
|
+
patch: Schema.String.pipe(optional),
|
|
7
15
|
additions: Schema.Finite,
|
|
8
16
|
deletions: Schema.Finite,
|
|
9
|
-
status:
|
|
10
|
-
}).annotate({ identifier: "
|
|
17
|
+
status: Schema.Literals(["added", "deleted", "modified"]).pipe(optional),
|
|
18
|
+
}).annotate({ identifier: "FileDiff.LegacyInfo" });
|
package/dist/index.d.ts
CHANGED
|
@@ -11,20 +11,22 @@ export { LLM } from "./llm.js";
|
|
|
11
11
|
export { Location } from "./location.js";
|
|
12
12
|
export { Mcp } from "./mcp.js";
|
|
13
13
|
export { Model } from "./model.js";
|
|
14
|
+
export { Money } from "./money.js";
|
|
14
15
|
export { Permission } from "./permission.js";
|
|
15
16
|
export { PermissionSaved } from "./permission-saved.js";
|
|
16
17
|
export { Project } from "./project.js";
|
|
17
18
|
export { ProjectCopy } from "./project-copy.js";
|
|
18
19
|
export { Provider } from "./provider.js";
|
|
19
20
|
export { Reference } from "./reference.js";
|
|
20
|
-
export { Revert } from "./revert.js";
|
|
21
21
|
export { Session } from "./session.js";
|
|
22
22
|
export { Vcs } from "./vcs.js";
|
|
23
23
|
export { SessionInput } from "./session-input.js";
|
|
24
24
|
export { SessionError } from "./session-error.js";
|
|
25
25
|
export { SessionMessage } from "./session-message.js";
|
|
26
|
+
export { Snapshot } from "./snapshot.js";
|
|
26
27
|
export { Shell } from "./shell.js";
|
|
27
28
|
export { Skill } from "./skill.js";
|
|
29
|
+
export { TokenUsage } from "./token-usage.js";
|
|
28
30
|
export { Pty } from "./pty.js";
|
|
29
31
|
export { PtyTicket } from "./pty-ticket.js";
|
|
30
32
|
export { Question } from "./question.js";
|
package/dist/index.js
CHANGED
|
@@ -11,20 +11,22 @@ export { LLM } from "./llm.js";
|
|
|
11
11
|
export { Location } from "./location.js";
|
|
12
12
|
export { Mcp } from "./mcp.js";
|
|
13
13
|
export { Model } from "./model.js";
|
|
14
|
+
export { Money } from "./money.js";
|
|
14
15
|
export { Permission } from "./permission.js";
|
|
15
16
|
export { PermissionSaved } from "./permission-saved.js";
|
|
16
17
|
export { Project } from "./project.js";
|
|
17
18
|
export { ProjectCopy } from "./project-copy.js";
|
|
18
19
|
export { Provider } from "./provider.js";
|
|
19
20
|
export { Reference } from "./reference.js";
|
|
20
|
-
export { Revert } from "./revert.js";
|
|
21
21
|
export { Session } from "./session.js";
|
|
22
22
|
export { Vcs } from "./vcs.js";
|
|
23
23
|
export { SessionInput } from "./session-input.js";
|
|
24
24
|
export { SessionError } from "./session-error.js";
|
|
25
25
|
export { SessionMessage } from "./session-message.js";
|
|
26
|
+
export { Snapshot } from "./snapshot.js";
|
|
26
27
|
export { Shell } from "./shell.js";
|
|
27
28
|
export { Skill } from "./skill.js";
|
|
29
|
+
export { TokenUsage } from "./token-usage.js";
|
|
28
30
|
export { Pty } from "./pty.js";
|
|
29
31
|
export { PtyTicket } from "./pty-ticket.js";
|
|
30
32
|
export { Question } from "./question.js";
|
package/dist/model.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as Model from "./model.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { Provider } from "./provider.js";
|
|
4
|
-
export declare const ID: Schema.brand<Schema.String, "
|
|
4
|
+
export declare const ID: Schema.brand<Schema.String, "Model.ID">;
|
|
5
5
|
export type ID = typeof ID.Type;
|
|
6
|
-
export declare const VariantID: Schema.brand<Schema.String, "VariantID">;
|
|
6
|
+
export declare const VariantID: Schema.brand<Schema.String, "Model.VariantID">;
|
|
7
7
|
export type VariantID = typeof VariantID.Type;
|
|
8
8
|
export declare const Ref: Schema.Struct<{
|
|
9
|
-
readonly id: Schema.brand<Schema.String, "
|
|
9
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
10
10
|
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
11
11
|
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
12
12
|
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
@@ -20,11 +20,11 @@ export declare const Ref: Schema.Struct<{
|
|
|
20
20
|
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
21
21
|
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
22
22
|
};
|
|
23
|
-
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
|
|
23
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
24
24
|
}>;
|
|
25
25
|
export interface Ref extends Schema.Schema.Type<typeof Ref> {
|
|
26
26
|
}
|
|
27
|
-
export declare const Family: Schema.brand<Schema.String, "Family">;
|
|
27
|
+
export declare const Family: Schema.brand<Schema.String, "Model.Family">;
|
|
28
28
|
export type Family = typeof Family.Type;
|
|
29
29
|
export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
|
|
30
30
|
}
|
|
@@ -37,17 +37,25 @@ export interface Cost extends Schema.Schema.Type<typeof Cost> {
|
|
|
37
37
|
}
|
|
38
38
|
export declare const Cost: Schema.Struct<{
|
|
39
39
|
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
40
|
-
readonly type: Schema.
|
|
40
|
+
readonly type: Schema.tag<"context">;
|
|
41
41
|
readonly size: Schema.Int;
|
|
42
42
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
43
|
-
readonly type: Schema.
|
|
43
|
+
readonly type: Schema.tag<"context">;
|
|
44
44
|
readonly size: Schema.Int;
|
|
45
45
|
}>>, never, never>;
|
|
46
|
-
readonly input: Schema.Finite
|
|
47
|
-
|
|
46
|
+
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
47
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
48
|
+
};
|
|
49
|
+
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
50
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
51
|
+
};
|
|
48
52
|
readonly cache: Schema.Struct<{
|
|
49
|
-
readonly read: Schema.Finite
|
|
50
|
-
|
|
53
|
+
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
54
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
55
|
+
};
|
|
56
|
+
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
57
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
58
|
+
};
|
|
51
59
|
}>;
|
|
52
60
|
}>;
|
|
53
61
|
export interface Variant extends Schema.Schema.Type<typeof Variant> {
|
|
@@ -56,7 +64,7 @@ export declare const Variant: Schema.Struct<{
|
|
|
56
64
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
57
65
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
58
66
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
59
|
-
readonly id: Schema.brand<Schema.String, "VariantID">;
|
|
67
|
+
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
60
68
|
}>;
|
|
61
69
|
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
62
70
|
}
|
|
@@ -70,24 +78,32 @@ export declare const Info: Schema.Struct<{
|
|
|
70
78
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
71
79
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
72
80
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
73
|
-
readonly id: Schema.brand<Schema.String, "VariantID">;
|
|
81
|
+
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
74
82
|
}>>;
|
|
75
83
|
readonly time: Schema.Struct<{
|
|
76
84
|
readonly released: Schema.Finite;
|
|
77
85
|
}>;
|
|
78
86
|
readonly cost: Schema.$Array<Schema.Struct<{
|
|
79
87
|
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
80
|
-
readonly type: Schema.
|
|
88
|
+
readonly type: Schema.tag<"context">;
|
|
81
89
|
readonly size: Schema.Int;
|
|
82
90
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
83
|
-
readonly type: Schema.
|
|
91
|
+
readonly type: Schema.tag<"context">;
|
|
84
92
|
readonly size: Schema.Int;
|
|
85
93
|
}>>, never, never>;
|
|
86
|
-
readonly input: Schema.Finite
|
|
87
|
-
|
|
94
|
+
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
95
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
96
|
+
};
|
|
97
|
+
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
98
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
99
|
+
};
|
|
88
100
|
readonly cache: Schema.Struct<{
|
|
89
|
-
readonly read: Schema.Finite
|
|
90
|
-
|
|
101
|
+
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
102
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
103
|
+
};
|
|
104
|
+
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
105
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
106
|
+
};
|
|
91
107
|
}>;
|
|
92
108
|
}>>;
|
|
93
109
|
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
@@ -100,8 +116,8 @@ export declare const Info: Schema.Struct<{
|
|
|
100
116
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
101
117
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
102
118
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
103
|
-
readonly id: Schema.brand<Schema.String, "
|
|
104
|
-
readonly modelID: Schema.brand<Schema.String, "
|
|
119
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
120
|
+
readonly modelID: Schema.brand<Schema.String, "Model.ID">;
|
|
105
121
|
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
106
122
|
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
107
123
|
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
@@ -115,7 +131,7 @@ export declare const Info: Schema.Struct<{
|
|
|
115
131
|
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
116
132
|
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
117
133
|
};
|
|
118
|
-
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Family">>, never, never>;
|
|
134
|
+
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
119
135
|
readonly name: Schema.String;
|
|
120
136
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
121
137
|
}> & {
|
|
@@ -126,7 +142,7 @@ export declare const Info: Schema.Struct<{
|
|
|
126
142
|
readonly output: readonly string[];
|
|
127
143
|
};
|
|
128
144
|
readonly variants: readonly {
|
|
129
|
-
readonly id: string & import("effect/Brand").Brand<"VariantID">;
|
|
145
|
+
readonly id: string & import("effect/Brand").Brand<"Model.VariantID">;
|
|
130
146
|
readonly settings?: {
|
|
131
147
|
readonly [x: string]: Schema.Json;
|
|
132
148
|
} | undefined;
|
|
@@ -141,11 +157,11 @@ export declare const Info: Schema.Struct<{
|
|
|
141
157
|
readonly released: number;
|
|
142
158
|
};
|
|
143
159
|
readonly cost: readonly {
|
|
144
|
-
readonly input: number
|
|
145
|
-
readonly output: number
|
|
160
|
+
readonly input: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
161
|
+
readonly output: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
146
162
|
readonly cache: {
|
|
147
|
-
readonly read: number
|
|
148
|
-
readonly write: number
|
|
163
|
+
readonly read: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
164
|
+
readonly write: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
149
165
|
};
|
|
150
166
|
readonly tier?: {
|
|
151
167
|
readonly type: "context";
|
|
@@ -159,8 +175,8 @@ export declare const Info: Schema.Struct<{
|
|
|
159
175
|
readonly output: number;
|
|
160
176
|
readonly input?: number | undefined;
|
|
161
177
|
};
|
|
162
|
-
readonly id: string & import("effect/Brand").Brand<"
|
|
163
|
-
readonly modelID: string & import("effect/Brand").Brand<"
|
|
178
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
179
|
+
readonly modelID: string & import("effect/Brand").Brand<"Model.ID">;
|
|
164
180
|
readonly providerID: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
165
181
|
readonly name: string;
|
|
166
182
|
readonly settings?: {
|
|
@@ -172,7 +188,7 @@ export declare const Info: Schema.Struct<{
|
|
|
172
188
|
readonly body?: {
|
|
173
189
|
readonly [x: string]: Schema.Json;
|
|
174
190
|
} | undefined;
|
|
175
|
-
readonly family?: (string & import("effect/Brand").Brand<"Family">) | undefined;
|
|
191
|
+
readonly family?: (string & import("effect/Brand").Brand<"Model.Family">) | undefined;
|
|
176
192
|
readonly package?: string | undefined;
|
|
177
193
|
};
|
|
178
194
|
};
|
package/dist/model.js
CHANGED
|
@@ -2,14 +2,15 @@ export * as Model from "./model.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { optional, statics } from "./schema.js";
|
|
4
4
|
import { Provider } from "./provider.js";
|
|
5
|
-
|
|
6
|
-
export const
|
|
5
|
+
import { Money } from "./money.js";
|
|
6
|
+
export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
|
|
7
|
+
export const VariantID = Schema.String.pipe(Schema.brand("Model.VariantID"));
|
|
7
8
|
export const Ref = Schema.Struct({
|
|
8
9
|
id: ID,
|
|
9
10
|
providerID: Provider.ID,
|
|
10
11
|
variant: VariantID.pipe(optional),
|
|
11
12
|
}).annotate({ identifier: "Model.Ref" });
|
|
12
|
-
export const Family = Schema.String.pipe(Schema.brand("Family"));
|
|
13
|
+
export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
|
|
13
14
|
export const Capabilities = Schema.Struct({
|
|
14
15
|
tools: Schema.Boolean,
|
|
15
16
|
input: Schema.Array(Schema.String),
|
|
@@ -17,14 +18,14 @@ export const Capabilities = Schema.Struct({
|
|
|
17
18
|
}).annotate({ identifier: "Model.Capabilities" });
|
|
18
19
|
export const Cost = Schema.Struct({
|
|
19
20
|
tier: Schema.Struct({
|
|
20
|
-
type: Schema.
|
|
21
|
+
type: Schema.tag("context"),
|
|
21
22
|
size: Schema.Int,
|
|
22
23
|
}).pipe(optional),
|
|
23
|
-
input:
|
|
24
|
-
output:
|
|
24
|
+
input: Money.USDPerMillionTokens,
|
|
25
|
+
output: Money.USDPerMillionTokens,
|
|
25
26
|
cache: Schema.Struct({
|
|
26
|
-
read:
|
|
27
|
-
write:
|
|
27
|
+
read: Money.USDPerMillionTokens,
|
|
28
|
+
write: Money.USDPerMillionTokens,
|
|
28
29
|
}),
|
|
29
30
|
}).annotate({ identifier: "Model.Cost" });
|
|
30
31
|
export const Variant = Schema.Struct({
|
|
@@ -53,7 +54,7 @@ export const Info = Schema.Struct({
|
|
|
53
54
|
output: Schema.Int,
|
|
54
55
|
}),
|
|
55
56
|
})
|
|
56
|
-
.annotate({ identifier: "
|
|
57
|
+
.annotate({ identifier: "Model.Info" })
|
|
57
58
|
.pipe(statics((schema) => ({
|
|
58
59
|
empty: (providerID, id) => schema.make({
|
|
59
60
|
id,
|
package/dist/money.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as Money from "./money.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const USD: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
4
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
5
|
+
};
|
|
6
|
+
export type USD = typeof USD.Type;
|
|
7
|
+
export declare const USDPerMillionTokens: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
8
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
9
|
+
};
|
|
10
|
+
export type USDPerMillionTokens = typeof USDPerMillionTokens.Type;
|
package/dist/money.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as Money from "./money.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { statics } from "./schema.js";
|
|
4
|
+
export const USD = Schema.Finite.pipe(Schema.brand("Money.USD"), Schema.annotate({ identifier: "Money.USD" }), statics((schema) => ({ zero: schema.make(0) })));
|
|
5
|
+
export const USDPerMillionTokens = Schema.Finite.pipe(Schema.brand("Money.USDPerMillionTokens"), Schema.annotate({ identifier: "Money.USDPerMillionTokens" }), statics((schema) => ({ zero: schema.make(0) })));
|