@opencode-ai/schema
Advanced tools
+19
-10
@@ -349,3 +349,3 @@ export * as SessionEvent from "./session-event.js"; | ||
| }); | ||
| /** Live replacement snapshot for a running tool. */ | ||
| /** Live replacement metadata for a running tool. */ | ||
| Tool.Progress = Event.ephemeral({ | ||
@@ -355,14 +355,16 @@ type: "session.tool.progress", | ||
| ...ToolBase, | ||
| structured: Schema.Record(Schema.String, Schema.Unknown), | ||
| content: Schema.Array(ToolContent), | ||
| metadata: Schema.Record(Schema.String, Schema.Json), | ||
| }, | ||
| }); | ||
| /** Canonical terminal success: one non-empty model representation plus optional UI metadata. */ | ||
| Tool.Success = Event.durable({ | ||
| type: "session.tool.success", | ||
| ...options, | ||
| durable: { | ||
| aggregate: "sessionID", | ||
| version: 2, | ||
| }, | ||
| schema: { | ||
| ...ToolBase, | ||
| structured: Schema.Record(Schema.String, Schema.Unknown), | ||
| content: Schema.Array(ToolContent), | ||
| result: Schema.Unknown.pipe(optional), | ||
| content: Schema.NonEmptyArray(ToolContent), | ||
| metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional), | ||
| executed: Schema.Boolean, | ||
@@ -372,5 +374,13 @@ resultState: SessionMessage.ProviderState.pipe(optional), | ||
| }); | ||
| /** | ||
| * Canonical terminal failure: one error plus the final bounded snapshot of | ||
| * partial progress. The event is self-contained; projection never reaches | ||
| * into ephemeral progress history. | ||
| */ | ||
| Tool.Failed = Event.durable({ | ||
| type: "session.tool.failed", | ||
| ...options, | ||
| durable: { | ||
| aggregate: "sessionID", | ||
| version: 2, | ||
| }, | ||
| schema: { | ||
@@ -380,4 +390,3 @@ ...ToolBase, | ||
| content: Schema.NonEmptyArray(ToolContent).pipe(optional), | ||
| metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional), | ||
| result: Schema.Unknown.pipe(optional), | ||
| metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional), | ||
| executed: Schema.Boolean, | ||
@@ -384,0 +393,0 @@ resultState: SessionMessage.ProviderState.pipe(optional), |
@@ -86,4 +86,3 @@ export * as SessionMessage from "./session-message.js"; | ||
| input: Schema.Record(Schema.String, Schema.Unknown), | ||
| structured: Schema.Record(Schema.String, Schema.Unknown), | ||
| content: ToolContent.pipe(Schema.Array), | ||
| metadata: Schema.Record(Schema.String, Schema.Json), | ||
| }).annotate({ identifier: "Session.Message.ToolState.Running" }); | ||
@@ -93,5 +92,4 @@ export const ToolStateCompleted = Schema.Struct({ | ||
| input: Schema.Record(Schema.String, Schema.Unknown), | ||
| content: ToolContent.pipe(Schema.Array), | ||
| structured: Schema.Record(Schema.String, Schema.Unknown), | ||
| result: Schema.Unknown.pipe(optional), | ||
| content: Schema.NonEmptyArray(ToolContent), | ||
| metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional), | ||
| }).annotate({ identifier: "Session.Message.ToolState.Completed" }); | ||
@@ -101,6 +99,5 @@ export const ToolStateError = Schema.Struct({ | ||
| input: Schema.Record(Schema.String, Schema.Unknown), | ||
| content: ToolContent.pipe(Schema.Array), | ||
| structured: Schema.Record(Schema.String, Schema.Unknown), | ||
| error: SessionError.Error, | ||
| result: Schema.Unknown.pipe(optional), | ||
| content: Schema.NonEmptyArray(ToolContent).pipe(optional), | ||
| metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional), | ||
| }).annotate({ identifier: "Session.Message.ToolState.Error" }); | ||
@@ -107,0 +104,0 @@ export const ToolState = Schema.Union([ToolStateStreaming, ToolStateRunning, ToolStateCompleted, ToolStateError]).pipe(Schema.toTaggedUnion("status")); |
+1
-1
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/schema", | ||
| "version": "0.0.0-next-16088", | ||
| "version": "0.0.0-next-16091", | ||
| "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
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.
3654739
-0.07%57087
-0.15%