@opencode-ai/protocol
Advanced tools
+35
-32
| import { SessionMessage } from "@opencode-ai/schema/session-message"; | ||
| import { SessionTransfer } from "@opencode-ai/schema/session-transfer"; | ||
| import { SessionPending } from "@opencode-ai/schema/session-pending"; | ||
| import { SessionInbox } from "@opencode-ai/schema/session-inbox"; | ||
| import { PromptInput } from "@opencode-ai/schema/prompt-input"; | ||
@@ -221,3 +221,3 @@ import { Session } from "@opencode-ai/schema/session"; | ||
| params: { sessionID: Session.ID }, | ||
| payload: Location.Ref, | ||
| payload: Schema.Struct({ ...Location.Ref.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }), | ||
| success: HttpApiSchema.NoContent, | ||
@@ -235,7 +235,7 @@ error: [SessionNotFoundError, InvalidRequestError], | ||
| ...PromptInput.Prompt.fields, | ||
| metadata: SessionPending.UserData.fields.metadata, | ||
| delivery: SessionPending.Delivery.pipe(Schema.optional), | ||
| metadata: SessionInbox.UserPayload.fields.metadata, | ||
| delivery: SessionInbox.Delivery.pipe(Schema.optional), | ||
| resume: Schema.Boolean.pipe(Schema.optional), | ||
| }), | ||
| success: Schema.Struct({ data: SessionPending.User }), | ||
| success: Schema.Struct({ data: SessionInbox.User }), | ||
| error: [ConflictError, InvalidRequestError, SessionNotFoundError], | ||
@@ -260,6 +260,6 @@ }) | ||
| skills: PromptInput.Prompt.fields.skills, | ||
| delivery: SessionPending.Delivery.pipe(Schema.optional), | ||
| delivery: SessionInbox.Delivery.pipe(Schema.optional), | ||
| resume: Schema.Boolean.pipe(Schema.optional), | ||
| }), | ||
| success: Schema.Struct({ data: SessionPending.User }), | ||
| success: Schema.Struct({ data: SessionInbox.User }), | ||
| error: [ConflictError, InvalidRequestError, SessionNotFoundError, CommandNotFoundError, CommandEvaluationError], | ||
@@ -296,6 +296,6 @@ }) | ||
| metadata: SessionMessage.Synthetic.fields.metadata, | ||
| delivery: SessionPending.Delivery.pipe(Schema.optional), | ||
| delivery: SessionInbox.Delivery.pipe(Schema.optional), | ||
| resume: Schema.Boolean.pipe(Schema.optional), | ||
| }), | ||
| success: Schema.Struct({ data: SessionPending.Synthetic }), | ||
| success: Schema.Struct({ data: SessionInbox.Synthetic }), | ||
| error: [ConflictError, SessionNotFoundError], | ||
@@ -326,4 +326,7 @@ }) | ||
| params: { sessionID: Session.ID }, | ||
| payload: Schema.Struct({ id: SessionMessage.ID.pipe(Schema.optional) }), | ||
| success: Schema.Struct({ data: SessionPending.Compaction }), | ||
| payload: Schema.Struct({ | ||
| id: SessionMessage.ID.pipe(Schema.optional), | ||
| delivery: SessionInbox.Delivery.pipe(Schema.optional), | ||
| }), | ||
| success: Schema.Struct({ data: SessionInbox.Compaction }), | ||
| error: [ConflictError, SessionNotFoundError], | ||
@@ -383,37 +386,37 @@ }) | ||
| }))) | ||
| .add(HttpApiEndpoint.get("session.pending.list", "/api/session/:sessionID/pending", { | ||
| .add(HttpApiEndpoint.get("session.inbox.list", "/api/session/:sessionID/inbox", { | ||
| params: { sessionID: Session.ID }, | ||
| success: Schema.Struct({ data: Schema.Array(SessionPending.Info) }), | ||
| success: Schema.Struct({ data: Schema.Array(SessionInbox.Info) }), | ||
| error: SessionNotFoundError, | ||
| }).annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.pending.list", | ||
| summary: "List pending session work", | ||
| description: "List durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.", | ||
| identifier: "v2.session.inbox.list", | ||
| summary: "List session inbox", | ||
| description: "List durable enqueued session work not yet delivered, ordered by enqueue sequence. Includes user, synthetic, compaction, and move items.", | ||
| }))) | ||
| .add(HttpApiEndpoint.delete("session.pending.cancel", "/api/session/:sessionID/pending/:inputID", { | ||
| params: { sessionID: Session.ID, inputID: SessionMessage.ID }, | ||
| .add(HttpApiEndpoint.delete("session.inbox.cancel", "/api/session/:sessionID/inbox/:inboxID", { | ||
| params: { sessionID: Session.ID, inboxID: SessionMessage.ID }, | ||
| success: HttpApiSchema.NoContent, | ||
| error: [ConflictError, SessionNotFoundError], | ||
| }).annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.pending.cancel", | ||
| summary: "Cancel pending input", | ||
| description: "Cancel an input that has not yet been promoted into session history.", | ||
| identifier: "v2.session.inbox.cancel", | ||
| summary: "Cancel inbox input", | ||
| description: "Cancel an inbox item that has not yet been delivered.", | ||
| }))) | ||
| .add(HttpApiEndpoint.post("session.pending.steer", "/api/session/:sessionID/pending/:inputID/steer", { | ||
| params: { sessionID: Session.ID, inputID: SessionMessage.ID }, | ||
| .add(HttpApiEndpoint.post("session.inbox.steer", "/api/session/:sessionID/inbox/:inboxID/steer", { | ||
| params: { sessionID: Session.ID, inboxID: SessionMessage.ID }, | ||
| success: HttpApiSchema.NoContent, | ||
| error: [ConflictError, SessionNotFoundError], | ||
| }).annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.pending.steer", | ||
| summary: "Steer queued input", | ||
| description: "Change a queued input to steer delivery and wake session execution.", | ||
| identifier: "v2.session.inbox.steer", | ||
| summary: "Steer queued item", | ||
| description: "Change a queued inbox item to steer delivery and wake session execution.", | ||
| }))) | ||
| .add(HttpApiEndpoint.post("session.pending.queue", "/api/session/:sessionID/pending/:inputID/queue", { | ||
| params: { sessionID: Session.ID, inputID: SessionMessage.ID }, | ||
| .add(HttpApiEndpoint.post("session.inbox.queue", "/api/session/:sessionID/inbox/:inboxID/queue", { | ||
| params: { sessionID: Session.ID, inboxID: SessionMessage.ID }, | ||
| success: HttpApiSchema.NoContent, | ||
| error: [ConflictError, SessionNotFoundError], | ||
| }).annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.pending.queue", | ||
| summary: "Queue pending steer", | ||
| description: "Change a pending steer to queued delivery.", | ||
| identifier: "v2.session.inbox.queue", | ||
| summary: "Queue steered item", | ||
| description: "Change a steered inbox item to queued delivery.", | ||
| }))) | ||
@@ -493,3 +496,3 @@ .add(HttpApiEndpoint.get("session.instructions.entry.list", "/api/session/:sessionID/instructions/entries", { | ||
| summary: "Interrupt session execution", | ||
| description: "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op. When continue=true, execution resumes if durable pending work remains after interruption.", | ||
| description: "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op. When continue=true, execution resumes if durable inbox work remains after interruption.", | ||
| }))) | ||
@@ -496,0 +499,0 @@ .add(HttpApiEndpoint.post("session.background", "/api/session/:sessionID/background", { |
+2
-2
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/protocol", | ||
| "version": "0.0.0-next-17343", | ||
| "version": "0.0.0-next-17346", | ||
| "type": "module", | ||
@@ -31,3 +31,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@opencode-ai/schema": "0.0.0-next-17343", | ||
| "@opencode-ai/schema": "0.0.0-next-17346", | ||
| "effect": "4.0.0-beta.101" | ||
@@ -34,0 +34,0 @@ }, |
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.
1840903
-0.64%29035
-0.78%+ Added
- Removed