mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-21 02:22:40 +00:00
This commit is contained in:
parent
5011465c81
commit
c8af8f96ce
2 changed files with 2 additions and 10 deletions
|
|
@ -63,11 +63,7 @@ export interface Interface {
|
|||
readonly ids: () => Effect.Effect<string[]>
|
||||
readonly all: () => Effect.Effect<Tool.Def[]>
|
||||
readonly named: () => Effect.Effect<{ task: TaskDef; read: ReadDef }>
|
||||
readonly tools: (model: {
|
||||
providerID: ProviderID
|
||||
modelID: ModelID
|
||||
agent: Agent.Info
|
||||
}) => Effect.Effect<Tool.Def[]>
|
||||
readonly tools: (model: { providerID: ProviderID; modelID: ModelID; agent: Agent.Info }) => Effect.Effect<Tool.Def[]>
|
||||
}
|
||||
|
||||
export class Service extends Context.Service<Service, Interface>()("@opencode/ToolRegistry") {}
|
||||
|
|
|
|||
|
|
@ -54,11 +54,7 @@ type Init<Parameters extends z.ZodType, M extends Metadata> =
|
|||
| (() => Effect.Effect<DefWithoutID<Parameters, M>>)
|
||||
|
||||
export type InferParameters<T> =
|
||||
T extends Info<infer P, any>
|
||||
? z.infer<P>
|
||||
: T extends Effect.Effect<Info<infer P, any>, any, any>
|
||||
? z.infer<P>
|
||||
: never
|
||||
T extends Info<infer P, any> ? z.infer<P> : T extends Effect.Effect<Info<infer P, any>, any, any> ? z.infer<P> : never
|
||||
export type InferMetadata<T> =
|
||||
T extends Info<any, infer M> ? M : T extends Effect.Effect<Info<any, infer M>, any, any> ? M : never
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue