mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-21 04:12:08 +03:00
refactor(client): group experimental SDK methods under client.experimental (#59072)
This commit is contained in:
committed by
GitHub
Unverified
parent
fe04f0ef13
commit
9a9386edbc
@@ -101,7 +101,7 @@ export const make = Effect.fnUntraced(function* (input: {
|
||||
const config = mcpConfig(server)
|
||||
if (isDeepStrictEqual(registered.get(server.name), config)) return Effect.void
|
||||
registered.set(server.name, config)
|
||||
return input.client.mcp.add({ server: server.name, location: { directory: attached.cwd }, config }).pipe(
|
||||
return input.client.experimental.mcp.add({ server: server.name, location: { directory: attached.cwd }, config }).pipe(
|
||||
Effect.catch(ACPClient.classify),
|
||||
Effect.onError(() => Effect.sync(() => registered.delete(server.name))),
|
||||
Effect.uninterruptible,
|
||||
|
||||
@@ -61,7 +61,7 @@ const findIntegration = Effect.fn("cli.auth.login.integration")(function* (clien
|
||||
if (protocol === "http:" || protocol === "https:") {
|
||||
const progress = spinner()
|
||||
progress.start("Discovering authentication provider...")
|
||||
yield* request((signal) => client.integration.wellknown.add({ url: target, location }, { signal })).pipe(
|
||||
yield* request((signal) => client.experimental.integration.wellknown.add({ url: target, location }, { signal })).pipe(
|
||||
Effect.tap(() => Effect.sync(() => progress.stop("Authentication provider discovered"))),
|
||||
Effect.tapCause(() => Effect.sync(() => progress.stop("Discovery failed", 1))),
|
||||
)
|
||||
|
||||
@@ -68,7 +68,7 @@ export default Runtime.handler(
|
||||
})
|
||||
if (!sessionID) return
|
||||
const data = yield* Effect.tryPromise({
|
||||
try: () => client.session.export({ sessionID, sanitize: input.sanitize }),
|
||||
try: () => client.experimental.session.export({ sessionID, sanitize: input.sanitize }),
|
||||
catch: (cause) => cause,
|
||||
})
|
||||
process.stdout.write(JSON.stringify(data, null, 2) + EOL)
|
||||
|
||||
@@ -29,7 +29,7 @@ const handler = Effect.fn("cli.stats")(function* (input: Runtime.Input<typeof Co
|
||||
: project
|
||||
const details = input.models || input.tools || input.cost || input.full
|
||||
const stats = yield* request(server.endpoint.url, (signal) =>
|
||||
client.session.stats(
|
||||
client.experimental.session.stats(
|
||||
{
|
||||
from: range.from,
|
||||
to: range.to,
|
||||
|
||||
@@ -758,7 +758,7 @@ export async function runNonInteractivePrompt(input: Input) {
|
||||
return
|
||||
}
|
||||
|
||||
const waiting = input.client.session.wait({ sessionID: input.sessionID })
|
||||
const waiting = input.client.experimental.session.wait({ sessionID: input.sessionID })
|
||||
await Promise.race([waiting, completed.then(() => waiting)])
|
||||
finalizing = true
|
||||
const projected = await reconcile()
|
||||
|
||||
Reference in New Issue
Block a user