@opencode-ai/schema 0.0.0-dev-18079 → 0.0.0-dev-18082
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/session-stats.d.ts +136 -0
- package/dist/session-stats.js +47 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Vcs } from "./vcs.js";
|
|
|
24
24
|
export { SessionInbox } from "./session-inbox.js";
|
|
25
25
|
export { SessionError } from "./session-error.js";
|
|
26
26
|
export { SessionMessage } from "./session-message.js";
|
|
27
|
+
export { SessionStats } from "./session-stats.js";
|
|
27
28
|
export { SessionTransfer } from "./session-transfer.js";
|
|
28
29
|
export { Snapshot } from "./snapshot.js";
|
|
29
30
|
export { Shell } from "./shell.js";
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { Vcs } from "./vcs.js";
|
|
|
24
24
|
export { SessionInbox } from "./session-inbox.js";
|
|
25
25
|
export { SessionError } from "./session-error.js";
|
|
26
26
|
export { SessionMessage } from "./session-message.js";
|
|
27
|
+
export { SessionStats } from "./session-stats.js";
|
|
27
28
|
export { SessionTransfer } from "./session-transfer.js";
|
|
28
29
|
export { Snapshot } from "./snapshot.js";
|
|
29
30
|
export { Shell } from "./shell.js";
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export * as SessionStats from "./session-stats.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Activity: Schema.Struct<{
|
|
4
|
+
readonly date: Schema.String;
|
|
5
|
+
readonly steps: Schema.Int;
|
|
6
|
+
}>;
|
|
7
|
+
export type Activity = typeof Activity.Type;
|
|
8
|
+
export declare const ModelUsage: Schema.Struct<{
|
|
9
|
+
readonly model: Schema.Struct<{
|
|
10
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
11
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
12
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
13
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
14
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
15
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
16
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
17
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
18
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
19
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
20
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
21
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
22
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
23
|
+
};
|
|
24
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
25
|
+
}> & {
|
|
26
|
+
parse: (input: string) => {
|
|
27
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
28
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
29
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly steps: Schema.Int;
|
|
33
|
+
readonly tokens: Schema.Struct<{
|
|
34
|
+
readonly input: Schema.Finite;
|
|
35
|
+
readonly output: Schema.Finite;
|
|
36
|
+
readonly reasoning: Schema.Finite;
|
|
37
|
+
readonly cache: Schema.Struct<{
|
|
38
|
+
readonly read: Schema.Finite;
|
|
39
|
+
readonly write: Schema.Finite;
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
42
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
43
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
export type ModelUsage = typeof ModelUsage.Type;
|
|
47
|
+
export declare const ToolUsage: Schema.Struct<{
|
|
48
|
+
readonly name: Schema.String;
|
|
49
|
+
readonly calls: Schema.Int;
|
|
50
|
+
readonly succeeded: Schema.Int;
|
|
51
|
+
readonly failed: Schema.Int;
|
|
52
|
+
readonly unfinished: Schema.Int;
|
|
53
|
+
readonly durationP50: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
54
|
+
}>;
|
|
55
|
+
export type ToolUsage = typeof ToolUsage.Type;
|
|
56
|
+
export declare const Info: Schema.Struct<{
|
|
57
|
+
readonly range: Schema.Struct<{
|
|
58
|
+
readonly from: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
59
|
+
readonly to: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
60
|
+
}>;
|
|
61
|
+
readonly sessions: Schema.Int;
|
|
62
|
+
readonly subagents: Schema.Int;
|
|
63
|
+
readonly prompts: Schema.Int;
|
|
64
|
+
readonly steps: Schema.Int;
|
|
65
|
+
readonly tokens: Schema.Struct<{
|
|
66
|
+
readonly input: Schema.Finite;
|
|
67
|
+
readonly output: Schema.Finite;
|
|
68
|
+
readonly reasoning: Schema.Finite;
|
|
69
|
+
readonly cache: Schema.Struct<{
|
|
70
|
+
readonly read: Schema.Finite;
|
|
71
|
+
readonly write: Schema.Finite;
|
|
72
|
+
}>;
|
|
73
|
+
}>;
|
|
74
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
75
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
76
|
+
};
|
|
77
|
+
readonly tools: Schema.Struct<{
|
|
78
|
+
readonly calls: Schema.Int;
|
|
79
|
+
readonly succeeded: Schema.Int;
|
|
80
|
+
readonly failed: Schema.Int;
|
|
81
|
+
readonly unfinished: Schema.Int;
|
|
82
|
+
}>;
|
|
83
|
+
readonly activeDays: Schema.Int;
|
|
84
|
+
readonly streak: Schema.Int;
|
|
85
|
+
readonly activity: Schema.$Array<Schema.Struct<{
|
|
86
|
+
readonly date: Schema.String;
|
|
87
|
+
readonly steps: Schema.Int;
|
|
88
|
+
}>>;
|
|
89
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
90
|
+
readonly model: Schema.Struct<{
|
|
91
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
92
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
93
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
94
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
95
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
96
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
97
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
98
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
99
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
100
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
101
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
102
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
103
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
104
|
+
};
|
|
105
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
106
|
+
}> & {
|
|
107
|
+
parse: (input: string) => {
|
|
108
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
109
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
110
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly steps: Schema.Int;
|
|
114
|
+
readonly tokens: Schema.Struct<{
|
|
115
|
+
readonly input: Schema.Finite;
|
|
116
|
+
readonly output: Schema.Finite;
|
|
117
|
+
readonly reasoning: Schema.Finite;
|
|
118
|
+
readonly cache: Schema.Struct<{
|
|
119
|
+
readonly read: Schema.Finite;
|
|
120
|
+
readonly write: Schema.Finite;
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
123
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
124
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
125
|
+
};
|
|
126
|
+
}>>;
|
|
127
|
+
readonly toolUsage: Schema.$Array<Schema.Struct<{
|
|
128
|
+
readonly name: Schema.String;
|
|
129
|
+
readonly calls: Schema.Int;
|
|
130
|
+
readonly succeeded: Schema.Int;
|
|
131
|
+
readonly failed: Schema.Int;
|
|
132
|
+
readonly unfinished: Schema.Int;
|
|
133
|
+
readonly durationP50: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
134
|
+
}>>;
|
|
135
|
+
}>;
|
|
136
|
+
export type Info = typeof Info.Type;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export * as SessionStats from "./session-stats.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Model } from "./model.js";
|
|
4
|
+
import { Money } from "./money.js";
|
|
5
|
+
import { DateTimeUtcFromMillis, NonNegativeInt, optional } from "./schema.js";
|
|
6
|
+
import { TokenUsage } from "./token-usage.js";
|
|
7
|
+
export const Activity = Schema.Struct({
|
|
8
|
+
date: Schema.String,
|
|
9
|
+
steps: NonNegativeInt,
|
|
10
|
+
}).annotate({ identifier: "SessionStats.Activity" });
|
|
11
|
+
export const ModelUsage = Schema.Struct({
|
|
12
|
+
model: Model.Ref,
|
|
13
|
+
steps: NonNegativeInt,
|
|
14
|
+
tokens: TokenUsage.Info,
|
|
15
|
+
cost: Money.USD,
|
|
16
|
+
}).annotate({ identifier: "SessionStats.ModelUsage" });
|
|
17
|
+
export const ToolUsage = Schema.Struct({
|
|
18
|
+
name: Schema.String,
|
|
19
|
+
calls: NonNegativeInt,
|
|
20
|
+
succeeded: NonNegativeInt,
|
|
21
|
+
failed: NonNegativeInt,
|
|
22
|
+
unfinished: NonNegativeInt,
|
|
23
|
+
durationP50: Schema.Finite.pipe(optional),
|
|
24
|
+
}).annotate({ identifier: "SessionStats.ToolUsage" });
|
|
25
|
+
export const Info = Schema.Struct({
|
|
26
|
+
range: Schema.Struct({
|
|
27
|
+
from: DateTimeUtcFromMillis,
|
|
28
|
+
to: DateTimeUtcFromMillis,
|
|
29
|
+
}),
|
|
30
|
+
sessions: NonNegativeInt,
|
|
31
|
+
subagents: NonNegativeInt,
|
|
32
|
+
prompts: NonNegativeInt,
|
|
33
|
+
steps: NonNegativeInt,
|
|
34
|
+
tokens: TokenUsage.Info,
|
|
35
|
+
cost: Money.USD,
|
|
36
|
+
tools: Schema.Struct({
|
|
37
|
+
calls: NonNegativeInt,
|
|
38
|
+
succeeded: NonNegativeInt,
|
|
39
|
+
failed: NonNegativeInt,
|
|
40
|
+
unfinished: NonNegativeInt,
|
|
41
|
+
}),
|
|
42
|
+
activeDays: NonNegativeInt,
|
|
43
|
+
streak: NonNegativeInt,
|
|
44
|
+
activity: Schema.Array(Activity),
|
|
45
|
+
models: Schema.Array(ModelUsage),
|
|
46
|
+
toolUsage: Schema.Array(ToolUsage),
|
|
47
|
+
}).annotate({ identifier: "SessionStats.Info" });
|