mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-27 00:31:00 +00:00
chore: generate
This commit is contained in:
parent
0373ea9128
commit
00ea47a502
3 changed files with 14 additions and 12 deletions
|
|
@ -39,7 +39,10 @@ export type Interface = {
|
|||
|
||||
export class Service extends Context.Service<Service, Interface>()("@opencode/ACPNext/Service") {}
|
||||
|
||||
export function make(input: { sdk: OpencodeClient; connection?: Pick<AgentSideConnection, "sessionUpdate"> }): Interface {
|
||||
export function make(input: {
|
||||
sdk: OpencodeClient
|
||||
connection?: Pick<AgentSideConnection, "sessionUpdate">
|
||||
}): Interface {
|
||||
const sessions = new Map<string, SessionState>()
|
||||
const directories = new Map<string, Promise<Directory.Snapshot>>()
|
||||
const registeredMcp = new Map<string, Set<string>>()
|
||||
|
|
@ -401,7 +404,10 @@ function registerMcpServers(
|
|||
{ throwOnError: true },
|
||||
),
|
||||
"mcp",
|
||||
).pipe(Effect.tap(() => Effect.sync(() => current.add(server.name))), Effect.ignore),
|
||||
).pipe(
|
||||
Effect.tap(() => Effect.sync(() => current.add(server.name))),
|
||||
Effect.ignore,
|
||||
),
|
||||
),
|
||||
{ concurrency: "unbounded" },
|
||||
).pipe(Effect.asVoid)
|
||||
|
|
|
|||
|
|
@ -215,7 +215,6 @@ describe("ACP next service sessions", () => {
|
|||
expect(result.configOptions?.find((option) => option.id === "mode")?.currentValue).toBe("plan")
|
||||
})
|
||||
|
||||
|
||||
it("maps provider auth failures to auth-required request errors", async () => {
|
||||
const service = ACPNextService.make({
|
||||
sdk: {
|
||||
|
|
@ -244,15 +243,15 @@ describe("ACP next service sessions", () => {
|
|||
it("does not cache failed directory snapshots", async () => {
|
||||
let providersCalls = 0
|
||||
const sdk = {
|
||||
config: {
|
||||
providers: () => {
|
||||
config: {
|
||||
providers: () => {
|
||||
providersCalls++
|
||||
if (providersCalls === 1) {
|
||||
return Promise.reject({ name: "ProviderAuthError", data: { providerID: "test" } })
|
||||
}
|
||||
return Promise.resolve({ data: { providers: [provider], default: { test: modelID } } })
|
||||
},
|
||||
get: () => Promise.resolve({ data: {} }),
|
||||
},
|
||||
get: () => Promise.resolve({ data: {} }),
|
||||
},
|
||||
app: {
|
||||
agents: () => Promise.resolve({ data: [{ name: "build", mode: "primary", permission: [], options: {} }] }),
|
||||
|
|
|
|||
|
|
@ -69,17 +69,14 @@ describe("opencode acp-next (subprocess)", () => {
|
|||
)
|
||||
yield* acp.request<InitializeResponse>("initialize", { protocolVersion: 1 })
|
||||
|
||||
const session = expectOk(
|
||||
yield* acp.request<NewSessionResponse>("session/new", { cwd: home, mcpServers: [] }),
|
||||
)
|
||||
const session = expectOk(yield* acp.request<NewSessionResponse>("session/new", { cwd: home, mcpServers: [] }))
|
||||
expect(typeof session.sessionId).toBe("string")
|
||||
expect(selectConfigOption(session.configOptions, "model")?.category).toBe("model")
|
||||
|
||||
const update = yield* acp.waitForNotification<SessionNotification>(
|
||||
"session/update",
|
||||
(params) =>
|
||||
params.sessionId === session.sessionId &&
|
||||
params.update.sessionUpdate === "available_commands_update",
|
||||
params.sessionId === session.sessionId && params.update.sessionUpdate === "available_commands_update",
|
||||
)
|
||||
expect(update.params?.sessionId).toBe(session.sessionId)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue