@opencode/protocol 0.0.0-beta-19275
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 +56 -0
- package/dist/api.js +79 -0
- package/dist/client.d.ts +64 -0
- package/dist/client.js +50 -0
- package/dist/errors.d.ts +153 -0
- package/dist/errors.js +122 -0
- package/dist/groups/agent.d.ts +194 -0
- package/dist/groups/agent.js +30 -0
- package/dist/groups/command.d.ts +15 -0
- package/dist/groups/command.js +20 -0
- package/dist/groups/config.d.ts +9 -0
- package/dist/groups/config.js +16 -0
- package/dist/groups/credential.d.ts +32 -0
- package/dist/groups/credential.js +40 -0
- package/dist/groups/debug.d.ts +17 -0
- package/dist/groups/debug.js +23 -0
- package/dist/groups/event.d.ts +14798 -0
- package/dist/groups/event.js +51 -0
- package/dist/groups/form.d.ts +781 -0
- package/dist/groups/form.js +95 -0
- package/dist/groups/fs.d.ts +35 -0
- package/dist/groups/fs.js +53 -0
- package/dist/groups/generate.d.ts +33 -0
- package/dist/groups/generate.js +23 -0
- package/dist/groups/health.d.ts +15 -0
- package/dist/groups/health.js +20 -0
- package/dist/groups/integration.d.ts +1154 -0
- package/dist/groups/integration.js +149 -0
- package/dist/groups/location.d.ts +16 -0
- package/dist/groups/location.js +34 -0
- package/dist/groups/mcp.d.ts +82 -0
- package/dist/groups/mcp.js +78 -0
- package/dist/groups/message.d.ts +688 -0
- package/dist/groups/message.js +37 -0
- package/dist/groups/migration.d.ts +28 -0
- package/dist/groups/migration.js +21 -0
- package/dist/groups/model.d.ts +312 -0
- package/dist/groups/model.js +33 -0
- package/dist/groups/permission.d.ts +156 -0
- package/dist/groups/permission.js +97 -0
- package/dist/groups/persistent-pty.d.ts +249 -0
- package/dist/groups/persistent-pty.js +91 -0
- package/dist/groups/plugin.d.ts +91 -0
- package/dist/groups/plugin.js +55 -0
- package/dist/groups/project.d.ts +90 -0
- package/dist/groups/project.js +39 -0
- package/dist/groups/provider.d.ts +154 -0
- package/dist/groups/provider.js +34 -0
- package/dist/groups/pty.d.ts +147 -0
- package/dist/groups/pty.js +113 -0
- package/dist/groups/reference.d.ts +29 -0
- package/dist/groups/reference.js +20 -0
- package/dist/groups/rpc.d.ts +22 -0
- package/dist/groups/rpc.js +24 -0
- package/dist/groups/server.d.ts +5 -0
- package/dist/groups/server.js +11 -0
- package/dist/groups/session.d.ts +10593 -0
- package/dist/groups/session.js +557 -0
- package/dist/groups/shell.d.ts +152 -0
- package/dist/groups/shell.js +82 -0
- package/dist/groups/skill.d.ts +20 -0
- package/dist/groups/skill.js +20 -0
- package/dist/groups/vcs.d.ts +70 -0
- package/dist/groups/vcs.js +76 -0
- package/dist/groups/websearch.d.ts +28 -0
- package/dist/groups/websearch.js +34 -0
- package/dist/groups/workspace.d.ts +22 -0
- package/dist/groups/workspace.js +27 -0
- package/dist/groups/worktree.d.ts +47 -0
- package/dist/groups/worktree.js +61 -0
- package/dist/middleware/authorization.d.ts +13 -0
- package/dist/middleware/authorization.js +6 -0
- package/dist/middleware/schema-error.d.ts +13 -0
- package/dist/middleware/schema-error.js +4 -0
- package/dist/simulation.d.ts +1801 -0
- package/dist/simulation.js +487 -0
- package/package.json +45 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Location } from "@opencode/schema/location";
|
|
2
|
+
import { Reference } from "@opencode/schema/reference";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const ReferenceGroup = HttpApiGroup.make("server.reference")
|
|
7
|
+
.add(HttpApiEndpoint.get("reference.list", "/api/reference", {
|
|
8
|
+
query: LocationQuery,
|
|
9
|
+
success: Location.response(Schema.Array(Reference.Info)),
|
|
10
|
+
})
|
|
11
|
+
.annotateMerge(locationQueryOpenApi)
|
|
12
|
+
.annotateMerge(OpenApi.annotations({
|
|
13
|
+
identifier: "v2.reference.list",
|
|
14
|
+
summary: "List references",
|
|
15
|
+
description: "List references available in the requested location.",
|
|
16
|
+
})))
|
|
17
|
+
.annotateMerge(OpenApi.annotations({
|
|
18
|
+
title: "reference",
|
|
19
|
+
description: "Location-scoped project references.",
|
|
20
|
+
}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
import { RpcError, RpcInternalError } from "../errors.js";
|
|
4
|
+
export declare const RpcInput: Schema.Struct<{
|
|
5
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Unknown>>, Schema.optionalKey<Schema.Unknown>, never, never>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const RpcOutput: Schema.Struct<{
|
|
8
|
+
readonly output: Schema.optionalKey<Schema.Unknown>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const RpcGroup: HttpApiGroup.HttpApiGroup<"server.rpc", HttpApiEndpoint.HttpApiEndpoint<"rpc.call", "POST", "/api/rpc/:rpcID/:method", Schema.toCodecStringTree<Schema.Struct<{
|
|
11
|
+
rpcID: Schema.String;
|
|
12
|
+
method: Schema.String;
|
|
13
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
14
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
15
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
16
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
17
|
+
}>>;
|
|
18
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
19
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Unknown>>, Schema.optionalKey<Schema.Unknown>, never, never>;
|
|
20
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
21
|
+
readonly output: Schema.optionalKey<Schema.Unknown>;
|
|
22
|
+
}>>, Schema.toCodecJson<typeof RpcError | typeof RpcInternalError>, never, never>, false>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { optional } from "@opencode/schema/schema";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { RpcError, RpcInternalError } from "../errors.js";
|
|
5
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
+
export const RpcInput = Schema.Struct({ input: optional(Schema.Unknown) }).annotate({ identifier: "Rpc.Input" });
|
|
7
|
+
export const RpcOutput = Schema.Struct({ output: Schema.optionalKey(Schema.Unknown) }).annotate({
|
|
8
|
+
identifier: "Rpc.Output",
|
|
9
|
+
});
|
|
10
|
+
export const RpcGroup = HttpApiGroup.make("server.rpc")
|
|
11
|
+
.add(HttpApiEndpoint.post("rpc.call", "/api/rpc/:rpcID/:method", {
|
|
12
|
+
params: { rpcID: Schema.String, method: Schema.String },
|
|
13
|
+
query: LocationQuery,
|
|
14
|
+
payload: RpcInput,
|
|
15
|
+
success: RpcOutput,
|
|
16
|
+
error: [RpcError, RpcInternalError],
|
|
17
|
+
})
|
|
18
|
+
.annotateMerge(locationQueryOpenApi)
|
|
19
|
+
.annotateMerge(OpenApi.annotations({
|
|
20
|
+
identifier: "v2.rpc.call",
|
|
21
|
+
summary: "Call a plugin RPC",
|
|
22
|
+
description: "Dispatch a method to the currently registered RPC at the requested location.",
|
|
23
|
+
})))
|
|
24
|
+
.annotateMerge(OpenApi.annotations({ title: "rpc", description: "Plugin RPC routes." }));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
export declare const ServerGroup: HttpApiGroup.HttpApiGroup<"server.server", HttpApiEndpoint.HttpApiEndpoint<"server.get", "GET", "/api/server", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
4
|
+
readonly urls: Schema.$Array<Schema.String>;
|
|
5
|
+
}>>, never, never, never>, false>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
3
|
+
export const ServerGroup = HttpApiGroup.make("server.server")
|
|
4
|
+
.add(HttpApiEndpoint.get("server.get", "/api/server", {
|
|
5
|
+
success: Schema.Struct({ urls: Schema.Array(Schema.String) }),
|
|
6
|
+
}).annotateMerge(OpenApi.annotations({
|
|
7
|
+
identifier: "v2.server.get",
|
|
8
|
+
summary: "Get server information",
|
|
9
|
+
description: "Return the URLs that can be used to connect to this server.",
|
|
10
|
+
})))
|
|
11
|
+
.annotateMerge(OpenApi.annotations({ title: "server" }));
|