Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions packages/opencode/src/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,28 +461,11 @@ export namespace Account {
return Option.getOrUndefined(await runPromise((service) => service.active()))
}

export async function list(): Promise<Info[]> {
return runPromise((service) => service.list())
}

export async function activeOrg(): Promise<ActiveOrg | undefined> {
return Option.getOrUndefined(await runPromise((service) => service.activeOrg()))
}

export async function orgsByAccount(): Promise<readonly AccountOrgs[]> {
return runPromise((service) => service.orgsByAccount())
}

export async function orgs(accountID: AccountID): Promise<readonly Org[]> {
return runPromise((service) => service.orgs(accountID))
}

export async function switchOrg(accountID: AccountID, orgID: OrgID) {
return runPromise((service) => service.use(accountID, Option.some(orgID)))
}

export async function token(accountID: AccountID): Promise<AccessToken | undefined> {
const t = await runPromise((service) => service.token(accountID))
return Option.getOrUndefined(t)
}
}
1 change: 0 additions & 1 deletion packages/opencode/src/effect/cross-spawn-spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,3 @@ const rt = lazy(async () => {

type RT = Awaited<ReturnType<typeof rt>>
export const runPromiseExit: RT["runPromiseExit"] = async (...args) => (await rt()).runPromiseExit(...(args as [any]))
export const runPromise: RT["runPromise"] = async (...args) => (await rt()).runPromise(...(args as [any]))
32 changes: 0 additions & 32 deletions packages/opencode/src/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,39 +265,7 @@ export namespace Git {
return runPromise((git) => git.run(args, opts))
}

export async function branch(cwd: string) {
return runPromise((git) => git.branch(cwd))
}

export async function prefix(cwd: string) {
return runPromise((git) => git.prefix(cwd))
}

export async function defaultBranch(cwd: string) {
return runPromise((git) => git.defaultBranch(cwd))
}

export async function hasHead(cwd: string) {
return runPromise((git) => git.hasHead(cwd))
}

export async function mergeBase(cwd: string, base: string, head?: string) {
return runPromise((git) => git.mergeBase(cwd, base, head))
}

export async function show(cwd: string, ref: string, file: string, prefix?: string) {
return runPromise((git) => git.show(cwd, ref, file, prefix))
}

export async function status(cwd: string) {
return runPromise((git) => git.status(cwd))
}

export async function diff(cwd: string, ref: string) {
return runPromise((git) => git.diff(cwd, ref))
}

export async function stats(cwd: string, ref: string) {
return runPromise((git) => git.stats(cwd, ref))
}
}
3 changes: 0 additions & 3 deletions packages/opencode/src/mcp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,6 @@ export namespace MCP {

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

export const getPrompt = async (clientName: string, name: string, args?: Record<string, string>) =>
runPromise((svc) => svc.getPrompt(clientName, name, args))

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

export const authenticate = async (mcpName: string) => runPromise((svc) => svc.authenticate(mcpName))
Expand Down
4 changes: 0 additions & 4 deletions packages/opencode/src/pty/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ export namespace Pty {
return runPromise((svc) => svc.get(id))
}

export async function resize(id: PtyID, cols: number, rows: number) {
return runPromise((svc) => svc.resize(id, cols, rows))
}

export async function write(id: PtyID, data: string) {
return runPromise((svc) => svc.write(id, data))
}
Expand Down
11 changes: 0 additions & 11 deletions packages/opencode/src/session/compaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,6 @@ When constructing the summary, try to stick to this template:
return runPromise((svc) => svc.prune(input))
}

export const process = fn(
z.object({
parentID: MessageID.zod,
messages: z.custom<MessageV2.WithParts[]>(),
sessionID: SessionID.zod,
auto: z.boolean(),
overflow: z.boolean().optional(),
}),
(input) => runPromise((svc) => svc.process(input)),
)

export const create = fn(
z.object({
sessionID: SessionID.zod,
Expand Down
13 changes: 0 additions & 13 deletions packages/opencode/src/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ export namespace Session {
runPromise((svc) => svc.fork(input)),
)

export const touch = fn(SessionID.zod, (id) => runPromise((svc) => svc.touch(id)))
export const get = fn(SessionID.zod, (id) => runPromise((svc) => svc.get(id)))
export const share = fn(SessionID.zod, (id) => runPromise((svc) => svc.share(id)))
export const unshare = fn(SessionID.zod, (id) => runPromise((svc) => svc.unshare(id)))
Expand All @@ -743,24 +742,12 @@ export namespace Session {
runPromise((svc) => svc.setArchived(input)),
)

export const setPermission = fn(z.object({ sessionID: SessionID.zod, permission: Permission.Ruleset }), (input) =>
runPromise((svc) => svc.setPermission(input)),
)

export const setRevert = fn(
z.object({ sessionID: SessionID.zod, revert: Info.shape.revert, summary: Info.shape.summary }),
(input) =>
runPromise((svc) => svc.setRevert({ sessionID: input.sessionID, revert: input.revert, summary: input.summary })),
)

export const clearRevert = fn(SessionID.zod, (id) => runPromise((svc) => svc.clearRevert(id)))

export const setSummary = fn(z.object({ sessionID: SessionID.zod, summary: Info.shape.summary }), (input) =>
runPromise((svc) => svc.setSummary({ sessionID: input.sessionID, summary: input.summary })),
)

export const diff = fn(SessionID.zod, (id) => runPromise((svc) => svc.diff(id)))

export const messages = fn(z.object({ sessionID: SessionID.zod, limit: z.number().optional() }), (input) =>
runPromise((svc) => svc.messages(input)),
)
Expand Down
4 changes: 0 additions & 4 deletions packages/opencode/src/session/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ export namespace Todo {
export const defaultLayer = layer.pipe(Layer.provide(Bus.layer))
const { runPromise } = makeRuntime(Service, defaultLayer)

export async function update(input: { sessionID: SessionID; todos: Info[] }) {
return runPromise((svc) => svc.update(input))
}

export async function get(sessionID: SessionID) {
return runPromise((svc) => svc.get(sessionID))
}
Expand Down
Loading