@opencode-ai/protocol 0.0.0-next-16916 → 0.0.0-next-16927

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.
@@ -1,4 +1,5 @@
1
1
  import { SessionMessage } from "@opencode-ai/schema/session-message";
2
+ import { SessionTransfer } from "@opencode-ai/schema/session-transfer";
2
3
  import { SessionPending } from "@opencode-ai/schema/session-pending";
3
4
  import { PromptInput } from "@opencode-ai/schema/prompt-input";
4
5
  import { Session } from "@opencode-ai/schema/session";
@@ -117,6 +118,28 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
117
118
  identifier: "v2.session.create",
118
119
  summary: "Create session",
119
120
  description: "Create a session at the requested location.",
121
+ })))
122
+ .add(HttpApiEndpoint.post("session.import", "/api/session/import", {
123
+ payload: Schema.Struct({
124
+ ...SessionTransfer.Data.fields,
125
+ location: Location.Ref.pipe(Schema.optional),
126
+ }),
127
+ success: Schema.Struct({ data: Session.Info }),
128
+ error: ConflictError,
129
+ }).annotateMerge(OpenApi.annotations({
130
+ identifier: "v2.session.import",
131
+ summary: "Import session",
132
+ description: "Import a projected session transcript at the requested location.",
133
+ })))
134
+ .add(HttpApiEndpoint.get("session.export", "/api/session/:sessionID/export", {
135
+ params: { sessionID: Session.ID },
136
+ query: Schema.Struct({ sanitize: BooleanFromString.pipe(Schema.optional) }),
137
+ success: Schema.Struct({ data: SessionTransfer.Data }),
138
+ error: [SessionNotFoundError, UnknownError],
139
+ }).annotateMerge(OpenApi.annotations({
140
+ identifier: "v2.session.export",
141
+ summary: "Export session",
142
+ description: "Export a complete projected session transcript.",
120
143
  })))
121
144
  .add(HttpApiEndpoint.get("session.active", "/api/session/active", {
122
145
  success: Schema.Struct({ data: Schema.Record(Session.ID, SessionActive) }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-16916",
4
+ "version": "0.0.0-next-16927",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "typecheck": "tsgo --noEmit"
29
29
  },
30
30
  "dependencies": {
31
- "@opencode-ai/schema": "0.0.0-next-16916",
31
+ "@opencode-ai/schema": "0.0.0-next-16927",
32
32
  "effect": "4.0.0-beta.101"
33
33
  },
34
34
  "devDependencies": {