@opencode-ai/protocol 0.0.0-next-14672 → 0.0.0-next-14674

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.
@@ -1480,6 +1480,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
1480
1480
  };
1481
1481
  readonly text: Schema.String;
1482
1482
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1483
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
1483
1484
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
1484
1485
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1485
1486
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -1493,6 +1494,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
1493
1494
  };
1494
1495
  readonly text: Schema.String;
1495
1496
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1497
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
1496
1498
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
1497
1499
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1498
1500
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -7269,6 +7271,9 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
7269
7271
  readonly timestamp: import("effect/DateTime").Utc;
7270
7272
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
7271
7273
  readonly description?: string | undefined;
7274
+ readonly metadata?: {
7275
+ readonly [x: string]: unknown;
7276
+ } | undefined;
7272
7277
  };
7273
7278
  readonly metadata?: {
7274
7279
  readonly [x: string]: unknown;
@@ -10619,6 +10624,7 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
10619
10624
  };
10620
10625
  readonly text: Schema.String;
10621
10626
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
10627
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
10622
10628
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
10623
10629
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
10624
10630
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -10632,6 +10638,7 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
10632
10638
  };
10633
10639
  readonly text: Schema.String;
10634
10640
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
10641
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
10635
10642
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
10636
10643
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
10637
10644
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -994,7 +994,16 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
994
994
  }>;
995
995
  readonly skill: Schema.String;
996
996
  readonly resume: Schema.optional<Schema.Boolean>;
997
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError | typeof SkillNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.compact", "POST", "/api/session/:sessionID/compact", HttpApiEndpoint.StringTree<Schema.Struct<{
997
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError | typeof SkillNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.synthetic", "POST", "/api/session/:sessionID/synthetic", HttpApiEndpoint.StringTree<Schema.Struct<{
998
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
999
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
1000
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
1001
+ };
1002
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1003
+ readonly text: Schema.String;
1004
+ readonly description: Schema.optional<Schema.String>;
1005
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
1006
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.compact", "POST", "/api/session/:sessionID/compact", HttpApiEndpoint.StringTree<Schema.Struct<{
998
1007
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
999
1008
  create: () => string & import("effect/Brand").Brand<"SessionID">;
1000
1009
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -2529,6 +2538,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
2529
2538
  };
2530
2539
  readonly text: Schema.String;
2531
2540
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2541
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
2532
2542
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2533
2543
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
2534
2544
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -2542,6 +2552,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
2542
2552
  };
2543
2553
  readonly text: Schema.String;
2544
2554
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2555
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
2545
2556
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2546
2557
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
2547
2558
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -5206,6 +5217,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
5206
5217
  };
5207
5218
  readonly text: Schema.String;
5208
5219
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5220
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
5209
5221
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
5210
5222
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5211
5223
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -5219,6 +5231,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
5219
5231
  };
5220
5232
  readonly text: Schema.String;
5221
5233
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5234
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
5222
5235
  readonly timestamp: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
5223
5236
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5224
5237
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -7019,6 +7032,9 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
7019
7032
  readonly timestamp: import("effect/DateTime").Utc;
7020
7033
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
7021
7034
  readonly description?: string | undefined;
7035
+ readonly metadata?: {
7036
+ readonly [x: string]: unknown;
7037
+ } | undefined;
7022
7038
  };
7023
7039
  readonly metadata?: {
7024
7040
  readonly [x: string]: unknown;
@@ -203,6 +203,22 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
203
203
  identifier: "v2.session.skill",
204
204
  summary: "Activate skill",
205
205
  description: "Activate a skill for a session by appending a skill message and resuming execution.",
206
+ })))
207
+ .add(HttpApiEndpoint.post("session.synthetic", "/api/session/:sessionID/synthetic", {
208
+ params: { sessionID: Session.ID },
209
+ payload: Schema.Struct({
210
+ text: Schema.String,
211
+ description: Schema.String.pipe(Schema.optional),
212
+ metadata: SessionMessage.Synthetic.fields.metadata,
213
+ }),
214
+ success: HttpApiSchema.NoContent,
215
+ error: SessionNotFoundError,
216
+ })
217
+ .middleware(sessionLocationMiddleware)
218
+ .annotateMerge(OpenApi.annotations({
219
+ identifier: "v2.session.synthetic",
220
+ summary: "Add synthetic message",
221
+ description: "Append a synthetic message to a session and resume execution.",
206
222
  })))
207
223
  .add(HttpApiEndpoint.post("session.compact", "/api/session/:sessionID/compact", {
208
224
  params: { sessionID: Session.ID },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-14672",
4
+ "version": "0.0.0-next-14674",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsgo --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-14672",
29
+ "@opencode-ai/schema": "0.0.0-next-14674",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {