@opencode-ai/schema
Advanced tools
@@ -75,2 +75,12 @@ export * as SessionEvent from "./session-event.js"; | ||
| }); | ||
| export const UsageRecorded = Event.durable({ | ||
| type: "session.usage.recorded", | ||
| ...options, | ||
| schema: { | ||
| ...Base, | ||
| source: Schema.Literals(["title", "compaction"]), | ||
| cost: Money.USD, | ||
| tokens: TokenUsage.Info, | ||
| }, | ||
| }); | ||
| export const UsageUpdated = Event.ephemeral({ | ||
@@ -450,6 +460,7 @@ type: "session.usage.updated", | ||
| export const Definitions = Event.inventory(AgentSelected, ModelSelected, Moved, Renamed, UsageUpdated, Deleted, Forked, InputPromoted, InputAdmitted, 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.Admitted, Compaction.Started, Compaction.Delta, Compaction.Ended, Compaction.Failed, RevertEvent.Staged, RevertEvent.Cleared, RevertEvent.Committed); | ||
| export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable")); | ||
| // UsageRecorded is durable but internal: excluded from Definitions so it never reaches the public manifest. | ||
| export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable"), UsageRecorded); | ||
| export const Durable = Schema.Union(DurableDefinitions, { mode: "oneOf" }) | ||
| .pipe(Schema.toTaggedUnion("type")) | ||
| .annotate({ identifier: "Session.Event.Durable" }); | ||
| export const All = Schema.Union(Definitions, { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type")); | ||
| export const All = Schema.Union(Event.inventory(...Definitions, UsageRecorded), { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type")); |
+1
-1
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/schema", | ||
| "version": "0.0.0-next-15716", | ||
| "version": "0.0.0-next-15718", | ||
| "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
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.
3616343
0.64%56896
0.7%