@opencode-ai/protocol 0.0.0-next-14854 → 0.0.0-reserved.0

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.
Files changed (63) hide show
  1. package/README.md +3 -0
  2. package/index.js +1 -0
  3. package/package.json +3 -23
  4. package/dist/api.d.ts +0 -49
  5. package/dist/api.js +0 -65
  6. package/dist/client.d.ts +0 -75
  7. package/dist/client.js +0 -61
  8. package/dist/errors.d.ts +0 -127
  9. package/dist/errors.js +0 -99
  10. package/dist/groups/agent.d.ts +0 -95
  11. package/dist/groups/agent.js +0 -15
  12. package/dist/groups/command.d.ts +0 -51
  13. package/dist/groups/command.js +0 -20
  14. package/dist/groups/credential.d.ts +0 -23
  15. package/dist/groups/credential.js +0 -28
  16. package/dist/groups/event.d.ts +0 -17224
  17. package/dist/groups/event.js +0 -49
  18. package/dist/groups/form.d.ts +0 -789
  19. package/dist/groups/form.js +0 -99
  20. package/dist/groups/fs.d.ts +0 -35
  21. package/dist/groups/fs.js +0 -51
  22. package/dist/groups/generate.d.ts +0 -32
  23. package/dist/groups/generate.js +0 -27
  24. package/dist/groups/health.d.ts +0 -5
  25. package/dist/groups/health.js +0 -9
  26. package/dist/groups/integration.d.ts +0 -105
  27. package/dist/groups/integration.js +0 -98
  28. package/dist/groups/location.d.ts +0 -16
  29. package/dist/groups/location.js +0 -32
  30. package/dist/groups/mcp.d.ts +0 -30
  31. package/dist/groups/mcp.js +0 -17
  32. package/dist/groups/message.d.ts +0 -446
  33. package/dist/groups/message.js +0 -42
  34. package/dist/groups/model.d.ts +0 -312
  35. package/dist/groups/model.js +0 -33
  36. package/dist/groups/permission.d.ts +0 -153
  37. package/dist/groups/permission.js +0 -99
  38. package/dist/groups/plugin.d.ts +0 -14
  39. package/dist/groups/plugin.js +0 -20
  40. package/dist/groups/project-copy.d.ts +0 -49
  41. package/dist/groups/project-copy.js +0 -44
  42. package/dist/groups/project.d.ts +0 -24
  43. package/dist/groups/project.js +0 -30
  44. package/dist/groups/provider.d.ts +0 -164
  45. package/dist/groups/provider.js +0 -34
  46. package/dist/groups/pty.d.ts +0 -145
  47. package/dist/groups/pty.js +0 -111
  48. package/dist/groups/question.d.ts +0 -92
  49. package/dist/groups/question.js +0 -56
  50. package/dist/groups/reference.d.ts +0 -13
  51. package/dist/groups/reference.js +0 -20
  52. package/dist/groups/session.d.ts +0 -5457
  53. package/dist/groups/session.js +0 -423
  54. package/dist/groups/shell.d.ts +0 -120
  55. package/dist/groups/shell.js +0 -65
  56. package/dist/groups/skill.d.ts +0 -19
  57. package/dist/groups/skill.js +0 -20
  58. package/dist/groups/vcs.d.ts +0 -33
  59. package/dist/groups/vcs.js +0 -37
  60. package/dist/middleware/authorization.d.ts +0 -13
  61. package/dist/middleware/authorization.js +0 -6
  62. package/dist/middleware/schema-error.d.ts +0 -13
  63. package/dist/middleware/schema-error.js +0 -4
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @opencode-ai/protocol
2
+
3
+ Reserved package name for opencode protocol.
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/package.json",
3
2
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-14854",
3
+ "version": "0.0.0-reserved.0",
4
+ "description": "Reserved package name for opencode protocol.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -12,27 +12,7 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "files": [
16
- "dist"
17
- ],
18
15
  "exports": {
19
- "./*": {
20
- "import": "./dist/*.js",
21
- "types": "./dist/*.d.ts"
22
- }
23
- },
24
- "scripts": {
25
- "build": "bun run script/build.ts",
26
- "typecheck": "tsgo --noEmit"
27
- },
28
- "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-14854",
30
- "effect": "4.0.0-beta.83"
31
- },
32
- "devDependencies": {
33
- "@tsconfig/bun": "1.0.9",
34
- "@types/bun": "1.3.13",
35
- "@typescript/native-preview": "7.0.0-dev.20251207.1",
36
- "typescript": "5.8.2"
16
+ ".": "./index.js"
37
17
  }
38
18
  }
package/dist/api.d.ts DELETED
@@ -1,49 +0,0 @@
1
- import { Context } from "effect";
2
- import { HttpApi, HttpApiGroup, HttpApiMiddleware } from "effect/unstable/httpapi";
3
- import { SchemaErrorMiddleware } from "./middleware/schema-error.js";
4
- import { GenerateGroup } from "./groups/generate.js";
5
- import { MessageGroup } from "./groups/message.js";
6
- import { ModelGroup } from "./groups/model.js";
7
- import { ProviderGroup } from "./groups/provider.js";
8
- import { makeSessionGroup } from "./groups/session.js";
9
- import { makePermissionGroup } from "./groups/permission.js";
10
- import { FileSystemGroup } from "./groups/fs.js";
11
- import { makeFormGroup } from "./groups/form.js";
12
- import { CommandGroup } from "./groups/command.js";
13
- import { SkillGroup } from "./groups/skill.js";
14
- import { EventGroup, makeEventGroup } from "./groups/event.js";
15
- import type { Definition } from "@opencode-ai/schema/event";
16
- import { AgentGroup } from "./groups/agent.js";
17
- import { PluginGroup } from "./groups/plugin.js";
18
- import { HealthGroup } from "./groups/health.js";
19
- import { PtyGroup } from "./groups/pty.js";
20
- import { ShellGroup } from "./groups/shell.js";
21
- import { makeQuestionGroup } from "./groups/question.js";
22
- import { ReferenceGroup } from "./groups/reference.js";
23
- import { Authorization } from "./middleware/authorization.js";
24
- import { LocationGroup } from "./groups/location.js";
25
- import { IntegrationGroup } from "./groups/integration.js";
26
- import { McpGroup } from "./groups/mcp.js";
27
- import { CredentialGroup } from "./groups/credential.js";
28
- import { ProjectGroup } from "./groups/project.js";
29
- import { ProjectCopyGroup } from "./groups/project-copy.js";
30
- import { VcsGroup } from "./groups/vcs.js";
31
- 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> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId>;
32
- type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | HttpApiGroup.AddMiddleware<typeof MessageGroup, SessionLocationId>;
33
- type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
34
- 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>>;
35
- 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;
36
- type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
37
- 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>>;
38
- 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: {
39
- readonly definitions: Definitions;
40
- readonly locationMiddleware: Context.Key<LocationId, LocationService>;
41
- readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
42
- readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
43
- }) => Api<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, EventGroupFor<Definitions>>;
44
- export declare const makeDefaultApi: <LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
45
- readonly locationMiddleware: Context.Key<LocationId, LocationService>;
46
- readonly formLocationMiddleware: Context.Key<FormLocationId, FormLocationService>;
47
- readonly sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>;
48
- }) => Api<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, typeof EventGroup>;
49
- export {};
package/dist/api.js DELETED
@@ -1,65 +0,0 @@
1
- import { Context } from "effect";
2
- import { HttpApi, HttpApiGroup, HttpApiMiddleware, OpenApi } from "effect/unstable/httpapi";
3
- import { SchemaErrorMiddleware } from "./middleware/schema-error.js";
4
- import { GenerateGroup } from "./groups/generate.js";
5
- import { MessageGroup } from "./groups/message.js";
6
- import { ModelGroup } from "./groups/model.js";
7
- import { ProviderGroup } from "./groups/provider.js";
8
- import { makeSessionGroup } from "./groups/session.js";
9
- import { makePermissionGroup } from "./groups/permission.js";
10
- import { FileSystemGroup } from "./groups/fs.js";
11
- import { makeFormGroup } from "./groups/form.js";
12
- import { CommandGroup } from "./groups/command.js";
13
- import { SkillGroup } from "./groups/skill.js";
14
- import { EventGroup, makeEventGroup } from "./groups/event.js";
15
- import { AgentGroup } from "./groups/agent.js";
16
- import { PluginGroup } from "./groups/plugin.js";
17
- import { HealthGroup } from "./groups/health.js";
18
- import { PtyGroup } from "./groups/pty.js";
19
- import { ShellGroup } from "./groups/shell.js";
20
- import { makeQuestionGroup } from "./groups/question.js";
21
- import { ReferenceGroup } from "./groups/reference.js";
22
- import { Authorization } from "./middleware/authorization.js";
23
- import { LocationGroup } from "./groups/location.js";
24
- import { IntegrationGroup } from "./groups/integration.js";
25
- import { McpGroup } from "./groups/mcp.js";
26
- import { CredentialGroup } from "./groups/credential.js";
27
- import { ProjectGroup } from "./groups/project.js";
28
- import { ProjectCopyGroup } from "./groups/project-copy.js";
29
- import { VcsGroup } from "./groups/vcs.js";
30
- // Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
31
- const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
32
- .add(HealthGroup)
33
- .add(LocationGroup.middleware(locationMiddleware))
34
- .add(AgentGroup.middleware(locationMiddleware))
35
- .add(PluginGroup.middleware(locationMiddleware))
36
- .add(makeSessionGroup(sessionLocationMiddleware))
37
- .add(MessageGroup.middleware(sessionLocationMiddleware))
38
- .add(ModelGroup.middleware(locationMiddleware))
39
- .add(GenerateGroup.middleware(locationMiddleware))
40
- .add(ProviderGroup.middleware(locationMiddleware))
41
- .add(IntegrationGroup.middleware(locationMiddleware))
42
- .add(McpGroup.middleware(locationMiddleware))
43
- .add(CredentialGroup.middleware(locationMiddleware))
44
- .add(ProjectGroup.middleware(locationMiddleware))
45
- .add(makeFormGroup(locationMiddleware, formLocationMiddleware))
46
- .add(makePermissionGroup(locationMiddleware, sessionLocationMiddleware))
47
- .add(FileSystemGroup.middleware(locationMiddleware))
48
- .add(CommandGroup.middleware(locationMiddleware))
49
- .add(SkillGroup.middleware(locationMiddleware))
50
- .add(eventGroup)
51
- .add(PtyGroup.middleware(locationMiddleware))
52
- .add(ShellGroup.middleware(locationMiddleware))
53
- .add(makeQuestionGroup(locationMiddleware, sessionLocationMiddleware))
54
- .add(ReferenceGroup.middleware(locationMiddleware))
55
- .add(ProjectCopyGroup.middleware(locationMiddleware))
56
- .add(VcsGroup.middleware(locationMiddleware))
57
- .annotateMerge(OpenApi.annotations({
58
- title: "opencode HttpApi",
59
- version: "0.0.1",
60
- description: "Experimental HttpApi surface for selected instance routes.",
61
- }))
62
- .middleware(Authorization)
63
- .middleware(SchemaErrorMiddleware);
64
- export const makeApi = (options) => makeApiFromGroup(makeEventGroup(options.definitions), options.locationMiddleware, options.formLocationMiddleware, options.sessionLocationMiddleware);
65
- export const makeDefaultApi = (options) => makeApiFromGroup(EventGroup, options.locationMiddleware, options.formLocationMiddleware, options.sessionLocationMiddleware);
package/dist/client.d.ts DELETED
@@ -1,75 +0,0 @@
1
- import { InvalidRequestError, SessionNotFoundError } from "./errors.js";
2
- import type { Api } from "./api.js";
3
- import type { Context } from "effect";
4
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
5
- import type { EventGroup } from "./groups/event.js";
6
- declare const LocationMiddleware_base: HttpApiMiddleware.ServiceClass<LocationMiddleware, "@opencode-ai/client/LocationMiddleware", {
7
- requires: never;
8
- provides: never;
9
- error: never;
10
- clientError: never;
11
- requiredForClient: false;
12
- security: never;
13
- }, HttpApiMiddleware.HttpApiMiddleware<never, never, never>>;
14
- declare class LocationMiddleware extends LocationMiddleware_base {
15
- }
16
- declare const SessionLocationMiddleware_base: HttpApiMiddleware.ServiceClass<SessionLocationMiddleware, "@opencode-ai/client/SessionLocationMiddleware", {
17
- requires: never;
18
- provides: never;
19
- error: readonly [typeof InvalidRequestError, typeof SessionNotFoundError];
20
- clientError: never;
21
- requiredForClient: false;
22
- security: never;
23
- }, HttpApiMiddleware.HttpApiMiddleware<never, readonly [typeof InvalidRequestError, typeof SessionNotFoundError], never>>;
24
- declare class SessionLocationMiddleware extends SessionLocationMiddleware_base {
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>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, typeof EventGroup>;
27
- export declare const ClientApi: ClientApiShape;
28
- export declare const groupNames: {
29
- readonly "server.health": "health";
30
- readonly "server.location": "location";
31
- readonly "server.agent": "agent";
32
- readonly "server.plugin": "plugin";
33
- readonly "server.session": "session";
34
- readonly "server.message": "message";
35
- readonly "server.model": "model";
36
- readonly "server.generate": "generate";
37
- readonly "server.provider": "provider";
38
- readonly "server.integration": "integration";
39
- readonly "server.credential": "credential";
40
- readonly "server.form": "form";
41
- readonly "server.permission": "permission";
42
- readonly "server.fs": "file";
43
- readonly "server.command": "command";
44
- readonly "server.skill": "skill";
45
- readonly "server.event": "event";
46
- readonly "server.pty": "pty";
47
- readonly "server.shell": "shell";
48
- readonly "server.question": "question";
49
- readonly "server.reference": "reference";
50
- readonly "server.project": "project";
51
- readonly "server.projectCopy": "projectCopy";
52
- readonly "server.vcs": "vcs";
53
- };
54
- export declare const endpointNames: {
55
- readonly "session.messages": "list";
56
- readonly "integration.connect.key": "connectKey";
57
- readonly "integration.connect.oauth": "connectOauth";
58
- readonly "integration.attempt.status": "attemptStatus";
59
- readonly "integration.attempt.complete": "attemptComplete";
60
- readonly "integration.attempt.cancel": "attemptCancel";
61
- readonly "session.context.entry.list": "listContextEntries";
62
- readonly "session.context.entry.put": "putContextEntry";
63
- readonly "session.context.entry.remove": "removeContextEntry";
64
- readonly "session.revert.stage": "revertStage";
65
- readonly "session.revert.clear": "revertClear";
66
- readonly "session.revert.commit": "revertCommit";
67
- readonly "permission.request.list": "listRequests";
68
- readonly "permission.saved.list": "listSaved";
69
- readonly "permission.saved.remove": "removeSaved";
70
- readonly "form.request.list": "listRequests";
71
- readonly "question.request.list": "listRequests";
72
- };
73
- export declare const promiseOmitEndpoints: Set<string>;
74
- export declare const effectOmitEndpoints: Set<string>;
75
- export {};
package/dist/client.js DELETED
@@ -1,61 +0,0 @@
1
- import { InvalidRequestError, SessionNotFoundError } from "./errors.js";
2
- import { makeDefaultApi } from "./api.js";
3
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
4
- class LocationMiddleware extends HttpApiMiddleware.Service()("@opencode-ai/client/LocationMiddleware") {
5
- }
6
- class SessionLocationMiddleware extends HttpApiMiddleware.Service()("@opencode-ai/client/SessionLocationMiddleware", { error: [InvalidRequestError, SessionNotFoundError] }) {
7
- }
8
- export const ClientApi = makeDefaultApi({
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
- sessionLocationMiddleware: SessionLocationMiddleware,
14
- });
15
- export const groupNames = {
16
- "server.health": "health",
17
- "server.location": "location",
18
- "server.agent": "agent",
19
- "server.plugin": "plugin",
20
- "server.session": "session",
21
- "server.message": "message",
22
- "server.model": "model",
23
- "server.generate": "generate",
24
- "server.provider": "provider",
25
- "server.integration": "integration",
26
- "server.credential": "credential",
27
- "server.form": "form",
28
- "server.permission": "permission",
29
- "server.fs": "file",
30
- "server.command": "command",
31
- "server.skill": "skill",
32
- "server.event": "event",
33
- "server.pty": "pty",
34
- "server.shell": "shell",
35
- "server.question": "question",
36
- "server.reference": "reference",
37
- "server.project": "project",
38
- "server.projectCopy": "projectCopy",
39
- "server.vcs": "vcs",
40
- };
41
- export const endpointNames = {
42
- "session.messages": "list",
43
- "integration.connect.key": "connectKey",
44
- "integration.connect.oauth": "connectOauth",
45
- "integration.attempt.status": "attemptStatus",
46
- "integration.attempt.complete": "attemptComplete",
47
- "integration.attempt.cancel": "attemptCancel",
48
- "session.context.entry.list": "listContextEntries",
49
- "session.context.entry.put": "putContextEntry",
50
- "session.context.entry.remove": "removeContextEntry",
51
- "session.revert.stage": "revertStage",
52
- "session.revert.clear": "revertClear",
53
- "session.revert.commit": "revertCommit",
54
- "permission.request.list": "listRequests",
55
- "permission.saved.list": "listSaved",
56
- "permission.saved.remove": "removeSaved",
57
- "form.request.list": "listRequests",
58
- "question.request.list": "listRequests",
59
- };
60
- export const promiseOmitEndpoints = new Set(["pty.connect", "pty.connectToken"]);
61
- export const effectOmitEndpoints = new Set(["fs.read", "pty.connect", "pty.connectToken"]);
package/dist/errors.d.ts DELETED
@@ -1,127 +0,0 @@
1
- import { Schema } from "effect";
2
- declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema.TaggedStruct<"InvalidRequestError", {
3
- readonly message: Schema.String;
4
- readonly kind: Schema.optional<Schema.String>;
5
- readonly field: Schema.optional<Schema.String>;
6
- }>, import("effect/Cause").YieldableError>;
7
- export declare class InvalidRequestError extends InvalidRequestError_base {
8
- }
9
- declare const UnauthorizedError_base: Schema.Class<UnauthorizedError, Schema.TaggedStruct<"UnauthorizedError", {
10
- readonly message: Schema.String;
11
- }>, import("effect/Cause").YieldableError>;
12
- export declare class UnauthorizedError extends UnauthorizedError_base {
13
- }
14
- declare const ConflictError_base: Schema.Class<ConflictError, Schema.TaggedStruct<"ConflictError", {
15
- readonly message: Schema.String;
16
- readonly resource: Schema.optional<Schema.String>;
17
- }>, import("effect/Cause").YieldableError>;
18
- export declare class ConflictError extends ConflictError_base {
19
- }
20
- declare const SessionBusyError_base: Schema.Class<SessionBusyError, Schema.TaggedStruct<"SessionBusyError", {
21
- readonly sessionID: Schema.String;
22
- readonly message: Schema.String;
23
- }>, import("effect/Cause").YieldableError>;
24
- export declare class SessionBusyError extends SessionBusyError_base {
25
- }
26
- declare const ServiceUnavailableError_base: Schema.Class<ServiceUnavailableError, Schema.TaggedStruct<"ServiceUnavailableError", {
27
- readonly message: Schema.String;
28
- readonly service: Schema.optional<Schema.String>;
29
- }>, import("effect/Cause").YieldableError>;
30
- export declare class ServiceUnavailableError extends ServiceUnavailableError_base {
31
- }
32
- declare const UnknownError_base: Schema.Class<UnknownError, Schema.TaggedStruct<"UnknownError", {
33
- readonly message: Schema.String;
34
- readonly ref: Schema.optional<Schema.String>;
35
- }>, import("effect/Cause").YieldableError>;
36
- export declare class UnknownError extends UnknownError_base {
37
- }
38
- declare const ProviderNotFoundError_base: Schema.Class<ProviderNotFoundError, Schema.TaggedStruct<"ProviderNotFoundError", {
39
- readonly providerID: Schema.String;
40
- readonly message: Schema.String;
41
- }>, import("effect/Cause").YieldableError>;
42
- export declare class ProviderNotFoundError extends ProviderNotFoundError_base {
43
- }
44
- declare const SessionNotFoundError_base: Schema.Class<SessionNotFoundError, Schema.TaggedStruct<"SessionNotFoundError", {
45
- readonly sessionID: Schema.String;
46
- readonly message: Schema.String;
47
- }>, import("effect/Cause").YieldableError>;
48
- export declare class SessionNotFoundError extends SessionNotFoundError_base {
49
- }
50
- declare const MessageNotFoundError_base: Schema.Class<MessageNotFoundError, Schema.TaggedStruct<"MessageNotFoundError", {
51
- readonly sessionID: Schema.String;
52
- readonly messageID: Schema.String;
53
- readonly message: Schema.String;
54
- }>, import("effect/Cause").YieldableError>;
55
- export declare class MessageNotFoundError extends MessageNotFoundError_base {
56
- }
57
- declare const SkillNotFoundError_base: Schema.Class<SkillNotFoundError, Schema.TaggedStruct<"SkillNotFoundError", {
58
- readonly skill: Schema.String;
59
- readonly message: Schema.String;
60
- }>, import("effect/Cause").YieldableError>;
61
- export declare class SkillNotFoundError extends SkillNotFoundError_base {
62
- }
63
- declare const CommandNotFoundError_base: Schema.Class<CommandNotFoundError, Schema.TaggedStruct<"CommandNotFoundError", {
64
- readonly command: Schema.String;
65
- readonly message: Schema.String;
66
- }>, import("effect/Cause").YieldableError>;
67
- export declare class CommandNotFoundError extends CommandNotFoundError_base {
68
- }
69
- declare const CommandEvaluationError_base: Schema.Class<CommandEvaluationError, Schema.TaggedStruct<"CommandEvaluationError", {
70
- readonly command: Schema.String;
71
- readonly message: Schema.String;
72
- }>, import("effect/Cause").YieldableError>;
73
- export declare class CommandEvaluationError extends CommandEvaluationError_base {
74
- }
75
- declare const InvalidCursorError_base: Schema.Class<InvalidCursorError, Schema.TaggedStruct<"InvalidCursorError", {
76
- readonly message: Schema.String;
77
- }>, import("effect/Cause").YieldableError>;
78
- export declare class InvalidCursorError extends InvalidCursorError_base {
79
- }
80
- declare const PermissionNotFoundError_base: Schema.Class<PermissionNotFoundError, Schema.TaggedStruct<"PermissionNotFoundError", {
81
- readonly requestID: Schema.String;
82
- readonly message: Schema.String;
83
- }>, import("effect/Cause").YieldableError>;
84
- export declare class PermissionNotFoundError extends PermissionNotFoundError_base {
85
- }
86
- declare const QuestionNotFoundError_base: Schema.Class<QuestionNotFoundError, Schema.TaggedStruct<"QuestionNotFoundError", {
87
- readonly requestID: Schema.String;
88
- readonly message: Schema.String;
89
- }>, import("effect/Cause").YieldableError>;
90
- export declare class QuestionNotFoundError extends QuestionNotFoundError_base {
91
- }
92
- declare const FormNotFoundError_base: Schema.Class<FormNotFoundError, Schema.TaggedStruct<"FormNotFoundError", {
93
- readonly id: Schema.String;
94
- readonly message: Schema.String;
95
- }>, import("effect/Cause").YieldableError>;
96
- export declare class FormNotFoundError extends FormNotFoundError_base {
97
- }
98
- declare const FormAlreadySettledError_base: Schema.Class<FormAlreadySettledError, Schema.TaggedStruct<"FormAlreadySettledError", {
99
- readonly id: Schema.String;
100
- readonly message: Schema.String;
101
- }>, import("effect/Cause").YieldableError>;
102
- export declare class FormAlreadySettledError extends FormAlreadySettledError_base {
103
- }
104
- declare const FormInvalidAnswerError_base: Schema.Class<FormInvalidAnswerError, Schema.TaggedStruct<"FormInvalidAnswerError", {
105
- readonly id: Schema.String;
106
- readonly message: Schema.String;
107
- }>, import("effect/Cause").YieldableError>;
108
- export declare class FormInvalidAnswerError extends FormInvalidAnswerError_base {
109
- }
110
- declare const ForbiddenError_base: Schema.Class<ForbiddenError, Schema.TaggedStruct<"ForbiddenError", {
111
- readonly message: Schema.String;
112
- }>, import("effect/Cause").YieldableError>;
113
- export declare class ForbiddenError extends ForbiddenError_base {
114
- }
115
- declare const PtyNotFoundError_base: Schema.Class<PtyNotFoundError, Schema.TaggedStruct<"PtyNotFoundError", {
116
- readonly ptyID: Schema.String;
117
- readonly message: Schema.String;
118
- }>, import("effect/Cause").YieldableError>;
119
- export declare class PtyNotFoundError extends PtyNotFoundError_base {
120
- }
121
- declare const ShellNotFoundError_base: Schema.Class<ShellNotFoundError, Schema.TaggedStruct<"ShellNotFoundError", {
122
- readonly id: Schema.String;
123
- readonly message: Schema.String;
124
- }>, import("effect/Cause").YieldableError>;
125
- export declare class ShellNotFoundError extends ShellNotFoundError_base {
126
- }
127
- export {};
package/dist/errors.js DELETED
@@ -1,99 +0,0 @@
1
- import { Schema } from "effect";
2
- export class InvalidRequestError extends Schema.TaggedErrorClass()("InvalidRequestError", {
3
- message: Schema.String,
4
- kind: Schema.optional(Schema.String),
5
- field: Schema.optional(Schema.String),
6
- }, { httpApiStatus: 400 }) {
7
- }
8
- export class UnauthorizedError extends Schema.TaggedErrorClass()("UnauthorizedError", { message: Schema.String }, { httpApiStatus: 401 }) {
9
- }
10
- export class ConflictError extends Schema.TaggedErrorClass()("ConflictError", {
11
- message: Schema.String,
12
- resource: Schema.optional(Schema.String),
13
- }, { httpApiStatus: 409 }) {
14
- }
15
- export class SessionBusyError extends Schema.TaggedErrorClass()("SessionBusyError", {
16
- sessionID: Schema.String,
17
- message: Schema.String,
18
- }, { httpApiStatus: 409 }) {
19
- }
20
- export class ServiceUnavailableError extends Schema.TaggedErrorClass()("ServiceUnavailableError", {
21
- message: Schema.String,
22
- service: Schema.optional(Schema.String),
23
- }, { httpApiStatus: 503 }) {
24
- }
25
- export class UnknownError extends Schema.TaggedErrorClass()("UnknownError", {
26
- message: Schema.String,
27
- ref: Schema.optional(Schema.String),
28
- }, { httpApiStatus: 500 }) {
29
- }
30
- export class ProviderNotFoundError extends Schema.TaggedErrorClass()("ProviderNotFoundError", {
31
- providerID: Schema.String,
32
- message: Schema.String,
33
- }, { httpApiStatus: 404 }) {
34
- }
35
- export class SessionNotFoundError extends Schema.TaggedErrorClass()("SessionNotFoundError", {
36
- sessionID: Schema.String,
37
- message: Schema.String,
38
- }, { httpApiStatus: 404 }) {
39
- }
40
- export class MessageNotFoundError extends Schema.TaggedErrorClass()("MessageNotFoundError", {
41
- sessionID: Schema.String,
42
- messageID: Schema.String,
43
- message: Schema.String,
44
- }, { httpApiStatus: 404 }) {
45
- }
46
- export class SkillNotFoundError extends Schema.TaggedErrorClass()("SkillNotFoundError", {
47
- skill: Schema.String,
48
- message: Schema.String,
49
- }, { httpApiStatus: 404 }) {
50
- }
51
- export class CommandNotFoundError extends Schema.TaggedErrorClass()("CommandNotFoundError", {
52
- command: Schema.String,
53
- message: Schema.String,
54
- }, { httpApiStatus: 404 }) {
55
- }
56
- export class CommandEvaluationError extends Schema.TaggedErrorClass()("CommandEvaluationError", {
57
- command: Schema.String,
58
- message: Schema.String,
59
- }, { httpApiStatus: 500 }) {
60
- }
61
- export class InvalidCursorError extends Schema.TaggedErrorClass()("InvalidCursorError", { message: Schema.String }, { httpApiStatus: 400 }) {
62
- }
63
- export class PermissionNotFoundError extends Schema.TaggedErrorClass()("PermissionNotFoundError", {
64
- requestID: Schema.String,
65
- message: Schema.String,
66
- }, { httpApiStatus: 404 }) {
67
- }
68
- export class QuestionNotFoundError extends Schema.TaggedErrorClass()("QuestionNotFoundError", {
69
- requestID: Schema.String,
70
- message: Schema.String,
71
- }, { httpApiStatus: 404 }) {
72
- }
73
- export class FormNotFoundError extends Schema.TaggedErrorClass()("FormNotFoundError", {
74
- id: Schema.String,
75
- message: Schema.String,
76
- }, { httpApiStatus: 404 }) {
77
- }
78
- export class FormAlreadySettledError extends Schema.TaggedErrorClass()("FormAlreadySettledError", {
79
- id: Schema.String,
80
- message: Schema.String,
81
- }, { httpApiStatus: 409 }) {
82
- }
83
- export class FormInvalidAnswerError extends Schema.TaggedErrorClass()("FormInvalidAnswerError", {
84
- id: Schema.String,
85
- message: Schema.String,
86
- }, { httpApiStatus: 400 }) {
87
- }
88
- export class ForbiddenError extends Schema.TaggedErrorClass()("ForbiddenError", { message: Schema.String }, { httpApiStatus: 403 }) {
89
- }
90
- export class PtyNotFoundError extends Schema.TaggedErrorClass()("PtyNotFoundError", {
91
- ptyID: Schema.String,
92
- message: Schema.String,
93
- }, { httpApiStatus: 404 }) {
94
- }
95
- export class ShellNotFoundError extends Schema.TaggedErrorClass()("ShellNotFoundError", {
96
- id: Schema.String,
97
- message: Schema.String,
98
- }, { httpApiStatus: 404 }) {
99
- }
@@ -1,95 +0,0 @@
1
- import { Agent } from "@opencode-ai/schema/agent";
2
- import { Location } from "@opencode-ai/schema/location";
3
- import { Schema } from "effect";
4
- import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
- export declare const AgentGroup: HttpApiGroup.HttpApiGroup<"server.agent", HttpApiEndpoint.HttpApiEndpoint<"agent.list", "GET", "/api/agent", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
6
- readonly location: Schema.optional<Schema.Struct<{
7
- readonly directory: Schema.optional<Schema.String>;
8
- readonly workspace: Schema.optional<Schema.String>;
9
- }>>;
10
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
11
- readonly location: typeof Location.Info;
12
- readonly data: Schema.$Array<Schema.Struct<{
13
- readonly id: Schema.brand<Schema.String, "AgentV2.ID">;
14
- readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
15
- readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
16
- readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
17
- opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
18
- anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
19
- openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
20
- google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
21
- googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
22
- githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
23
- amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
24
- azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
25
- openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
26
- mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
27
- gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
28
- };
29
- readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
30
- }>>>, Schema.optionalKey<Schema.Struct<{
31
- readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
32
- readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
33
- opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
34
- anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
35
- openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
36
- google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
37
- googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
38
- githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
39
- amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
40
- azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
41
- openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
42
- mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
43
- gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
44
- };
45
- readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
46
- }>>, never, never>;
47
- readonly request: Schema.Struct<{
48
- readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
49
- readonly headers: Schema.$Record<Schema.String, Schema.String>;
50
- readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
51
- }>;
52
- readonly system: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
53
- readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
54
- readonly mode: Schema.Literals<readonly ["subagent", "primary", "all"]>;
55
- readonly hidden: Schema.Boolean;
56
- readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.String, Schema.Literals<readonly ["primary", "secondary", "accent", "success", "warning", "error", "info"]>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Literals<readonly ["primary", "secondary", "accent", "success", "warning", "error", "info"]>]>>, never, never>;
57
- readonly steps: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
58
- readonly permissions: Schema.$Array<Schema.Struct<{
59
- readonly action: Schema.String;
60
- readonly resource: Schema.String;
61
- readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
62
- }>>;
63
- }> & {
64
- empty: (id: Agent.ID) => {
65
- readonly id: string & import("effect/Brand").Brand<"AgentV2.ID">;
66
- readonly request: {
67
- readonly settings: {
68
- readonly [x: string]: unknown;
69
- };
70
- readonly headers: {
71
- readonly [x: string]: string;
72
- };
73
- readonly body: {
74
- readonly [x: string]: Schema.Json;
75
- };
76
- };
77
- readonly mode: "primary" | "subagent" | "all";
78
- readonly hidden: boolean;
79
- readonly permissions: readonly {
80
- readonly action: string;
81
- readonly resource: string;
82
- readonly effect: "allow" | "deny" | "ask";
83
- }[];
84
- readonly model?: {
85
- readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
86
- readonly providerID: string & import("effect/Brand").Brand<"ProviderV2.ID">;
87
- readonly variant?: (string & import("effect/Brand").Brand<"VariantID">) | undefined;
88
- } | undefined;
89
- readonly system?: string | undefined;
90
- readonly description?: string | undefined;
91
- readonly color?: string | undefined;
92
- readonly steps?: number | undefined;
93
- };
94
- }>;
95
- }>>, HttpApiEndpoint.Json<never>, never, never>, false>;
@@ -1,15 +0,0 @@
1
- import { Agent } from "@opencode-ai/schema/agent";
2
- import { Location } from "@opencode-ai/schema/location";
3
- import { Schema } from "effect";
4
- import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
- import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
- export const AgentGroup = HttpApiGroup.make("server.agent").add(HttpApiEndpoint.get("agent.list", "/api/agent", {
7
- query: LocationQuery,
8
- success: Location.response(Schema.Array(Agent.Info)),
9
- })
10
- .annotateMerge(locationQueryOpenApi)
11
- .annotateMerge(OpenApi.annotations({
12
- identifier: "v2.agent.list",
13
- summary: "List agents",
14
- description: "Retrieve currently registered agents.",
15
- })));