Skip to content

Commit ecdcee9

Browse files
committed
fix(client): omit WebSocket RPC endpoint from generated clients
1 parent 7e71208 commit ecdcee9

5 files changed

Lines changed: 3 additions & 55 deletions

File tree

‎packages/client/src/effect/api/api.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,18 +1800,8 @@ export type RpcCallInput = {
18001800
export type RpcCallOutput = { readonly output?: unknown }
18011801
export type RpcCallOperation<E = never> = (input: RpcCallInput) => Effect.Effect<RpcCallOutput, E>
18021802

1803-
export type RpcConnectInput = {
1804-
readonly rpcID: string
1805-
readonly method: string
1806-
readonly location?: { readonly directory?: string | undefined } | undefined
1807-
readonly input: string
1808-
}
1809-
export type RpcConnectOutput = void
1810-
export type RpcConnectOperation<E = never> = (input: RpcConnectInput) => Effect.Effect<RpcConnectOutput, E>
1811-
18121803
export interface RpcApi<E = never> {
18131804
readonly call: RpcCallOperation<E>
1814-
readonly connect: RpcConnectOperation<E>
18151805
}
18161806

18171807
export type EventSubscribeOutput = OpenCodeEvent

‎packages/client/src/effect/generated/client.ts‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ import type {
194194
SkillListOutput,
195195
RpcCallInput,
196196
RpcCallOutput,
197-
RpcConnectInput,
198-
RpcConnectOutput,
199197
EventSubscribeOutput,
200198
PtyListInput,
201199
PtyListOutput,
@@ -1239,18 +1237,7 @@ const EndpointRpcCall = (raw: RawClient["server.rpc"]) => (input: RpcCallInput)
12391237
}).pipe(Effect.mapError(mapClientError)),
12401238
)
12411239

1242-
const EndpointRpcConnect = (raw: RawClient["server.rpc"]) => (input: RpcConnectInput) =>
1243-
preserveEffect<RpcConnectOutput>()(
1244-
raw["rpc.connect"]({
1245-
params: { rpcID: input["rpcID"], method: input["method"] },
1246-
query: { location: input["location"], input: input["input"] },
1247-
}).pipe(Effect.mapError(mapClientError)),
1248-
)
1249-
1250-
const adaptGroupRpc = (raw: RawClient["server.rpc"]) => ({
1251-
call: EndpointRpcCall(raw),
1252-
connect: EndpointRpcConnect(raw),
1253-
})
1240+
const adaptGroupRpc = (raw: RawClient["server.rpc"]) => ({ call: EndpointRpcCall(raw) })
12541241

12551242
const EndpointEventSubscribe = (raw: RawClient["server.event"]) => () =>
12561243
preserveStream<EventSubscribeOutput>()(

‎packages/client/src/promise/generated/client.ts‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ import type {
192192
SkillListOutput,
193193
RpcCallInput,
194194
RpcCallOutput,
195-
RpcConnectInput,
196-
RpcConnectOutput,
197195
EventSubscribeOutput,
198196
PtyListInput,
199197
PtyListOutput,
@@ -1710,18 +1708,6 @@ export function make(options: ClientOptions) {
17101708
},
17111709
requestOptions,
17121710
),
1713-
connect: (input: RpcConnectInput, requestOptions?: RequestOptions) =>
1714-
request<RpcConnectOutput>(
1715-
{
1716-
method: "GET",
1717-
path: `/api/rpc/${encodeURIComponent(input.rpcID)}/${encodeURIComponent(input.method)}/socket`,
1718-
query: { location: input["location"], input: input["input"] },
1719-
successStatus: 200,
1720-
declaredStatuses: [400, 401, 404, 500],
1721-
empty: true,
1722-
},
1723-
requestOptions,
1724-
),
17251711
},
17261712
event: {
17271713
subscribe: (requestOptions?: RequestOptions): AsyncIterable<EventSubscribeOutput> =>

‎packages/client/src/promise/generated/types.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6386,21 +6386,6 @@ export type RpcCallInput = {
63866386

63876387
export type RpcCallOutput = RpcOutput
63886388

6389-
export type RpcConnectInput = {
6390-
readonly rpcID: { readonly rpcID: string; readonly method: string }["rpcID"]
6391-
readonly method: { readonly rpcID: string; readonly method: string }["method"]
6392-
readonly location?: {
6393-
readonly location?: { readonly directory?: string | undefined } | undefined
6394-
readonly input: string
6395-
}["location"]
6396-
readonly input: {
6397-
readonly location?: { readonly directory?: string | undefined } | undefined
6398-
readonly input: string
6399-
}["input"]
6400-
}
6401-
6402-
export type RpcConnectOutput = void
6403-
64046389
export type EventSubscribeOutput = V2Event
64056390

64066391
export type PtyListInput = {

‎packages/protocol/src/client.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ export const groupNames = {
6666
"server.config": "config",
6767
} as const
6868

69-
export const promiseOmitEndpoints = new Set(["pty.connect", "persistentPty.connect"])
70-
export const effectOmitEndpoints = new Set(["fs.read", "fs.write", "pty.connect", "persistentPty.connect"])
69+
export const promiseOmitEndpoints = new Set(["pty.connect", "persistentPty.connect", "rpc.connect"])
70+
export const effectOmitEndpoints = new Set(["fs.read", "fs.write", "pty.connect", "persistentPty.connect", "rpc.connect"])

0 commit comments

Comments
 (0)