@opencode-ai/schema 0.0.0-dev-18293 → 0.0.0-dev-18296
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 +416 -0
- package/dist/session-event.d.ts +1042 -0
- package/dist/session-event.js +11 -1
- package/dist/session-message.d.ts +76 -0
- package/dist/session-message.js +3 -0
- package/package.json +1 -1
package/dist/session-event.js
CHANGED
|
@@ -99,6 +99,16 @@ export const Viewed = Event.durable({
|
|
|
99
99
|
idle: Schema.Finite,
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
|
+
export const MessageContentUpdated = Event.durable({
|
|
103
|
+
type: "session.message.content.updated",
|
|
104
|
+
...options,
|
|
105
|
+
schema: {
|
|
106
|
+
...Base,
|
|
107
|
+
messageID: SessionMessage.ID,
|
|
108
|
+
// Public events are framed directly, so timestamps must already be encoded.
|
|
109
|
+
content: Schema.Array(SessionMessage.AssistantContentEncoded),
|
|
110
|
+
},
|
|
111
|
+
});
|
|
102
112
|
export const UsageRecorded = Event.durable({
|
|
103
113
|
type: "session.usage.recorded",
|
|
104
114
|
...options,
|
|
@@ -505,7 +515,7 @@ export var RevertEvent;
|
|
|
505
515
|
schema: { ...Base, to: SessionMessage.ID },
|
|
506
516
|
});
|
|
507
517
|
})(RevertEvent || (RevertEvent = {}));
|
|
508
|
-
export const Definitions = Event.inventory(Created, AgentSelected, ModelSelected, Moved, Renamed, Viewed, UsageUpdated, Deleted, Forked, InboxDelivered, InboxEnqueued, InboxCancelled, InboxDeliveryChanged, 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.Started, Compaction.Delta, Compaction.Ended, Compaction.Failed, RevertEvent.Staged, RevertEvent.Cleared, RevertEvent.Committed);
|
|
518
|
+
export const Definitions = Event.inventory(Created, AgentSelected, ModelSelected, Moved, Renamed, Viewed, UsageUpdated, Deleted, Forked, InboxDelivered, InboxEnqueued, InboxCancelled, InboxDeliveryChanged, 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.Started, Compaction.Delta, Compaction.Ended, Compaction.Failed, RevertEvent.Staged, RevertEvent.Cleared, RevertEvent.Committed, MessageContentUpdated);
|
|
509
519
|
// UsageRecorded is durable but internal: excluded from Definitions so it never reaches the public manifest.
|
|
510
520
|
export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable"), UsageRecorded);
|
|
511
521
|
export const EphemeralDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "ephemeral"));
|
|
@@ -654,6 +654,82 @@ export declare const AssistantContent: Schema.toTaggedUnion<"type", readonly [Sc
|
|
|
654
654
|
}>;
|
|
655
655
|
}>]>;
|
|
656
656
|
export type AssistantContent = AssistantText | AssistantReasoning | AssistantTool;
|
|
657
|
+
export declare const AssistantContentEncoded: Schema.toEncoded<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
658
|
+
readonly type: Schema.tag<"text">;
|
|
659
|
+
readonly text: Schema.String;
|
|
660
|
+
readonly state: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
661
|
+
}>, Schema.Struct<{
|
|
662
|
+
readonly type: Schema.tag<"reasoning">;
|
|
663
|
+
readonly text: Schema.String;
|
|
664
|
+
readonly state: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
665
|
+
readonly time: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
666
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
667
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
668
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
669
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
670
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
671
|
+
}>>, never, never>;
|
|
672
|
+
}>, Schema.Struct<{
|
|
673
|
+
readonly type: Schema.tag<"tool">;
|
|
674
|
+
readonly id: Schema.String;
|
|
675
|
+
readonly name: Schema.String;
|
|
676
|
+
readonly executed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
677
|
+
readonly providerState: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
678
|
+
readonly providerResultState: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
679
|
+
readonly state: Schema.toTaggedUnion<"status", readonly [Schema.Struct<{
|
|
680
|
+
readonly status: Schema.tag<"streaming">;
|
|
681
|
+
readonly input: Schema.String;
|
|
682
|
+
}>, Schema.Struct<{
|
|
683
|
+
readonly status: Schema.tag<"running">;
|
|
684
|
+
readonly input: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
685
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
686
|
+
}>, Schema.Struct<{
|
|
687
|
+
readonly status: Schema.tag<"completed">;
|
|
688
|
+
readonly input: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
689
|
+
readonly content: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
690
|
+
readonly type: Schema.Literal<"text">;
|
|
691
|
+
readonly text: Schema.String;
|
|
692
|
+
}>, Schema.Struct<{
|
|
693
|
+
readonly type: Schema.Literal<"file">;
|
|
694
|
+
readonly uri: Schema.String;
|
|
695
|
+
readonly mime: Schema.String;
|
|
696
|
+
readonly name: Schema.optional<Schema.String>;
|
|
697
|
+
}>]>>;
|
|
698
|
+
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>;
|
|
699
|
+
}>, Schema.Struct<{
|
|
700
|
+
readonly status: Schema.tag<"error">;
|
|
701
|
+
readonly input: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
702
|
+
readonly error: Schema.Struct<{
|
|
703
|
+
readonly type: Schema.String;
|
|
704
|
+
readonly message: Schema.String;
|
|
705
|
+
readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
706
|
+
}>;
|
|
707
|
+
readonly content: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
708
|
+
readonly type: Schema.Literal<"text">;
|
|
709
|
+
readonly text: Schema.String;
|
|
710
|
+
}>, Schema.Struct<{
|
|
711
|
+
readonly type: Schema.Literal<"file">;
|
|
712
|
+
readonly uri: Schema.String;
|
|
713
|
+
readonly mime: Schema.String;
|
|
714
|
+
readonly name: Schema.optional<Schema.String>;
|
|
715
|
+
}>]>>>>, Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
716
|
+
readonly type: Schema.Literal<"text">;
|
|
717
|
+
readonly text: Schema.String;
|
|
718
|
+
}>, Schema.Struct<{
|
|
719
|
+
readonly type: Schema.Literal<"file">;
|
|
720
|
+
readonly uri: Schema.String;
|
|
721
|
+
readonly mime: Schema.String;
|
|
722
|
+
readonly name: Schema.optional<Schema.String>;
|
|
723
|
+
}>]>>>, never, never>;
|
|
724
|
+
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>;
|
|
725
|
+
}>]>;
|
|
726
|
+
readonly time: Schema.Struct<{
|
|
727
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
728
|
+
readonly ran: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
729
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
730
|
+
}>;
|
|
731
|
+
}>]>>;
|
|
732
|
+
export type AssistantContentEncoded = typeof AssistantContentEncoded.Type;
|
|
657
733
|
export interface AssistantRetry extends Schema.Schema.Type<typeof AssistantRetry> {
|
|
658
734
|
}
|
|
659
735
|
export declare const AssistantRetry: Schema.Struct<{
|
package/dist/session-message.js
CHANGED
|
@@ -147,6 +147,9 @@ export const AssistantReasoning = Schema.Struct({
|
|
|
147
147
|
}).pipe(optional),
|
|
148
148
|
}).annotate({ identifier: "Session.Message.Assistant.Reasoning" });
|
|
149
149
|
export const AssistantContent = Schema.Union([AssistantText, AssistantReasoning, AssistantTool]).pipe(Schema.toTaggedUnion("type"));
|
|
150
|
+
export const AssistantContentEncoded = Schema.toEncoded(AssistantContent).annotate({
|
|
151
|
+
identifier: "Session.Message.AssistantContent.Encoded",
|
|
152
|
+
});
|
|
150
153
|
export const AssistantRetry = Schema.Struct({
|
|
151
154
|
attempt: PositiveInt,
|
|
152
155
|
at: DateTimeUtcFromMillis,
|