@opencode-ai/schema
Advanced tools
@@ -102,2 +102,12 @@ export * as SessionEvent from "./session-event.js"; | ||
| }); | ||
| export const MessageContentUpdated = Event.durable({ | ||
| type: "session.message.content.updated", | ||
| ...options, | ||
| schema: { | ||
| ...Base, | ||
| messageID: SessionMessage.ID, | ||
| // Public events are framed directly, so timestamps must already be encoded. | ||
| content: Schema.Array(SessionMessage.AssistantContentEncoded), | ||
| }, | ||
| }); | ||
| export const UsageRecorded = Event.durable({ | ||
@@ -257,2 +267,11 @@ type: "session.usage.recorded", | ||
| }); | ||
| /** Records the provider response-body boundary independently of tool settlement. */ | ||
| Step.Streamed = Event.durable({ | ||
| type: "session.step.streamed", | ||
| ...options, | ||
| schema: { | ||
| ...Base, | ||
| assistantMessageID: SessionMessage.ID, | ||
| }, | ||
| }); | ||
| Step.Ended = Event.durable({ | ||
@@ -510,3 +529,3 @@ type: "session.step.ended", | ||
| })(RevertEvent || (RevertEvent = {})); | ||
| 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); | ||
| 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.Streamed, 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); | ||
| // UsageRecorded is durable but internal: excluded from Definitions so it never reaches the public manifest. | ||
@@ -513,0 +532,0 @@ export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable"), UsageRecorded); |
@@ -150,2 +150,5 @@ export * as SessionMessage from "./session-message.js"; | ||
| export const AssistantContent = Schema.Union([AssistantText, AssistantReasoning, AssistantTool]).pipe(Schema.toTaggedUnion("type")); | ||
| export const AssistantContentEncoded = Schema.toEncoded(AssistantContent).annotate({ | ||
| identifier: "Session.Message.AssistantContent.Encoded", | ||
| }); | ||
| export const AssistantRetry = Schema.Struct({ | ||
@@ -176,2 +179,4 @@ attempt: PositiveInt, | ||
| created: DateTimeUtcFromMillis, | ||
| /** When the provider response body ended, before tool settlement. */ | ||
| streamed: DateTimeUtcFromMillis.pipe(optional), | ||
| completed: DateTimeUtcFromMillis.pipe(optional), | ||
@@ -178,0 +183,0 @@ }), |
@@ -696,2 +696,3 @@ export * as SessionTransfer from "./session-transfer.js"; | ||
| readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>; | ||
| readonly streamed: 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>; | ||
| 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>; | ||
@@ -698,0 +699,0 @@ }>; |
+1
-1
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/schema", | ||
| "version": "0.0.0-beta-18286", | ||
| "version": "0.0.0-beta-18311", | ||
| "type": "module", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
3734141
4.05%59019
3.51%