@opencode-ai/protocol 0.0.0-next-14708 → 0.0.0-next-14710
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/client.d.ts +3 -0
- package/dist/client.js +3 -0
- package/dist/groups/session.d.ts +25 -1
- package/dist/groups/session.js +35 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -56,6 +56,9 @@ export declare const endpointNames: {
|
|
|
56
56
|
readonly "integration.attempt.status": "attemptStatus";
|
|
57
57
|
readonly "integration.attempt.complete": "attemptComplete";
|
|
58
58
|
readonly "integration.attempt.cancel": "attemptCancel";
|
|
59
|
+
readonly "session.context.entry.list": "listContextEntries";
|
|
60
|
+
readonly "session.context.entry.put": "putContextEntry";
|
|
61
|
+
readonly "session.context.entry.remove": "removeContextEntry";
|
|
59
62
|
readonly "session.revert.stage": "revertStage";
|
|
60
63
|
readonly "session.revert.clear": "revertClear";
|
|
61
64
|
readonly "session.revert.commit": "revertCommit";
|
package/dist/client.js
CHANGED
|
@@ -40,6 +40,9 @@ export const endpointNames = {
|
|
|
40
40
|
"integration.attempt.status": "attemptStatus",
|
|
41
41
|
"integration.attempt.complete": "attemptComplete",
|
|
42
42
|
"integration.attempt.cancel": "attemptCancel",
|
|
43
|
+
"session.context.entry.list": "listContextEntries",
|
|
44
|
+
"session.context.entry.put": "putContextEntry",
|
|
45
|
+
"session.context.entry.remove": "removeContextEntry",
|
|
43
46
|
"session.revert.stage": "revertStage",
|
|
44
47
|
"session.revert.clear": "revertClear",
|
|
45
48
|
"session.revert.commit": "revertCommit",
|
package/dist/groups/session.d.ts
CHANGED
|
@@ -1447,7 +1447,31 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
|
|
|
1447
1447
|
readonly summary: Schema.String;
|
|
1448
1448
|
readonly recent: Schema.String;
|
|
1449
1449
|
}>]>>;
|
|
1450
|
-
}>>, HttpApiEndpoint.Json<typeof UnknownError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.
|
|
1450
|
+
}>>, HttpApiEndpoint.Json<typeof UnknownError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.context.entry.list", "GET", "/api/session/:sessionID/context-entry", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1451
|
+
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
1452
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
1453
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
1454
|
+
};
|
|
1455
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1456
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
1457
|
+
readonly key: Schema.String;
|
|
1458
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1459
|
+
}>>;
|
|
1460
|
+
}>>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.context.entry.put", "PUT", "/api/session/:sessionID/context-entry/:key", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1461
|
+
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
1462
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
1463
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
1464
|
+
};
|
|
1465
|
+
key: Schema.String;
|
|
1466
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1467
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1468
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.context.entry.remove", "DELETE", "/api/session/:sessionID/context-entry/:key", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1469
|
+
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
1470
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
1471
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
1472
|
+
};
|
|
1473
|
+
key: Schema.String;
|
|
1474
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.history", "GET", "/api/session/:sessionID/history", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1451
1475
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
1452
1476
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
1453
1477
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
package/dist/groups/session.js
CHANGED
|
@@ -2,6 +2,7 @@ import { SessionMessage } from "@opencode-ai/schema/session-message";
|
|
|
2
2
|
import { SessionInput } from "@opencode-ai/schema/session-input";
|
|
3
3
|
import { PromptInput } from "@opencode-ai/schema/prompt-input";
|
|
4
4
|
import { Session } from "@opencode-ai/schema/session";
|
|
5
|
+
import { SessionContextEntry } from "@opencode-ai/schema/session-context-entry";
|
|
5
6
|
import { Project } from "@opencode-ai/schema/project";
|
|
6
7
|
import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from "@opencode-ai/schema/schema";
|
|
7
8
|
import { Workspace } from "@opencode-ai/schema/workspace";
|
|
@@ -278,6 +279,40 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
|
|
|
278
279
|
identifier: "v2.session.context",
|
|
279
280
|
summary: "Get session context",
|
|
280
281
|
description: "Retrieve the active context messages for a session (all messages after the last compaction).",
|
|
282
|
+
})))
|
|
283
|
+
.add(HttpApiEndpoint.get("session.context.entry.list", "/api/session/:sessionID/context-entry", {
|
|
284
|
+
params: { sessionID: Session.ID },
|
|
285
|
+
success: Schema.Struct({ data: Schema.Array(SessionContextEntry.Info) }),
|
|
286
|
+
error: SessionNotFoundError,
|
|
287
|
+
})
|
|
288
|
+
.middleware(sessionLocationMiddleware)
|
|
289
|
+
.annotateMerge(OpenApi.annotations({
|
|
290
|
+
identifier: "v2.session.context.entry.list",
|
|
291
|
+
summary: "List context entries",
|
|
292
|
+
description: "List API-managed context entries attached to the session's system context.",
|
|
293
|
+
})))
|
|
294
|
+
.add(HttpApiEndpoint.put("session.context.entry.put", "/api/session/:sessionID/context-entry/:key", {
|
|
295
|
+
params: { sessionID: Session.ID, key: SessionContextEntry.Key },
|
|
296
|
+
payload: Schema.Struct({ value: Schema.Json }),
|
|
297
|
+
success: HttpApiSchema.NoContent,
|
|
298
|
+
error: SessionNotFoundError,
|
|
299
|
+
})
|
|
300
|
+
.middleware(sessionLocationMiddleware)
|
|
301
|
+
.annotateMerge(OpenApi.annotations({
|
|
302
|
+
identifier: "v2.session.context.entry.put",
|
|
303
|
+
summary: "Put context entry",
|
|
304
|
+
description: "Attach or replace one durable context entry. The value is rendered into the session's system context; changes announce as updates at the next turn boundary.",
|
|
305
|
+
})))
|
|
306
|
+
.add(HttpApiEndpoint.delete("session.context.entry.remove", "/api/session/:sessionID/context-entry/:key", {
|
|
307
|
+
params: { sessionID: Session.ID, key: SessionContextEntry.Key },
|
|
308
|
+
success: HttpApiSchema.NoContent,
|
|
309
|
+
error: SessionNotFoundError,
|
|
310
|
+
})
|
|
311
|
+
.middleware(sessionLocationMiddleware)
|
|
312
|
+
.annotateMerge(OpenApi.annotations({
|
|
313
|
+
identifier: "v2.session.context.entry.remove",
|
|
314
|
+
summary: "Remove context entry",
|
|
315
|
+
description: "Remove one context entry; the removal is announced to the model at the next turn boundary.",
|
|
281
316
|
})))
|
|
282
317
|
.add(HttpApiEndpoint.get("session.history", "/api/session/:sessionID/history", {
|
|
283
318
|
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-14710",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsgo --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
29
|
+
"@opencode-ai/schema": "0.0.0-next-14710",
|
|
30
30
|
"effect": "4.0.0-beta.83"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|