@opencode/protocol 0.0.0-dev-19656 → 0.0.0-dev-19658
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
CHANGED
|
@@ -867,7 +867,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
867
867
|
};
|
|
868
868
|
readonly created: Schema.Finite;
|
|
869
869
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
870
|
-
readonly type: Schema.Literal<"session.permissions
|
|
870
|
+
readonly type: Schema.Literal<"session.permissions">;
|
|
871
871
|
readonly durable: Schema.Struct<{
|
|
872
872
|
readonly aggregateID: Schema.String;
|
|
873
873
|
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
@@ -904,7 +904,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
904
904
|
};
|
|
905
905
|
}>;
|
|
906
906
|
}> & {
|
|
907
|
-
type: "session.permissions
|
|
907
|
+
type: "session.permissions";
|
|
908
908
|
durability: "durable";
|
|
909
909
|
durable: {
|
|
910
910
|
readonly version: number;
|
|
@@ -6850,7 +6850,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
6850
6850
|
readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
|
|
6851
6851
|
readonly version: number & import("effect/Brand").Brand<"Event.Version">;
|
|
6852
6852
|
};
|
|
6853
|
-
readonly type: "session.permissions
|
|
6853
|
+
readonly type: "session.permissions";
|
|
6854
6854
|
readonly created: number;
|
|
6855
6855
|
readonly location?: {
|
|
6856
6856
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
@@ -9283,7 +9283,7 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
9283
9283
|
};
|
|
9284
9284
|
readonly created: Schema.Finite;
|
|
9285
9285
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
9286
|
-
readonly type: Schema.Literal<"session.permissions
|
|
9286
|
+
readonly type: Schema.Literal<"session.permissions">;
|
|
9287
9287
|
readonly durable: Schema.Struct<{
|
|
9288
9288
|
readonly aggregateID: Schema.String;
|
|
9289
9289
|
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
@@ -9320,7 +9320,7 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
9320
9320
|
};
|
|
9321
9321
|
}>;
|
|
9322
9322
|
}> & {
|
|
9323
|
-
type: "session.permissions
|
|
9323
|
+
type: "session.permissions";
|
|
9324
9324
|
durability: "durable";
|
|
9325
9325
|
durable: {
|
|
9326
9326
|
readonly version: number;
|
|
@@ -157,15 +157,4 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
157
157
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
158
158
|
readonly decision: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
159
159
|
readonly message: Schema.optional<Schema.String>;
|
|
160
|
-
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId
|
|
161
|
-
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
162
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
163
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
164
|
-
};
|
|
165
|
-
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
166
|
-
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
167
|
-
readonly action: Schema.String;
|
|
168
|
-
readonly resource: Schema.String;
|
|
169
|
-
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
170
|
-
}>>;
|
|
171
|
-
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>>, false>;
|
|
160
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>>, false>;
|
|
@@ -93,17 +93,5 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
93
93
|
identifier: "session.permission.reply",
|
|
94
94
|
summary: "Reply to pending permission request",
|
|
95
95
|
description: "Respond to a pending permission request owned by a session.",
|
|
96
|
-
})))
|
|
97
|
-
.add(HttpApiEndpoint.put("session.permission.rules", "/api/session/:sessionID/permission/rules", {
|
|
98
|
-
params: { sessionID: Session.ID },
|
|
99
|
-
payload: Schema.Struct({ permissions: Permission.Ruleset }),
|
|
100
|
-
success: HttpApiSchema.NoContent,
|
|
101
|
-
error: SessionNotFoundError,
|
|
102
|
-
})
|
|
103
|
-
.middleware(sessionLocationMiddleware)
|
|
104
|
-
.annotateMerge(OpenApi.annotations({
|
|
105
|
-
identifier: "session.permission.rules",
|
|
106
|
-
summary: "Replace session permission rules",
|
|
107
|
-
description: "Replace the session-scoped permission rules. Rules are evaluated after the agent's rules, and the last matching rule wins.",
|
|
108
96
|
})))
|
|
109
97
|
.annotateMerge(OpenApi.annotations({ title: "permission", description: "Experimental permission routes." }));
|
package/dist/groups/session.d.ts
CHANGED
|
@@ -3016,13 +3016,18 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
|
|
|
3016
3016
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
3017
3017
|
};
|
|
3018
3018
|
};
|
|
3019
|
-
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.
|
|
3019
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.update", "PATCH", "/api/session/:sessionID", Schema.toCodecStringTree<Schema.Struct<{
|
|
3020
3020
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
3021
3021
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
3022
3022
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
3023
3023
|
};
|
|
3024
3024
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
3025
|
-
readonly title: Schema.String
|
|
3025
|
+
readonly title: Schema.optional<Schema.String>;
|
|
3026
|
+
readonly permissions: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
3027
|
+
readonly action: Schema.String;
|
|
3028
|
+
readonly resource: Schema.String;
|
|
3029
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
3030
|
+
}>>>;
|
|
3026
3031
|
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.move", "POST", "/api/session/:sessionID/move", Schema.toCodecStringTree<Schema.Struct<{
|
|
3027
3032
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
3028
3033
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -5098,7 +5103,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
|
|
|
5098
5103
|
};
|
|
5099
5104
|
readonly created: Schema.Finite;
|
|
5100
5105
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
5101
|
-
readonly type: Schema.Literal<"session.permissions
|
|
5106
|
+
readonly type: Schema.Literal<"session.permissions">;
|
|
5102
5107
|
readonly durable: Schema.Struct<{
|
|
5103
5108
|
readonly aggregateID: Schema.String;
|
|
5104
5109
|
readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
|
|
@@ -5135,7 +5140,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
|
|
|
5135
5140
|
};
|
|
5136
5141
|
}>;
|
|
5137
5142
|
}> & {
|
|
5138
|
-
type: "session.permissions
|
|
5143
|
+
type: "session.permissions";
|
|
5139
5144
|
durability: "durable";
|
|
5140
5145
|
durable: {
|
|
5141
5146
|
readonly version: number;
|
|
@@ -8687,7 +8692,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
|
|
|
8687
8692
|
readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
|
|
8688
8693
|
readonly version: number & import("effect/Brand").Brand<"Event.Version">;
|
|
8689
8694
|
};
|
|
8690
|
-
readonly type: "session.permissions
|
|
8695
|
+
readonly type: "session.permissions";
|
|
8691
8696
|
readonly created: number;
|
|
8692
8697
|
readonly location?: {
|
|
8693
8698
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
package/dist/groups/session.js
CHANGED
|
@@ -249,17 +249,20 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
249
249
|
summary: "Switch session model",
|
|
250
250
|
description: "Switch the model used by subsequent provider turns.",
|
|
251
251
|
})))
|
|
252
|
-
.add(HttpApiEndpoint.patch("session.
|
|
252
|
+
.add(HttpApiEndpoint.patch("session.update", "/api/session/:sessionID", {
|
|
253
253
|
params: { sessionID: Session.ID },
|
|
254
|
-
payload: Schema.Struct({
|
|
254
|
+
payload: Schema.Struct({
|
|
255
|
+
title: Schema.String.pipe(Schema.optional),
|
|
256
|
+
permissions: Permission.Ruleset.pipe(Schema.optional),
|
|
257
|
+
}),
|
|
255
258
|
success: HttpApiSchema.NoContent,
|
|
256
259
|
error: SessionNotFoundError,
|
|
257
260
|
})
|
|
258
261
|
.middleware(sessionLocationMiddleware)
|
|
259
262
|
.annotateMerge(OpenApi.annotations({
|
|
260
|
-
identifier: "session.
|
|
261
|
-
summary: "
|
|
262
|
-
description: "Update
|
|
263
|
+
identifier: "session.update",
|
|
264
|
+
summary: "Update session",
|
|
265
|
+
description: "Update mutable session properties.",
|
|
263
266
|
})))
|
|
264
267
|
.add(HttpApiEndpoint.post("session.move", "/api/session/:sessionID/move", {
|
|
265
268
|
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/protocol",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19658",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typecheck": "tsgo --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@opencode/schema": "0.0.0-dev-
|
|
35
|
+
"@opencode/schema": "0.0.0-dev-19658",
|
|
36
36
|
"effect": "4.0.0-rc.112"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|