@opencode-ai/schema 0.0.0-next-15716 → 0.0.0-next-15717
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/durable-event-manifest.d.ts +78 -2
- package/dist/session-event.d.ts +310 -4
- package/dist/session-event.js +13 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Event } from "./event.js";
|
|
|
3
3
|
import { SessionEvent } from "./session-event.js";
|
|
4
4
|
export declare const SessionDurable: {
|
|
5
5
|
readonly definitions: ReadonlyMap<string, Event.DurableDefinition<string, import("effect/Schema").Codec<unknown, unknown, never, never>>>;
|
|
6
|
-
readonly schema: import("effect/Schema").Union<readonly ((import("effect/Schema").Struct<{
|
|
6
|
+
readonly schema: import("effect/Schema").Union<readonly [...((import("effect/Schema").Struct<{
|
|
7
7
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
8
8
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
9
9
|
};
|
|
@@ -2825,6 +2825,82 @@ export declare const SessionDurable: {
|
|
|
2825
2825
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
2826
2826
|
};
|
|
2827
2827
|
}>;
|
|
2828
|
-
}))[]
|
|
2828
|
+
}))[], import("effect/Schema").Struct<{
|
|
2829
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
2830
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
2831
|
+
};
|
|
2832
|
+
readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
|
|
2833
|
+
readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
|
|
2834
|
+
readonly type: import("effect/Schema").Literal<"session.usage.recorded">;
|
|
2835
|
+
readonly durable: import("effect/Schema").Struct<{
|
|
2836
|
+
readonly aggregateID: import("effect/Schema").String;
|
|
2837
|
+
readonly seq: import("effect/Schema").brand<import("effect/Schema").Int, "Event.Seq">;
|
|
2838
|
+
readonly version: import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").Int, "Event.Version">>, import("effect/Schema").Literal<number>, never, never>;
|
|
2839
|
+
}>;
|
|
2840
|
+
readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
2841
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
2842
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "WorkspaceV2.ID"> & {
|
|
2843
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2844
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2845
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "WorkspaceV2.ID"> & {
|
|
2846
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2847
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2848
|
+
}>, never, never>;
|
|
2849
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
2850
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
2851
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "WorkspaceV2.ID"> & {
|
|
2852
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2853
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2854
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "WorkspaceV2.ID"> & {
|
|
2855
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2856
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
2857
|
+
}>, never, never>;
|
|
2858
|
+
}>>, never, never>;
|
|
2859
|
+
readonly data: import("effect/Schema").Struct<{
|
|
2860
|
+
readonly source: import("effect/Schema").Literals<readonly ["title", "compaction"]>;
|
|
2861
|
+
readonly cost: import("effect/Schema").brand<import("effect/Schema").Finite, "Money.USD"> & {
|
|
2862
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
2863
|
+
};
|
|
2864
|
+
readonly tokens: import("effect/Schema").Struct<{
|
|
2865
|
+
readonly input: import("effect/Schema").Finite;
|
|
2866
|
+
readonly output: import("effect/Schema").Finite;
|
|
2867
|
+
readonly reasoning: import("effect/Schema").Finite;
|
|
2868
|
+
readonly cache: import("effect/Schema").Struct<{
|
|
2869
|
+
readonly read: import("effect/Schema").Finite;
|
|
2870
|
+
readonly write: import("effect/Schema").Finite;
|
|
2871
|
+
}>;
|
|
2872
|
+
}>;
|
|
2873
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
2874
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
2875
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
2876
|
+
};
|
|
2877
|
+
}>;
|
|
2878
|
+
}> & {
|
|
2879
|
+
type: "session.usage.recorded";
|
|
2880
|
+
durability: "durable";
|
|
2881
|
+
durable: {
|
|
2882
|
+
readonly version: number;
|
|
2883
|
+
readonly aggregate: string;
|
|
2884
|
+
};
|
|
2885
|
+
data: import("effect/Schema").Struct<{
|
|
2886
|
+
readonly source: import("effect/Schema").Literals<readonly ["title", "compaction"]>;
|
|
2887
|
+
readonly cost: import("effect/Schema").brand<import("effect/Schema").Finite, "Money.USD"> & {
|
|
2888
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
2889
|
+
};
|
|
2890
|
+
readonly tokens: import("effect/Schema").Struct<{
|
|
2891
|
+
readonly input: import("effect/Schema").Finite;
|
|
2892
|
+
readonly output: import("effect/Schema").Finite;
|
|
2893
|
+
readonly reasoning: import("effect/Schema").Finite;
|
|
2894
|
+
readonly cache: import("effect/Schema").Struct<{
|
|
2895
|
+
readonly read: import("effect/Schema").Finite;
|
|
2896
|
+
readonly write: import("effect/Schema").Finite;
|
|
2897
|
+
}>;
|
|
2898
|
+
}>;
|
|
2899
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
2900
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
2901
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
2902
|
+
};
|
|
2903
|
+
}>;
|
|
2904
|
+
}]>;
|
|
2829
2905
|
};
|
|
2830
2906
|
export declare const Durable: ReadonlyMap<string, Event.DurableDefinition<string, import("effect/Schema").Codec<unknown, unknown, never, never>>>;
|
package/dist/session-event.d.ts
CHANGED
|
@@ -300,6 +300,84 @@ export declare const Renamed: Schema.Struct<{
|
|
|
300
300
|
}>;
|
|
301
301
|
};
|
|
302
302
|
export type Renamed = typeof Renamed.Type;
|
|
303
|
+
export declare const UsageRecorded: Schema.Struct<{
|
|
304
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
305
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
306
|
+
};
|
|
307
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
308
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
309
|
+
readonly type: Schema.Literal<"session.usage.recorded">;
|
|
310
|
+
readonly durable: Schema.Struct<{
|
|
311
|
+
readonly aggregateID: Schema.String;
|
|
312
|
+
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
313
|
+
readonly version: Schema.decodeTo<Schema.toType<Schema.brand<Schema.Int, "Event.Version">>, Schema.Literal<number>, never, never>;
|
|
314
|
+
}>;
|
|
315
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
316
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
317
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
318
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
319
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
320
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
321
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
322
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
323
|
+
}>, never, never>;
|
|
324
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
325
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
326
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
327
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
328
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
329
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
330
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
331
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
332
|
+
}>, never, never>;
|
|
333
|
+
}>>, never, never>;
|
|
334
|
+
readonly data: Schema.Struct<{
|
|
335
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
336
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
337
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
338
|
+
};
|
|
339
|
+
readonly tokens: Schema.Struct<{
|
|
340
|
+
readonly input: Schema.Finite;
|
|
341
|
+
readonly output: Schema.Finite;
|
|
342
|
+
readonly reasoning: Schema.Finite;
|
|
343
|
+
readonly cache: Schema.Struct<{
|
|
344
|
+
readonly read: Schema.Finite;
|
|
345
|
+
readonly write: Schema.Finite;
|
|
346
|
+
}>;
|
|
347
|
+
}>;
|
|
348
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
349
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
350
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
351
|
+
};
|
|
352
|
+
}>;
|
|
353
|
+
}> & {
|
|
354
|
+
type: "session.usage.recorded";
|
|
355
|
+
durability: "durable";
|
|
356
|
+
durable: {
|
|
357
|
+
readonly version: number;
|
|
358
|
+
readonly aggregate: string;
|
|
359
|
+
};
|
|
360
|
+
data: Schema.Struct<{
|
|
361
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
362
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
363
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
364
|
+
};
|
|
365
|
+
readonly tokens: Schema.Struct<{
|
|
366
|
+
readonly input: Schema.Finite;
|
|
367
|
+
readonly output: Schema.Finite;
|
|
368
|
+
readonly reasoning: Schema.Finite;
|
|
369
|
+
readonly cache: Schema.Struct<{
|
|
370
|
+
readonly read: Schema.Finite;
|
|
371
|
+
readonly write: Schema.Finite;
|
|
372
|
+
}>;
|
|
373
|
+
}>;
|
|
374
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
375
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
376
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
377
|
+
};
|
|
378
|
+
}>;
|
|
379
|
+
};
|
|
380
|
+
export type UsageRecorded = typeof UsageRecorded.Type;
|
|
303
381
|
export declare const UsageUpdated: Schema.Struct<{
|
|
304
382
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
305
383
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
@@ -6306,7 +6384,7 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
6306
6384
|
};
|
|
6307
6385
|
}>;
|
|
6308
6386
|
}];
|
|
6309
|
-
export declare const DurableDefinitions: readonly ((Schema.Struct<{
|
|
6387
|
+
export declare const DurableDefinitions: readonly [...((Schema.Struct<{
|
|
6310
6388
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6311
6389
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6312
6390
|
};
|
|
@@ -9128,8 +9206,84 @@ export declare const DurableDefinitions: readonly ((Schema.Struct<{
|
|
|
9128
9206
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
9129
9207
|
};
|
|
9130
9208
|
}>;
|
|
9131
|
-
}))[]
|
|
9132
|
-
|
|
9209
|
+
}))[], Schema.Struct<{
|
|
9210
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
9211
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
9212
|
+
};
|
|
9213
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
9214
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
9215
|
+
readonly type: Schema.Literal<"session.usage.recorded">;
|
|
9216
|
+
readonly durable: Schema.Struct<{
|
|
9217
|
+
readonly aggregateID: Schema.String;
|
|
9218
|
+
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
9219
|
+
readonly version: Schema.decodeTo<Schema.toType<Schema.brand<Schema.Int, "Event.Version">>, Schema.Literal<number>, never, never>;
|
|
9220
|
+
}>;
|
|
9221
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
9222
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
9223
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
9224
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9225
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9226
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
9227
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9228
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9229
|
+
}>, never, never>;
|
|
9230
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
9231
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
9232
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
9233
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9234
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9235
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
9236
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9237
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
9238
|
+
}>, never, never>;
|
|
9239
|
+
}>>, never, never>;
|
|
9240
|
+
readonly data: Schema.Struct<{
|
|
9241
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
9242
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
9243
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
9244
|
+
};
|
|
9245
|
+
readonly tokens: Schema.Struct<{
|
|
9246
|
+
readonly input: Schema.Finite;
|
|
9247
|
+
readonly output: Schema.Finite;
|
|
9248
|
+
readonly reasoning: Schema.Finite;
|
|
9249
|
+
readonly cache: Schema.Struct<{
|
|
9250
|
+
readonly read: Schema.Finite;
|
|
9251
|
+
readonly write: Schema.Finite;
|
|
9252
|
+
}>;
|
|
9253
|
+
}>;
|
|
9254
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
9255
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
9256
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
9257
|
+
};
|
|
9258
|
+
}>;
|
|
9259
|
+
}> & {
|
|
9260
|
+
type: "session.usage.recorded";
|
|
9261
|
+
durability: "durable";
|
|
9262
|
+
durable: {
|
|
9263
|
+
readonly version: number;
|
|
9264
|
+
readonly aggregate: string;
|
|
9265
|
+
};
|
|
9266
|
+
data: Schema.Struct<{
|
|
9267
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
9268
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
9269
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
9270
|
+
};
|
|
9271
|
+
readonly tokens: Schema.Struct<{
|
|
9272
|
+
readonly input: Schema.Finite;
|
|
9273
|
+
readonly output: Schema.Finite;
|
|
9274
|
+
readonly reasoning: Schema.Finite;
|
|
9275
|
+
readonly cache: Schema.Struct<{
|
|
9276
|
+
readonly read: Schema.Finite;
|
|
9277
|
+
readonly write: Schema.Finite;
|
|
9278
|
+
}>;
|
|
9279
|
+
}>;
|
|
9280
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
9281
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
9282
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
9283
|
+
};
|
|
9284
|
+
}>;
|
|
9285
|
+
}];
|
|
9286
|
+
export declare const Durable: Schema.Union<readonly [...((Schema.Struct<{
|
|
9133
9287
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
9134
9288
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
9135
9289
|
};
|
|
@@ -11951,7 +12105,83 @@ export declare const Durable: Schema.Union<readonly ((Schema.Struct<{
|
|
|
11951
12105
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
11952
12106
|
};
|
|
11953
12107
|
}>;
|
|
11954
|
-
}))[]
|
|
12108
|
+
}))[], Schema.Struct<{
|
|
12109
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
12110
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
12111
|
+
};
|
|
12112
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
12113
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
12114
|
+
readonly type: Schema.Literal<"session.usage.recorded">;
|
|
12115
|
+
readonly durable: Schema.Struct<{
|
|
12116
|
+
readonly aggregateID: Schema.String;
|
|
12117
|
+
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
12118
|
+
readonly version: Schema.decodeTo<Schema.toType<Schema.brand<Schema.Int, "Event.Version">>, Schema.Literal<number>, never, never>;
|
|
12119
|
+
}>;
|
|
12120
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
12121
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12122
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
12123
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12124
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12125
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
12126
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12127
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12128
|
+
}>, never, never>;
|
|
12129
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
12130
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12131
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
12132
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12133
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12134
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
12135
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12136
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
12137
|
+
}>, never, never>;
|
|
12138
|
+
}>>, never, never>;
|
|
12139
|
+
readonly data: Schema.Struct<{
|
|
12140
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
12141
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
12142
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
12143
|
+
};
|
|
12144
|
+
readonly tokens: Schema.Struct<{
|
|
12145
|
+
readonly input: Schema.Finite;
|
|
12146
|
+
readonly output: Schema.Finite;
|
|
12147
|
+
readonly reasoning: Schema.Finite;
|
|
12148
|
+
readonly cache: Schema.Struct<{
|
|
12149
|
+
readonly read: Schema.Finite;
|
|
12150
|
+
readonly write: Schema.Finite;
|
|
12151
|
+
}>;
|
|
12152
|
+
}>;
|
|
12153
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
12154
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
12155
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
12156
|
+
};
|
|
12157
|
+
}>;
|
|
12158
|
+
}> & {
|
|
12159
|
+
type: "session.usage.recorded";
|
|
12160
|
+
durability: "durable";
|
|
12161
|
+
durable: {
|
|
12162
|
+
readonly version: number;
|
|
12163
|
+
readonly aggregate: string;
|
|
12164
|
+
};
|
|
12165
|
+
data: Schema.Struct<{
|
|
12166
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
12167
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
12168
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
12169
|
+
};
|
|
12170
|
+
readonly tokens: Schema.Struct<{
|
|
12171
|
+
readonly input: Schema.Finite;
|
|
12172
|
+
readonly output: Schema.Finite;
|
|
12173
|
+
readonly reasoning: Schema.Finite;
|
|
12174
|
+
readonly cache: Schema.Struct<{
|
|
12175
|
+
readonly read: Schema.Finite;
|
|
12176
|
+
readonly write: Schema.Finite;
|
|
12177
|
+
}>;
|
|
12178
|
+
}>;
|
|
12179
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
12180
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
12181
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
12182
|
+
};
|
|
12183
|
+
}>;
|
|
12184
|
+
}]>;
|
|
11955
12185
|
export type DurableEvent = typeof Durable.Type;
|
|
11956
12186
|
export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
11957
12187
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
@@ -15047,6 +15277,82 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
|
15047
15277
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
15048
15278
|
};
|
|
15049
15279
|
}>;
|
|
15280
|
+
}, Schema.Struct<{
|
|
15281
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
15282
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
15283
|
+
};
|
|
15284
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
15285
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
15286
|
+
readonly type: Schema.Literal<"session.usage.recorded">;
|
|
15287
|
+
readonly durable: Schema.Struct<{
|
|
15288
|
+
readonly aggregateID: Schema.String;
|
|
15289
|
+
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
15290
|
+
readonly version: Schema.decodeTo<Schema.toType<Schema.brand<Schema.Int, "Event.Version">>, Schema.Literal<number>, never, never>;
|
|
15291
|
+
}>;
|
|
15292
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
15293
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
15294
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
15295
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15296
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15297
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
15298
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15299
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15300
|
+
}>, never, never>;
|
|
15301
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
15302
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
15303
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
15304
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15305
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15306
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
15307
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15308
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
15309
|
+
}>, never, never>;
|
|
15310
|
+
}>>, never, never>;
|
|
15311
|
+
readonly data: Schema.Struct<{
|
|
15312
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
15313
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
15314
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
15315
|
+
};
|
|
15316
|
+
readonly tokens: Schema.Struct<{
|
|
15317
|
+
readonly input: Schema.Finite;
|
|
15318
|
+
readonly output: Schema.Finite;
|
|
15319
|
+
readonly reasoning: Schema.Finite;
|
|
15320
|
+
readonly cache: Schema.Struct<{
|
|
15321
|
+
readonly read: Schema.Finite;
|
|
15322
|
+
readonly write: Schema.Finite;
|
|
15323
|
+
}>;
|
|
15324
|
+
}>;
|
|
15325
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
15326
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
15327
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
15328
|
+
};
|
|
15329
|
+
}>;
|
|
15330
|
+
}> & {
|
|
15331
|
+
type: "session.usage.recorded";
|
|
15332
|
+
durability: "durable";
|
|
15333
|
+
durable: {
|
|
15334
|
+
readonly version: number;
|
|
15335
|
+
readonly aggregate: string;
|
|
15336
|
+
};
|
|
15337
|
+
data: Schema.Struct<{
|
|
15338
|
+
readonly source: Schema.Literals<readonly ["title", "compaction"]>;
|
|
15339
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
15340
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
15341
|
+
};
|
|
15342
|
+
readonly tokens: Schema.Struct<{
|
|
15343
|
+
readonly input: Schema.Finite;
|
|
15344
|
+
readonly output: Schema.Finite;
|
|
15345
|
+
readonly reasoning: Schema.Finite;
|
|
15346
|
+
readonly cache: Schema.Struct<{
|
|
15347
|
+
readonly read: Schema.Finite;
|
|
15348
|
+
readonly write: Schema.Finite;
|
|
15349
|
+
}>;
|
|
15350
|
+
}>;
|
|
15351
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
15352
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
15353
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
15354
|
+
};
|
|
15355
|
+
}>;
|
|
15050
15356
|
}]>;
|
|
15051
15357
|
export type Event = typeof All.Type;
|
|
15052
15358
|
export type Type = Event["type"];
|
package/dist/session-event.js
CHANGED
|
@@ -72,6 +72,16 @@ export const Renamed = Event.durable({
|
|
|
72
72
|
title: Schema.String,
|
|
73
73
|
},
|
|
74
74
|
});
|
|
75
|
+
export const UsageRecorded = Event.durable({
|
|
76
|
+
type: "session.usage.recorded",
|
|
77
|
+
...options,
|
|
78
|
+
schema: {
|
|
79
|
+
...Base,
|
|
80
|
+
source: Schema.Literals(["title", "compaction"]),
|
|
81
|
+
cost: Money.USD,
|
|
82
|
+
tokens: TokenUsage.Info,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
75
85
|
export const UsageUpdated = Event.ephemeral({
|
|
76
86
|
type: "session.usage.updated",
|
|
77
87
|
schema: {
|
|
@@ -446,8 +456,9 @@ export var RevertEvent;
|
|
|
446
456
|
});
|
|
447
457
|
})(RevertEvent || (RevertEvent = {}));
|
|
448
458
|
export const Definitions = Event.inventory(AgentSelected, ModelSelected, Moved, Renamed, UsageUpdated, Deleted, Forked, InputPromoted, InputAdmitted, Execution.Started, Execution.Succeeded, Execution.Failed, Execution.Interrupted, InstructionsUpdated, Synthetic, Skill.Activated, Shell.Started, Shell.Ended, Step.Started, Step.Ended, Step.Failed, Text.Started, Text.Delta, Text.Ended, Reasoning.Started, Reasoning.Delta, Reasoning.Ended, Tool.Input.Started, Tool.Input.Delta, Tool.Input.Ended, Tool.Called, Tool.Progress, Tool.Success, Tool.Failed, RetryScheduled, Compaction.Admitted, Compaction.Started, Compaction.Delta, Compaction.Ended, Compaction.Failed, RevertEvent.Staged, RevertEvent.Cleared, RevertEvent.Committed);
|
|
449
|
-
|
|
459
|
+
// UsageRecorded is durable but internal: excluded from Definitions so it never reaches the public manifest.
|
|
460
|
+
export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable"), UsageRecorded);
|
|
450
461
|
export const Durable = Schema.Union(DurableDefinitions, { mode: "oneOf" })
|
|
451
462
|
.pipe(Schema.toTaggedUnion("type"))
|
|
452
463
|
.annotate({ identifier: "Session.Event.Durable" });
|
|
453
|
-
export const All = Schema.Union(Definitions, { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"));
|
|
464
|
+
export const All = Schema.Union(Event.inventory(...Definitions, UsageRecorded), { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"));
|