@opencode-ai/protocol 0.0.0-next-17335 → 0.0.0-next-17346
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.
- package/dist/groups/event.d.ts +180 -348
- package/dist/groups/session.d.ts +150 -212
- package/dist/groups/session.js +35 -32
- package/package.json +2 -2
package/dist/groups/session.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SessionMessage } from "@opencode-ai/schema/session-message";
|
|
2
2
|
import { SessionTransfer } from "@opencode-ai/schema/session-transfer";
|
|
3
|
-
import {
|
|
3
|
+
import { SessionInbox } from "@opencode-ai/schema/session-inbox";
|
|
4
4
|
import { PromptInput } from "@opencode-ai/schema/prompt-input";
|
|
5
5
|
import { Session } from "@opencode-ai/schema/session";
|
|
6
6
|
import { InstructionEntry } from "@opencode-ai/schema/instruction-entry";
|
|
@@ -218,7 +218,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
218
218
|
})))
|
|
219
219
|
.add(HttpApiEndpoint.post("session.move", "/api/session/:sessionID/move", {
|
|
220
220
|
params: { sessionID: Session.ID },
|
|
221
|
-
payload: Location.Ref,
|
|
221
|
+
payload: Schema.Struct({ ...Location.Ref.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }),
|
|
222
222
|
success: HttpApiSchema.NoContent,
|
|
223
223
|
error: [SessionNotFoundError, InvalidRequestError],
|
|
224
224
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -231,11 +231,11 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
231
231
|
payload: Schema.Struct({
|
|
232
232
|
id: SessionMessage.ID.pipe(Schema.optional),
|
|
233
233
|
...PromptInput.Prompt.fields,
|
|
234
|
-
metadata:
|
|
235
|
-
delivery:
|
|
234
|
+
metadata: SessionInbox.UserPayload.fields.metadata,
|
|
235
|
+
delivery: SessionInbox.Delivery.pipe(Schema.optional),
|
|
236
236
|
resume: Schema.Boolean.pipe(Schema.optional),
|
|
237
237
|
}),
|
|
238
|
-
success: Schema.Struct({ data:
|
|
238
|
+
success: Schema.Struct({ data: SessionInbox.User }),
|
|
239
239
|
error: [ConflictError, InvalidRequestError, SessionNotFoundError],
|
|
240
240
|
})
|
|
241
241
|
.middleware(sessionLocationMiddleware)
|
|
@@ -255,10 +255,10 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
255
255
|
files: PromptInput.Prompt.fields.files,
|
|
256
256
|
agents: PromptInput.Prompt.fields.agents,
|
|
257
257
|
skills: PromptInput.Prompt.fields.skills,
|
|
258
|
-
delivery:
|
|
258
|
+
delivery: SessionInbox.Delivery.pipe(Schema.optional),
|
|
259
259
|
resume: Schema.Boolean.pipe(Schema.optional),
|
|
260
260
|
}),
|
|
261
|
-
success: Schema.Struct({ data:
|
|
261
|
+
success: Schema.Struct({ data: SessionInbox.User }),
|
|
262
262
|
error: [ConflictError, InvalidRequestError, SessionNotFoundError, CommandNotFoundError, CommandEvaluationError],
|
|
263
263
|
})
|
|
264
264
|
.middleware(sessionLocationMiddleware)
|
|
@@ -290,10 +290,10 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
290
290
|
text: Schema.String,
|
|
291
291
|
description: Schema.String.pipe(Schema.optional),
|
|
292
292
|
metadata: SessionMessage.Synthetic.fields.metadata,
|
|
293
|
-
delivery:
|
|
293
|
+
delivery: SessionInbox.Delivery.pipe(Schema.optional),
|
|
294
294
|
resume: Schema.Boolean.pipe(Schema.optional),
|
|
295
295
|
}),
|
|
296
|
-
success: Schema.Struct({ data:
|
|
296
|
+
success: Schema.Struct({ data: SessionInbox.Synthetic }),
|
|
297
297
|
error: [ConflictError, SessionNotFoundError],
|
|
298
298
|
})
|
|
299
299
|
.middleware(sessionLocationMiddleware)
|
|
@@ -319,8 +319,11 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
319
319
|
})))
|
|
320
320
|
.add(HttpApiEndpoint.post("session.compact", "/api/session/:sessionID/compact", {
|
|
321
321
|
params: { sessionID: Session.ID },
|
|
322
|
-
payload: Schema.Struct({
|
|
323
|
-
|
|
322
|
+
payload: Schema.Struct({
|
|
323
|
+
id: SessionMessage.ID.pipe(Schema.optional),
|
|
324
|
+
delivery: SessionInbox.Delivery.pipe(Schema.optional),
|
|
325
|
+
}),
|
|
326
|
+
success: Schema.Struct({ data: SessionInbox.Compaction }),
|
|
324
327
|
error: [ConflictError, SessionNotFoundError],
|
|
325
328
|
})
|
|
326
329
|
.middleware(sessionLocationMiddleware)
|
|
@@ -375,41 +378,41 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
375
378
|
summary: "Get session context",
|
|
376
379
|
description: "Retrieve the active context messages for a session (all messages after the last compaction).",
|
|
377
380
|
})))
|
|
378
|
-
.add(HttpApiEndpoint.get("session.
|
|
381
|
+
.add(HttpApiEndpoint.get("session.inbox.list", "/api/session/:sessionID/inbox", {
|
|
379
382
|
params: { sessionID: Session.ID },
|
|
380
|
-
success: Schema.Struct({ data: Schema.Array(
|
|
383
|
+
success: Schema.Struct({ data: Schema.Array(SessionInbox.Info) }),
|
|
381
384
|
error: SessionNotFoundError,
|
|
382
385
|
}).annotateMerge(OpenApi.annotations({
|
|
383
|
-
identifier: "v2.session.
|
|
384
|
-
summary: "List
|
|
385
|
-
description: "List durable
|
|
386
|
+
identifier: "v2.session.inbox.list",
|
|
387
|
+
summary: "List session inbox",
|
|
388
|
+
description: "List durable enqueued session work not yet delivered, ordered by enqueue sequence. Includes user, synthetic, compaction, and move items.",
|
|
386
389
|
})))
|
|
387
|
-
.add(HttpApiEndpoint.delete("session.
|
|
388
|
-
params: { sessionID: Session.ID,
|
|
390
|
+
.add(HttpApiEndpoint.delete("session.inbox.cancel", "/api/session/:sessionID/inbox/:inboxID", {
|
|
391
|
+
params: { sessionID: Session.ID, inboxID: SessionMessage.ID },
|
|
389
392
|
success: HttpApiSchema.NoContent,
|
|
390
393
|
error: [ConflictError, SessionNotFoundError],
|
|
391
394
|
}).annotateMerge(OpenApi.annotations({
|
|
392
|
-
identifier: "v2.session.
|
|
393
|
-
summary: "Cancel
|
|
394
|
-
description: "Cancel an
|
|
395
|
+
identifier: "v2.session.inbox.cancel",
|
|
396
|
+
summary: "Cancel inbox input",
|
|
397
|
+
description: "Cancel an inbox item that has not yet been delivered.",
|
|
395
398
|
})))
|
|
396
|
-
.add(HttpApiEndpoint.post("session.
|
|
397
|
-
params: { sessionID: Session.ID,
|
|
399
|
+
.add(HttpApiEndpoint.post("session.inbox.steer", "/api/session/:sessionID/inbox/:inboxID/steer", {
|
|
400
|
+
params: { sessionID: Session.ID, inboxID: SessionMessage.ID },
|
|
398
401
|
success: HttpApiSchema.NoContent,
|
|
399
402
|
error: [ConflictError, SessionNotFoundError],
|
|
400
403
|
}).annotateMerge(OpenApi.annotations({
|
|
401
|
-
identifier: "v2.session.
|
|
402
|
-
summary: "Steer queued
|
|
403
|
-
description: "Change a queued
|
|
404
|
+
identifier: "v2.session.inbox.steer",
|
|
405
|
+
summary: "Steer queued item",
|
|
406
|
+
description: "Change a queued inbox item to steer delivery and wake session execution.",
|
|
404
407
|
})))
|
|
405
|
-
.add(HttpApiEndpoint.post("session.
|
|
406
|
-
params: { sessionID: Session.ID,
|
|
408
|
+
.add(HttpApiEndpoint.post("session.inbox.queue", "/api/session/:sessionID/inbox/:inboxID/queue", {
|
|
409
|
+
params: { sessionID: Session.ID, inboxID: SessionMessage.ID },
|
|
407
410
|
success: HttpApiSchema.NoContent,
|
|
408
411
|
error: [ConflictError, SessionNotFoundError],
|
|
409
412
|
}).annotateMerge(OpenApi.annotations({
|
|
410
|
-
identifier: "v2.session.
|
|
411
|
-
summary: "Queue
|
|
412
|
-
description: "Change a
|
|
413
|
+
identifier: "v2.session.inbox.queue",
|
|
414
|
+
summary: "Queue steered item",
|
|
415
|
+
description: "Change a steered inbox item to queued delivery.",
|
|
413
416
|
})))
|
|
414
417
|
.add(HttpApiEndpoint.get("session.instructions.entry.list", "/api/session/:sessionID/instructions/entries", {
|
|
415
418
|
params: { sessionID: Session.ID },
|
|
@@ -484,7 +487,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
484
487
|
.annotateMerge(OpenApi.annotations({
|
|
485
488
|
identifier: "v2.session.interrupt",
|
|
486
489
|
summary: "Interrupt session execution",
|
|
487
|
-
description: "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op. When continue=true, execution resumes if durable
|
|
490
|
+
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.",
|
|
488
491
|
})))
|
|
489
492
|
.add(HttpApiEndpoint.post("session.background", "/api/session/:sessionID/background", {
|
|
490
493
|
params: { sessionID: Session.ID },
|
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-
|
|
4
|
+
"version": "0.0.0-next-17346",
|
|
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-
|
|
31
|
+
"@opencode-ai/schema": "0.0.0-next-17346",
|
|
32
32
|
"effect": "4.0.0-beta.101"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|