@opencode-ai/schema 0.0.0-dev-18493 → 0.0.0-dev-18508
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/event-manifest.d.ts +4 -0
- package/dist/session-event.d.ts +20 -0
- package/dist/session-event.js +3 -0
- package/dist/session-metadata.d.ts +8 -0
- package/dist/session-metadata.js +9 -0
- package/dist/session-transfer.d.ts +1 -0
- package/dist/session.d.ts +4 -0
- package/dist/session.js +3 -0
- package/package.json +1 -1
package/dist/event-manifest.d.ts
CHANGED
|
@@ -306,6 +306,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
|
|
|
306
306
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
307
307
|
};
|
|
308
308
|
}>, never, never>;
|
|
309
|
+
readonly metadata: 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>;
|
|
309
310
|
readonly version: Schema.String;
|
|
310
311
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
311
312
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -389,6 +390,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
|
|
|
389
390
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
390
391
|
};
|
|
391
392
|
}>, never, never>;
|
|
393
|
+
readonly metadata: 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>;
|
|
392
394
|
readonly version: Schema.String;
|
|
393
395
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
394
396
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -6348,6 +6350,7 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
6348
6350
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
6349
6351
|
};
|
|
6350
6352
|
}>, never, never>;
|
|
6353
|
+
readonly metadata: 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>;
|
|
6351
6354
|
readonly version: Schema.String;
|
|
6352
6355
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
6353
6356
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -6431,6 +6434,7 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
6431
6434
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
6432
6435
|
};
|
|
6433
6436
|
}>, never, never>;
|
|
6437
|
+
readonly metadata: 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>;
|
|
6434
6438
|
readonly version: Schema.String;
|
|
6435
6439
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
6436
6440
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
package/dist/session-event.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export declare const Created: Schema.Struct<{
|
|
|
111
111
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
112
112
|
};
|
|
113
113
|
}>, never, never>;
|
|
114
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
115
|
+
readonly metadata: 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>;
|
|
114
116
|
readonly version: Schema.String;
|
|
115
117
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
116
118
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -194,6 +196,8 @@ export declare const Created: Schema.Struct<{
|
|
|
194
196
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
195
197
|
};
|
|
196
198
|
}>, never, never>;
|
|
199
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
200
|
+
readonly metadata: 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>;
|
|
197
201
|
readonly version: Schema.String;
|
|
198
202
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
199
203
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -4234,6 +4238,8 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
4234
4238
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
4235
4239
|
};
|
|
4236
4240
|
}>, never, never>;
|
|
4241
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
4242
|
+
readonly metadata: 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>;
|
|
4237
4243
|
readonly version: Schema.String;
|
|
4238
4244
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
4239
4245
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -4317,6 +4323,8 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
4317
4323
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
4318
4324
|
};
|
|
4319
4325
|
}>, never, never>;
|
|
4326
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
4327
|
+
readonly metadata: 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>;
|
|
4320
4328
|
readonly version: Schema.String;
|
|
4321
4329
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
4322
4330
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -8159,6 +8167,8 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
|
|
|
8159
8167
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
8160
8168
|
};
|
|
8161
8169
|
}>, never, never>;
|
|
8170
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
8171
|
+
readonly metadata: 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>;
|
|
8162
8172
|
readonly version: Schema.String;
|
|
8163
8173
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
8164
8174
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -8242,6 +8252,8 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
|
|
|
8242
8252
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
8243
8253
|
};
|
|
8244
8254
|
}>, never, never>;
|
|
8255
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
8256
|
+
readonly metadata: 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>;
|
|
8245
8257
|
readonly version: Schema.String;
|
|
8246
8258
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
8247
8259
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -12161,6 +12173,8 @@ export declare const Durable: Schema.Union<readonly [...((Schema.Struct<{
|
|
|
12161
12173
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
12162
12174
|
};
|
|
12163
12175
|
}>, never, never>;
|
|
12176
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
12177
|
+
readonly metadata: 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>;
|
|
12164
12178
|
readonly version: Schema.String;
|
|
12165
12179
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
12166
12180
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -12244,6 +12258,8 @@ export declare const Durable: Schema.Union<readonly [...((Schema.Struct<{
|
|
|
12244
12258
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
12245
12259
|
};
|
|
12246
12260
|
}>, never, never>;
|
|
12261
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
12262
|
+
readonly metadata: 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>;
|
|
12247
12263
|
readonly version: Schema.String;
|
|
12248
12264
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
12249
12265
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -15837,6 +15853,8 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Union<re
|
|
|
15837
15853
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
15838
15854
|
};
|
|
15839
15855
|
}>, never, never>;
|
|
15856
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
15857
|
+
readonly metadata: 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>;
|
|
15840
15858
|
readonly version: Schema.String;
|
|
15841
15859
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
15842
15860
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -15920,6 +15938,8 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Union<re
|
|
|
15920
15938
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
15921
15939
|
};
|
|
15922
15940
|
}>, never, never>;
|
|
15941
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
15942
|
+
readonly metadata: 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>;
|
|
15923
15943
|
readonly version: Schema.String;
|
|
15924
15944
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
15925
15945
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
package/dist/session-event.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Model } from "./model.js";
|
|
|
8
8
|
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js";
|
|
9
9
|
import { FileAttachment } from "./prompt.js";
|
|
10
10
|
import { SessionID } from "./session-id.js";
|
|
11
|
+
import { SessionMetadata } from "./session-metadata.js";
|
|
11
12
|
import { Location } from "./location.js";
|
|
12
13
|
import { SessionMessage } from "./session-message.js";
|
|
13
14
|
import { Revert } from "./session-revert.js";
|
|
@@ -53,6 +54,8 @@ export const Created = Event.durable({
|
|
|
53
54
|
title: Schema.String.pipe(optional),
|
|
54
55
|
agent: Agent.ID.pipe(optional),
|
|
55
56
|
model: Model.Ref.pipe(optional),
|
|
57
|
+
/** Host-supplied annotations resolved at creation, including any inherited from a parent. */
|
|
58
|
+
metadata: SessionMetadata.pipe(optional),
|
|
56
59
|
version: Schema.String,
|
|
57
60
|
},
|
|
58
61
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Host-supplied session annotations, durable from creation and opaque to
|
|
4
|
+
* core. Keys are arbitrary; values must be JSON-serializable. Children and
|
|
5
|
+
* forks inherit the parent's metadata unless the creator supplies its own.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SessionMetadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
8
|
+
export type SessionMetadata = typeof SessionMetadata.Type;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Host-supplied session annotations, durable from creation and opaque to
|
|
4
|
+
* core. Keys are arbitrary; values must be JSON-serializable. Children and
|
|
5
|
+
* forks inherit the parent's metadata unless the creator supplies its own.
|
|
6
|
+
*/
|
|
7
|
+
export const SessionMetadata = Schema.Record(Schema.String, Schema.Json).annotate({
|
|
8
|
+
identifier: "Session.Metadata",
|
|
9
|
+
});
|
|
@@ -133,6 +133,7 @@ export declare const Data: Schema.Struct<{
|
|
|
133
133
|
}>, never, never>;
|
|
134
134
|
}>;
|
|
135
135
|
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
136
|
+
readonly metadata: 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>;
|
|
136
137
|
readonly revert: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
137
138
|
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
138
139
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
package/dist/session.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ 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 { SessionMetadata } from "./session-metadata.js";
|
|
5
6
|
import { Revert } from "./session-revert.js";
|
|
6
7
|
import { SessionFork } from "./session-fork.js";
|
|
7
8
|
export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
|
|
@@ -9,6 +10,8 @@ export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
|
|
|
9
10
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
10
11
|
};
|
|
11
12
|
export type ID = SessionID;
|
|
13
|
+
export declare const Metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
14
|
+
export type Metadata = SessionMetadata;
|
|
12
15
|
export declare const Event: typeof SessionEvent;
|
|
13
16
|
export { Revert };
|
|
14
17
|
export declare const ForkBoundary: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -168,6 +171,7 @@ export declare const Info: Schema.Struct<{
|
|
|
168
171
|
}>, never, never>;
|
|
169
172
|
}>;
|
|
170
173
|
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
174
|
+
readonly metadata: 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>;
|
|
171
175
|
readonly revert: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
172
176
|
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
173
177
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
package/dist/session.js
CHANGED
|
@@ -7,11 +7,13 @@ import { Project } from "./project.js";
|
|
|
7
7
|
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
8
8
|
import { SessionEvent } from "./session-event.js";
|
|
9
9
|
import { SessionID } from "./session-id.js";
|
|
10
|
+
import { SessionMetadata } from "./session-metadata.js";
|
|
10
11
|
import { Money } from "./money.js";
|
|
11
12
|
import { TokenUsage } from "./token-usage.js";
|
|
12
13
|
import { Revert } from "./session-revert.js";
|
|
13
14
|
import { SessionFork } from "./session-fork.js";
|
|
14
15
|
export const ID = SessionID;
|
|
16
|
+
export const Metadata = SessionMetadata;
|
|
15
17
|
export const Event = SessionEvent;
|
|
16
18
|
export { Revert };
|
|
17
19
|
export const ForkBoundary = SessionFork.Boundary;
|
|
@@ -40,6 +42,7 @@ export const Info = Schema.Struct({
|
|
|
40
42
|
title: Schema.String.pipe(optional),
|
|
41
43
|
location: Location.Ref,
|
|
42
44
|
subpath: RelativePath.pipe(optional),
|
|
45
|
+
metadata: Metadata.pipe(optional),
|
|
43
46
|
revert: Revert.pipe(optional),
|
|
44
47
|
}).annotate({ identifier: "Session.Info" });
|
|
45
48
|
export const ListAnchor = Schema.Struct({
|