( directory: string, body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>, processLayer: Layer.Layer<AppProcess.Service> = appProcess, )
| 98 | } |
| 99 | |
| 100 | const withTool = <A, E, R>( |
| 101 | directory: string, |
| 102 | body: (registry: ToolRegistry.Interface) => Effect.Effect<A, E, R>, |
| 103 | processLayer: Layer.Layer<AppProcess.Service> = appProcess, |
| 104 | ) => { |
| 105 | const activeLocation = Layer.succeed( |
| 106 | Location.Service, |
| 107 | Location.Service.of(location({ directory: AbsolutePath.make(directory) })), |
| 108 | ) |
| 109 | return Effect.gen(function* () { |
| 110 | return yield* body(yield* ToolRegistry.Service) |
| 111 | }).pipe( |
| 112 | Effect.provide( |
| 113 | AppNodeBuilder.build( |
| 114 | LayerNode.group([ToolRegistry.node, ToolRegistry.toolsNode, LocationMutation.node, BashTool.node]), |
| 115 | [ |
| 116 | [Location.node, activeLocation], |
| 117 | [PermissionV2.node, permission], |
| 118 | [AppProcess.node, processLayer], |
| 119 | [Config.node, config], |
| 120 | [ToolOutputStore.node, ToolOutputStore.nodeWithoutConfig], |
| 121 | ], |
| 122 | ), |
| 123 | ), |
| 124 | ) |
| 125 | } |
| 126 | |
| 127 | const call = (input: typeof BashTool.Input.Type, id = "call-bash") => ({ |
| 128 | sessionID, |
no test coverage detected