@opencode/schema 2.0.2 → 2.0.3

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.
@@ -1291,6 +1291,25 @@ export declare const Compaction: Schema.Union<readonly [Schema.Struct<{
1291
1291
  readonly type: Schema.tag<"compaction">;
1292
1292
  }>]>;
1293
1293
  export type Compaction = CompactionRunning | CompactionCompleted | CompactionFailed;
1294
+ /**
1295
+ * Marks the Session going idle: every step since the previous marker belongs to
1296
+ * one turn, including prompts steered in while it was busy. A shutdown does not
1297
+ * record one, since the resumed execution continues the same turn.
1298
+ */
1299
+ export interface Idle extends Schema.Schema.Type<typeof Idle> {
1300
+ }
1301
+ export declare const Idle: Schema.Struct<{
1302
+ readonly type: Schema.tag<"idle">;
1303
+ readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
1304
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1305
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
1306
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
1307
+ };
1308
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
1309
+ readonly time: Schema.Struct<{
1310
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
1311
+ }>;
1312
+ }>;
1294
1313
  export declare const Info: Schema.Union<readonly [Schema.Struct<{
1295
1314
  readonly type: Schema.tag<"agent-switched">;
1296
1315
  readonly agent: Schema.brand<Schema.String, "Agent.ID">;
@@ -2002,6 +2021,17 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
2002
2021
  readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2003
2022
  }>;
2004
2023
  readonly type: Schema.tag<"compaction">;
2005
- }>]>]>;
2006
- export type Info = AgentSelected | ModelSelected | LocationSwitched | User | Synthetic | System | Skill | Shell | Assistant | Compaction;
2024
+ }>]>, Schema.Struct<{
2025
+ readonly type: Schema.tag<"idle">;
2026
+ readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
2027
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
2028
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2029
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2030
+ };
2031
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
2032
+ readonly time: Schema.Struct<{
2033
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2034
+ }>;
2035
+ }>]>;
2036
+ export type Info = AgentSelected | ModelSelected | LocationSwitched | User | Synthetic | System | Skill | Shell | Assistant | Compaction | Idle;
2007
2037
  export type Type = Info["type"];
@@ -213,6 +213,11 @@ export const CompactionFailed = Schema.Struct({
213
213
  ...CompactionUsage,
214
214
  }).annotate({ identifier: "Session.Message.Compaction.Failed" });
215
215
  export const Compaction = Schema.Union([CompactionRunning, CompactionCompleted, CompactionFailed]).pipe(Schema.toTaggedUnion("status"), Schema.annotate({ identifier: "Session.Message.Compaction" }));
216
+ export const Idle = Schema.Struct({
217
+ ...Base,
218
+ type: Schema.tag("idle"),
219
+ outcome: Schema.Literals(["succeeded", "failed", "interrupted"]),
220
+ }).annotate({ identifier: "Session.Message.Idle" });
216
221
  export const Info = Schema.Union([
217
222
  AgentSelected,
218
223
  ModelSelected,
@@ -224,4 +229,5 @@ export const Info = Schema.Union([
224
229
  Shell,
225
230
  Assistant,
226
231
  Compaction,
232
+ Idle,
227
233
  ]).annotate({ identifier: "Session.Message.Info" });
@@ -893,5 +893,16 @@ export declare const Data: Schema.Struct<{
893
893
  readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
894
894
  }>;
895
895
  readonly type: Schema.tag<"compaction">;
896
- }>]>]>>;
896
+ }>]>, Schema.Struct<{
897
+ readonly type: Schema.tag<"idle">;
898
+ readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
899
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
900
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
901
+ fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
902
+ };
903
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
904
+ readonly time: Schema.Struct<{
905
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
906
+ }>;
907
+ }>]>>;
897
908
  }>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {