Skip to content

Commit 9f54115

Browse files
authored
refactor: remove unused runtime facade exports (#21731)
1 parent 2ecc6ae commit 9f54115

8 files changed

Lines changed: 0 additions & 85 deletions

File tree

packages/opencode/src/account/index.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -461,28 +461,11 @@ export namespace Account {
461461
return Option.getOrUndefined(await runPromise((service) => service.active()))
462462
}
463463

464-
export async function list(): Promise<Info[]> {
465-
return runPromise((service) => service.list())
466-
}
467-
468-
export async function activeOrg(): Promise<ActiveOrg | undefined> {
469-
return Option.getOrUndefined(await runPromise((service) => service.activeOrg()))
470-
}
471-
472464
export async function orgsByAccount(): Promise<readonly AccountOrgs[]> {
473465
return runPromise((service) => service.orgsByAccount())
474466
}
475467

476-
export async function orgs(accountID: AccountID): Promise<readonly Org[]> {
477-
return runPromise((service) => service.orgs(accountID))
478-
}
479-
480468
export async function switchOrg(accountID: AccountID, orgID: OrgID) {
481469
return runPromise((service) => service.use(accountID, Option.some(orgID)))
482470
}
483-
484-
export async function token(accountID: AccountID): Promise<AccessToken | undefined> {
485-
const t = await runPromise((service) => service.token(accountID))
486-
return Option.getOrUndefined(t)
487-
}
488471
}

packages/opencode/src/effect/cross-spawn-spawner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,4 +499,3 @@ const rt = lazy(async () => {
499499

500500
type RT = Awaited<ReturnType<typeof rt>>
501501
export const runPromiseExit: RT["runPromiseExit"] = async (...args) => (await rt()).runPromiseExit(...(args as [any]))
502-
export const runPromise: RT["runPromise"] = async (...args) => (await rt()).runPromise(...(args as [any]))

packages/opencode/src/git/index.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -265,39 +265,7 @@ export namespace Git {
265265
return runPromise((git) => git.run(args, opts))
266266
}
267267

268-
export async function branch(cwd: string) {
269-
return runPromise((git) => git.branch(cwd))
270-
}
271-
272-
export async function prefix(cwd: string) {
273-
return runPromise((git) => git.prefix(cwd))
274-
}
275-
276268
export async function defaultBranch(cwd: string) {
277269
return runPromise((git) => git.defaultBranch(cwd))
278270
}
279-
280-
export async function hasHead(cwd: string) {
281-
return runPromise((git) => git.hasHead(cwd))
282-
}
283-
284-
export async function mergeBase(cwd: string, base: string, head?: string) {
285-
return runPromise((git) => git.mergeBase(cwd, base, head))
286-
}
287-
288-
export async function show(cwd: string, ref: string, file: string, prefix?: string) {
289-
return runPromise((git) => git.show(cwd, ref, file, prefix))
290-
}
291-
292-
export async function status(cwd: string) {
293-
return runPromise((git) => git.status(cwd))
294-
}
295-
296-
export async function diff(cwd: string, ref: string) {
297-
return runPromise((git) => git.diff(cwd, ref))
298-
}
299-
300-
export async function stats(cwd: string, ref: string) {
301-
return runPromise((git) => git.stats(cwd, ref))
302-
}
303271
}

packages/opencode/src/mcp/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,6 @@ export namespace MCP {
906906

907907
export const disconnect = async (name: string) => runPromise((svc) => svc.disconnect(name))
908908

909-
export const getPrompt = async (clientName: string, name: string, args?: Record<string, string>) =>
910-
runPromise((svc) => svc.getPrompt(clientName, name, args))
911-
912909
export const startAuth = async (mcpName: string) => runPromise((svc) => svc.startAuth(mcpName))
913910

914911
export const authenticate = async (mcpName: string) => runPromise((svc) => svc.authenticate(mcpName))

packages/opencode/src/pty/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ export namespace Pty {
371371
return runPromise((svc) => svc.get(id))
372372
}
373373

374-
export async function resize(id: PtyID, cols: number, rows: number) {
375-
return runPromise((svc) => svc.resize(id, cols, rows))
376-
}
377-
378374
export async function write(id: PtyID, data: string) {
379375
return runPromise((svc) => svc.write(id, data))
380376
}

packages/opencode/src/session/compaction.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,17 +401,6 @@ When constructing the summary, try to stick to this template:
401401
return runPromise((svc) => svc.prune(input))
402402
}
403403

404-
export const process = fn(
405-
z.object({
406-
parentID: MessageID.zod,
407-
messages: z.custom<MessageV2.WithParts[]>(),
408-
sessionID: SessionID.zod,
409-
auto: z.boolean(),
410-
overflow: z.boolean().optional(),
411-
}),
412-
(input) => runPromise((svc) => svc.process(input)),
413-
)
414-
415404
export const create = fn(
416405
z.object({
417406
sessionID: SessionID.zod,

packages/opencode/src/session/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ export namespace Session {
730730
runPromise((svc) => svc.fork(input)),
731731
)
732732

733-
export const touch = fn(SessionID.zod, (id) => runPromise((svc) => svc.touch(id)))
734733
export const get = fn(SessionID.zod, (id) => runPromise((svc) => svc.get(id)))
735734
export const share = fn(SessionID.zod, (id) => runPromise((svc) => svc.share(id)))
736735
export const unshare = fn(SessionID.zod, (id) => runPromise((svc) => svc.unshare(id)))
@@ -743,24 +742,12 @@ export namespace Session {
743742
runPromise((svc) => svc.setArchived(input)),
744743
)
745744

746-
export const setPermission = fn(z.object({ sessionID: SessionID.zod, permission: Permission.Ruleset }), (input) =>
747-
runPromise((svc) => svc.setPermission(input)),
748-
)
749-
750745
export const setRevert = fn(
751746
z.object({ sessionID: SessionID.zod, revert: Info.shape.revert, summary: Info.shape.summary }),
752747
(input) =>
753748
runPromise((svc) => svc.setRevert({ sessionID: input.sessionID, revert: input.revert, summary: input.summary })),
754749
)
755750

756-
export const clearRevert = fn(SessionID.zod, (id) => runPromise((svc) => svc.clearRevert(id)))
757-
758-
export const setSummary = fn(z.object({ sessionID: SessionID.zod, summary: Info.shape.summary }), (input) =>
759-
runPromise((svc) => svc.setSummary({ sessionID: input.sessionID, summary: input.summary })),
760-
)
761-
762-
export const diff = fn(SessionID.zod, (id) => runPromise((svc) => svc.diff(id)))
763-
764751
export const messages = fn(z.object({ sessionID: SessionID.zod, limit: z.number().optional() }), (input) =>
765752
runPromise((svc) => svc.messages(input)),
766753
)

packages/opencode/src/session/todo.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ export namespace Todo {
8585
export const defaultLayer = layer.pipe(Layer.provide(Bus.layer))
8686
const { runPromise } = makeRuntime(Service, defaultLayer)
8787

88-
export async function update(input: { sessionID: SessionID; todos: Info[] }) {
89-
return runPromise((svc) => svc.update(input))
90-
}
91-
9288
export async function get(sessionID: SessionID) {
9389
return runPromise((svc) => svc.get(sessionID))
9490
}

0 commit comments

Comments
 (0)