(directory: string, body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>)
| 77 | ).pipe(Layer.provide(LayerNode.compile(FSUtil.node))) |
| 78 | |
| 79 | const withTool = <A, E, R>(directory: string, body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>) => { |
| 80 | const activeLocation = Layer.succeed( |
| 81 | Location.Service, |
| 82 | Location.Service.of(location({ directory: AbsolutePath.make(directory) })), |
| 83 | ) |
| 84 | return Effect.gen(function* () { |
| 85 | return yield* body(yield* ToolRegistry.Service) |
| 86 | }).pipe( |
| 87 | Effect.provide( |
| 88 | AppNodeBuilder.build( |
| 89 | LayerNode.group([ |
| 90 | ToolRegistry.node, |
| 91 | ToolRegistry.toolsNode, |
| 92 | LocationMutation.node, |
| 93 | FileMutation.node, |
| 94 | EditTool.node, |
| 95 | ]), |
| 96 | [ |
| 97 | [FSUtil.node, filesystem], |
| 98 | [Location.node, activeLocation], |
| 99 | [PermissionV2.node, permission], |
| 100 | [ToolOutputStore.node, ToolOutputStore.nodeWithoutConfig], |
| 101 | ], |
| 102 | ), |
| 103 | ), |
| 104 | ) |
| 105 | } |
| 106 | |
| 107 | const call = (input: typeof EditTool.Input.Type, id = "call-edit") => ({ |
| 108 | sessionID, |
no test coverage detected