@opencode-ai/protocol 0.0.0-next-14744 → 0.0.0-next-14759
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 +8 -11
- package/dist/api.js +5 -5
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -5
- package/dist/errors.d.ts +3 -15
- package/dist/errors.js +2 -12
- package/dist/groups/event.d.ts +7625 -5011
- package/dist/groups/question.d.ts +92 -0
- package/dist/groups/question.js +56 -0
- package/package.json +2 -2
- package/dist/groups/form.d.ts +0 -823
- package/dist/groups/form.js +0 -110
package/dist/api.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ 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";
|
|
12
11
|
import { CommandGroup } from "./groups/command.js";
|
|
13
12
|
import { SkillGroup } from "./groups/skill.js";
|
|
14
13
|
import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
@@ -18,6 +17,7 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
18
17
|
import { HealthGroup } from "./groups/health.js";
|
|
19
18
|
import { PtyGroup } from "./groups/pty.js";
|
|
20
19
|
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,20 +28,17 @@ 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
|
|
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;
|
|
31
|
+
type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>> | ReturnType<typeof makeQuestionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
|
|
32
|
+
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = typeof HealthGroup | LocationGroups<LocationId> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
|
|
34
33
|
type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
|
|
35
|
-
export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService,
|
|
36
|
-
export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService,
|
|
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: {
|
|
37
36
|
readonly definitions: Definitions;
|
|
38
37
|
readonly locationMiddleware: Context.Key<LocationId, LocationService>;
|
|
39
|
-
readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
|
|
40
38
|
readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
|
|
41
|
-
}) => Api<LocationId, LocationService,
|
|
42
|
-
export declare const makeDefaultApi: <LocationId extends HttpApiMiddleware.AnyId, LocationService,
|
|
39
|
+
}) => Api<LocationId, LocationService, SessionLocationId, SessionLocationService, EventGroupFor<Definitions>>;
|
|
40
|
+
export declare const makeDefaultApi: <LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
|
43
41
|
readonly locationMiddleware: Context.Key<LocationId, LocationService>;
|
|
44
|
-
readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
|
|
45
42
|
readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
|
|
46
|
-
}) => Api<LocationId, LocationService,
|
|
43
|
+
}) => Api<LocationId, LocationService, SessionLocationId, SessionLocationService, typeof EventGroup>;
|
|
47
44
|
export {};
|
package/dist/api.js
CHANGED
|
@@ -8,7 +8,6 @@ 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";
|
|
12
11
|
import { CommandGroup } from "./groups/command.js";
|
|
13
12
|
import { SkillGroup } from "./groups/skill.js";
|
|
14
13
|
import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
@@ -17,6 +16,7 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
17
16
|
import { HealthGroup } from "./groups/health.js";
|
|
18
17
|
import { PtyGroup } from "./groups/pty.js";
|
|
19
18
|
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,
|
|
29
|
+
const makeApiFromGroup = (eventGroup, locationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
|
|
30
30
|
.add(HealthGroup)
|
|
31
31
|
.add(LocationGroup.middleware(locationMiddleware))
|
|
32
32
|
.add(AgentGroup.middleware(locationMiddleware))
|
|
@@ -40,7 +40,6 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
|
|
|
40
40
|
.add(McpGroup.middleware(locationMiddleware))
|
|
41
41
|
.add(CredentialGroup.middleware(locationMiddleware))
|
|
42
42
|
.add(ProjectGroup.middleware(locationMiddleware))
|
|
43
|
-
.add(makeFormGroup(locationMiddleware, formLocationMiddleware))
|
|
44
43
|
.add(makePermissionGroup(locationMiddleware, sessionLocationMiddleware))
|
|
45
44
|
.add(FileSystemGroup.middleware(locationMiddleware))
|
|
46
45
|
.add(CommandGroup.middleware(locationMiddleware))
|
|
@@ -48,6 +47,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
|
|
|
48
47
|
.add(eventGroup)
|
|
49
48
|
.add(PtyGroup.middleware(locationMiddleware))
|
|
50
49
|
.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, formLocationMiddleware
|
|
|
57
57
|
}))
|
|
58
58
|
.middleware(Authorization)
|
|
59
59
|
.middleware(SchemaErrorMiddleware);
|
|
60
|
-
export const makeApi = (options) => makeApiFromGroup(makeEventGroup(options.definitions), options.locationMiddleware, options.
|
|
61
|
-
export const makeDefaultApi = (options) => makeApiFromGroup(EventGroup, options.locationMiddleware, options.
|
|
60
|
+
export const makeApi = (options) => makeApiFromGroup(makeEventGroup(options.definitions), options.locationMiddleware, options.sessionLocationMiddleware);
|
|
61
|
+
export const makeDefaultApi = (options) => makeApiFromGroup(EventGroup, options.locationMiddleware, 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>,
|
|
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>;
|
|
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";
|
|
42
41
|
readonly "server.fs": "file";
|
|
43
42
|
readonly "server.command": "command";
|
|
44
43
|
readonly "server.skill": "skill";
|
|
45
44
|
readonly "server.event": "event";
|
|
46
45
|
readonly "server.pty": "pty";
|
|
47
46
|
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 "question.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,9 +7,6 @@ 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,
|
|
13
10
|
sessionLocationMiddleware: SessionLocationMiddleware,
|
|
14
11
|
});
|
|
15
12
|
export const groupNames = {
|
|
@@ -25,13 +22,13 @@ export const groupNames = {
|
|
|
25
22
|
"server.integration": "integration",
|
|
26
23
|
"server.credential": "credential",
|
|
27
24
|
"server.permission": "permission",
|
|
28
|
-
"server.form": "form",
|
|
29
25
|
"server.fs": "file",
|
|
30
26
|
"server.command": "command",
|
|
31
27
|
"server.skill": "skill",
|
|
32
28
|
"server.event": "event",
|
|
33
29
|
"server.pty": "pty",
|
|
34
30
|
"server.shell": "shell",
|
|
31
|
+
"server.question": "question",
|
|
35
32
|
"server.reference": "reference",
|
|
36
33
|
"server.project": "project",
|
|
37
34
|
"server.projectCopy": "projectCopy",
|
|
@@ -52,7 +49,7 @@ export const endpointNames = {
|
|
|
52
49
|
"permission.request.list": "listRequests",
|
|
53
50
|
"permission.saved.list": "listSaved",
|
|
54
51
|
"permission.saved.remove": "removeSaved",
|
|
55
|
-
"
|
|
52
|
+
"question.request.list": "listRequests",
|
|
56
53
|
};
|
|
57
54
|
export const promiseOmitEndpoints = new Set(["pty.connect", "pty.connectToken"]);
|
|
58
55
|
export const effectOmitEndpoints = new Set(["fs.read", "pty.connect", "pty.connectToken"]);
|
package/dist/errors.d.ts
CHANGED
|
@@ -83,23 +83,11 @@ 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
|
|
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;
|
|
86
|
+
declare const QuestionNotFoundError_base: Schema.Class<QuestionNotFoundError, Schema.TaggedStruct<"QuestionNotFoundError", {
|
|
87
|
+
readonly requestID: Schema.String;
|
|
100
88
|
readonly message: Schema.String;
|
|
101
89
|
}>, import("effect/Cause").YieldableError>;
|
|
102
|
-
export declare class
|
|
90
|
+
export declare class QuestionNotFoundError extends QuestionNotFoundError_base {
|
|
103
91
|
}
|
|
104
92
|
declare const ForbiddenError_base: Schema.Class<ForbiddenError, Schema.TaggedStruct<"ForbiddenError", {
|
|
105
93
|
readonly message: Schema.String;
|
package/dist/errors.js
CHANGED
|
@@ -65,21 +65,11 @@ 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 QuestionNotFoundError extends Schema.TaggedErrorClass()("QuestionNotFoundError", {
|
|
69
|
+
requestID: 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
|
-
}
|
|
83
73
|
export class ForbiddenError extends Schema.TaggedErrorClass()("ForbiddenError", { message: Schema.String }, { httpApiStatus: 403 }) {
|
|
84
74
|
}
|
|
85
75
|
export class PtyNotFoundError extends Schema.TaggedErrorClass()("PtyNotFoundError", {
|