(directory: string, body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>)
| 87 | ).pipe(Layer.provide(LayerNode.compile(FSUtil.node))) |
| 88 | |
| 89 | const withTool = <A, E, R>(directory: string, body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>) => { |
| 90 | const activeLocation = Layer.succeed( |
| 91 | Location.Service, |
| 92 | Location.Service.of(location({ directory: AbsolutePath.make(directory) })), |
| 93 | ) |
| 94 | return Effect.gen(function* () { |
| 95 | return yield* body(yield* ToolRegistry.Service) |
| 96 | }).pipe( |
| 97 | Effect.provide( |
| 98 | AppNodeBuilder.build( |
| 99 | LayerNode.group([ |
| 100 | ToolRegistry.node, |
| 101 | ToolRegistry.toolsNode, |
| 102 | LocationMutation.node, |
| 103 | FileMutation.node, |
| 104 | ApplyPatchTool.node, |
| 105 | ]), |
| 106 | [ |
| 107 | [FSUtil.node, filesystem], |
| 108 | [Location.node, activeLocation], |
| 109 | [PermissionV2.node, permission], |
| 110 | [ToolOutputStore.node, ToolOutputStore.nodeWithoutConfig], |
| 111 | ], |
| 112 | ), |
| 113 | ), |
| 114 | ) |
| 115 | } |
| 116 | |
| 117 | const call = (patchText: string, id = "call-apply-patch") => ({ |
| 118 | sessionID, |
no test coverage detected