@opencode-ai/protocol 0.0.0-next-14722 → 0.0.0-next-14730
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/api.d.ts +11 -8
- package/dist/api.js +5 -5
- package/dist/client.d.ts +3 -3
- package/dist/client.js +5 -2
- package/dist/errors.d.ts +15 -3
- package/dist/errors.js +12 -2
- package/dist/groups/event.d.ts +1711 -1227
- package/dist/groups/event.js +11 -3
- package/dist/groups/form.d.ts +823 -0
- package/dist/groups/form.js +110 -0
- package/dist/groups/message.d.ts +1 -0
- package/dist/groups/message.js +5 -0
- package/dist/groups/session.d.ts +322 -2990
- package/dist/groups/session.js +23 -29
- package/package.json +2 -2
- package/dist/groups/question.d.ts +0 -92
- package/dist/groups/question.js +0 -56
package/dist/api.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ProviderGroup } from "./groups/provider.js";
|
|
|
8
8
|
import { makeSessionGroup } from "./groups/session.js";
|
|
9
9
|
import { makePermissionGroup } from "./groups/permission.js";
|
|
10
10
|
import { FileSystemGroup } from "./groups/fs.js";
|
|
11
|
+
import { makeFormGroup } from "./groups/form.js";
|
|
11
12
|
import { CommandGroup } from "./groups/command.js";
|
|
12
13
|
import { SkillGroup } from "./groups/skill.js";
|
|
13
14
|
import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
@@ -17,7 +18,6 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
17
18
|
import { HealthGroup } from "./groups/health.js";
|
|
18
19
|
import { PtyGroup } from "./groups/pty.js";
|
|
19
20
|
import { ShellGroup } from "./groups/shell.js";
|
|
20
|
-
import { makeQuestionGroup } from "./groups/question.js";
|
|
21
21
|
import { ReferenceGroup } from "./groups/reference.js";
|
|
22
22
|
import { Authorization } from "./middleware/authorization.js";
|
|
23
23
|
import { LocationGroup } from "./groups/location.js";
|
|
@@ -28,17 +28,20 @@ import { ProjectGroup } from "./groups/project.js";
|
|
|
28
28
|
import { ProjectCopyGroup } from "./groups/project-copy.js";
|
|
29
29
|
type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.AddMiddleware<typeof LocationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof AgentGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PluginGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ModelGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof GenerateGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProviderGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof IntegrationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof McpGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CredentialGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectCopyGroup, LocationId>;
|
|
30
30
|
type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | HttpApiGroup.AddMiddleware<typeof MessageGroup, SessionLocationId>;
|
|
31
|
-
type
|
|
32
|
-
type
|
|
31
|
+
type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
|
|
32
|
+
type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
|
|
33
|
+
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = typeof HealthGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
|
|
33
34
|
type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
|
|
34
|
-
export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
|
|
35
|
-
export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
|
35
|
+
export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
|
|
36
|
+
export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
|
36
37
|
readonly definitions: Definitions;
|
|
37
38
|
readonly locationMiddleware: Context.Key<LocationId, LocationService>;
|
|
39
|
+
readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
|
|
38
40
|
readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
|
|
39
|
-
}) => Api<LocationId, LocationService, SessionLocationId, SessionLocationService, EventGroupFor<Definitions>>;
|
|
40
|
-
export declare const makeDefaultApi: <LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
|
41
|
+
}) => Api<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, EventGroupFor<Definitions>>;
|
|
42
|
+
export declare const makeDefaultApi: <LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
|
41
43
|
readonly locationMiddleware: Context.Key<LocationId, LocationService>;
|
|
44
|
+
readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
|
|
42
45
|
readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
|
|
43
|
-
}) => Api<LocationId, LocationService, SessionLocationId, SessionLocationService, typeof EventGroup>;
|
|
46
|
+
}) => Api<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, typeof EventGroup>;
|
|
44
47
|
export {};
|
package/dist/api.js
CHANGED
|
@@ -8,6 +8,7 @@ import { ProviderGroup } from "./groups/provider.js";
|
|
|
8
8
|
import { makeSessionGroup } from "./groups/session.js";
|
|
9
9
|
import { makePermissionGroup } from "./groups/permission.js";
|
|
10
10
|
import { FileSystemGroup } from "./groups/fs.js";
|
|
11
|
+
import { makeFormGroup } from "./groups/form.js";
|
|
11
12
|
import { CommandGroup } from "./groups/command.js";
|
|
12
13
|
import { SkillGroup } from "./groups/skill.js";
|
|
13
14
|
import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
@@ -16,7 +17,6 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
16
17
|
import { HealthGroup } from "./groups/health.js";
|
|
17
18
|
import { PtyGroup } from "./groups/pty.js";
|
|
18
19
|
import { ShellGroup } from "./groups/shell.js";
|
|
19
|
-
import { makeQuestionGroup } from "./groups/question.js";
|
|
20
20
|
import { ReferenceGroup } from "./groups/reference.js";
|
|
21
21
|
import { Authorization } from "./middleware/authorization.js";
|
|
22
22
|
import { LocationGroup } from "./groups/location.js";
|
|
@@ -26,7 +26,7 @@ import { CredentialGroup } from "./groups/credential.js";
|
|
|
26
26
|
import { ProjectGroup } from "./groups/project.js";
|
|
27
27
|
import { ProjectCopyGroup } from "./groups/project-copy.js";
|
|
28
28
|
// Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
|
|
29
|
-
const makeApiFromGroup = (eventGroup, locationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
|
|
29
|
+
const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
|
|
30
30
|
.add(HealthGroup)
|
|
31
31
|
.add(LocationGroup.middleware(locationMiddleware))
|
|
32
32
|
.add(AgentGroup.middleware(locationMiddleware))
|
|
@@ -40,6 +40,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, sessionLocationMiddlew
|
|
|
40
40
|
.add(McpGroup.middleware(locationMiddleware))
|
|
41
41
|
.add(CredentialGroup.middleware(locationMiddleware))
|
|
42
42
|
.add(ProjectGroup.middleware(locationMiddleware))
|
|
43
|
+
.add(makeFormGroup(locationMiddleware, formLocationMiddleware))
|
|
43
44
|
.add(makePermissionGroup(locationMiddleware, sessionLocationMiddleware))
|
|
44
45
|
.add(FileSystemGroup.middleware(locationMiddleware))
|
|
45
46
|
.add(CommandGroup.middleware(locationMiddleware))
|
|
@@ -47,7 +48,6 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, sessionLocationMiddlew
|
|
|
47
48
|
.add(eventGroup)
|
|
48
49
|
.add(PtyGroup.middleware(locationMiddleware))
|
|
49
50
|
.add(ShellGroup.middleware(locationMiddleware))
|
|
50
|
-
.add(makeQuestionGroup(locationMiddleware, sessionLocationMiddleware))
|
|
51
51
|
.add(ReferenceGroup.middleware(locationMiddleware))
|
|
52
52
|
.add(ProjectCopyGroup.middleware(locationMiddleware))
|
|
53
53
|
.annotateMerge(OpenApi.annotations({
|
|
@@ -57,5 +57,5 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, sessionLocationMiddlew
|
|
|
57
57
|
}))
|
|
58
58
|
.middleware(Authorization)
|
|
59
59
|
.middleware(SchemaErrorMiddleware);
|
|
60
|
-
export const makeApi = (options) => makeApiFromGroup(makeEventGroup(options.definitions), options.locationMiddleware, options.sessionLocationMiddleware);
|
|
61
|
-
export const makeDefaultApi = (options) => makeApiFromGroup(EventGroup, options.locationMiddleware, options.sessionLocationMiddleware);
|
|
60
|
+
export const makeApi = (options) => makeApiFromGroup(makeEventGroup(options.definitions), options.locationMiddleware, options.formLocationMiddleware, options.sessionLocationMiddleware);
|
|
61
|
+
export const makeDefaultApi = (options) => makeApiFromGroup(EventGroup, options.locationMiddleware, options.formLocationMiddleware, options.sessionLocationMiddleware);
|
package/dist/client.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare const SessionLocationMiddleware_base: HttpApiMiddleware.ServiceClass<Ses
|
|
|
23
23
|
}, HttpApiMiddleware.HttpApiMiddleware<never, readonly [typeof InvalidRequestError, typeof SessionNotFoundError], never>>;
|
|
24
24
|
declare class SessionLocationMiddleware extends SessionLocationMiddleware_base {
|
|
25
25
|
}
|
|
26
|
-
type ClientApiShape = Api<Context.Service.Identifier<typeof LocationMiddleware>, Context.Service.Shape<typeof LocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, typeof EventGroup>;
|
|
26
|
+
type ClientApiShape = Api<Context.Service.Identifier<typeof LocationMiddleware>, Context.Service.Shape<typeof LocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, typeof EventGroup>;
|
|
27
27
|
export declare const ClientApi: ClientApiShape;
|
|
28
28
|
export declare const groupNames: {
|
|
29
29
|
readonly "server.health": "health";
|
|
@@ -38,13 +38,13 @@ export declare const groupNames: {
|
|
|
38
38
|
readonly "server.integration": "integration";
|
|
39
39
|
readonly "server.credential": "credential";
|
|
40
40
|
readonly "server.permission": "permission";
|
|
41
|
+
readonly "server.form": "form";
|
|
41
42
|
readonly "server.fs": "file";
|
|
42
43
|
readonly "server.command": "command";
|
|
43
44
|
readonly "server.skill": "skill";
|
|
44
45
|
readonly "server.event": "event";
|
|
45
46
|
readonly "server.pty": "pty";
|
|
46
47
|
readonly "server.shell": "shell";
|
|
47
|
-
readonly "server.question": "question";
|
|
48
48
|
readonly "server.reference": "reference";
|
|
49
49
|
readonly "server.project": "project";
|
|
50
50
|
readonly "server.projectCopy": "projectCopy";
|
|
@@ -65,7 +65,7 @@ export declare const endpointNames: {
|
|
|
65
65
|
readonly "permission.request.list": "listRequests";
|
|
66
66
|
readonly "permission.saved.list": "listSaved";
|
|
67
67
|
readonly "permission.saved.remove": "removeSaved";
|
|
68
|
-
readonly "
|
|
68
|
+
readonly "form.request.list": "listRequests";
|
|
69
69
|
};
|
|
70
70
|
export declare const promiseOmitEndpoints: Set<string>;
|
|
71
71
|
export declare const effectOmitEndpoints: Set<string>;
|
package/dist/client.js
CHANGED
|
@@ -7,6 +7,9 @@ class SessionLocationMiddleware extends HttpApiMiddleware.Service()("@opencode-a
|
|
|
7
7
|
}
|
|
8
8
|
export const ClientApi = makeDefaultApi({
|
|
9
9
|
locationMiddleware: LocationMiddleware,
|
|
10
|
+
// The real server uses a form-specific middleware with an undocumented `global` sentinel branch.
|
|
11
|
+
// The generated client only needs a middleware identity for API typing.
|
|
12
|
+
formLocationMiddleware: SessionLocationMiddleware,
|
|
10
13
|
sessionLocationMiddleware: SessionLocationMiddleware,
|
|
11
14
|
});
|
|
12
15
|
export const groupNames = {
|
|
@@ -22,13 +25,13 @@ export const groupNames = {
|
|
|
22
25
|
"server.integration": "integration",
|
|
23
26
|
"server.credential": "credential",
|
|
24
27
|
"server.permission": "permission",
|
|
28
|
+
"server.form": "form",
|
|
25
29
|
"server.fs": "file",
|
|
26
30
|
"server.command": "command",
|
|
27
31
|
"server.skill": "skill",
|
|
28
32
|
"server.event": "event",
|
|
29
33
|
"server.pty": "pty",
|
|
30
34
|
"server.shell": "shell",
|
|
31
|
-
"server.question": "question",
|
|
32
35
|
"server.reference": "reference",
|
|
33
36
|
"server.project": "project",
|
|
34
37
|
"server.projectCopy": "projectCopy",
|
|
@@ -49,7 +52,7 @@ export const endpointNames = {
|
|
|
49
52
|
"permission.request.list": "listRequests",
|
|
50
53
|
"permission.saved.list": "listSaved",
|
|
51
54
|
"permission.saved.remove": "removeSaved",
|
|
52
|
-
"
|
|
55
|
+
"form.request.list": "listRequests",
|
|
53
56
|
};
|
|
54
57
|
export const promiseOmitEndpoints = new Set(["pty.connect", "pty.connectToken"]);
|
|
55
58
|
export const effectOmitEndpoints = new Set(["fs.read", "pty.connect", "pty.connectToken"]);
|
package/dist/errors.d.ts
CHANGED
|
@@ -83,11 +83,23 @@ declare const PermissionNotFoundError_base: Schema.Class<PermissionNotFoundError
|
|
|
83
83
|
}>, import("effect/Cause").YieldableError>;
|
|
84
84
|
export declare class PermissionNotFoundError extends PermissionNotFoundError_base {
|
|
85
85
|
}
|
|
86
|
-
declare const
|
|
87
|
-
readonly
|
|
86
|
+
declare const FormNotFoundError_base: Schema.Class<FormNotFoundError, Schema.TaggedStruct<"FormNotFoundError", {
|
|
87
|
+
readonly id: Schema.String;
|
|
88
|
+
readonly message: Schema.String;
|
|
89
|
+
}>, import("effect/Cause").YieldableError>;
|
|
90
|
+
export declare class FormNotFoundError extends FormNotFoundError_base {
|
|
91
|
+
}
|
|
92
|
+
declare const FormAlreadySettledError_base: Schema.Class<FormAlreadySettledError, Schema.TaggedStruct<"FormAlreadySettledError", {
|
|
93
|
+
readonly id: Schema.String;
|
|
94
|
+
readonly message: Schema.String;
|
|
95
|
+
}>, import("effect/Cause").YieldableError>;
|
|
96
|
+
export declare class FormAlreadySettledError extends FormAlreadySettledError_base {
|
|
97
|
+
}
|
|
98
|
+
declare const FormInvalidAnswerError_base: Schema.Class<FormInvalidAnswerError, Schema.TaggedStruct<"FormInvalidAnswerError", {
|
|
99
|
+
readonly id: Schema.String;
|
|
88
100
|
readonly message: Schema.String;
|
|
89
101
|
}>, import("effect/Cause").YieldableError>;
|
|
90
|
-
export declare class
|
|
102
|
+
export declare class FormInvalidAnswerError extends FormInvalidAnswerError_base {
|
|
91
103
|
}
|
|
92
104
|
declare const ForbiddenError_base: Schema.Class<ForbiddenError, Schema.TaggedStruct<"ForbiddenError", {
|
|
93
105
|
readonly message: Schema.String;
|
package/dist/errors.js
CHANGED
|
@@ -65,11 +65,21 @@ export class PermissionNotFoundError extends Schema.TaggedErrorClass()("Permissi
|
|
|
65
65
|
message: Schema.String,
|
|
66
66
|
}, { httpApiStatus: 404 }) {
|
|
67
67
|
}
|
|
68
|
-
export class
|
|
69
|
-
|
|
68
|
+
export class FormNotFoundError extends Schema.TaggedErrorClass()("FormNotFoundError", {
|
|
69
|
+
id: Schema.String,
|
|
70
70
|
message: Schema.String,
|
|
71
71
|
}, { httpApiStatus: 404 }) {
|
|
72
72
|
}
|
|
73
|
+
export class FormAlreadySettledError extends Schema.TaggedErrorClass()("FormAlreadySettledError", {
|
|
74
|
+
id: Schema.String,
|
|
75
|
+
message: Schema.String,
|
|
76
|
+
}, { httpApiStatus: 409 }) {
|
|
77
|
+
}
|
|
78
|
+
export class FormInvalidAnswerError extends Schema.TaggedErrorClass()("FormInvalidAnswerError", {
|
|
79
|
+
id: Schema.String,
|
|
80
|
+
message: Schema.String,
|
|
81
|
+
}, { httpApiStatus: 400 }) {
|
|
82
|
+
}
|
|
73
83
|
export class ForbiddenError extends Schema.TaggedErrorClass()("ForbiddenError", { message: Schema.String }, { httpApiStatus: 403 }) {
|
|
74
84
|
}
|
|
75
85
|
export class PtyNotFoundError extends Schema.TaggedErrorClass()("PtyNotFoundError", {
|