mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-27 17:28:50 +00:00
chore: generate
This commit is contained in:
parent
9dd24d7d03
commit
7499021132
2 changed files with 17 additions and 25 deletions
|
|
@ -114,12 +114,7 @@ export const loaderLayer = Layer.effect(
|
|||
return yield* Effect.gen(function* () {
|
||||
const providers = yield* provider.list()
|
||||
const [agents, defaultAgent, commands, defaultModel] = yield* Effect.all(
|
||||
[
|
||||
agent.list(),
|
||||
agent.defaultInfo(),
|
||||
command.list(),
|
||||
provider.defaultModel().pipe(Effect.option),
|
||||
],
|
||||
[agent.list(), agent.defaultInfo(), command.list(), provider.defaultModel().pipe(Effect.option)],
|
||||
{ concurrency: "unbounded" },
|
||||
)
|
||||
return build({
|
||||
|
|
@ -161,7 +156,7 @@ export const layer = Layer.effect(
|
|||
})
|
||||
|
||||
const get = Effect.fn("ACPNextDirectory.get")(function* (directory: string) {
|
||||
return yield* (yield* cached(directory))
|
||||
return yield* yield* cached(directory)
|
||||
})
|
||||
|
||||
const refresh = Effect.fn("ACPNextDirectory.refresh")(function* (directory: string) {
|
||||
|
|
|
|||
|
|
@ -107,10 +107,7 @@ export const layer = Layer.effect(
|
|||
return yield* new ACPNextError.SessionNotFoundError({ sessionId })
|
||||
})
|
||||
|
||||
const update = Effect.fn("ACPNext.Session.update")(function* (
|
||||
sessionId: string,
|
||||
fn: (session: Info) => Info,
|
||||
) {
|
||||
const update = Effect.fn("ACPNext.Session.update")(function* (sessionId: string, fn: (session: Info) => Info) {
|
||||
const result = yield* Ref.modify(sessions, (state) => {
|
||||
const session = state.get(sessionId)
|
||||
if (!session) return [undefined, state] as const
|
||||
|
|
@ -143,20 +140,20 @@ export const layer = Layer.effect(
|
|||
update(sessionId, (session) => ({ ...session, modeId })),
|
||||
)
|
||||
|
||||
const recordPartMetadata: Interface["recordPartMetadata"] = Effect.fn("ACPNext.Session.recordPartMetadata")(
|
||||
(input) => {
|
||||
const metadata = {
|
||||
messageId: input.messageId,
|
||||
partId: input.partId,
|
||||
toolCallId: input.toolCallId,
|
||||
metadata: input.metadata,
|
||||
}
|
||||
return update(input.sessionId, (session) => ({
|
||||
...session,
|
||||
knownParts: new Map(session.knownParts).set(partMetadataKey(input), metadata),
|
||||
})).pipe(Effect.as(metadata))
|
||||
},
|
||||
)
|
||||
const recordPartMetadata: Interface["recordPartMetadata"] = Effect.fn("ACPNext.Session.recordPartMetadata")((
|
||||
input,
|
||||
) => {
|
||||
const metadata = {
|
||||
messageId: input.messageId,
|
||||
partId: input.partId,
|
||||
toolCallId: input.toolCallId,
|
||||
metadata: input.metadata,
|
||||
}
|
||||
return update(input.sessionId, (session) => ({
|
||||
...session,
|
||||
knownParts: new Map(session.knownParts).set(partMetadataKey(input), metadata),
|
||||
})).pipe(Effect.as(metadata))
|
||||
})
|
||||
|
||||
return Service.of({
|
||||
create: store,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue